MSSQL MCP Server is an MCP server that provides tools for connecting to and interacting with Microsoft SQL Server instances. Built for developers, database administrators, and data analysts using Model Context Protocol clients like Claude Desktop, it allows users to inspect database contents, retrieve records, and run custom queries directly from an AI chat interface. The server connects via standard connection strings or granular configuration parameters including host, port, user, and password. To prevent unintended modifications and protect data integrity, the server includes built-in security protections that filter out destructive DDL and execution commands such as DROP, TRUNCATE, ALTER, CREATE, and EXEC. It features connection pooling, query timeout controls, parameter validation, and support for TLS encryption settings. By exposing a dedicated query tool, the server enables language models to examine schema data, fetch operational records, and answer contextual database questions without requiring external SQL management applications.
Category: Databases & Data Stores
Tags: database, microsoft, mssql, SQL, sql server
Follow these steps to set up the MSSQL MCP Server: 1. Install the server package using npm or Smithery: bash npm install mssql-mcp-server Or via Smithery for Claude Desktop: bash npx -y @smithery/cli install @c0h1b4/mssql-mcp-server --client claude 2. Open your client's MCP configuration file and register the server under the mcpServers block: json { "mcpServers": { "mssql": { "command": "mssql-mcp-server", "env": { "MSSQL_HOST": "localhost", "MSSQL_PORT": "1433", "MSSQL_DATABASE": "master", "MSSQL_USER": "sa", "MSSQL_PASSWORD": "yourpassword", "MSSQL_ENCRYPT": "false", "MSSQL_TRUST_SERVER_CERTIFICATE": "true" } } } } 3. Alternatively, supply a full connection string via the MSSQL_CONNECTION_STRING environment variable in the same configuration block, then restart your client.
Part of MCP Servers
You can install the server via npm with the command npm install mssql-mcp-server, or use the Smithery CLI to install it directly for Claude Desktop using npx -y @smithery/cli install @c0h1b4/mssql-mcp-server --client claude.
It provides a query tool to execute SQL queries on Microsoft SQL Server databases. You can pass explicit credentials or rely on environment variables, while built-in protections restrict destructive statements like DROP and ALTER.
It works with any Model Context Protocol compliant client, such as Claude Desktop, that supports running command-based local MCP server processes through standard configuration files.
The server includes security safeguards that actively block potentially harmful commands, including DROP, TRUNCATE, ALTER, CREATE, and EXEC, focusing access on safe read and data operations.
Yes, MSSQL MCP Server is open source and distributed under the MIT license, with source code available on GitHub.