Skip to content

MCP configuration and scope

DRE MCP exposes only reports with meta.ai.expose: true. An owner should review the report SQL, connections, inputs and related tables before enabling it. AI-ready reports explains how to supply business context and typed inputs.

A report can declare:

meta:
ai:
expose: true
questions:
- What was net revenue by region last month?

Descriptions and inherited ai_context.md files explain grain, units, exclusions and reporting periods. Supply representative var_schema defaults so context compilation can resolve the report.

An inherited expose: false closes that branch: a report cannot reopen it below that layer. The most specific questions and access annotations replace earlier values. Access annotations describe intended use in personal mode; they are not authentication controls.

Tables read by an exposed report are exposed by default, even if no extra tables are configured. To disable this globally, create .dre-mcp.yml at the project root:

expose_report_tables: false

The companion’s --no-report-tables flag provides the same global choice. A report can also declare meta.ai.expose_report_tables: false.

The following is an illustrative configuration; replace connection and object names with the ones you intend to expose:

expose_report_tables: false
tables:
warehouse: [analytics.customer_targets]
schemas:
warehouse: [analytics_public]
exclude_tables:
warehouse: [analytics.customer_private]
cache_ttl_seconds: 300
max_rows: 1000
query_timeout_seconds: 60
max_runs: 100
max_snapshots: 3

warehouse is a connection name from profiles.yml, not a credential. Extra tables and schemas are opt-in. Explicit exclusions override both automatic report-table exposure and explicit exposure. Exclusions match resolved names using each connection’s identifier case and quoting rules.

Limits bound query output, execution time and retained state. .dre-mcp/ contains retained runs and provenance: treat it as user data rather than disposable build cache.

Terminal window
dre mcp validate
dre mcp access

Schema commands print the companion-owned JSON Schemas without loading a project or connecting to a database:

Terminal window
dre mcp schema meta-ai
dre mcp schema config

After changing report definitions, scope or upstream comments, ask the connected agent to call refresh_context. It validates and compiles a replacement, retrieves comments and swaps the active context atomically. A failed refresh keeps the previous context; in-flight calls keep their starting snapshot.

Personal mode uses the local user’s existing DRE connections. Scope configuration does not replace database permissions.

DuckDB and PostgreSQL exploration require a source plugin advertising read-only session support. Databricks uses a validated single SELECT but cannot enforce a read-only session; use a read-only database role. Unsupported sources fail closed. Exposed report SQL can contain writes, so review reports and choose an appropriate role even when delivery is disabled.

Next: tools and provenance.