mssql-mcp-server

mssql-mcp-server

A Microsoft SQL Server MCP server that enables querying, inspecting, and troubleshooting SQL Server instances via ODBC with per-caller credential elicitation.

Category
Visit Server

README

mssql-mcp-server

License: MIT Python 3.11 Docker

A Microsoft SQL Server MCP server. Query, inspect, and troubleshoot any SQL Server instance from Cursor, Claude Code, Codex, or any MCP (Model Context Protocol) client. Connects via ODBC using per-caller credentials elicited at runtime. Passwords live only in server memory with an idle TTL and are never logged.

  • Query tools: connect / disconnect / list_sessions session lifecycle, execute_sql with table/JSON/CSV output, and explain_query for estimated or actual Showplan XML execution plans
  • Per-caller identity: the X-DB-User and X-DB-Password headers are both optional; anything missing is elicited once and cached in-memory
  • Permission-scoped access: read vs. write is governed by the SQL login's own permissions; provision_mcp_read.sql provisions a ready-made read-only mcp_read login across all user databases
  • Zero secrets on disk: no credentials in config files, env vars, or logs

Example prompts

  • "Show the execution plan for this query and suggest a better index."
  • "Who is blocking whom on db1 right now?"
  • "List the 10 largest tables in the sales database."
  • "Find all stored procedures that reference the Orders table."
  • "Export the results of this query as CSV."

Tools

Tool Description
connect Open a session to a SQL Server database and return a session_id
disconnect Close an active SQL Server session
list_sessions List active sessions with server, database, and usage details
execute_sql Run a SQL statement and return rows as table, JSON, or CSV
explain_query Estimated or actual execution plan as Showplan XML

Quick Start

docker compose -f docker-compose.yml -p mssql-mcp up -d --build --force-recreate

Client setup

Both X-DB-User and X-DB-Password headers are optional: anything missing is prompted for once via MCP elicitation and cached in memory.

Cursor (mcp.json)

{
  "mcpServers": {
    "mssql-mcp": {
      "type": "http",
      "url": "http://localhost:8007/mcp",
      "headers": {
        "X-DB-User": "<your-db-username>",
        "X-DB-Password": "<your-db-password>"
      }
    }
  }
}

Claude Code

claude mcp add --transport http mssql-mcp http://localhost:8007/mcp \
  --header "X-DB-User: <your-db-username>" \
  --header "X-DB-Password: <your-db-password>"

Codex (~/.codex/config.toml)

[mcp_servers.mssql-mcp]
url = "http://localhost:8007/mcp"
http_headers = { "X-DB-User" = "<your-db-username>", "X-DB-Password" = "<your-db-password>" }

Any other MCP client works the same way: point it at the streamable HTTP endpoint and pass the headers.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured