
Microsoft SQL Server
β 373from RichardHan
A server for secure interaction with Microsoft SQL Server databases using environment variables for configuration.
π₯π₯π₯β VerifiedAccount requiredNeeds API keys
Microsoft SQL Server MCP Server
<a href="https://glama.ai/mcp/servers/29cpe19k30"> <img width="380" height="200" src="https://glama.ai/mcp/servers/29cpe19k30/badge" alt="Microsoft SQL Server MCP server" /> </a>A Model Context Protocol (MCP) server for secure SQL Server database access through Claude Desktop.
Features
- π List database tables
- π Execute SQL queries (SELECT, INSERT, UPDATE, DELETE)
- π Multiple authentication methods (SQL, Windows, Azure AD)
- π’ LocalDB and Azure SQL support
- π Custom port configuration
Security
- Create a dedicated SQL user with minimal permissions
- Never use admin/sa accounts
- Use Windows Authentication when possible
- Enable encryption for sensitive data
License
MIT
Copy & paste β that's it
pip install microsoft_sql_server_mcpBefore it works, you'll need: MSSQL_SERVERMSSQL_DATABASEMSSQL_USERMSSQL_PASSWORD
Quick Start
Install with Claude Desktop
Add to your claude_desktop_config.json:
Copy & paste β that's it
{
"mcpServers": {
"mssql": {
"command": "uvx",
"args": ["microsoft_sql_server_mcp"],
"env": {
"MSSQL_SERVER": "localhost",
"MSSQL_DATABASE": "your_database",
"MSSQL_USER": "your_username",
"MSSQL_PASSWORD": "your_password"
}
}
}
}Configuration
Basic SQL Authentication
Copy & paste β that's it
MSSQL_SERVER=localhost # Required
MSSQL_DATABASE=your_database # Required
MSSQL_USER=your_username # Required for SQL auth
MSSQL_PASSWORD=your_password # Required for SQL authWindows Authentication
Copy & paste β that's it
MSSQL_SERVER=localhost
MSSQL_DATABASE=your_database
MSSQL_WINDOWS_AUTH=true # Use Windows credentialsAzure SQL Database
Copy & paste β that's it
MSSQL_SERVER=your-server.database.windows.net
MSSQL_DATABASE=your_database
MSSQL_USER=your_username
MSSQL_PASSWORD=your_password
# Encryption is automatic for AzureOptional Settings
Copy & paste β that's it
MSSQL_PORT=1433 # Custom port (default: 1433)
MSSQL_ENCRYPT=true # Force encryptionAlternative Installation Methods
Using pip
Copy & paste β that's it
pip install microsoft_sql_server_mcpThen in claude_desktop_config.json:
Copy & paste β that's it
{
"mcpServers": {
"mssql": {
"command": "python",
"args": ["-m", "mssql_mcp_server"],
"env": { ... }
}
}
}Development
Copy & paste β that's it
git clone https://github.com/RichardHan/mssql_mcp_server.git
cd mssql_mcp_server
pip install -e .No common issues documented yet. If you hit a problem, the repository's GitHub Issues page is the best place to look.