MSSQL Client MCP

v1.0.0Databasesstable

A Microsoft SQL Server client implementing the Model Context Protocol (MCP). This server provides SQL query capabilities through a simple MCP interface.

mssqlclientmcpai-integration
Share:
35
Stars
0
Downloads
0
Weekly
0/5

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

Query Microsoft SQL Server using natural language.
Execute SQL operations through MCP interface.
Retrieve schema information and run complex queries.
aadversteeg

Maintainer

LicenseMIT
Languagec#
Versionv1.0.0
UpdatedApr 17, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx mssqlclient

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

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
1

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.MsSqlClient
2

Prepare 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;

3

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.

4

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"
      }
    }
  }
}
5

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.

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.

Quick Config Preview

{ "mcpServers": { "mssqlclient": { "command": "npx", "args": ["-y", "mssqlclient"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

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.

33,000+ ServersFree & Open SourceStep-by-Step Guides