Skip to content
← All MCP servers

Is the SQL Server MCP server safe? What it can reach

What the SQL Server MCP server can read, write and delete, how it signs in, and how to limit it in Claude Code and Codex.

Official serverChecked

Microsoft’s SQL MCP Server is part of the open source Data API builder (dab). You host it yourself, over stdio or streamable HTTP, and it exposes only the tables, views and stored procedures you list in dab-config.json, filtered by role. By default it includes create, update and delete tools, so switch off what you don’t need under runtime.mcp.dml-tools. A popular community server, mssql_mcp_server, is read-only by default.

Who maintains it

ImplementationKindStatus
SQL MCP Server in Data API builder (Microsoft)Officialactive
mssql_mcp_server (RichardHan, community)Communityactive

It runs as a local process on your machine or as a hosted remote server.

How it signs in

The database connection string lives in dab-config.json, so the server reaches SQL Server with that one identity. Callers then get a Data API builder role: stdio uses a simulator role (anonymous unless you pass role:<name>), and hosted HTTP uses the identity provider you set up in dab.

What its tools can do

KindTools
Readdescribe_entities, read_records, aggregate_records
Writecreate_record, update_record
Can’t be undonedelete_record, execute_entity

These are the seven DML tools from Microsoft’s SQL MCP Server (aggregate_records needs dab 2.0 or later). Stored procedures marked custom-tool become extra named tools that are not listed here. The community mssql server exposes one tool, query by default or execute_sql with MSSQL_ALLOW_WRITES=1, and is not covered by these names.

Built-in limits

OptionWhat it does
runtime.mcp.dml-toolsEach tool (describe-entities, create-record, read-records, update-record, delete-record, execute-entity, aggregate-records) takes true or false. A disabled tool is hidden and can’t be called.
Entity list and permissionsOnly entities in dab-config.json are exposed. Each entity lists roles, allowed actions and fields, and row-level policies.
Entity mcp settingSet mcp.dml-tools to false on an entity to keep it away from agents, and custom-tool only where you want a stored procedure exposed.
dab start --mcp-stdio role:<role-name>Runs the server over stdio as a named role instead of the default anonymous role.
Community server: MSSQL_ALLOW_WRITESmssql_mcp_server accepts only a single SELECT unless MSSQL_ALLOW_WRITES=1, and its README tells you to use a least-privilege SQL login as well.

The risks

  • Row data an agent reads can carry injected instructions, and with update_record, delete_record or execute_entity enabled it could change or remove rows or run a stored procedure.
  • execute_entity runs whatever stored procedures you expose, and a procedure can do far more than its name suggests, so review each one before you add it.
  • The connection string sits in the config file and every caller shares that database identity, so the entity permissions and roles are the only limit on what an agent can touch.
  • Query results, including personal and financial data, go to your LLM provider.
  • The community server’s read-only check parses T-SQL, but its README says to rely on database permissions and not on the parser.

Limit it in Claude Code

Add it from the documented launch settings, at local or user scope so a token never lands in a shared .mcp.json:

claude mcp add sqlserver -- dab start --mcp-stdio

Claude Code names MCP tools mcp__sqlserver__<tool>. Deny rules win over ask rules, and ask rules over allow rules. Put these in ~/.claude/settings.json or the project’s .claude/settings.json:

{
  "permissions": {
    "deny": [
      "mcp__sqlserver__delete_record"
    ],
    "ask": [
      "mcp__sqlserver__create_record",
      "mcp__sqlserver__update_record",
      "mcp__sqlserver__execute_entity"
    ]
  }
}

Limit it in Codex

Codex reads MCP servers from ~/.codex/config.toml. disabled_tools removes tools, and enabled_tools keeps only the ones you list:

[mcp_servers.sqlserver]
command = "dab"
args = ["start", "--mcp-stdio"]
disabled_tools = ["delete_record"]

Checklist

  • Expose only the entities and fields an agent needs.
  • Set delete-record and create-record to false in runtime.mcp.dml-tools.
  • Connect with a least-privilege SQL login, never sa.
  • Review each stored procedure before you expose it.

Checked against the vendor documentation on November 25, 2026. SQL MCP Server overview (Microsoft Learn) · SQL MCP Server DML tools (Microsoft Learn) · mssql_mcp_server README

What Excellent covers

Excellent doesn’t inspect MCP servers themselves. Its free scan reads supported logs on the Mac (Claude Code, Codex, Grok Build, GitHub Copilot CLI, Gemini CLI and Qwen Code) and reports findings for review, so you can see what an agent did after a session. Run the free scan · See a sample report · How to vet any MCP server

Excellent Pro adds checks before supported actions. Claude Code can display an ask prompt. With Codex, an Excellent “ask” refuses the action and tells the agent to ask you. Pro is US-only for now. Agent coverage · Pricing