Microsoft SQL Server MCP Server

Microsoft SQL Server MCP Server

mssql-mcp-server-vuutla•byrichardhan

A Model Context Protocol server that provides secure SQL Server database access through Claude Desktop.

License: MIT•Runtime: Awaiting documentation review•Category: databases storage

WHAT IT DOES

  • •Lists database tables and executes SQL queries, read-only by default with optional write mode.
  • •Supports multiple authentication methods including SQL, Windows, and Azure AD, plus LocalDB and Azure SQL.
  • •Exposes a query tool that only accepts a single read-only T-SQL statement, rejecting stacked batches, SELECT INTO, and EXEC before reaching the driver.
  • •When write mode is enabled via MSSQL_ALLOW_WRITES, exposes an execute_sql tool allowing INSERT, UPDATE, and DELETE.

BEST FOR

  • •Querying and exploring SQL Server databases from Claude Desktop.
  • •Read-only database deployments using a least-privilege SQL login.
  • •Connecting to Azure SQL Database or LocalDB instances with automatic encryption for Azure.

ABOUT MSSQL-MCP-SERVER-VUUTLA

Microsoft SQL Server MCP Server is cataloged as an MCP server attributed to richardhan. A Model Context Protocol server that provides secure SQL Server database access through Claude Desktop. It is categorized under databases storage. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.

HOW TO INSTALL

Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.

LICENSE

Catalog license label: MIT. Check the source repository's current license and terms before using, modifying or distributing this software.

能力检查器

能力定义尚未审核。未核验的采集内容不会作为可信接口展示。

Tools (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Resources (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Prompts (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

NEWSLETTER - COMING LATER

Newsletter subscriptions are not open yet

Email delivery is not connected. This page does not collect email addresses or create subscriptions.

Browse the registry for current listings instead.

Community Reviews

Coming later

Reviews for Microsoft SQL Server MCP Server are not available yet

Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.

FREQUENTLY ASKED QUESTIONS

Does the server allow writes by default?

No. By default it exposes only a read-only query tool; writes require explicitly setting MSSQL_ALLOW_WRITES=1, which exposes execute_sql.

Can query execution time be limited?

Yes, MSSQL_QUERY_TIMEOUT sets a query timeout in seconds, defaulting to 300, and queries exceeding the limit are automatically terminated.

上游原版 README

在 GitHub 查看同一版本原文

README.md · ac8d7faf8a0e · 采集于 2026-11-13 13:10:04 UTC

保留上游原文,不做 AI 改写。为安全起见过滤脚本、表单和不安全链接。

当前显示最后一次成功采集的文档快照,请以来源页面为准。

Microsoft SQL Server MCP Server

PyPI License: MIT

Microsoft SQL Server MCP server

A Model Context Protocol (MCP) server for secure SQL Server database access through Claude Desktop.

Features

  • 🔍 List database tables
  • 📊 Execute SQL queries (read-only by default; optional write mode)
  • 🔐 Multiple authentication methods (SQL, Windows, Azure AD)
  • 🏢 LocalDB and Azure SQL support
  • 🔌 Custom port configuration

Quick Start

Install with Claude Desktop

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "mssql": {
      "command": "uvx",
      "args": ["--from", "microsoft-sql-server-mcp", "mssql_mcp_server"],
      "env": {
        "MSSQL_SERVER": "localhost",
        "MSSQL_DATABASE": "your_database",
        "MSSQL_USER": "your_username",
        "MSSQL_PASSWORD": "your_password"
      }
    }
  }
}

Configuration

Basic SQL Authentication

MSSQL_SERVER=localhost          # Required
MSSQL_DATABASE=your_database    # Required
MSSQL_USER=your_username        # Required for SQL auth
MSSQL_PASSWORD=your_password    # Required for SQL auth

Windows Authentication

MSSQL_SERVER=localhost
MSSQL_DATABASE=your_database
MSSQL_WINDOWS_AUTH=true         # Use Windows credentials

Azure SQL Database

MSSQL_SERVER=your-server.database.windows.net
MSSQL_DATABASE=your_database
MSSQL_USER=your_username
MSSQL_PASSWORD=your_password
# Encryption is automatic for Azure

Optional Settings

MSSQL_PORT=1433                 # Custom port (default: 1433)
MSSQL_ENCRYPT=true              # Force encryption (uses pymssql `encryption=require`)
MSSQL_TRUST_SERVER_CERTIFICATE=true  # Trust SQL Server TLS cert (default: true for non-Azure encrypt, false for Azure)
MSSQL_QUERY_TIMEOUT=300         # Query timeout in seconds (default: 300). Queries exceeding this limit are automatically terminated.
MSSQL_ALLOW_WRITES=1            # Allow INSERT/UPDATE/DELETE; tool name becomes execute_sql (default: read-only `query` tool)
MSSQL_COMMAND=query             # Optional override for the MCP tool name

Read-only vs write mode

By default the server exposes a query tool that only accepts a single read-only SELECT / WITH / set-operation statement (parsed as T-SQL) and sets readOnlyHint (so Cursor Ask mode can use it). Stacked batches (SELECT …; INSERT …), SELECT INTO, EXEC, and other non-SELECT statements are rejected before they reach the database driver.

Set MSSQL_ALLOW_WRITES=1 to expose execute_sql and allow writes. Prefer a least-privilege read-only SQL login for the default mode — the parser is fail-closed defense in depth, not a substitute for database permissions, and does not claim to prove arbitrary T-SQL is free of side effects.

Alternative Installation Methods

Using pip

pip install microsoft_sql_server_mcp

Then in claude_desktop_config.json:

{
  "mcpServers": {
    "mssql": {
      "command": "python",
      "args": ["-m", "mssql_mcp_server"],
      "env": { ... }
    }
  }
}

Development

git clone https://github.com/RichardHan/mssql_mcp_server.git
cd mssql_mcp_server
pip install -e .

Dependency notes

The mcp SDK is pinned to >=1.0.0,<2.0.0 in both pyproject.toml and requirements.txt.

mcp 2.0.0 removed the legacy Server decorator API (@app.list_resources(), @app.list_tools(), ...) that src/mssql_mcp_server/server.py is built on, so an unconstrained install crashes at import time with:

AttributeError: 'Server' object has no attribute 'list_resources'

This matters most for uvx --from git+... launches, which resolve dependencies fresh on every cold start and ignore uv.lock. Do not drop the upper bound until the server is migrated to the 2.x API.

Security

  • Create a dedicated SQL user with minimal permissions (e.g. db_datareader for read-only deployments)
  • Never use admin/sa accounts for the MCP connection
  • Use Windows Authentication when possible
  • Enable encryption for sensitive data
  • Treat MSSQL_ALLOW_WRITES as an explicit opt-in; keep it off unless the user deliberately wants writes
  • Read-only mode parses T-SQL and fail-closes on unsupported/stacked statements — still pair it with least-privilege DB grants

License

MIT

Install configuration

Are you the maintainer?

Claim this server with your GitHub account to request manual ownership verification.

README Embed Badge
Markdown

Link to the catalog listing for Microsoft SQL Server MCP Server from your README. This badge does not certify ownership, compatibility or security.

[![MCP catalog listing](https://img.shields.io/badge/MCP-awesome--mcp-orange?style=flat-square)](https://awesome-mcp.com/servers/mssql-mcp-server-vuutla)

REPOSITORY STATS

GitHub StarsUnavailable
ForksUnavailable

Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.

下载与拉取统计

来源、范围和时段分别列出;不相加,不代表安装人数、活跃用户或安全审核。

尚无已审核的包 / 镜像标识,暂不展示下载统计。

Related databases storage MCP Servers

Alternative and complementary servers in the same category

View all in databases storage →
AIStor MCP server
mcp-server-aistor•minio

This is a Model Context Protocol (MCP) server for interacting with AIStor object stores.

Repository stats unavailable
Databases & Storage
InfluxDB v2 MCP Server
influxdb-mcp-server•idoru

A Model Context Protocol (MCP) server that exposes access to an InfluxDB v2 instance using the InfluxDB OSS API v2.

Repository stats unavailable
Databases & Storage