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?

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.

Configuration and credentials

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

More MCP options

Compare MCP servers by category, or browse hosted MCP servers if you prefer an endpoint over a local process.

Maintainer setup documentation.

Recorded tools

Check the linked publisher documentation and your connected client's tool list. Names and availability can vary with the server version and account permissions.

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)
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.