SQL Server MCP Client
About
A Microsoft SQL Server client implementing the Model Context Protocol (MCP). This server provides SQL query capabilities through a simple MCP interface.
Details
- Author
- aadversteeg
- GitHub stars
- 37
- Downloads
- 496
- Categories
- Database
Jump to
- Execute SQL queries and stored procedures with type-safe automatic JSON-to-SQL conversion
- List all tables with schema and row count information
- Retrieve detailed schema information for specific tables
- Discover stored procedure parameters in table or JSON Schema format
- Configurable timeouts and background session management for long-running operations
- Automatic execution timing and optional query profiling with IO statistics and XML plans
- Two-mode architecture optimized for single-database or multi-database scenarios
Setting up with Highlight
This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:
- Download and install Highlight from highlightai.com/download
- Navigate to the plugins tab and select "Add Custom Plugin"
-
Configure the plugin with the settings below
Plugin Name
SQL Server MCP ClientCommand (node, npx, python, etc.)Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.
- Enable "Start Automatically" if you want the plugin to start when Highlight launches
From the repository
Install as a .NET global tool (dotnet tool install --global Ave.McpServer.MsSqlClient) or run as a Docker container. Configure it as an MCP server in Claude Desktop/Claude Code by adding the mssql entry to the mcpServers configuration with the MSSQL_CONNECTIONSTRING environment variable. By default, only read-only tools are enabled; to enable query and stored procedure execution, set the corresponding DatabaseConfiguration__Enable* environment variables to "true".
Claude Desktop / Cursor
Paste into your MCP client config file to install this server.
{
"mcpServers": {
"sql server mcp client": {
"mssqlclient-mcp-server": {
"command": "docker",
"args": [
"pull",
"aadversteeg/mssqlclient-mcp-server:latest"
]
}
}
}
}
McpServers
{
"mssqlclient-mcp-server": {
"command": "docker",
"args": [
"pull",
"aadversteeg/mssqlclient-mcp-server:latest"
]
}
}
SQL Server MCP Client
> Breaking Change in 0.0.5: Query and stored procedure execution tools are now disabled by default for security. If you were relying on the previous defaults, you must now explicitly enable them by setting the corresponding environment variables to "true":
> - DatabaseConfiguration__EnableExecuteQuery
> - DatabaseConfiguration__EnableExecuteStoredProcedure
> - DatabaseConfiguration__EnableStartQuery
> - DatabaseConfiguration__EnableStartStoredProcedure
>
> See Configuring Claude Desktop / Claude Code for examples.
A comprehensive Microsoft SQL Server client implementing the Model Context Protocol (MCP). This server provides extensive SQL Server capabilities including query execution, schema discovery, and stored procedure management through a simple MCP interface.
Overview
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.
The MCP client operates in one of two modes:
- Database Mode: When a specific database is specified in the connection string, only operations within that database context are available
- Server Mode: When no database is specified in the connection string, server-wide operations across all databases are available
Features
Core Database Operations
- Execute SQL queries on connected SQL Server databases - List all tables with schema and row count information - Retrieve detailed schema information for specific tables - Comprehensive stored procedure management and executionStored Procedure Support
- Parameter Discovery: Get detailed parameter information in table or JSON Schema format - Type-Safe Execution: Automatic JSON-to-SQL type conversion based on parameter metadata - Rich Metadata: Support for input/output parameters, default values, and data type constraints - Cross-Database Operations: Execute procedures across different databases (Server Mode)Advanced Features
- JSON Schema Output: Parameter metadata compatible with validation tools - Case-Insensitive Parameters: Flexible parameter naming with @ prefix normalization - SQL Server Feature Detection: Comprehensive capability reporting - Two-Mode Architecture: Optimized for both single-database and multi-database scenarios - Configurable Timeouts: Default and per-operation timeout control with runtime management tools - Background Session Management: Execute long-running queries and procedures with session-based monitoring - Execution Timing: Automatic wall-clock and SQL Server-reported timing on query and stored procedure results - Query Profiling: Optional per-table IO statistics and actual XML execution plans for performance analysis - Rows Affected: Automatic reporting of rows affected by DML operationsSecurity & Configuration
- Configurable tool enablement for security - Environment-based configuration - Comprehensive error handling with standardized error messages - Input validation against SQL Server metadataGetting Started
Prerequisites
- .NET 10.0 SDK (for local development/deployment)
- Docker (for container deployment)
Build Instructions (for development)
If you want to build the project from source:
1. Clone this repository:
git clone https://github.com/aadversteeg/mssqlclient-mcp-server.git
2. Navigate to the source directory:
cd mssqlclient-mcp-server/src
3. Build the project:
dotnet build
4. Run the unit tests:
dotnet test
Running Integration Tests
Integration tests verify the MCP server against a real SQL Server instance. The test framework automatically manages Docker containers: it finds a free port (in the 14330–14339 range), starts a SQL Server container with a unique name, runs all tests, and removes the container when done.
The only prerequisite is that Docker is running:
cd tst
dotnet test --filter "TestType=Integration"
The integration tests cover both database mode (connection string with Database=) and server mode (connection string without Database=), including tool metadata verification and functional tests for query execution, table listing, and schema retrieval.
Integration tests also run automatically in CI via the Integration Tests workflow, which can be triggered manually from the GitHub Actions tab.
Docker Support
Docker Hub
The SQL Server MCP Client is available on Docker Hub.
```bash
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.



