SQL Server MCP Client MCP Server

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

Local serverstdio

What is the SQL Server MCP Client MCP server?

SQL Server MCP Client MCP server exists for a simple reason — assistants are far more useful when they can act on SQL Server MCP Client directly instead of describing what you should do. A Microsoft SQL Server client implementing the Model Context Protocol (MCP). This server provides SQL query capabilities through a simple MCP interface.

What you get

The SQL Server MCP client is built with .NET Core using the Model Context Protocol C# SDK (github.com/modelcontextprotocol/csharp-sdk). It provides tools for executing SQL queries, managing stored procedures, listing tables, and retrieving comprehensive schema information from SQL Server databases. The server is designed to be lightweight yet powerful, demonstrating how to create a robust MCP server with practical database functionality. It can be deployed either directly on a machine or as a Docker container.

What the assistant can call

Once SQL Server MCP Client is connected, these are the calls the assistant has available:

  • rowsAffected — Total rows affected by DML operations (always captured)
  • ioStats — Per-table IO statistics (only when includeIoStats was true on the start tool)
  • executionPlanXml — Actual XML execution plan (only when includeExecutionPlan was true on the start tool)
  • Prerequisites — The Prerequisites tool exposed by this server
  • Installation — The Installation tool exposed by this server
  • Running — The Running tool exposed by this server
  • server_capabilities — Returns detailed information about the capabilities and features of the connected SQL Server instance
  • get_command_timeout — Example request: json { "name": "get_command_timeout", "parameters": {} }
  • set_command_timeout — Parameters: - timeoutSeconds (required): New timeout in seconds (1-3600)
  • execute_query — Parameters: - query (required): The SQL query to execute. - timeoutSeconds (optional): Command timeout in seconds. Overrides the default timeout. -
  • list_tables — Lists all tables in the connected SQL Server database with schema and row count information

Setting it up

Setup follows the usual MCP pattern — install or clone the server, register it in your client's configuration file, restart the client.

Configuration and credentials

You will need one environment variable: MSSQL_CONNECTIONSTRING. Keep credentials in your client's env block or a secrets manager rather than in a file you might commit.

  • .NET 10.0 SDK (for local development/deployment) - Docker (for container deployment)

Choosing this one

This sits in the database access group, where several servers overlap in what they claim to do but differ sharply once you actually set them up. SQL Server MCP Client's toolset — rowsAffected, ioStats, executionPlanXml and 8 more — is a fair guide to whether it matches your workflow. It is maintained by aadversteeg; worth a glance at recent repository activity before you build anything load-bearing on it.

SyncDev reviews every entry in this directory against the project's own documentation before publishing, and revisits them as servers change.

Before you rely on it

  • It runs with your machine's permissions. That is convenient and also the reason to think about what you point it at before you approve a tool call.
  • With 11 tools registered it takes up a noticeable share of the context window; turn it off in projects that never touch SQL Server MCP Client.
  • MCP clients confirm each tool call by default. Leave that on until you have watched what the sql server mcp client mcp server does with a few real requests.

Available tools

ToolWhat it does
rowsAffectedTotal rows affected by DML operations (always captured)
ioStatsPer-table IO statistics (only when includeIoStats was true on the start tool)
executionPlanXmlActual XML execution plan (only when includeExecutionPlan was true on the start tool)
PrerequisitesThe Prerequisites tool exposed by this server.
InstallationThe Installation tool exposed by this server.
RunningThe Running tool exposed by this server.
server_capabilitiesReturns detailed information about the capabilities and features of the connected SQL Server instance.
get_command_timeoutExample request: json { "name": "get_command_timeout", "parameters": {} }
set_command_timeoutParameters: - timeoutSeconds (required): New timeout in seconds (1-3600)
execute_queryParameters: - query (required): The SQL query to execute. - timeoutSeconds (optional): Command timeout in seconds. Overrides the default timeout. - includeIoStats (optional): Include per-table IO statistics. Default is f
list_tablesLists all tables in the connected SQL Server database with schema and row count information.

Configuration

  • .NET 10.0 SDK (for local development/deployment) - Docker (for container deployment)
VariableDescriptionRequired
MSSQL_CONNECTIONSTRINGConfiguration value read at startup.Optional

Example prompts to try

  • Use SQL Server MCP Client to rowsAffected.
  • Use SQL Server MCP Client to ioStats.
  • Use SQL Server MCP Client to executionPlanXml.

Frequently asked questions

For security reasons as of version 0.0.5. You must explicitly enable them by setting the corresponding environment variables to `"true"` to prevent unintended data modification.