Skip to main content

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

Metadata

Release files for iflow-mcp_microsoft_sql_server_mcp 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for iflow-mcp_microsoft_sql_server_mcp 0.1.0
File Size Uploaded
iflow_mcp_microsoft_sql_server_mcp-0.1.0.tar.gz 34.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for iflow-mcp_microsoft_sql_server_mcp 0.1.0
File Interpreter ABI Platform
iflow_mcp_microsoft_sql_server_mcp-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 42.3 kB

Release files / iflow_mcp_microsoft_sql_server_mcp-0.1.0.tar.gz

Download URL iflow_mcp_microsoft_sql_server_mcp-0.1.0.tar.gz
Size 34.6 kB
Tags Source
SHA-256 checksum
How to use checksums
e191d3a53dc8a6c8f789b3d24522c98c25d09bd2263a576e242fe1bf3402aa91
BLAKE2b-256 checksum
How to use checksums
aa762a6ab55e85468f2f30854fcabd66a41ab77ed41c8b41233c71376c211025
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.8

Release files / iflow_mcp_microsoft_sql_server_mcp-0.1.0-py3-none-any.whl

Download URL iflow_mcp_microsoft_sql_server_mcp-0.1.0-py3-none-any.whl
Size 7.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bd004a594606d6431df52643a003814334ff26eda6907805001705f8d7b88203
BLAKE2b-256 checksum
How to use checksums
5f7832879d6daac6dfc276d85c0353d673e48730503aba244ec6869c09a55f16
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.8

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page