Microsoft SQL Server

v1.0.0Databasesstable

A Model Context Protocol (MCP) server for Microsoft SQL Server that enables secure database interactions through a controlled interface. Allows AI assistants to safely list tables, read data, and execute SQL queries while maintaining security and str

microsoft-sql-server-mcp-servermcpai-integration
Share:
347
Stars
0
Downloads
0
Weekly
0/5

What is Microsoft SQL Server?

Microsoft SQL Server is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to model context protocol (mcp) server for microsoft sql server that enables secure database interactions through a controlled interface. allows ai assistants to safely list tables, read data, and execut...

A Model Context Protocol (MCP) server for Microsoft SQL Server that enables secure database interactions through a controlled interface. Allows AI assistants to safely list tables, read data, and execute SQL queries while maintaining security and str

This server falls under the Databases category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • A Model Context Protocol (MCP) server for Microsoft SQL Serv

Use Cases

Execute SQL queries securely.
List and read database tables.
Manage SQL Server data safely.
RichardHan

Maintainer

LicenseMIT License
Languagepython
Versionv1.0.0
UpdatedMay 22, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx microsoft-sql-server-mcp-server

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use Microsoft SQL Server

The Microsoft SQL Server MCP server gives AI assistants like Claude a controlled, secure interface to query and manage data in Microsoft SQL Server databases, including on-premises instances, LocalDB, and Azure SQL. It exposes tools to list all tables in a database, read table contents, and execute arbitrary SQL statements (SELECT, INSERT, UPDATE, DELETE) through a standardized MCP protocol. Data engineers and developers use it to let Claude write and run SQL queries, explore schemas, and automate database tasks without exposing raw connection strings in prompts.

Prerequisites

  • Python 3.9 or newer
  • Microsoft SQL Server instance accessible over the network (on-premises, LocalDB, or Azure SQL)
  • SQL Server credentials: hostname, database name, username, and password (or Windows Authentication)
  • uvx (from the uv package manager) for the recommended zero-install startup method
  • An MCP client such as Claude Desktop
1

Install the package (optional, for direct Python use)

The server can be run with uvx without any prior installation. Alternatively, install it via pip for permanent availability.

pip install microsoft_sql_server_mcp
2

Test connectivity to your SQL Server

Before configuring the MCP server, confirm your SQL Server is reachable on the expected port (default 1433) and that your credentials work.

# Using sqlcmd or any SQL client to test
sqlcmd -S your_server -d your_database -U your_user -P your_password -Q "SELECT 1"
3

Add the MCP server to Claude Desktop configuration

Open the Claude Desktop config file and add an entry for the MSSQL server. The required environment variables are MSSQL_SERVER and MSSQL_DATABASE, plus credentials for SQL authentication.

{
  "mcpServers": {
    "mssql": {
      "command": "uvx",
      "args": ["microsoft_sql_server_mcp"],
      "env": {
        "MSSQL_SERVER": "your-server-host",
        "MSSQL_DATABASE": "your_database",
        "MSSQL_USER": "your_username",
        "MSSQL_PASSWORD": "your_password",
        "MSSQL_PORT": "1433"
      }
    }
  }
}
4

Configure Windows Authentication (if applicable)

For Windows Authentication instead of SQL login, set MSSQL_WINDOWS_AUTH to true and omit MSSQL_USER and MSSQL_PASSWORD. This only works when Claude Desktop runs on a Windows machine joined to the same domain.

{
  "mcpServers": {
    "mssql": {
      "command": "uvx",
      "args": ["microsoft_sql_server_mcp"],
      "env": {
        "MSSQL_SERVER": "your-server-host",
        "MSSQL_DATABASE": "your_database",
        "MSSQL_WINDOWS_AUTH": "true"
      }
    }
  }
}
5

Restart Claude Desktop and verify

Save the config and restart Claude Desktop. Ask Claude to list the tables in your database to confirm the connection is working.

Microsoft SQL Server Examples

Client configuration

Standard SQL authentication config using uvx for zero-install startup. Replace server, database, and credentials with your actual values. For Azure SQL, MSSQL_ENCRYPT is recommended.

{
  "mcpServers": {
    "mssql": {
      "command": "uvx",
      "args": ["microsoft_sql_server_mcp"],
      "env": {
        "MSSQL_SERVER": "myserver.database.windows.net",
        "MSSQL_DATABASE": "sales_db",
        "MSSQL_USER": "sqladmin",
        "MSSQL_PASSWORD": "yourpassword",
        "MSSQL_PORT": "1433",
        "MSSQL_ENCRYPT": "true"
      }
    }
  }
}

Prompts to try

These prompts work after the MSSQL MCP server is connected and Claude has access to your database.

- "List all tables in the database and describe what each one likely contains"
- "Show me the top 10 rows from the Orders table where status is 'pending'"
- "Write and execute a query to find customers who have placed more than 5 orders this month"
- "What are the column names and data types in the Products table?"
- "Generate a summary report of total sales by region for the last quarter"

Troubleshooting Microsoft SQL Server

Connection timeout or 'Cannot open server' error

Check that your SQL Server allows TCP/IP connections on port 1433 (or your custom MSSQL_PORT). For Azure SQL, confirm the firewall rule allows your IP. For on-premises servers, enable TCP/IP in SQL Server Configuration Manager.

Login failed for user error

Verify MSSQL_USER and MSSQL_PASSWORD are correct. Ensure SQL Server Authentication is enabled on the server (not just Windows Authentication). In SSMS: Server Properties > Security > select 'SQL Server and Windows Authentication mode'.

uvx: command not found

Install uv following instructions at https://docs.astral.sh/uv/. On macOS/Linux: 'curl -LsSf https://astral.sh/uv/install.sh | sh'. Then restart your terminal so uvx is on your PATH.

Frequently Asked Questions about Microsoft SQL Server

What is Microsoft SQL Server?

Microsoft SQL Server is a Model Context Protocol (MCP) server that model context protocol (mcp) server for microsoft sql server that enables secure database interactions through a controlled interface. allows ai assistants to safely list tables, read data, and execute sql queries while maintaining security and str It connects AI assistants to external tools and data sources through a standardized interface.

How do I install Microsoft SQL Server?

Follow the installation instructions on the Microsoft SQL Server GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.

Which AI clients work with Microsoft SQL Server?

Microsoft SQL Server works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is Microsoft SQL Server free to use?

Yes, Microsoft SQL Server is open source and available under the MIT License license. You can use it freely in both personal and commercial projects.

Browse More Databases MCP Servers

Explore all databases servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "microsoft-sql-server-mcp-server": { "command": "npx", "args": ["-y", "microsoft-sql-server-mcp-server"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use Microsoft SQL Server?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides