
A Model Context Protocol (MCP) server for connecting to Microsoft SQL Server databases. This server
A Model Context Protocol (MCP) server for connecting to Microsoft SQL Server databases. This server provides tools for executing SQL queries and managing database connections.
A Model Context Protocol (MCP) server for connecting to Microsoft SQL Server databases. This server provides tools for executing SQL queries and managing database connections.
Version Notice: This project has been upgraded to use Model Context Protocol SDK 1.9.0. See UPGRADE.md for details.
To install MSSQL MCP Server for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install @c0h1b4/mssql-mcp-server --client claudenpm install mssql-mcp-serverAdd the server to your MCP settings configuration file:
{
"mcpServers": {
"mssql": {
"command": "mssql-mcp-server",
"env": {
"MSSQL_CONNECTION_STRING": "Server=localhost;Database=master;User Id=sa;Password=yourpassword;",
// Or individual connection parameters:
"MSSQL_HOST": "localhost",
"MSSQL_PORT": "1433",
"MSSQL_DATABASE": "master",
"MSSQL_USER": "sa",
"MSSQL_PASSWORD": "yourpassword",
"MSSQL_ENCRYPT": "false",
"MSSQL_TRUST_SERVER_CERTIFICATE": "true"
}
}
}
}Execute a SQL query on a MSSQL database.
connectionString (string, optional): Full connection string (alternative to individual parameters)host (string, optional): Database server hostnameport (number, optional): Database server port (default: 1433)database (string, optional): Database name (default: master)username (string, optional): Database usernamepassword (string, optional): Database passwordquery (string, required): SQL query to executeencrypt (boolean, optional): Enable encryption (default: false)trustServerCertificate (boolean, optional): Trust server certificate (default: true)Either connectionString OR (host + username + password) must be provided.
const result = await use_mcp_tool({
server_name: 'mssql',
tool_name: 'query',
arguments: {
host: 'localhost',
username: 'sa',
password: 'yourpassword',
query: 'SELECT * FROM Users',
},
});# Install dependencies
npm install
# Run in development mode
npm run dev
# Build
npm run build
# Run the built server
npm start# Build and start services (SQL Server + MCP server)
docker-compose up
# Or just build the Docker image
docker build -t mssql-mcp-server .# Run tests
npm test
# Run tests with coverage
npm run test:coverageThe evals package loads an mcp client that then runs the index.ts file, so there is no need to rebuild between tests. You can load environment variables by prefixing the npx command. Full documentation can be found here.
OPENAI_API_KEY=your-key npx mcp-eval src/evals/evals.ts examples/simple-server.tsThe server includes safeguards against dangerous SQL operations:
MIT
Pick your client and paste the snippet. Each one is the same server, written the way that client expects it.
claude mcp add mssql -- mssql-mcp-server{
"mcpServers": {
"mssql": {
"env": {
"MSSQL_HOST": "",
"MSSQL_PORT": "",
"MSSQL_USER": "",
"MSSQL_ENCRYPT": "",
"MSSQL_DATABASE": "",
"MSSQL_PASSWORD": "",
"MSSQL_CONNECTION_STRING": "",
"MSSQL_TRUST_SERVER_CERTIFICATE": ""
},
"command": "mssql-mcp-server"
}
}
}code --add-mcp '{"name":"mssql","env":{"MSSQL_HOST":"","MSSQL_PORT":"","MSSQL_USER":"","MSSQL_ENCRYPT":"","MSSQL_DATABASE":"","MSSQL_PASSWORD":"","MSSQL_CONNECTION_STRING":"","MSSQL_TRUST_SERVER_CERTIFICATE":""},"command":"mssql-mcp-server"}'[mcp_servers.mssql]
command = "mssql-mcp-server"Runs locally on your device. Your client starts the server itself, so nothing has to be hosted.
Paste this prompt into your agent. It reads this page and does the setup for you.
Read https://aiagentslisting.com/mcp/mssql-mcp-server-3 to learn what the "MSSQL MCP Server" MCP server does and how to install it. Add it to my coding agent's MCP configuration as documented on that page, then confirm the server connects and list the tools it exposes.Agents can also browse this directory over MCP at https://aiagentslisting.com/api/mcp
npx -y @smithery/cli install @c0h1b4/mssql-mcp-server --client claudeThis server runs locally, so we can't read its tool list over the web yet.
Paste this line near the top of your repository's README. The badge always renders the current score.
[](https://aiagentslisting.com/mcp/mssql-mcp-server-3)Nothing comparable is listed yet.
No tagged releases on record.
Connect to the AI Agents Listing MCP server at https://aiagentslisting.com/api/mcp using the HTTP transport and complete the sign-in when it asks. Then call the submit_review tool for the listing "mssql-mcp-server-3" with a rating from 1 to 5 and a short note on what worked and what did not.One email a week. New agents, MCP servers and skills, and what is actually getting traction.