Skip to main content
Glama

Microsoft SQL Server MCP Server

by RichardHan

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

Deploy Server
A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

hybrid server

The server is able to function both locally and remotely, depending on the configuration or use case.

Microsoft SQL Server 데이터베이스와의 안전한 상호작용을 가능하게 하는 모델 컨텍스트 프로토콜 서버로, AI 보조자가 제어된 인터페이스를 통해 테이블을 나열하고, 데이터를 읽고, SQL 쿼리를 실행할 수 있도록 해줍니다.

  1. 특징
    1. 설치
      1. 구성
        1. 용법
          1. 클로드 데스크톱과 함께
          2. 독립형 서버로서
        2. 개발
          1. 보안 고려 사항
            1. 보안 모범 사례
              1. 특허
                1. 기여하다

                  Related MCP Servers

                  • -
                    security
                    A
                    license
                    -
                    quality
                    A Model Context Protocol server that enables secure and structured interaction with Microsoft SQL Server databases, allowing AI assistants to list tables, read data, and execute SQL queries with controlled access.
                    Last updated -
                    46
                    MIT License
                    • Linux
                    • Apple
                  • -
                    security
                    A
                    license
                    -
                    quality
                    A Model Context Protocol server implementation that enables AI assistants to execute SQL queries and interact with SQLite databases through a structured interface.
                    Last updated -
                    7
                    MIT License
                  • A
                    security
                    A
                    license
                    A
                    quality
                    A Model Context Protocol server that enables executing SQL queries and managing connections with Microsoft SQL Server databases.
                    Last updated -
                    1
                    49
                    5
                    MIT License
                  • A
                    security
                    A
                    license
                    A
                    quality
                    A Model Context Protocol server that enables AI assistants (Cursor, Windsurf, Claude Code) to interact with Microsoft SQL Server databases by providing connectivity through environment-configurable connections.
                    Last updated -
                    8
                    14
                    2
                    MIT License

                  View all related MCP servers

                  MCP directory API

                  We provide all the information about MCP servers via our MCP API.

                  curl -X GET 'https://glama.ai/api/mcp/v1/servers/RichardHan/mssql_mcp_server'

                  If you have feedback or need assistance with the MCP directory API, please join our Discord server