Why Your MCP Analytics Server Should Serve Pre-Governed Metrics Instead of Raw Supabase Tables to AI Agents
Serve agents vetted metric definitions, not raw tables, to keep answers trustworthy.

For governed data access for AI agents on Supabase via MCP, the analytics server should expose pre-governed, pre-calculated metrics. A layered architecture puts agreed metric definitions into datasets, serves them through a stateless MCP server backed by DuckDB, and routes agent queries through a gateway that enforces permissions and logs access. This makes the data contract, rather than the agent’s interpretation of a schema, the foundation of trustworthy analytics.
Why the MCP layer makes data governance more urgent, not less
Agents are already querying business data through MCP. Anthropic launched the Model Context Protocol in November 2024 to standardize how AI systems access external data, and by early 2026, over 10,000 MCP servers exist. For teams adopting these connections, agent-to-data access is an operational concern. Every unresolved definition can now reach an agent at machine speed.
The protocol separates the AI client, the MCP server that provides connector logic, and the resource, such as a database or API. That separation creates a decision point at the server. It can expose a raw schema and leave interpretation to the client, or expose data whose meaning has already been settled. The protocol standardizes access, but standard access does not establish a standard meaning for revenue, churn, or activity. MCP amplifies the quality of the data behind it, whether that quality is good or bad.
Improvado’s AI Product Lead states the consequence plainly. “MCP does not remove the need for a governed data layer. It makes governance more important, because AI agents will expose every naming gap, permission gap, and metric-definition conflict faster.” A metric can have an agreed name but an ambiguous calculation, or a clear calculation but inadequate access controls. A trustworthy analytics endpoint has to address both meaning and permission before an agent consumes its results.
What actually happens when an agent hits a raw Supabase table through MCP
Consider an agent asked “what was MRR last month?” and given access to a raw invoices table. It encounters a column called revenue_usd, but the schema does not tell it which revenue definition the leadership deck uses. To answer, the agent must fill in the missing calculation logic. Its SQL may execute successfully while representing a different metric from the one the business intended. A valid query is not necessarily a valid answer.
The failure begins before the answer is written. The agent has inferred a business definition that the data layer should have supplied, so changing the wording of its response cannot repair the underlying ambiguity. In this context, hallucination is a governance failure. With greater autonomy, the consequence can extend beyond an incorrect number. An agent could trigger a payment, modify a record, or route a decision using that interpretation before a human reviews it.
Raw access also exposes the transactional database to unpredictable analytical work. An agent querying the primary Postgres database can issue full-table scans, placing analytical demand on the same system that serves live users. Even an agent with only read access can cause that collision. Production database credentials should also stay out of an agent’s configuration. Agent database queries should pass through a gateway that enforces permissions and logs access, while analytical queries should run apart from the production tables, with that choice kept out of the agent’s hands.
Why metric drift at the data layer becomes compounded error at the agent layer
dbt Labs ran into this problem among its own teams. Data work became hard across teams because they had no single source of truth for their most important metrics. The company centralized definitions in a governed semantic layer, with executive buy-in, to establish consistent, reliable metrics. Agreement had to become part of the data system rather than remain something each analyst reconstructed.
Agent access multiplies the places where that reconstruction can occur. Without a central definition, labels such as “monthly active users,” “churn rate,” and “revenue” can refer to different calculations across tools, teams, and calls. An agent can use one implicit definition early in a conversation and another later, without a mechanism to detect or correct the change. Subsequent reasoning can then treat incompatible numbers as though they describe the same thing.
Row-level security does not close this semantic gap. RLS on a read replica determines which rows an agent can see, but it does not determine how those rows should be aggregated. The agent can remain within its permissions while writing different aggregation SQL on every call. The failure cannot be repaired solely at the agent layer, because the missing authority belongs in what the MCP server exposes.
What a governed dataset actually is and why it is the correct unit to serve through MCP
A governed dataset is a pre-calculated, versioned representation of a metric with a fixed definition. It is a modeled artifact with explicit semantics. Its definition specifies the grain, calculation, inclusion and exclusion rules, and owner. Those details make the metric interpretable outside the conversation that requested it. “MRR” therefore refers to the same calculation when a human opens a dashboard and when an agent calls an MCP endpoint.
Pre-calculation settles a different part of the contract. The aggregation has already run, so the agent receives structured results rather than a blank SQL surface on which to invent the metric. Queries can still operate over the governed dataset. What changes is that the business calculation no longer has to be reconstructed from production records each time someone asks a question.
In this architecture, the MCP server becomes a governed read surface over pre-modeled datasets, queryable through DuckDB against governed Parquet files. Agents do not touch the production database. Their queries run on prepared datasets, so an ad-hoc request has no way to become a full-table scan against production Postgres. Permissions still govern who can read the exposed data, while the dataset governs what the metric means.
How enterprise teams have already landed on governed services as the agentic data pattern
Informatica’s Intelligent Data Management Cloud announced a headless architecture in May 2026 that exposes data integration, quality, governance, and lineage as reusable services through APIs and MCP endpoints. Salesforce’s official announcement described it as “the first enterprise data management platform to deliver fully headless data management.” Agents use governed services instead of connecting straight to the source as the final step of the integration. Governance becomes part of the callable infrastructure.
ZoomInfo’s GTM.AI, generally available June 1, 2026, applies that separation to a context layer. The product is headless and MCP-native, with no interface of its own, and agents receive governed data without touching source records directly. Data grounding becomes a distinct infrastructure concern. Its existence as a purchasable layer separates the work of preparing trustworthy context from the application that eventually uses it.
Salesforce’s Headless Data 360 for Model Context Protocol, announced August 2026, likewise gives governed customer data straight to agents. Its stated principle is that humans structure responses and experts monitor them, with a customer describing a “physician-curated ontology.” Trustworthy answers rest on metadata that humans govern. Across these examples, the architectural pattern is a governed layer decoupled from the agent and any single front end, while supporting human interfaces and agents from shared definitions.
The minimum viable governed MCP layer for a Supabase team without a dedicated data function
A Supabase team does not need a full semantic layer deployment to apply this pattern. The handful of KPIs that appear in every leadership meeting provides a practical starting point. For a team building this layer, the first task is to agree on each metric’s grain and calculation logic, then materialize the results as Parquet datasets or materialized views. A stateless MCP server backed by DuckDB can expose the prepared analytical data. The initial scope can remain deliberately small.
The file-backed version establishes a clear workload boundary. Agents query pre-calculated files rather than live tables, insulating the production Postgres primary from ad-hoc analytical requests. Materializing a metric inside Postgres addresses repeated calculation, but workload placement remains a separate decision. The governed-file design addresses both concerns by moving the agreed results outside the primary’s query path.
Supabase’s 2026 acquisition of Hydra, the team behind pg_duckdb, and the resulting Supabase Warehouse signal that analytical separation is becoming a first-class concern in the ecosystem. The pg_duckdb extension can accelerate analytical queries on existing Postgres tables without data export. For production deployments, running those queries against a dedicated replica is recommended to avoid affecting transactional workloads. This follows the same separation principle as serving pre-calculated files, although acceleration alone does not govern metric definitions.
The MCP layer should expose governed datasets, keep production credentials out of agent configuration, and route queries through permission enforcement and access logging. A well-configured read replica with RLS can satisfy simple row-level access requirements. It cannot, by itself, make every permitted aggregation mean the same thing. The distinction is especially important when evaluating a connector whose main capability is translating an agent request into SQL.
Operational visibility belongs in the initial implementation as well. Teams need p50/p95 latency dashboards and query-level instrumentation to detect when agent-related queries begin affecting transactional performance. pg_stat_statements, enabled by default on most managed Postgres, provides relevant query-level instrumentation. For founders unable to staff the build, external analytics partners that already maintain governed metric definitions and MCP-compatible endpoints can compress months of work by delivering the governed layer as a service.
What the governed MCP contract enables beyond answering questions correctly
Pre-calculated metrics can be pushed to inbox, Slack, or phone instead of waiting for someone to remember to query a dashboard. Agents can operate on those same scheduled artifacts. That shared input removes the divergence between the number a person receives and the number an agent uses as the basis for action. Delivery changes, but the metric definition does not.
This is the structural value of headless analytics. A governed backend accessible through MCP or API can support multiple human interfaces and agents without making any one interface the home of the business logic. A new consumer can use the established definitions instead of creating another interpretation of the source tables. As agents take on more work and applications change, keeping this layer separate gives them an analytical contract they can keep relying on.
SAFE-MCP, adopted by the Linux Foundation and OpenID Foundation in 2025, and the OWASP Top 10 for Agentic Applications, published December 2025, add a security and governance context to this design. They reinforce the importance of controlled agent data access. A pre-governed MCP layer supports a compliance posture, although shared definitions alone do not replace permission enforcement or access logging. Its operational payoff is a team able to act on shared numbers, removing the need to reconcile competing calculations. This architecture is not a workaround for today’s agent limitations, but a durable boundary for running more capable agents reliably.
Sources
- Inside Track - Protecting AI conversations at Microsoft with Model Context Protocol security and governance
- Sophrosyne: Agentic Exploration of Relational Data Systems Needs Moderation
- Mind the Metrics: Patterns for Telemetry-Aware In-IDE AI Application Development using the Model Context Protocol (MCP)
- Supabase MCP can leak your entire SQL database
- Architecture overview - Model Context Protocol
- MCP Semantic Layer: How AI Agents Get Governed Metrics [2026]


