How to connect Claude Code to the Microsoft Fabric SQL MCP server
A step-by-step setup of Fabric's remote SQL MCP server in Claude Code, from the Entra app registration to the first query, tested on six questions about my own chess games.
- Data engineering
- Microsoft Fabric
Microsoft Fabric now has a remote MCP server for SQL, in preview, that lets an AI assistant query a warehouse or a lakehouse directly. Microsoft's docs show it with VS Code. I wanted to know how it works from Claude Code in a terminal: what the setup takes, what the assistant actually sends, and where it needs help.
To judge the answers I needed data I already knew, so I used my chess.com history, the same games behind a dashboard I built a few weeks ago. This post walks through the setup step by step, then shows how Claude works with a server that has a single tool.
Before you start: you need a Fabric capacity (a trial or any F SKU), a workspace you're admin of, Claude Code, and the right to register an app in Microsoft Entra. I used a small F2.
What I built
A notebook pulls the games from chess.com into a lakehouse table. Claude Code never touches the lakehouse itself: it sends T-SQL through Fabric's MCP server to the read-only SQL endpoint, signed in with my own Microsoft account.
The SQL MCP server in one minute
In short, the server gives Claude a way into the SQL endpoint, and Claude does the translating. It first queries the schema and metadata to learn which tables and columns exist, then turns each plain-English question into T-SQL, runs it, and answers from the rows that come back. The server itself doesn't interpret anything: it runs the queries Claude writes, as you.
Fabric's remote MCP servers are endpoints an AI client connects to over HTTP. The SQL one is the one that reads data:
- One tool,
executeSQL. It runs a T-SQL query and returns the rows. There's no schema browser and no list of tables. - One item per address. The URL names a workspace and one warehouse or SQL analytics endpoint, so a connection only sees that item.
- Your own identity. You sign in with your Microsoft account through Entra, and every query runs with your permissions.
- Read-only on a lakehouse. A lakehouse SQL analytics endpoint can't change data, so it's a safe first target.
It's separate from the Fabric Core MCP server, which manages workspaces and items but doesn't query them.
Step 1: a workspace and a lakehouse
In Fabric I created a workspace called chess-lab and assigned it to my capacity. Inside it, I created a lakehouse called chess, with schemas enabled.

Creating the lakehouse also creates its SQL analytics endpoint, with the same name. That endpoint is what we'll point Claude at later. It's a read-only T-SQL view over the lakehouse tables, so nothing on the Claude side can change the data.

I chose a lakehouse over a warehouse on purpose. The data arrives through a notebook, which writes Delta tables into a lakehouse by default, and the SQL endpoint comes for free.
Step 2: something to query
Any table works. I loaded my games with one PySpark cell in a notebook attached to the lakehouse, calling chess.com's free public API. It's the dashboard's extract, ported to Python.
import requests, datetime as dt
from zoneinfo import ZoneInfo
USER = "lucagdeluca"
H = {"User-Agent": "chess-lab-fabric-demo"}
# Every monthly archive, then every standard chess game in them, oldest first
archives = requests.get(f"https://api.chess.com/pub/player/{USER}/games/archives", headers=H).json()["archives"]
games = [g for url in archives for g in requests.get(url, headers=H).json().get("games", []) if g.get("rules") == "chess"]
games.sort(key=lambda g: g["end_time"])
# Hours in my local time: Brazil before the move, Central European time after
MOVED = dt.datetime(2023, 9, 1, tzinfo=dt.timezone.utc).timestamp()
local = lambda ts: dt.datetime.fromtimestamp(ts, dt.timezone.utc).astimezone(
ZoneInfo("America/Sao_Paulo" if ts < MOVED else "Europe/Zurich"))
DRAWS = {"agreed", "repetition", "stalemate", "insufficient", "50move", "timevsinsufficient"}
me = lambda g: "white" if g["white"]["username"].lower() == USER else "black"
them = lambda g: "black" if me(g) == "white" else "white"
outcome = lambda g: "win" if g[me(g)]["result"] == "win" else ("draw" if g[me(g)]["result"] in DRAWS else "loss")
ending = lambda g: g[them(g)]["result"] if outcome(g) == "win" else g[me(g)]["result"]
opening = lambda g: g.get("eco", "").rstrip("/").split("/")[-1].replace("-", " ")
rows = [dict(
game_no=i + 1,
month=local(g["end_time"]).strftime("%Y-%m"),
weekday=local(g["end_time"]).strftime("%a"),
hour=local(g["end_time"]).hour,
time_class=g["time_class"],
colour=me(g),
result=outcome(g),
ending=ending(g),
opening=opening(g),
rating=g[me(g)]["rating"],
gap_hours=None if i == 0 else round((g["end_time"] - games[i - 1]["end_time"]) / 3600, 1),
) for i, g in enumerate(games)]
df = spark.createDataFrame(rows)
df.write.mode("overwrite").option("overwriteSchema", "true").saveAsTable("games")
display(df.groupBy("time_class", "result").count().orderBy("time_class", "result"))
The table has no opponents, game links or exact timestamps. Two columns matter later, because their meaning isn't obvious from the name: hour is already local time (Brazil before September 2023, Central European time after), and gap_hours, the time from the end of the previous game to the end of this one, is rounded to a tenth of an hour.
The Spark session started in 14 seconds and the cell ran in under a minute. The result: a games table with 6,858 rows, 5,703 of them blitz. It showed up in the SQL endpoint under dbo.games.

Step 3: register an app and add the server
The server's address is built from two IDs, both in the SQL endpoint's URL in the Fabric portal: the workspace ID and the endpoint's item ID.
https://api.fabric.microsoft.com/v1/mcp/dataPlane/workspaces/<workspace-id>/items/<sql-endpoint-id>/sqlEndpoint
Claude Code adds remote servers with claude mcp add, but it can't sign in to this one by itself. By default it tries to register itself with the server's sign-in provider, and Microsoft Entra doesn't allow that. So you register an app once and give Claude Code its ID.
- In the Microsoft Entra admin center, go to App registrations and create a new one. Single tenant is enough.
- Under Authentication, add a mobile and desktop platform with the redirect URI
http://localhost:8765/callback. - Under API permissions, add delegated Power BI Service permissions:
Item.Read.All,Item.Execute.All,Workspace.Read.All,SQLEndpoint.Read.AllandSQLEndpoint.Execute.All. None of them need admin consent. - Copy the application (client) ID.
Then add the server, with the same port as the redirect:
claude mcp add --transport http --client-id <your-app-id> --callback-port 8765 fabric-chess https://api.fabric.microsoft.com/v1/mcp/dataPlane/workspaces/<workspace-id>/items/<sql-endpoint-id>/sqlEndpoint
Inside Claude Code, run /mcp, pick the server, choose Authenticate and sign in in the browser. The status turns to connected, with 1 tool.

Two tips from the first run:
- Keep only one Fabric server enabled. I also had the Fabric Core server connected, and Claude started by listing my workspaces through it instead of querying the table.
- Name the server in your first question. "Using the fabric-chess MCP server, …" sends Claude straight to the right tool instead of searching your files for config.
Step 4: how Claude works with one tool
From here it's conversation. Each time Claude wants to run a query, Claude Code shows the executeSQL call and asks for approval, so nothing reaches Fabric without you seeing it. I asked six questions about data I knew well, which made a wrong answer easy to spot.
Discovering the schema
My first question was "What's in the games table?". With no schema tool, Claude looked the columns up with SQL first, then summarised: 6,858 rows at game grain, January 2018 to November 2026, 11 columns. It also noticed something I hadn't asked about, that only 84 of the 107 months have games. Expect this round trip at the start of each new conversation. It's the price of a single tool.

Reading the T-SQL it sends
For "How did my blitz rating change year by year, and when did I peak?", I pressed ctrl+o to open the detailed view. It shows the exact T-SQL Claude sent through the server and the rows Fabric sent back. That's the part to read when you try this on your own data, because it tells you whether an answer comes from a real aggregate or from a guess.

Charted from those rows: a peak of 1342 in September 2026. In 2021, my busiest year with 1,409 blitz games, I gained only about 90 points.
Turning a vague question into SQL
"Do I play worse late at night?" has no column to look up. Claude made its own time-of-day buckets from hour, said which hours each one covers, and then broke out single hours where a bucket hid something.
Late night turned out fine. The weak spot was 8 to 9am: 43.3% over 501 games, against 56.5% at midnight. Claude added a caveat I liked: matchmaking pushes every win rate towards 50%, so gaps like these understate the real effect.
Because the dashboard had already shown me 56% after midnight and 48% in the morning, I could check the answer. It matched, and went one level finer than the dashboard does.

When the data can't answer the question as asked
I asked: "After a loss, if I start the next game within 5 minutes, does my win rate drop?" gap_hours is rounded to 0.1 hours, so a 5-minute cut isn't possible. Claude said so before answering, and used 0.0 hours (about 3 minutes or less) as "instant" instead. That's the behaviour you want from an assistant that only sees column names.
The answer: after a loss, the "instant" next game won 40.4% of the time (213 games), against about 49% otherwise. It looked like proof of tilt, until a second look showed a catch that neither Claude nor I had seen. gap_hours runs from the end of one game to the end of the next, so it includes the length of the next game. "Instant" really means "the next game was over within about 3 minutes", which mixes quick requeues with short games. So it's a hint of tilt, not proof. Measuring it properly needs a start-time column, which chess.com's PGN headers provide.

Follow-ups are just more queries
The last two questions, on openings and on whether moving from Brazil to Europe in 2023 changed anything, each took a few executeSQL calls and no new setup. The short versions: the Scandinavian is my best defence as black (58.0% over 1,645 games), and the move changed when I play, not how well. The 8 to 9am slump shows up in both countries.

What I'd tell you before you try it
- It's a preview, and it shows. The SQL server has one tool,
executeSQL. There's no schema tool, so Claude spends its first query or two working out your columns. - Your column names are your documentation. Claude guessed most meanings right, but it couldn't know that
hourwas already local time or howgap_hourswas measured. It flagged the rounding, but not that the gap includes the next game's length, and I'd forgotten that myself. A short description per column would have caught both. - Read-only is a feature. The lakehouse SQL endpoint can't change data, so letting an assistant loose on it is low risk.
- Approve every call, at least at first. Seeing each T-SQL query before it runs is how you learn what the assistant is actually doing with your data.
The setup is one app registration and one command. After that, a Fabric table becomes something you can question in plain English, with every query visible before it runs. For my chess, the clearest answer was: don't play blitz at 8am. Your own data will have its own questions.