MSSQL MCP 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.
Version Notice: This project has been upgraded to use Model Context Protocol SDK 1.9.0. See UPGRADE.md for details.
Installation
Installing via Smithery
To install MSSQL MCP Server for Claude Desktop automatically via Smithery:
Manual Installation
Usage
Add the server to your MCP settings configuration file:
Tools
query
Execute a SQL query on a MSSQL database.
Parameters
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.
Example
Running the Server
Local Development
Using Docker
Testing
Security
The server includes safeguards against dangerous SQL operations:
- Blocks potentially harmful commands like DROP, TRUNCATE, ALTER, CREATE, EXEC, etc.
- Validates all input parameters and database names
- Sets reasonable limits on query length and timeout
- Uses connection pooling for better performance and security
License
MIT
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
Tools
Enables execution of SQL queries and management of Microsoft SQL Server database connections through the Model Context Protocol.
Related Resources
Related MCP Servers
- -securityAlicense-qualityA Model Context Protocol server that enables secure and structured interaction with Microsoft SQL Server databases, allowing AI assistants to list tables, read data, and execute SQL queries with controlled access.Last updated -43PythonMIT License
- -securityFlicense-qualityA Model Context Protocol server that enables SQL query execution, database management, and business intelligence capabilities through MySQL connections.Last updated -JavaScript
- AsecurityAlicenseAqualityA Model Context Protocol server that enables executing SQL queries and managing connections with Microsoft SQL Server databases.Last updated -11215TypeScriptMIT License
- -securityFlicense-qualityA Model Context Protocol server that provides comprehensive access to Microsoft SQL Server databases, enabling Language Models to inspect schemas, execute queries, manage database objects, and perform advanced database operations.Last updated -6Python