SQL Server MCP
Click on "Install 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., "@SQL Server MCPlist tables in AdventureWorks"
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.
SQL Server MCP
A read-only MCP (Model Context Protocol) server for SQL Server database introspection. Use with Claude Desktop to let Claude explore and query your SQL Server databases.
Features
List databases, tables, views, stored procedures, and functions
Get object definitions (DDL/source code)
Execute read-only SELECT queries
Search for objects across databases
Read-only by design - all mutation queries are blocked
Related MCP server: mssql-mcp
Installation
# Clone the repo
git clone https://github.com/millelog/sql-server-mcp.git
cd sql-server-mcp
# Install in a virtual environment
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
pip install -e .Claude Desktop Configuration
Add to your Claude Desktop config file:
Windows:
%APPDATA%\Claude\claude_desktop_config.jsonmacOS:
~/Library/Application Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"sql-server": {
"command": "python",
"args": ["-m", "sql_server_mcp"],
"cwd": "C:\\path\\to\\sql-server-mcp",
"env": {
"MSSQL_HOST": "your-server",
"MSSQL_USER": "your-username",
"MSSQL_PASSWORD": "your-password",
"MSSQL_DATABASE": "master"
}
}
}
}Restart Claude Desktop after updating the config.
Configuration Options
Variable | Description | Default |
| SQL Server hostname |
|
| SQL Server port |
|
| Username | - |
| Password | - |
| Default database |
|
| Full connection string (overrides above) | - |
| Maximum rows returned |
|
| Query timeout (seconds) |
|
| Comma-separated allowlist | - |
| Comma-separated blocklist | - |
Available Tools
Tool | Description |
| List all accessible databases |
| List tables in a database |
| Get CREATE TABLE DDL |
| Get column metadata |
| Get index information |
| Get foreign key relationships |
| List views in a database |
| Get CREATE VIEW DDL |
| List stored procedures |
| Get CREATE PROCEDURE DDL |
| Get procedure parameters |
| List user-defined functions |
| Get CREATE FUNCTION DDL |
| Run read-only SELECT queries |
| Get sample rows from a table |
| Search for objects by name |
| Search within object definitions |
| Get database schema summary (object counts, size) |
Development
# Run tests
pytest tests/ -v
# Run with coverage
pytest tests/ --cov=src/sql_server_mcpLicense
MIT
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/millelog/sql-server-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server