# MCP configuration and scope

> Control exposed reports, report-linked tables, explicit schemas, exclusions and retention in DRE MCP.

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](https://getdre.com/docs/ai-ready-reports/) explains how to supply business context and typed inputs.

## Expose a reviewed report

A report can declare:

```yaml
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.

## Review report-related tables

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:

```yaml
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`.

## Add explicit scope and limits

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

```yaml
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.

## Validate the resolved configuration

```bash
dre mcp validate
dre mcp access
```

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

```bash
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.

## Database permissions still matter

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](https://getdre.com/docs/mcp-tools/).

[Edit page](https://github.com/get-dre/getdre.com/edit/master/content/mcp/mcp-configuration.md)

[Previous  
Install and connect](https://getdre.com/docs/mcp-setup/)[Next  
Tools and provenance](https://getdre.com/docs/mcp-tools/)
