Single Metric Definition Across MCP, API, and Dashboard Consumers

Pre-modeling each metric once keeps agents, APIs, and dashboards agreeing.

· 9 min read · Updated
Cover illustration for “Single Metric Definition Across MCP, API, and Dashboard Consumers”
MCP and Headless Analytics · October 26, 2026 · 9 min read · 1,938 words

For API-first and agent-first teams, a headless analytics backend should expose governed metrics without requiring an opinionated frontend. “Single Metric Definition Across MCP, API, and Dashboard Consumers” explains the essential architecture. A single, pre-modeled metric definition guarantees that every consumer reads the same calculation, rather than independently deciding what the number means.

Why the same metric produces different answers for different consumers

Two people on the team join the same investor call with different numbers for Q2 revenue. One brings a dashboard export, while the other brings an answer from an agent connected to the company’s Supabase data. Both think their number answers the investor’s question. Each consumer resolves revenue independently, so access to the same underlying records does not produce agreement about the calculation.

The fragmentation sits in the application architecture. An API endpoint owns its SQL, a dashboard owns its field references, and an agent chooses its own filter logic. One engineer writes SUM(revenue), while another writes SUM(amount_captured). Both expressions are plausible, but neither establishes which definition the business has agreed to use. Until someone checks the outputs against each other, each surface can look right on its own.

That gap is not a minor rounding difference. The fields and filters chosen answer different business questions, even when all the results have the same label. A human analyst can ask a colleague what a field means and wait a day for the right export. An autonomous agent operating without that fallback can select a table and act without flagging the uncertainty. The architecture therefore leads to inconsistent reporting and decisions made from calculations whose meanings change with the consumer.

How MCP accelerates the spread of metric disagreement rather than resolving it

MCP is a genuine advance in integration. Sources and consumers can share a common protocol in place of keeping N×M point-to-point connections. That reduces the complexity of connecting an agent to data, but it does not settle what the data means. A newly connected agent inherits the ambiguity already present in the fields, tables, and competing calculations it can reach.

The protocol also makes that access easier to scale. MCP’s July 28, 2026 specification added a stateless, request/response core, so servers can run behind a plain load balancer without shared session storage. More agent instances can consequently query the same layer concurrently. If that layer contains unresolved definitions, the improvement in throughput delivers the disagreement to more consumers at machine speed.

Starburst identifies implementation-level enforcement, rather than the standard itself, as the basis of governance. MCP provides connective tissue. Placing a revenue definition in an MCP server description may explain the intended calculation, but an agent that still constructs its own SQL can execute something else. Documentation is not enforcement of the calculation itself. A governed definition must determine what runs, rather than merely describe what a consumer ought to run.

Why agents cannot resolve metric ambiguity through reasoning or retrieval

Even a more capable model does not have the organization’s institutional memory. Schemas do not tell it which reports are current, which fields nobody trusts, or which version of revenue the CFO uses. Those distinctions often live in people. Retrieval can expose more candidate fields and reports, but their availability does not establish which one has authority.

Starburst describes the consequence as errors in meaning becoming incorrect answers delivered with total confidence unless infrastructure resolves ambiguity before reasoning begins. Confidence does not establish which definition is authoritative. Enterprise data volumes also keep compounding, and much of what an agent encounters was created recently. The agent is therefore interpreting both uncertain meaning and changing inputs. More context cannot take the place of an agreed calculation when that context has competing versions.

lakeFS distinguishes agent access from pipelines that are versioned and reviewed and from people whose activity leaves an audit trail. Agents are non-deterministic and traverse data at a speed no human can monitor in real time. That difference makes case-by-case human reconciliation an unsuitable foundation for autonomous consumption. Upgrading the model leaves the competing definitions intact, while upgrading the protocol only improves access to them. Neither change determines which calculation the business intends to authorize.

Databricks observes that most databases on Neon are now created by AI agents. Agents are no longer only downstream readers of infrastructure that humans prepare. They also participate in provisioning it, which makes a human governance afterthought increasingly untenable. The definition must exist before the agent chooses how to answer. Otherwise, the system delegates a business decision to a model without giving it an authoritative basis for that decision.

What a single pre-modeled metric definition actually means in practice

A governed metric definition is a named, pre-calculated dataset that encodes the calculation once. The unit is a dataset, not a query. Its definition fixes the field, filter, and aggregation window before an MCP tool, API caller, or dashboard requests the result. Consumers read that result instead of independently reconstructing it from operational tables. The shared name refers to a shared data artifact, not to several SQL strings that happen to use the same label.

For MRR, this means the dashboard and the agent read the same modeled output. A change belongs in the definition, where it becomes the result all downstream consumers read, rather than in separate dashboard logic, agent prompts, and API implementations. There is no consumer-specific calculation to patch. This is the technical distinction between centralizing a description and centralizing execution.

The concrete storage shape is governed Parquet datasets containing pre-calculated metrics, with DuckDB providing analytical queries over those datasets. A single MCP server exposes access to the resulting analytical layer. The agent queries the modeled result, never the production table. That separation makes the calculation an upstream artifact rather than a decision made during each agent interaction. It also gives API callers and dashboard feeds the same underlying source of meaning.

For Supabase teams, this separates analytics from production Postgres. Agents do not need a connection to the operational instance to answer metric questions. With no direct agent queries to that instance, the analytical path cannot use up its connection pool or bypass its row-level security. This protection comes from keeping production access out of the path. It does not depend on an agent remembering instructions about which production tables are safe to inspect.

How governance must be built into the data path, not layered on top of it

Even when a calculation is right, it can reach the wrong consumer. Pre-modeling resolves what the metric means, but the data path must also enforce who may read it. lakeFS identifies data-layer policy enforcement as a core component of agentic access, with security applying wherever the data lives. Moving a metric out of production does not remove its access requirements. The governed dataset must keep those requirements when it is made available through another interface.

Attribute-based access control applies those restrictions to the requesting identity. Row-level security returns only authorized records, while column-level masking redacts sensitive fields even within otherwise permitted queries. Under these rules, a fraud detection agent can see transaction amounts and timestamps without seeing payment card numbers. The permitted view is narrower than the dataset. Authorized results can differ without a metric disagreement when they use the same calculation and the same access rules are enforced each time.

Promethium says that enforcing static policies at the start of a session is not enough for agent workflows. Governance must operate at the request level, with every action. The corresponding design requirement is a verifiable identity for each agent and least-privilege permissions scoped to its task. A support agent and a financial reporting agent should not share credentials, even within the same organization. Otherwise, the data layer cannot distinguish their different authority when serving the metric.

lakeFS also identifies lineage and version control as requirements for tracing and reproducing results. Lineage records where data originated and how it changed, while version control supports investigation of stale or incomplete inputs. Correctness must remain explainable after the query finishes. A single MRR definition thus has the same access policy, audit trail, and lineage record wherever consumers read it.

Why Supabase teams need this architecture from the start, not after scaling problems appear

For a Supabase founder, the practical recommendation is to establish governed metric definitions at formation. Analytics against the production Postgres primary can damage transactional performance, making a separate analytical layer part of keeping the application database healthy. Waiting for conflicting investor reports means waiting until several consumers already depend on their own interpretations. At that point, reconciliation must address both the calculation and the places that adopted it.

Drift can begin with ordinary implementation choices. One engineer queries production for revenue, an agent applies a different filter to the same table, and a dashboard reads a materialized view refreshed on another schedule. Each choice introduces a separate place to investigate when results diverge. Tracing the disagreement then requires reconstructing definitions and timing. Setting up the canonical artifact early gives future consumers the calculation to use, with no new interpretation to investigate.

The same separation supports visibility into the operational database. Active connections past the danger threshold, query latency, connection pool saturation, and replication lag need a monitoring layer separate from the production instance and readable by humans and agents. These signals serve a different purpose from business KPIs. They show whether the operational system is healthy, while governed business metrics support decisions about the company. Both need access paths that do not turn every new consumer into another production analytics workload.

lakeFS identifies read-only agent access as the lowest-risk and most widely deployed first stage. For an early team, agents that search, retrieve, and summarize without modifying data provide a practical starting scope. Read-only access limits what an agent can change. The governed metric layer also constrains what its answers mean, which a read-only permission alone cannot accomplish. The initial modeling work can stay focused on five or fewer actionable KPIs, including retention, churn, ARR, CAC, and gross margin.

How the single definition surfaces to every consumer through one governed layer

The end-to-end flow starts with the metric calculation, before any consumer requests an answer. Its pre-calculated output is stored as a governed Parquet dataset, and DuckDB supplies fast, cheap analytical reads over that output. The MCP server exposes the analytical layer to agents, API access, and dashboard data feeds. Each surface presents a different way to consume the result.

For an agent, the entry point is an MCP tool. For an API caller, it is programmatic access to the metric result, while a dashboard uses the same definition as its data feed. This is the relevant headless analytics pattern for teams that want full API control without an opinionated frontend. An AI agent can get usage analytics without anyone first putting them in a prebuilt dashboard UI. The interface is optional. The governed calculation is not.

Concurrency changes the number of readers of the same definition. The stateless protocol allows the serving layer to scale horizontally for agent and human traffic without introducing consumer-specific session state. Access policy still applies to each request. Because the metric calculation is kept upstream, adding a server instance or consumer adds no new place where revenue has to be interpreted.

Salesforce’s Headless 360, announced at TrailblazerDX on April 15, 2026, demonstrates the broader pattern at enterprise scale. Capabilities appear as APIs, MCP tools, or CLI commands accessible to humans and agents without a browser. An API-first team can build its own interface, an agent-first team can consume tools directly, and a dashboard can display the output without any of them becoming the authority on how the metric is calculated.

Sources

  1. The 2026-07-28 MCP Specification Release Candidate

More in MCP and Headless Analytics