MSSQL Client MCP
A Microsoft SQL Server client implementing the Model Context Protocol (MCP). This server provides SQL query capabilities through a simple MCP interface.
What is MSSQL Client MCP?
MSSQL Client MCP is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to microsoft sql server client implementing the model context protocol (mcp). this server provides sql query capabilities through a simple mcp interface.
A Microsoft SQL Server client implementing the Model Context Protocol (MCP). This server provides SQL query capabilities through a simple MCP interface.
This server falls under the Databases category on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- A Microsoft SQL Server client implementing the Model Context
Use Cases
Maintainer
Works with
Installation
Manual Installation
npx mssqlclientConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use MSSQL Client MCP
The MSSQL Client MCP server connects AI assistants directly to Microsoft SQL Server databases, exposing tools for executing queries, inspecting table schemas, listing stored procedures, and running background long-running operations. Built as a .NET global tool, it supports both single-database and server-level modes, making it suitable for database exploration, reporting, and automated data pipelines. Query and stored procedure execution are disabled by default for security and must be explicitly enabled via environment variables.
Prerequisites
- .NET 10 SDK or later installed on your machine
- A running Microsoft SQL Server instance (local or remote) with valid credentials
- The MSSQL connection string including Server, Database, User Id, and Password
- An MCP client such as Claude Desktop
Install the .NET global tool
Install the Ave.McpServer.MsSqlClient .NET global tool, which provides the mssqlclient MCP server binary.
dotnet tool install --global Ave.McpServer.MsSqlClientPrepare your connection string
Construct a SQL Server connection string with your server address, database name, credentials, and any TLS settings. Example: Server=localhost;Database=MyDb;User Id=sa;Password=secret;TrustServerCertificate=True;
Enable query and procedure execution
By default, query and stored procedure execution are disabled for security. Set the following environment variables to true to enable them in your MCP client configuration.
Add the server to your MCP client config
Add the mssqlclient entry to your Claude Desktop claude_desktop_config.json, providing the connection string and feature toggles as environment variables.
{
"mcpServers": {
"mssql": {
"command": "dotnet",
"args": ["tool", "exec", "-y", "ave.mcpserver.mssqlclient"],
"env": {
"MSSQL_CONNECTIONSTRING": "Server=localhost;Database=MyDb;User Id=sa;Password=secret;TrustServerCertificate=True;",
"DatabaseConfiguration__EnableExecuteQuery": "true",
"DatabaseConfiguration__EnableExecuteStoredProcedure": "true",
"DatabaseConfiguration__EnableStartQuery": "true",
"DatabaseConfiguration__EnableStartStoredProcedure": "true"
}
}
}
}Restart Claude Desktop and verify connection
Restart Claude Desktop so it picks up the new server config. Ask Claude to list all tables in your database to confirm the connection is working.
MSSQL Client MCP Examples
Client configuration
Full Claude Desktop JSON config for the MSSQL Client MCP server with query execution enabled.
{
"mcpServers": {
"mssql": {
"command": "dotnet",
"args": ["tool", "exec", "-y", "ave.mcpserver.mssqlclient"],
"env": {
"MSSQL_CONNECTIONSTRING": "Server=localhost;Database=SalesDB;User Id=sa;Password=YourPassword;TrustServerCertificate=True;",
"DatabaseConfiguration__EnableExecuteQuery": "true",
"DatabaseConfiguration__EnableExecuteStoredProcedure": "true",
"DatabaseConfiguration__EnableStartQuery": "true",
"DatabaseConfiguration__EnableStartStoredProcedure": "true",
"DatabaseConfiguration__DefaultCommandTimeoutSeconds": "60"
}
}
}
}Prompts to try
Example prompts to use after connecting to your SQL Server database.
- "List all tables in the database with their row counts"
- "Show me the schema for the Orders table"
- "Run this query: SELECT TOP 10 * FROM Customers ORDER BY CreatedAt DESC"
- "List all stored procedures and their parameters"
- "Execute the stored procedure CreateNewOrder with OrderDate='2026-01-01' and CustomerId=42"
- "Start a background query to export all transactions from January 2026"Troubleshooting MSSQL Client MCP
Query execution returns 'tool not enabled' or similar error
Set DatabaseConfiguration__EnableExecuteQuery to "true" in the env section of your MCP config. Query and stored procedure execution are disabled by default for security.
Connection fails with TLS or certificate error
Add TrustServerCertificate=True to your MSSQL_CONNECTIONSTRING if your SQL Server uses a self-signed certificate, or ensure the server certificate is trusted on your machine.
Long queries time out before returning results
Increase DatabaseConfiguration__DefaultCommandTimeoutSeconds and DatabaseConfiguration__TotalToolCallTimeoutSeconds in env, or use start_query for background execution with a custom timeoutSeconds parameter.
Frequently Asked Questions about MSSQL Client MCP
What is MSSQL Client MCP?
MSSQL Client MCP is a Model Context Protocol (MCP) server that microsoft sql server client implementing the model context protocol (mcp). this server provides sql query capabilities through a simple mcp interface. It connects AI assistants to external tools and data sources through a standardized interface.
How do I install MSSQL Client MCP?
Follow the installation instructions on the MSSQL Client MCP GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.
Which AI clients work with MSSQL Client MCP?
MSSQL Client MCP works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is MSSQL Client MCP free to use?
Yes, MSSQL Client MCP is open source and available under the MIT license. You can use it freely in both personal and commercial projects.
MSSQL Client MCP Alternatives — Similar Databases Servers
Looking for alternatives to MSSQL Client MCP? Here are other popular databases servers you can use with Claude, Cursor, and VS Code.
Excelize
★ 20.6kGo language library for reading and writing Microsoft Excel™ (XLAM / XLSM / XLSX / XLTM / XLTX) spreadsheets
MCP Toolbox for Databases
★ 15.3kOpen source MCP server specializing in easy, fast, and secure tools for Databases.
DBHub
★ 2.8kA universal database gateway MCP server that enables AI assistants to connect to and query multiple databases (PostgreSQL, MySQL, MariaDB, SQL Server, SQLite) with support for schema exploration, SQL execution, and secure connections via SSH tunnels.
Tabularis
★ 2.1kA lightweight, cross-platform database client for developers. Supports MySQL, PostgreSQL and SQLite. Hackable with plugins. Built for speed, security, and aesthetics.
Postgres AI Guide
★ 1.7kMCP server and Claude plugin for Postgres skills and documentation. Helps AI coding tools generate better PostgreSQL code.
Anyquery
★ 1.7k🏎️ 🏠 ☁️ - Query more than 40 apps with one binary using SQL. It can also connect to your PostgreSQL, MySQL, or SQLite compatible database. Local-first and private by design.
Browse More Databases MCP Servers
Explore all databases servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.
Set Up MSSQL Client MCP in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
Ready to use MSSQL Client MCP?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.