← All posts

Microsoft's New mCP server for SQL server

ClauBee Ai ·

SQL MCP Server is a new, free, open‑source Microsoft component (part of Data API Builder 2.0) that exposes SQL Server and other databases to AI agents through the Model Context Protocol (MCP). It runs as a lightweight container with a single JSON config file and provides a secure, deterministic, schema‑abstracted interface for AI agents—without letting models generate SQL directly.


🧩 What SQL MCP Server is SQL MCP Server is Microsoft’s official MCP-compliant data access server for AI agents. It sits between your database and an AI model, exposing a fixed set of safe, deterministic tools instead of raw SQL or schema.

Key identity points:

  • It is a feature of Data API Builder (DAB) 2.0.
  • It implements the Model Context Protocol (MCP) so AI agents (ChatGPT, VS Code MCP extensions, etc.) can discover and call database operations safely.
  • It supports SQL Server, Azure SQL, PostgreSQL, MySQL, and Cosmos DB as backends.
  • It is designed for agentic workflows—AI agents that need structured, reliable access to enterprise data.

💸 Is it free? Yes — completely free and open source, maintained by Microsoft.

  • “Best of all, SQL MCP Server is open source and free. It runs in any cloud, including on‑premises.”
  • No licensing cost, no per‑agent cost, no DAB license cost.

🏗️ What does it need to run? At a high level, very little:

Minimal requirements

  • A container runtime (Docker, Podman, Kubernetes, Azure Container Apps, etc.)
  • A JSON configuration file describing your entities, permissions, and database connection.
    • “SQL MCP Server is a simple MCR container that requires a JSON configuration file.”
  • A database (SQL Server, Azure SQL, PostgreSQL, MySQL, Cosmos DB).
  • Optional: Azure Key Vault, Redis, Azure Monitor, Application Insights, OpenTelemetry.

How you start it DAB 2.0 uses three CLI commands:

  • dab init
  • dab add
  • dab start

Supported transports

  • HTTP (streamable) for server/hosted scenarios
  • stdio for local/CLI scenarios

🔍 What SQL MCP Server does (high‑level) SQL MCP Server gives AI agents deterministic, secure, schema‑abstracted access to your data.

  1. Deterministic query generation (NL2DAB, not NL2SQL) Microsoft intentionally avoids NL→SQL because LLM‑generated SQL is error‑prone.
    Instead, the model produces intent, and SQL MCP Server uses DAB’s query builder to generate correct, deterministic T‑SQL every time.

  2. Fixed “Family of Seven” tools Instead of exposing thousands of tables, it exposes seven stable tools:

  • describeentities — discover objects
  • readrecords — query data
  • createrecord
  • updaterecord
  • deleterecord
  • executeentity — run stored procedures
  • aggregaterecords

This keeps the agent’s context window small and predictable.

  1. Security-first design
  • RBAC at the API layer
  • Azure Key Vault integration
  • Schema aliasing (agents never see real table names)
  • DML‑only (no schema changes allowed)
  1. Performance & observability
  • L1/L2 caching with Redis
  • Azure Monitor, Application Insights, OpenTelemetry instrumentation
  1. Zero-code deployment You don’t write controllers, ORMs, or SQL.
    You configure entities in JSON and run the container.

🧠 Why this matters SQL MCP Server is essentially:

A Microsoft‑supported, production‑safe bridge between your SQL Server and AI agents—without exposing schema, without writing an API, and without trusting LLMs to generate SQL.

It replaces:

  • Custom REST APIs
  • Ad‑hoc NL2SQL agents
  • Risky direct DB access
  • Hand‑rolled CRUD endpoints

And it integrates cleanly with your existing Entra ID, Key Vault, Redis, and Azure Monitor stack.