MsSqlMCP MCP Server

MCP to query SQL Server database schema, such as tables, columns, and relationships

Local serverstdio

What is the MsSqlMCP MCP server?

MCP to query SQL Server database schema, such as tables, columns, and relationships. That is what the mssqlmcp mcp server brings to an AI assistant: the same capability, reachable through the Model Context Protocol rather than a separate app or dashboard.

The short version

  • Read-only access — All queries are validated to prevent data modification (INSERT, UPDATE, DELETE, DROP, EXEC, etc. are blocked)
  • Schema discovery — Tables, columns, relationships, and stored procedures
  • SQL execution — Safe SELECT queries only
  • Dual transport — Supports both stdio and HTTP/SSE protocols
  • Windows Service — Can run as a Windows Service for production deployments
  • MCP Protocol — Compatible with VS Code Copilot, Claude Desktop, and other MCP clients

Getting it running

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

The tools it exposes

The server publishes 7 tools. What each one is for:

  • GetTables — Get all table names in the database
  • GetColumns — Get columns (fields) for a specific table
  • GetRelationships — Get foreign key relationships between tables
  • GetStoreProcedure — Get stored procedure definition
  • ExecuteSql — Execute a read-only SELECT query
  • Endpoint — Method
  • Security — The ExecuteSql tool only allows SELECT queries. The following statements are blocked:

What it needs from you

  • .NET 10 (or .NET 9 with minor adjustments) - SQL Server

Things to watch

  • 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.
  • Keep per-call confirmation enabled while you learn its behaviour; it is the cheapest safeguard you have.

How it compares

Plenty of database access servers cover similar ground. The differences that matter in practice are scope of access and how much setup stands between you and a working tool call. MsSqlMCP's toolset — GetTables, GetColumns, GetRelationships and 4 more — is a fair guide to whether it matches your workflow. It is maintained by jdlemes; 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.

Available tools

ToolWhat it does
GetTablesGet all table names in the database
GetColumnsGet columns (fields) for a specific table
GetRelationshipsGet foreign key relationships between tables
GetStoreProcedureGet stored procedure definition
ExecuteSqlExecute a read-only SELECT query
EndpointMethod
SecurityThe ExecuteSql tool only allows SELECT queries. The following statements are blocked:

Configuration

  • .NET 10 (or .NET 9 with minor adjustments) - SQL Server

Example prompts to try

  • Use MsSqlMCP to GetTables.
  • Use MsSqlMCP to GetColumns.
  • Use MsSqlMCP to GetRelationships.

Frequently asked questions

The `ExecuteSql` tool only allows SELECT queries. Blocked statements include INSERT, UPDATE, DELETE, MERGE, TRUNCATE, CREATE, ALTER, DROP, GRANT, REVOKE, DENY, EXEC, EXECUTE, SP_EXECUTESQL, XP_, BACKUP, RESTORE, BULK, OPENROWSET, OPENQUERY, and OPENDATASOURCE.