Book a demo
Published November 10, 2026 / Posted by: Ryan Siegler / Reviewed by: Dave Mariani

Connecting an AI Agent to a Semantic Layer with MCP

Supply governed metrics to AI Agents
Estimated reading time: 8 minutes
Connecting an AI Agent to a Semantic Layer with MCP - blog

Executive Summary

An MCP server gives an AI agent a standard way to connect to a system. It does not define what a metric means. Connecting to AtScale over MCP lets an agent browse a semantic model, ask for a metric by name, and retrieve the warehouse SQL that produced the answer.

Claude selects columns and filters, and ACE, AtScale’s AI Computation Engine, computes the metric from the definition the business already agreed on.

Key Takeaways

  • MCP is a connection protocol, and it does not store definitions. An agent with MCP access to raw tables still has to determine which tables join to which, and at what grain.
  • The query path rejects most of what an agent would write. SELECT only, no CTEs over a model, no self-joins, one semantic model per query.
  • Every answer comes with the SQL that produced it. The warehouse query AtScale sent can be retrieved against the answer’s query ID, which is what makes an agent’s number checkable.
  • Skill files work until the schema changes. Anthropic’s data team lifted Claude from 21% to about 95% with hand-written metric files, then saw accuracy fall to about 65% within a month.

Valid SQL, wrong answer

In the first post in this series I asked a database how many units were sold in Q2 2008. It returned 25,427. The retail calendar answer was 24,639, about 3% lower. Both queries were valid, and both ran without error. The schema didn’t say which quarter I meant, and the agent didn’t ask me.

A wrong business answer is hard to catch because it arrives in the same form as a correct one: a number, from a query that ran.

Let’s take revenue as another example. One company can carry recognized revenue, bookings, ARR, and revenue net of returns, each owned by a different team and stored in a different table. An agent reading column names selects one of them and often does so without asking.

This is the fourth post in my hundred days of learning AtScale. In this one: why agents get business questions wrong even when the SQL is valid, why MCP and a well-written skill file do not solve this problem, what connecting to AtScale over MCP gives an agent, and how to check an agent’s answer.

What MCP gives an agent

MCP standardizes how an agent connects to a system. It does not define what a metric means.

An agent with MCP access to raw warehouse tables has the same problem it had before, through a cleaner connector. It still has to determine which tables join to which, what one row represents, and whether a distinct count can be summed across regions. Those three decisions produce most wrong numbers.

Tool descriptions help an agent find the right columns. They do not perform the calculation. In a recent webinar, Andrew Brust of Blue Badge Insights explains:

“Hints are great. But hints alone don’t lead to AI accuracy.”

What connecting to AtScale over MCP gives an agent

  • Browse the semantic model. The agent sees which models exist and searches metrics and dimensions by name or description. On the ones it is considering, it pulls full metadata: how a metric aggregates, which hierarchy a dimension sits in, and the formula behind a calculation.
  • Ask for a metric and get a computed answer. The agent sends a SELECT naming metrics and dimensions. AtScale’s AI Compute Engine (ACE) plans the joins, the grain, and the passes, generates the warehouse SQL, and returns rows. Large results stay server-side, so the agent can slice or post-process them without loading everything into context.
  • Check the answer afterward. Every answer carries a query ID, and you can retrieve the warehouse SQL AtScale sent against it. The agent can also record whether an answer was correct, which feeds a memory of certified queries offered back on similar questions later.
  • Build and validate a model. Tools walk warehouse schemas, generate SML, and check a calculation against the engine before it ships. That part writes files, so the server is not read-only end to end, though the query path is.

The query rules are narrower than general SQL. The model needs only to generate a simple SELECT: no joins, GROUP BYs, or other complexities. Measures go in bare, without aggregation functions, because the SML defines the aggregation and the engine applies it. An invalid column path fails validation before reaching the warehouse, so a bad query costs nothing to send. Any hallucinated metric won’t run, because the real metrics are already defined in the model.

The full tool list is in the AtScale docs. Setup guides for Claude, ChatGPT, Grok, and Gemini Enterprise are there too. Cursor connects through the Marketplace listing and the GitHub repo.

Why not just write a skill file?

Write your definitions into a skill file that Claude loads, and you give it the same knowledge with no server in the path. Anthropic’s own data team published what that took. How Anthropic enables self-service data analytics with Claude.  

Without skills, Claude did not exceed 21% accuracy on their analytics evals. Adding skills took it consistently above 95%. Then, in their words, “we watched our offline accuracy drift from ~95% at launch to ~65% over a month.” 

They got it back. But doing so meant lots of manual, error-prone work: per-domain eval suites, adversarial review of every skill, an accuracy threshold each domain had to clear before launch, and monitoring thumbs-down rates as a live proxy between eval runs. 

AtScale Ava makes work easy for the agent: joins, grain, aggregation, and SQL. The agent selects metrics and filters, ACE computes the metric, and AtScale Canary (coming soon) logs and tracks the queries for further evaluation. The Excel, Tableau, or PowerBI user asking the same question gets the same number, for the same reason.

Use it yourself

See these guides for connecting your agents to the AtScale MCP server:

Then test:

Ask the agent for a total you already know, one your BI tool reports every week, and compare the two. Choose a metric with a known edge case if you have one: a distinct count across regions, or anything on a fiscal calendar. Then pull the warehouse SQL AtScale sent and read it. Viewing outbound queries requires the queries_view role.

Considerations

A shared definition can be wrong. Serving one metric to every agent spreads an error faster, which is why definitions need review before they ship. AtScale semantic models ship as YAML files, and live within your software development lifecycle with Git and CI/CD.

Removing work from the agent

I came into this expecting the MCP server to be a connector. It is one. The more useful thing it does is shrink the set of decisions the agent makes.

The agent picks a metric by name and a filter. It never sees the calculation, so there is no step where it could substitute a different definition. The number that comes back is the one your model already defined.

The agent can still explore, compare, and explain. It just can’t invent a second meaning for a metric you already defined. Next month the agent will be different, but the definitions will stay in the semantic model where you put them.

Frequently Asked Questions

What is a semantic layer MCP server?

It is an MCP server that sits in front of a semantic engine rather than a database. The agent asks for a metric by name and the engine computes it, so the agent never writes SQL against raw tables.

Does MCP replace a semantic layer?

No. MCP standardizes how an agent connects to data. A semantic layer holds what a metric means and computes it. An agent with MCP access to raw tables still has to infer joins, grain, and metric logic on every question.

Can an AI agent write to my data through the AtScale MCP server?

Not through the query path, which accepts SELECT statements only and rejects anything else before it reaches the warehouse. The model-authoring tools do write SML files, so the server as a whole is not read-only.

How do I check an AI agent’s answer?

Ask for a total your BI tool already reports and compare the two, then retrieve the warehouse SQL AtScale sent for that query and read it. Viewing outbound queries requires the queries_view role.

Which AI tools connect to AtScale over MCP?

The AtScale docs and tutorials carry setup guides for Claude, ChatGPT, Grok, and Google Gemini Enterprise. Cursor connects through the Marketplace listing and the GitHub repo.


Resources

Full tool list and setup guides: the AtScale MCP documentation · BIRD-Interact explained · AtScale for AI

Connect with me on LinkedIn!