YashUkhare/mcp_sqlserver
MCP Server for MSSQL Server database
Platform-specific configuration:
{
"mcpServers": {
"mcp_sqlserver": {
"command": "npx",
"args": [
"-y",
"mcp_sqlserver"
]
}
}
}Add the config above to .claude/settings.json under the mcpServers key.
A local Model Context Protocol (MCP) server written in Python that connects Claude Desktop (or any MCP-compatible client) directly to a Microsoft SQL Server database.
Claude can explore your schema, execute safe read-only queries, and answer natural-language questions about your data — all without leaving the chat.
---
SELECT or EXEC <proc> statementDROP, DELETE, TRUNCATE, ALTER, INSERT, CREATE, dynamic SQL, xp_* procs, OPENROWSET, and multi-statement batches---
mcp_sqlserver/
├── server.py # JSON-RPC 2.0 loop over stdio (MCP entry point)
├── tool_handler.py # Tool dispatcher and implementations
├── db_service.py # pyodbc connection, schema introspection, query execution
├── query_validator.py # SQL safety guard — keyword scanner + statement-type enforcer
├── config.py # All configuration in one place
└── requirements.txt # Python dependencies---
| Requirement | Notes | |---|---| | Python 3.10+ | | | ODBC Driver 17 or 18 for SQL Server | Must match the driver value in config.py | | pyodbc | Installed via requirements.txt | | Claude Desktop | Download — or any MCP-compatible client |
---
git clone https://github.com/YashUkharLoading reviews...