Microsoft SQL Server
STDIOMCP server enabling secure interaction with Microsoft SQL Server databases through controlled interface.
MCP server enabling secure interaction with Microsoft SQL Server databases through controlled interface.
A Model Context Protocol (MCP) server that enables secure interaction with Microsoft SQL Server databases. This server allows AI assistants to list tables, read data, and execute SQL queries through a controlled interface, making database exploration and analysis safer and more structured.
The package will automatically install required system dependencies (like FreeTDS) when installed through MCP:
pip install mssql-mcp-server
Set the following environment variables:
MSSQL_SERVER=localhost MSSQL_USER=your_username MSSQL_PASSWORD=your_password MSSQL_DATABASE=your_database
Add this to your claude_desktop_config.json
:
{ "mcpServers": { "mssql": { "command": "uv", "args": [ "--directory", "path/to/mssql_mcp_server", "run", "mssql_mcp_server" ], "env": { "MSSQL_SERVER": "localhost", "MSSQL_USER": "your_username", "MSSQL_PASSWORD": "your_password", "MSSQL_DATABASE": "your_database" } } } }
# Install dependencies pip install -r requirements.txt # Run the server python -m mssql_mcp_server
# Clone the repository git clone https://github.com/RichardHan/mssql_mcp_server.git cd mssql_mcp_server # Create virtual environment python -m venv venv source venv/bin/activate # or `venv\Scripts\activate` on Windows # Install development dependencies pip install -r requirements-dev.txt # Run tests pytest
This MCP server requires database access to function. For security:
See SQL Server Security Configuration Guide for detailed instructions on:
⚠️ IMPORTANT: Always follow the principle of least privilege when configuring database access.
MIT License - see LICENSE file for details.
git checkout -b feature/amazing-feature
)git commit -m 'Add some amazing feature'
)git push origin feature/amazing-feature
)