# Ask the data, get the governed answer

> Analysts had become a queue for questions the warehouse already knew the answer to. We built an MCP server that lets an AI assistant query the governed metrics directly, with the same definitions, permissions and audit trail as a person.

Project on Variable Frog. Page: https://variablefrog.com/work/mcp-server

- Client: A media agency's analytics team
- Industry: Advertising
- Service: Lab
- Stack: MCP, Claude, BigQuery, a semantic layer
- What we built: An MCP server over the governed metrics
- Outcome: 61% fewer ad hoc requests, answers in minutes
- Headline number: -61% ad hoc data requests

## In short

- The problem: Analysts spent half their week pulling numbers that already existed. A simple question waited two days.
- What we built: An MCP server with twelve tools over the semantic layer, with permissions, limits and a full audit log.
- The result: 61% fewer ad hoc requests reach analysts, and the median answer takes 4 minutes.

Chart: Ad hoc data requests to analysts each week: teams with the assistant against teams without.

Ad hoc requests per week over 12 weeks: teams with the assistant fall from 46 to 18 while teams without it stay near 46.

### At a glance

- Challenge: **2 days** Median wait for an ad hoc data question, most of them a filter on a number that already existed.
- Approach: **12** Tools behind one MCP server: find a metric, read its definition, query it, compare periods, explain a change.
- Result: **-61%** Ad hoc requests reaching analysts, against teams without the assistant. Median answer time: 4 minutes.

The warehouse was in good shape. The bottleneck was people. Every account lead with a question about spend, reach or cost per lead sent it to an analyst, who opened the same tables, wrote almost the same query and sent back a screenshot. The analysts were good at it, and it was half their week.

## The problem

Pointing a chat model straight at the database is the obvious shortcut and the wrong one. It guesses the joins, invents its own definition of a metric, and answers confidently with a number nobody can trace (In our first test without guardrails, 1 answer in 5 was wrong in a way that looked right: the correct tables, the wrong definition.). One wrong number in a client meeting costs more than a hundred slow ones.

The opposite mistake is a chatbot that only reads documentation. It can tell you what cost per lead means. It cannot tell you what it was last week.

## What we built

The Model Context Protocol is an open standard for giving an AI assistant tools it can call. We built a server that speaks it and put the semantic layer behind it. The assistant cannot write its own definition of revenue: it can only ask for the one finance approved, with the filters it is allowed to use.

### The system, from question to answer

A semantic layer, the warehouse and platform APIs sit behind an MCP server made of tools, guardrails and an audit log, which serves the assistant, scheduled briefings and the analysts.

- What it can reach: Semantic layer (Every metric and dimension with its definition, its owner and the questions it is meant to answer.); The warehouse (Read only, and only through the metric layer. The assistant never sees a raw table.); Platform APIs (Live delivery and pacing from the ad platforms, for questions about today.)
- The MCP server: Tools (Twelve typed tools with strict inputs. The model picks a metric, dimensions, filters and dates; the server writes the query.); Guardrails (The asker's own permissions apply. Row limits, cost limits, and no personal data ever leaves the server.); Audit log (Every question, tool call, query and answer is stored, so any number can be traced and replayed.)
- Where people ask: The assistant (Claude, in the tools the team already works in. Under every answer: the metric, the filters and the dates it used.); Scheduled briefings (The Monday summary for each account, written from the same tools, on the same definitions.); Analysts (They get the questions that need judgment, with the assistant's trail attached.)

Before launch we took 240 real questions from the request queue, wrote down the right answer to each, and ran the assistant against them on every change. A change ships only when the assistant matches on at least 97% and says it cannot answer on the rest.

## The result

We switched the assistant on for six teams and left five without it for twelve weeks. Requests to analysts from the six fell from 46 a week to 18. The questions that still arrive are the ones worth an analyst: why something moved, and what to do about it.

The analysts' own time moved with it. Ad hoc pulls went from about half their week to under a fifth, and the difference went into the models and experiments the pulls had been crowding out.

## What they own now

### Theirs to keep

The server runs inside their cloud, next to their data. The model can be swapped without rewriting a single tool.

- **The MCP server**: In their repository, tested and deployed by their pipeline.
- **The tool catalogue**: Each tool, its inputs and what it is allowed to return.
- **The evaluation set**: 240 questions with known answers, run on every change.
- **The audit log**: Every answer, traceable to its query.
- **The runbook**: How to add a metric, a tool or a team.

### How it was measured

Requests are the ad hoc data requests logged to the analytics queue each week, for six teams with the assistant and five without, over twelve weeks. Answer time is the median from question to answer in the assistant.

- Teams: 6 with the assistant, 5 without
- Period: 12 weeks
- Evaluation: 240 questions, 97% matched
- Median answer: 4 minutes

