SQL MCP Server: Microsoft's Open-Source Bridge Between AI Agents and SQL Databases

Microsoft's SQL MCP Server connects AI agents like Copilot and Claude to SQL Server databases through the Model Context Protocol. Here's what it actually does, how to set it up, and where an experienced DBA is still irreplaceable.


Every few years, a tool shows up that actually changes how DBAs work. Not a new GUI wrapper or a slightly better execution plan viewer — something that shifts the nature of the job. Model Context Protocol, and specifically Microsoft's SQL MCP Server, is one of those tools. It's also being oversold in ways that will burn people who don't understand what it actually does.

I've been hands-on SQL Server for over 20 years. I've seen AI features come and go — query optimizer hints that never worked, "intelligent" backup scheduling that wasn't, Azure Advisor recommendations that ranged from useful to actively bad. So when Microsoft shipped SQL MCP Server, I looked at it the same way I look at any new tool: what does it actually do, where does it genuinely help, and where does the hype outrun reality?

Here's what I found.

What Is the Model Context Protocol (MCP)?

MCP is an open standard — originally introduced by Anthropic in late 2024 — that defines how AI agents discover and call external tools. Think of it as a standardized API contract between an AI model and the outside world. Instead of every AI vendor inventing a custom integration for every data source, MCP gives you a consistent protocol: here's what tools are available, here's how to call them, here's what comes back.

A "tool" in MCP terms is a single operation: read records from a table, create a row, execute a stored procedure. The AI agent discovers available tools at runtime through a standard discovery call, then calls them as it needs them while working through a task. This is how Claude can look up your schema, query your data, and propose a query fix — all within a single conversation — without you having to copy-paste results back and forth.

MCP is to AI agents what REST was to APIs: a common language that lets different systems talk without custom glue code for every combination. Microsoft, Google, and a growing ecosystem of vendors have adopted it. It's not going away.

What SQL MCP Server Actually Does

Free · 2 Minutes
How healthy is your database, really?
Get your free database health score — spot risks before they become incidents.
Get my health score

SQL MCP Server is Microsoft's implementation of an MCP server on top of their Data API builder (DAB) platform. It ships open-source and free starting in DAB version 1.7. It gives AI agents (Copilot, Claude, or anything else MCP-compatible) a controlled, structured way to interact with your SQL Server databases — and it works across SQL Server, Azure SQL, PostgreSQL, MySQL, and Cosmos DB.

The key word is "controlled." This is not a free pass for AI to do whatever it wants to your database. SQL MCP Server exposes exactly seven operations to agents:

  • describe_entities — Discover what tables, views, and stored procedures are available
  • read_records — Query data from exposed entities
  • create_record — Insert new rows
  • update_record — Modify existing rows
  • delete_record — Remove rows
  • execute_entity — Run a stored procedure
  • aggregate_records — Perform aggregation queries

That's it. No DDL. No schema changes. No ALTER TABLE, no DROP INDEX, no TRUNCATE. The agents work with data, not structure. And they only see what you tell them to see.

The NL2DAB Approach — Why It Matters

Most database MCP servers on the market take the obvious approach: take what the user said, hand it to the AI, have the AI write T-SQL, execute the T-SQL. This is called NL2SQL (natural language to SQL) and it is a reliability problem waiting to happen.

AI models are not deterministic. Two runs of the same prompt can produce different queries. Complex queries — joins across multiple tables, aggregations with multiple conditions, anything involving dates or NULL handling — are exactly where subtle errors appear and exactly where users trust the output without verifying it. An AI-generated query that returns 999,990 rows when the right answer is 1,000,000 does not look wrong. It looks like the answer.

Microsoft took a different approach they call NL2DAB. Instead of having the AI write raw T-SQL, the AI calls the structured DML tools. SQL MCP Server uses Data API builder's own query builder to produce the T-SQL deterministically. The AI agent describes what it wants in terms of the tool API — read these records with these filters — and DAB generates the correct, well-formed SQL internally.

This is a meaningful design choice. The output is predictable, testable, and safe to run. The downside: it only works through the entity abstraction. You can't write arbitrary queries. If you need a cross-database join or a recursive CTE, you either build it into a stored procedure and expose it via execute_entity, or you live without it. For most CRUD and reporting use cases, this trade-off is the right call.

Setup: Three Commands to Get Running

The Data API builder CLI makes initial setup straightforward. You need Docker or .NET runtime, and then:

-- Step 1: Initialize the DAB config file with your connection string
dab init --database-type mssql \
  --connection-string "Server=myserver;Database=mydb;User Id=myuser;Password=mypassword;" \
  --config dab-config.json \
  --host-mode development

-- Step 2: Add an entity (table/view you want to expose to agents)
dab add Customers \
  --source dbo.Customers \
  --source.type table \
  --permissions "anonymous:read" \
  --description "Customer records including contact info and account status"

-- Step 3: Start the MCP server
dab start

Once running, you can connect any MCP-compatible client. To test with the MCP Inspector tool:

npx -y @modelcontextprotocol/inspector http://localhost:5000/mcp

The configuration lives in dab-config.json. The MCP runtime block enables the server and lets you toggle individual tools:

{
  "runtime": {
    "mcp": {
      "enabled": true,
      "path": "/mcp",
      "dml-tools": {
        "describe-entities": true,
        "create-record": true,
        "read-records": true,
        "update-record": true,
        "delete-record": false,
        "execute-entity": true,
        "aggregate-records": true
      }
    }
  }
}

Notice "delete-record": false. You can selectively disable individual tools. In production, my default is to disable delete and update at the runtime level, then re-enable only on the specific entities where agents genuinely need write access. Defense in depth: even if an agent is prompted badly, it cannot blow away data it has no delete permission on.

Practical Use Cases Where This Actually Helps

Schema Exploration and Query Assistance

This is the most immediate win. Your developer asks Claude "what does the Orders table look like and how does it relate to OrderItems?" Instead of hunting through SSMS object explorer, they get a structured answer derived from the entity definitions you've configured — including the semantic descriptions you've added to fields. If you documented that unit_price is "the per-item price at time of order, not current catalog price," that context surfaces in the agent's response. The AI is not guessing at semantics; it's reading what you documented.

AI-Assisted Performance Troubleshooting

Configure a read-only view of your sys.dm_exec_query_stats and sys.dm_os_wait_stats data as DAB entities, and an AI agent can help interpret wait statistics and flag high-cost queries — without needing full database access. This is not a replacement for knowing what PAGEIOLATCH_SH means; see the post on SQL Server Performance Monitoring with DMVs and Extended Events for that foundation. But it is a useful first pass that asks the right questions and surfaces the queries worth investigating.

Migration Inventory and Planning

Read-only access to schema metadata gives an AI agent enough context to reason about migration complexity: table counts, foreign key chains, stored procedure references, data volumes. For SQL Server 2016 environments hitting the July 2026 EOL deadline, AI-assisted schema inventory is genuinely useful for scoping the work. I covered the migration decision framework in SQL Server 2016 End of Life: Migration Guide — the tactical choices still require human judgment, but the inventory work can be AI-accelerated.

Internal Data Access Without Custom APIs

Business users need data without going through a developer every time. SQL MCP Server, configured carefully with role-based access control, lets you build internal chatbots and copilots that answer business questions against live data — without exposing the full schema or writing custom API endpoints for every use case. Finance gets their monthly close numbers. Operations gets current inventory counts. Nobody gets access to tables they should not see.

Is your SQL Server environment ready for AI tooling?

Take the SSTS Database Assessment — 10 questions, no sales call, actionable results on where your gaps are and what to address first.

Take the Free Assessment →

The Security Model — Read This Before You Deploy

Microsoft's own security guidance flags over-permissioned MCP servers as a primary risk. An MCP server with access to your entire schema, with all DML tools enabled, is a meaningful attack surface if your agent prompting is manipulated or if the AI makes bad decisions under an unusual input. The right configuration is explicit and minimal:

{
  "entities": {
    "Customers": {
      "source": "dbo.Customers",
      "permissions": [
        {
          "role": "anonymous",
          "actions": ["read"],
          "fields": {
            "include": ["customer_id", "company_name", "account_status", "region"],
            "exclude": ["ssn", "payment_method_token", "internal_notes"]
          }
        }
      ],
      "mcp": {
        "dml-tools": true
      }
    },
    "PaymentDetails": {
      "mcp": {
        "dml-tools": false
      }
    }
  }
}

Field-level exclusion is critical in compliance environments. PCI-DSS and HIPAA requirements on what AI agents can access are still evolving, but the safe position is to treat agent access the same as you would treat an application service account: minimum privilege, specific tables, specific fields, read-only unless you have a documented reason for writes.

Role-based access control in DAB applies consistently across REST, GraphQL, and MCP endpoints from a single configuration. Configure permissions once, and they apply everywhere. This is a security advantage over environments where API security and database security are configured separately and drift apart.

Where You Still Need an Experienced DBA

This is where I push back on the hype.

SQL MCP Server is a good tool for structured data access. It is not a DBA. The gap looks like this in practice:

Plan regression diagnosis. When a query goes from 200ms to 45 seconds after a statistics update, the fix requires reading execution plans, understanding parameter sniffing, and deciding whether you need OPTION (RECOMPILE), a plan guide, or an index rebuild. An AI agent can surface the query from sys.dm_exec_query_stats. It cannot reliably diagnose why the plan changed or prescribe the right fix. The SQL Server Performance Tuning Checklist walks through the 12 checks that require understanding what each wait type means and why — that knowledge does not come from a configuration file.

Architecture decisions. Should this be a filtered index or a covering index? Should reporting workload move to a readable AG secondary? Is the real fix a bad data model that needs to change at the schema level? These are judgment calls built on years of seeing what happens when you make each choice in production. More on the AG options in the SQL Server AG Deep Dive.

Incident response under pressure. At 2AM, production is slow, users are calling. You need someone who has run that kind of incident before — who can quickly isolate a blocking chain from a runaway query from a tempdb issue from a storage problem — and can act fast without making it worse. The 2AM Database Test exists because experienced judgment under pressure is not something you automate.

Where NL2DAB hits its limits. Complex reporting queries, recursive CTEs, multi-database joins, anything requiring dynamic SQL — these do not fit the seven DML tools. You either pre-build them as stored procedures (which requires a DBA to write and maintain) or you work around them. The tool is good at what it does. It does not do everything, and the boundary of what it does is narrower than the marketing suggests.

The Honest Take

SQL MCP Server is legitimately useful — and it's the first version of an approach that will mature significantly in the next few years. The NL2DAB model is the right engineering call. The security model is well-designed. The DAB CLI makes initial setup fast. For schema exploration, structured internal tooling, and AI-assisted first-pass analysis of performance data, this is worth your time.

The worst use case is unsupervised write access to production databases. Don't do that. Not yet. "Safer than NL2SQL" is not the same as "safe."

What SQL MCP Server signals is more interesting than what it does today. Every major database vendor is shipping MCP support in 2026. The protocol is becoming infrastructure the same way REST became infrastructure. DBAs who understand how to configure and secure MCP endpoints will have an advantage over the ones who wait until it's a requirement. The value of that advantage is proportional to how quickly you understand where the line is between what the tool does well and where experience is still the thing that matters.

If you want a read on where AI tooling fits in the broader DBA picture, see the post on AI Changing Database Administration in 2026. The short version: AI augments experienced DBAs. It doesn't replace the judgment the job actually requires.


The SQL MCP Server documentation is at Microsoft Learn. The DAB CLI gets you running in an afternoon on a dev environment. If you want a read on whether your current SQL Server setup is positioned well for AI tooling, the SSTS Database Assessment covers it — 10 questions, no sales call, prioritized results.

Free · Takes 2 Minutes

Get your free database health score

Find out exactly where your database is vulnerable before it causes an incident. 20+ years of DBA expertise, distilled into a single assessment.

Back to all posts