mssql-mcp-server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mssql-mcp-serverlist the 10 largest tables in sales"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
mssql-mcp-server
A Microsoft SQL Server MCP server. Query, inspect, and troubleshoot any SQL Server instance from Cursor, Claude Code, Codex, or any MCP (Model Context Protocol) client. Connects via ODBC using per-caller credentials elicited at runtime. Passwords live only in server memory with an idle TTL and are never logged.
Query tools:
connect/disconnect/list_sessionssession lifecycle,execute_sqlwith table/JSON/CSV output, andexplain_queryfor estimated or actual Showplan XML execution plansPer-caller identity: the
X-DB-UserandX-DB-Passwordheaders are both optional; anything missing is elicited once and cached in-memoryPermission-scoped access: read vs. write is governed by the SQL login's own permissions;
provision_mcp_read.sqlprovisions a ready-made read-onlymcp_readlogin across all user databasesZero secrets on disk: no credentials in config files, env vars, or logs
Example prompts
"Show the execution plan for this query and suggest a better index."
"Who is blocking whom on
db1right now?""List the 10 largest tables in the
salesdatabase.""Find all stored procedures that reference the
Orderstable.""Export the results of this query as CSV."
Related MCP server: mcp-sqlserver
Tools
Tool | Description |
| Open a session to a SQL Server database and return a |
| Close an active SQL Server session |
| List active sessions with server, database, and usage details |
| Run a SQL statement and return rows as table, JSON, or CSV |
| Estimated or actual execution plan as Showplan XML |
Quick Start
docker compose -f docker-compose.yml -p mssql-mcp up -d --build --force-recreateClient setup
Both X-DB-User and X-DB-Password headers are optional: anything missing is prompted for once via MCP elicitation and cached in memory.
Cursor (mcp.json)
{
"mcpServers": {
"mssql-mcp": {
"type": "http",
"url": "http://localhost:8007/mcp",
"headers": {
"X-DB-User": "<your-db-username>",
"X-DB-Password": "<your-db-password>"
}
}
}
}Claude Code
claude mcp add --transport http mssql-mcp http://localhost:8007/mcp \
--header "X-DB-User: <your-db-username>" \
--header "X-DB-Password: <your-db-password>"Codex (~/.codex/config.toml)
[mcp_servers.mssql-mcp]
url = "http://localhost:8007/mcp"
http_headers = { "X-DB-User" = "<your-db-username>", "X-DB-Password" = "<your-db-password>" }Any other MCP client works the same way: point it at the streamable HTTP endpoint and pass the headers.
This server cannot be deployed
Maintenance
Related MCP Connectors
MCP server for querying and analyzing data from ad platforms, analytics tools, and spreadsheets
An MCP server that provides read access to your cloud storage providers, bank accounts and more.
The MCP server for Azure DevOps, bringing the power of Azure DevOps directly to your agents.
MCP server for mandates, delegation, policy-gated execution, credential grants, and audit.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceAn MCP server that enables connection to Microsoft SQL Server databases, providing tools for schema inspection and querying through standardized interfaces.MIT
- FlicenseAqualityDmaintenanceAn MCP server for Microsoft SQL Server that enables executing read-only queries, listing tables, and describing database schemas. It offers specialized support for custom ports and multiple authentication methods including SQL credentials, NTLM, and Windows Integrated Auth.3-
- AlicenseNot gradedqualityDmaintenanceAn MCP server that enables interaction with Microsoft SQL Server instances using Windows or SQL Server authentication via native ODBC drivers. It allows users to execute SQL queries, list tables, and inspect schemas across multiple configured database environments through natural language.3,162 npmMIT
- FlicenseNot gradedqualityDmaintenanceAn MCP server that enables querying SQL Server databases via tools for table search, SELECT execution, and table info retrieval.-