Microsoft Fabric AI & Machine Learning Data Engineering

Fabric GraphQL MCP: Connect AI Agents to Fabric | Numlytics

Fabric GraphQL MCP: Connect AI Agents to Fabric | Numlytics
Microsoft Fabric Data Engineering AI & Machine Learning

Connecting AI Agents to Microsoft Fabric with GraphQL and MCP

⏱️7 min read
📅October 23, 2026
Microsoft Fabric · Data Engineering · AI & Machine Learning
Diagram of an AI agent introspecting a Fabric GraphQL schema and querying data through a local MCP server, by Numlytics

A local MCP server lets an agent learn a Fabric GraphQL schema and then query warehouses, lakehouses and databases.

Giving an AI agent access to data usually means writing a connector for every table or query. Fabric GraphQL MCP takes a different route. Microsoft documents a local server that connects an agent to a Fabric GraphQL API through the Model Context Protocol (MCP), lets it learn the schema on its own and then query data in natural language.

This guide explains why GraphQL suits agents, how the server works, what setup involves, how to harden it and where it should not be used. It is written for data engineers and architects who want to test agent access to Fabric data without overpromising to the business.

Why GraphQL Suits AI Agents

A GraphQL API describes itself. Through introspection, a client can ask the API which types, fields and operations exist, so an agent can learn the data model at runtime instead of relying on hand-written tool definitions. Microsoft lists four reasons GraphQL fits MCP: schema introspection, flexible queries, type safety and efficient fetching.

PropertyWhat it gives an agent
Schema introspectionDiscovers types, fields and relationships without manual documentation
Flexible queriesRequests exactly the data it needs in a single call
Strong typingUnderstands data formats and constraints before it queries
Efficient fetchingLess over-fetching and under-fetching than many REST designs

If you are new to the API itself, our guide to the Microsoft Fabric API for GraphQL explains how to expose Fabric data through it. It can expose Fabric data warehouses, SQL databases in Fabric, lakehouses and mirrored databases through their SQL analytics endpoints, and Azure SQL Database, with support for tables, views and stored procedures in SQL databases and warehouses. Every exposed table or view needs a primary key. Here we focus on the agent layer on top.

"GraphQL gives an agent a map. MCP gives it a way to walk it."

How the Local Server Works

The server is a simple local Node.js application from the Microsoft Fabric samples repository, described in a Microsoft Learn tutorial and on the Microsoft Fabric Updates blog. It uses HTTP transport, listens on your machine at port 3000, and acts as a translator between the agent and your GraphQL API. It exposes two tools:

ToolPurposeNotes
introspect-schemaRetrieves the complete GraphQL schemaNo parameters; must be called first
query-graphqlExecutes GraphQL queries against your Fabric dataTakes a query string and optional variables; used for data retrieval and manipulation

Because the agent reads the schema through the server, you do not define a separate MCP tool for each GraphQL type, query or mutation. When someone asks to "show me customers", the agent first learns that a customers type exists and which fields it has, then writes the query. Microsoft's tutorial follows the same pattern: ask the agent to introspect the schema first, then ask a question about the data in natural language, such as retrieving a list of customers.

What Setup Involves

The setup is short but touches identity, so involve your security team. Microsoft's tutorial needs Node.js, VS Code, a workspace with an API for GraphQL item and the following steps:

Step 01
Register an app and allow service principals
Create an app registration in Microsoft Entra ID and add a client secret. A Fabric tenant admin enables "Service principals can use Fabric APIs" under Developer settings, and a workspace admin or contributor grants the service principal access to the workspace or the GraphQL API.
Step 02
Turn on introspection
A workspace admin must enable it in the API settings, because it is disabled by default and the server depends on it.
Step 03
Configure the server
Clone the Fabric samples repository, install dependencies and set the API URL, tenant ID, client ID, client secret and scope in an environment file.
Step 04
Start and test it
Run the server, check its health address, then test schema introspection and a simple query before connecting any agent.
Step 05
Connect your client
Add the local endpoint (localhost:3000/mcp) to your MCP client. Microsoft documents GitHub Copilot in VS Code and Cursor; ask the agent to introspect the schema before asking questions.
📣 Introspection Trade-off

Enabling introspection exposes schema information to everyone with access to the API endpoint. Review what the API exposes before you turn it on, and expose only the objects and columns an agent needs. Microsoft notes that exporting the schema as a file works even when introspection is off.

GraphQL MCP vs Other Fabric MCP Options

Microsoft now ships several MCP servers, and this one is for querying data through a GraphQL API you define. Choose by the job:

OptionBest forData accessMaturity
GraphQL MCP sampleAgents querying a data API you controlWarehouses, lakehouses, databases via GraphQLTutorial and sample for development
Fabric IQ MCPAgents asking governed BI questionsPower BI semantic models via DAX, read-onlyGenerally available
Core MCPManaging workspaces, items and rolesNo table dataStatus not stated in overview
Local Fabric MCPBuilding solutions, OneLake files, pipelinesOneLake files and item operationsOpen source, development-focused

See our guides to the Fabric IQ MCP server and the Fabric Core MCP server for the other two.

Security: From Demo to Production

Microsoft is explicit that this server is for development and learning. It authenticates with a service principal, so every question runs with that app's rights, not the asker's. That makes least privilege essential. Microsoft's production guidance lists six steps:

ConcernRecommended action
SecretsStore them in Azure Key Vault instead of environment files
AccessImplement authorization, network security and firewall rules
AuditingEnable audit logging for all GraphQL queries
HostingUse a managed host such as Azure App Service or Container Instances
AbuseAdd rate limiting and authentication to the MCP endpoints
RotationRotate client secrets and certificates regularly

One detail deserves attention: the query tool is documented for data retrieval and manipulation, so an agent can run GraphQL mutations wherever the API exposes them. Sources exposed through a SQL analytics endpoint are read-only, but warehouses and SQL databases can accept writes. We would add two practices of our own: expose only the objects and mutations an agent genuinely needs, and scope the service principal to a workspace that holds only the data the agent should reach.

Troubleshooting Checklist

ProblemFirst checks
Authentication errorsApp registration permissions, service principals enabled in the tenant, client secret not expired
Schema introspection failsIntrospection enabled, correct endpoint URL, network access to the workspace
Agent does not see the toolsRestart the client, confirm the server address responds, check server logs
Query errorsReview logged queries, match the schema and confirm permissions on the requested data

Where This Pattern Pays Off

The best fit is exploration and prototyping: a data engineer asks questions of a new GraphQL API, a developer checks which fields exist, or a team demonstrates conversational access to operational data before investing in a full application. For governed BI questions, a semantic model is usually the better foundation, because measures and security are already defined there.

A useful test is to run the same question two ways. Ask the agent directly through GraphQL, then ask through a semantic model. Differences in the answers usually reveal missing definitions, and that finding is often worth more than the demo itself.

Free Consultation
Prototype agent access to your Fabric data
We build a secure proof of concept, choose the right MCP option for your use case and plan the path to production.
Get Free Proposal →

Numlytics builds Fabric data platforms and the data engineering pipelines behind them. Speak with a certified consultant to scope an agent access pilot.