Microsoft SQL Server MCP

Microsoft SQL Server MCP is an MCP server that provides AI agents with direct access to Microsoft SQL Server databases. Built as a .NET application utilizing Akka.NET for internal coordination and the official MCP C# SDK, it allows database administrators, software engineers, and data analysts to inspect schemas and run queries directly from compatible MCP clients. The server enables users to connect to local SQL Server instances, Azure SQL databases, or remote enterprise deployments using standard connection strings with Windows or SQL Server authentication. Through its protocol tools, AI models can discover schemas, view existing tables with row counts, and execute full SQL operations including SELECT, INSERT, UPDATE, DELETE, and DDL commands. The server validates connections automatically on startup, formats query outputs into structured tables suitable for language model consumption, and provides detailed error messages when queries fail. It can be run either as a compiled local .NET binary or as an isolated Docker container configured through environment variables.

Category: Databases & Data Stores

Tags: database, dotnet, mssql, sql server

Visit Microsoft SQL Server MCP

How to install and configure Microsoft SQL Server MCP

  1. Clone the repository and build the container image: bash git clone https://github.com/Aaronontheweb/mssql-mcp.git cd mssql-mcp dotnet publish --os linux --arch x64 /t:PublishContainer 2. Open your client configuration file, such as Claude Desktop's claude_desktop_config.json or Cursor's Model Context Protocol settings. 3. Add the mssql server configuration using Docker: json { "mcpServers": { "mssql": { "command": "docker", "args": [ "run", "-i", "--rm", "-e", "MSSQL_CONNECTION_STRING", "mssql-mcp:latest" ], "env": { "MSSQL_CONNECTION_STRING": "Server=host.docker.internal,1533; Database=MyDb; User Id=myUser; Password=My(!)Password;TrustServerCertificate=true;" } } } } 4. Alternatively, point the command directly to the compiled binary /path/to/mssql-mcp/src/MSSQL.MCP/bin/Release/net9.0/MSSQL.MCP and restart your client.

What you can do with Microsoft SQL Server MCP

  • Inspect database schemas across SQL Server instances without manually writing metadata queries. * Explore existing database tables, structures, and row counts before generating data transformation pipelines. * Execute SELECT queries to extract, summarize, and analyze operational records using natural language prompts. * Run data modification statements such as INSERT, UPDATE, or DELETE to apply scripted data updates. * Execute DDL operations to generate, alter, or configure database tables during local application development.

Key facts

  • https://github.com/Aaronontheweb/mssql-mcp
  • Databases & Data Stores
  • database, dotnet, mssql, sql server

Part of MCP Servers

Related MCP servers

  • MCP Memory Keeper — MCP Memory Keeper is an MCP server that provides persistent context management and memory storage for Claude AI coding assistants.…
  • MCP Notes — MCP Notes is an MCP server that provides note-taking and note-management capabilities to AI models using Amazon Web Services DynamoDB…
  • MCP Neo4j Server — MCP Neo4j Server is an MCP server that provides an integration between the Neo4j graph database and Model Context Protocol…
  • MCP Memory Toolkit — MCP Memory Toolkit is an MCP server that provides persistent memory capabilities for Claude and other compatible assistants using ChromaDB.…
  • MCP Memory Server — MCP Memory Server is an MCP server that integrates Claude Desktop with Azure Cosmos DB and OpenAI embeddings to provide…
  • MCP MS SQL Server — MCP MS SQL Server is an MCP server that provides a standardized Model Context Protocol interface for AI models to…

How do I install Microsoft SQL Server MCP?

You can install Microsoft SQL Server MCP by cloning its GitHub repository and building the container using the dotnet publish container command. Once the Docker image is built, you register it in your MCP client configuration file by invoking the docker run command with the MSSQL_CONNECTION_STRING environment variable. Alternatively, you can build and run the .NET binary directly.

What can Microsoft SQL Server MCP do?

Microsoft SQL Server MCP provides three primary tools: list_schemas to view available schemas and databases, list_tables to inspect table names along with types and row counts, and execute_sql to run arbitrary SQL statements including SELECT, INSERT, UPDATE, DELETE, and DDL statements. Query outputs are returned in readable table formats for LLMs.

Which MCP clients work with Microsoft SQL Server MCP?

It works with any standard Model Context Protocol client that supports stdio process execution. The project includes explicit configuration instructions for Claude Desktop and the Cursor IDE, executing either through a local Docker container or directly as a standalone .NET executable.

How do I connect to a local database with Microsoft SQL Server MCP?

When running the MCP server inside Docker, replace localhost with host.docker.internal in the MSSQL_CONNECTION_STRING environment variable. This allows the Docker container to route traffic back to the host machine where your SQL Server instance is listening, such as on port 1433 or a custom port.

  • AI Tools
  • Categories
  • Industries
  • CLI Coding Agents
  • MCP Servers
  • MCP Categories