mssql_mcp_server

MCP.Pizza Chef: RichardHan

Questions about company data get answered from the source instead of from a stale export: it shows which tables exist, runs the query, and reports back. Reading is not the limit — it can also insert, update, and delete rows, so give it a restricted database login if you only want it looking. Local SQL Server, LocalDB, and Azure SQL all work, with SQL, Windows, or Azure sign-in. No paid key. Last updated November 2025, about nine months ago.

Data
Spreadsheets

Use This MCP server To

Ask which customers ordered twice last month See what tables exist before I start a report Pull a quick count without opening a database tool Correct a handful of rows I know are wrong Query an Azure SQL database from my chat window

README

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 (SELECT, INSERT, UPDATE, DELETE)
  • 🔐 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": ["microsoft_sql_server_mcp"],
      "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

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 .

Security

  • Create a dedicated SQL user with minimal permissions
  • Never use admin/sa accounts
  • Use Windows Authentication when possible
  • Enable encryption for sensitive data

License

MIT

mssql_mcp_server FAQ

Is this project still maintained?
Mostly idle. It is not archived and no replacement is named, but the last change was November 2025, roughly nine months ago, and recent work came from outside contributors rather than the author.
Do I need a paid key?
No. You supply the database sign-in details you already have — server name, database name, and either a username and password or your Windows account.
Can it change my data, or only read it?
It can add, change, and delete rows as well as read them. Create a dedicated login with read-only permission if you want it to look but not touch.
Does it work with Azure SQL?
Yes, alongside a SQL Server on your own machine or network, and LocalDB. Encryption is applied automatically for Azure.
Can I use this to answer a question about last quarter's sales?
Yes — you describe the question, it finds the relevant tables and runs the query, then explains the result in plain language.
How hard is setup?
Easy if you have the database details to hand. You paste a short block into Claude Desktop's settings with the server, database, username, and password.