Skip to content
Automation Squad

Ranked roundup · SQL Server

Best MCP Server for SQL Server

The best MCP server for SQL Server right now is the one Microsoft actually ships: SQL MCP Server, built into Data API builder 1.7 and later, with the full feature set in the 2.0 release. That wasn't true a year ago. Microsoft's earlier sample — the MssqlMcp server in Azure-Samples/SQL-AI-samples that most 2025 tutorials still link to — was deleted from that repo in June 2026, with the commit message "Removed problematic MCP sample." If a guide points you there, it's stale. The rest of the field splits three ways: multi-database community servers (Bytebase's DBHub, 3,439 stars, commits landing the day we verified), dedicated community mssql servers (mostly Python, mostly SQL auth via environment variables), and Zapier's managed route, which requires your database to accept connections from Zapier's cloud. We ranked these five on verifiable criteria — official status, commit recency, stars, auth model, documented capabilities — not paid placement, and every caveat we found is listed, including the unflattering ones.

Facts checked September 1, 2026 · ranked on verifiable criteria · placement is never for sale

Robert MacKelfresh

By Robert MacKelfresh

Founder, Automation Squad ·

The ranking

  1. Production agent access to SQL Server with RBAC and auditability — teams that want a controlled contract, not a SQL prompt aimed at their database.

    Seven deterministic DML tools (describe_entities, create_record, read_records, update_record, delete_record, execute_entity, aggregate_records) over the tables, views, and stored procedures you configure; stored procedures can register as named custom tools; built-in caching, health checks, and OpenTelemetry tracing. Same config also serves REST and GraphQL.

    Self-hosted: run locally via the DAB CLI (stdio or streamable HTTP), in Docker, or deploy to Azure Container Apps; quickstarts exist for VS Code, .NET Aspire, and Microsoft Foundry. · Database side: a standard connection string, so integrated/Windows auth works on-prem and Entra ID or SQL auth works for Azure SQL; secrets can come from environment variables or Azure Key Vault. Caller side: Data API builder's auth providers with per-role RBAC; local stdio mode uses the simulator provider with an optional role. · MIT · 1,503★

    • No arbitrary SQL and no NL2SQL by design — the model cannot write its own T-SQL, which is the point, but it rules out ad-hoc analytical queries
    • DML only, no DDL: schema changes stay in SSMS or the VS Code MSSQL extension
    • Requires authoring a dab-config.json entity map before anything works; per-tool toggles and custom stored-procedure tools need the DAB 2.0 release
    • Microsoft's older MssqlMcp sample (Azure-Samples/SQL-AI-samples), still linked from many tutorials, was removed in June 2026 — this DAB-based server is the current official path
  2. Fast, low-friction raw SQL access for development and analytics, especially in shops running SQL Server alongside other databases.

    execute_sql with read-only mode, row limiting, and query timeouts; search_objects for schema exploration; opt-in explain_sql and health_check; deliberately small ~1.4k-token tool surface. Also speaks PostgreSQL, MySQL, MariaDB, and SQLite through the same interface.

    Self-hosted: npx @bytebase/dbhub, Docker image, or one-click MCP Bundle; stdio and HTTP transports. · DSN connection string with a SQL login (user/password); SSH tunneling and SSL/TLS supported. Windows/integrated authentication is not documented. · MIT · 3,439★

    • Not SQL Server-specific — generic tools, no T-SQL-aware extras
    • Windows auth undocumented; plan on a SQL login
    • Outside read-only mode, execute_sql runs whatever the model writes — the login's permissions are the only guardrail
  3. Official · Microsoft

    Azure SQL admins who want to provision, scale, and firewall databases from an agent instead of the portal.

    13 Azure SQL management tools: create, delete, rename, and scale databases and servers, manage firewall rules and elastic pools, list Entra ID administrators — alongside tools for the rest of Azure.

    Self-hosted locally (VS Code, Visual Studio, or any MCP client) against your Azure subscription. · Microsoft Entra ID via your existing Azure credentials — no database credentials stored in the MCP config. · MIT · 3,630★

    • Management-plane only — it cannot run a single query against your data
    • Azure SQL only; does nothing for on-prem SQL Server
    • The original Azure/azure-mcp repo was archived in February 2026 and development moved into the microsoft/mcp monorepo, so older install guides point at a dead repo
    • Star count is for the whole microsoft/mcp catalog, not the SQL tools alone
  4. A lightweight local bridge to on-prem SQL Server when you need Windows auth and minimal setup.

    List database tables and execute SQL — SELECT, INSERT, UPDATE, DELETE — through a single controlled interface, with custom port support.

    Self-hosted Python: run with uvx or pip over stdio; configured entirely through environment variables. · SQL auth via MSSQL_USER/MSSQL_PASSWORD environment variables, Windows Authentication via an MSSQL_WINDOWS_AUTH flag; works with LocalDB and Azure SQL. · MIT · 386★

    • No pushes since November 2025 — ten months idle at verification
    • Community project with no vendor support
    • Executes whatever SQL the model writes; its own docs tell you to create a dedicated minimal-permission login and never use sa or admin accounts
  5. No-code teams with a cloud-reachable SQL Server who want database actions alongside their other Zapier integrations.

    Custom query execution plus new-row, update-row, and find-row actions via Zapier's SQL Server app; the same MCP endpoint can also reach the rest of Zapier's app catalog.

    Fully managed by Zapier — nothing to run yourself, but your database must accept inbound connections from Zapier's static IP ranges (44.214.195.64/28 and 18.246.81.208/28) on port 1433 by default. · Zapier-managed connection: you store host, port, database name, and a SQL login with Zapier; your MCP client connects to a unique Zapier MCP URL.

    • Your SQL Server must be reachable from outside your network — localhost and purely internal instances won't work, which excludes most on-prem setups without firewall changes
    • Requires SQL Server 2012 or newer and IP allowlisting; Zapier rotated its static IPs in early 2026, and firewalls not updated by the deadline broke
    • Custom query triggers are flagged 'advanced users only' in Zapier's own docs
    • Closed source and hosted — no stars, license, or commit history to inspect, and your database credentials live with Zapier

SQL Server MCP servers compared

ServerMaintained byRunsAuthLicense
SQL MCP Server (Microsoft, Data API builder)MicrosoftSelf-hosted: run locally via the DAB CLI (stdio or streamable HTTP), in Docker, or deploy to Azure Container Apps; quickstarts exist for VS Code, .NET Aspire, and Microsoft Foundry.Database side: a standard connection string, so integrated/Windows auth works on-prem and Entra ID or SQL auth works for Azure SQL; secrets can come from environment variables or Azure Key Vault. Caller side: Data API builder's auth providers with per-role RBAC; local stdio mode uses the simulator provider with an optional role.MIT
DBHub (Bytebase)CommunitySelf-hosted: npx @bytebase/dbhub, Docker image, or one-click MCP Bundle; stdio and HTTP transports.DSN connection string with a SQL login (user/password); SSH tunneling and SSL/TLS supported. Windows/integrated authentication is not documented.MIT
Azure MCP Server (microsoft/mcp)MicrosoftSelf-hosted locally (VS Code, Visual Studio, or any MCP client) against your Azure subscription.Microsoft Entra ID via your existing Azure credentials — no database credentials stored in the MCP config.MIT
mssql_mcp_server (RichardHan)CommunitySelf-hosted Python: run with uvx or pip over stdio; configured entirely through environment variables.SQL auth via MSSQL_USER/MSSQL_PASSWORD environment variables, Windows Authentication via an MSSQL_WINDOWS_AUTH flag; works with LocalDB and Azure SQL.MIT
Zapier MCP (SQL Server)CommunityFully managed by Zapier — nothing to run yourself, but your database must accept inbound connections from Zapier's static IP ranges (44.214.195.64/28 and 18.246.81.208/28) on port 1433 by default.Zapier-managed connection: you store host, port, database name, and a SQL login with Zapier; your MCP client connects to a unique Zapier MCP URL.

How to choose

Pick Microsoft's SQL MCP Server if you can spend an hour on a dab-config.json and want RBAC, deterministic CRUD tools, and no chance of the model free-styling T-SQL. Pick DBHub if you want raw SQL access in five minutes via npx and are disciplined about read-only mode and a restricted login. Pick Azure MCP Server only for managing Azure SQL resources — it never touches your data. Pick RichardHan's mssql_mcp_server if you need Windows auth from a lightweight Python server and accept a repo idle since November 2025. Pick Zapier only if exposing your database to Zapier's IP ranges is acceptable; for most on-prem shops it isn't.

How this ranking works

Every server here is real and was checked against its repository or vendor documentation on the date above — stars and licenses come from the GitHub API, not from memory. Order reflects verifiable criteria only: official support, maintenance recency, adoption, auth model, and documented capability coverage. We do not run paid placements, and we list every caveat we find, including the unflattering ones.

Common questions

Is there an official MCP server for SQL Server?
Yes. Microsoft ships SQL MCP Server as part of Data API builder (version 1.7 and later, full feature set in 2.0), documented at learn.microsoft.com/sql/mcp. Be aware that Microsoft's earlier MssqlMcp sample in Azure-Samples/SQL-AI-samples — the one most 2025 tutorials link to — was removed from that repo in June 2026.
What does setup and authentication actually look like?
Every self-hosted option needs credentials for your database: Microsoft's server takes a standard connection string (so Windows/integrated auth works on-prem and Entra ID works for Azure SQL), DBHub takes a DSN with a SQL login, and RichardHan's server uses environment variables with an optional Windows-auth flag. Whichever you pick, create a dedicated minimal-permission SQL login rather than reusing sa or an admin account.
Can an MCP server run any SQL against my database?
Depends which one. DBHub and the dedicated community servers execute whatever SQL the model writes, limited only by the login's permissions and optional read-only modes. Microsoft's SQL MCP Server deliberately refuses arbitrary SQL and NL2SQL — it exposes typed CRUD tools over entities you explicitly configure, with role-based access control on every call.
Do I have to expose my database to the internet?
Only for Zapier's managed route, which requires your SQL Server to accept connections from Zapier's static IP ranges on port 1433. Every other option on this list runs on your own machine or network, next to the database.

MCP servers we build

Automation Squad publishes its own open-source MCP servers and agent skills, documented with the same rules this ranking uses.