Skip to main content
Glama

MSSQL MCP Server

by ralacher

MSSQL MCP Server

This project is an MCP (Model Context Protocol) server for connecting to Microsoft SQL Server databases. It uses MCPO to introduce an OpenAPI proxy in front of the MCP server, enabling OpenAPI-compatible clients to interact with the MCP server via a standardized HTTP interface. The server provides tools for schema inspection and querying, all accessible via the MCP protocol or through the OpenAPI proxy.

Diagram

Features

  • Connects to Microsoft SQL Server using MCP
  • Provides tools for querying and schema inspection
  • Designed for integration with MCP-compatible clients
  • Container-ready (Docker)

Available Tools

  • read_query: Execute SELECT queries on the MSSQL database
  • list_tables: List all existing tables and their columns

Required Environment Variables

Set the following environment variables to configure the database connection:

  • MSSQL_SERVER (name.database.windows.net)
  • MSSQL_DATABASE (Name)
  • MSSQL_USER (Username)
  • MSSQL_PASSWORD (Password)
  • MCP_SERVER_NAME (mcp-database-assistant)
  • MCP_SERVER_VERSION (1.0.0)
  • APPLICATIONINSIGHTS_CONNECTION_STRING (InstrumentationKey=...)

These can be set in your environment or injected at container runtime.

Building and Running with Docker

  1. Build the Docker image:
    docker build -t mssql-mcp .
  2. Run the container:
    docker run --rm -it mssql-mcp
  3. Default command: The container runs:
    mcpo --config config.json

Requirements

  • Python 3.11+
  • Microsoft ODBC Driver 17 for SQL Server (installed in the Docker image)
  • MCP-compatible client (for example, VS Code with MCP extension)

License

See LICENSE.

-
security - not tested
A
license - permissive license
-
quality - not tested

hybrid server

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

An MCP server that enables connection to Microsoft SQL Server databases, providing tools for schema inspection and querying through standardized interfaces.

  1. Diagram
    1. Features
      1. Available Tools
        1. Required Environment Variables
          1. Building and Running with Docker
            1. Requirements
              1. License

                Related MCP Servers

                • -
                  security
                  A
                  license
                  -
                  quality
                  Facilitates interaction with Microsoft SQL Server Express, supporting database operations such as querying, table management, and schema inspection via natural language MCP commands.
                  Last updated -
                  4
                  Python
                  MIT License
                • -
                  security
                  A
                  license
                  -
                  quality
                  An MCP server that connects to Supabase PostgreSQL databases, exposing table schemas as resources and providing tools for data analysis through SQL queries.
                  Last updated -
                  1
                  JavaScript
                  MIT License
                • -
                  security
                  F
                  license
                  -
                  quality
                  An MCP server that allows working with MySQL databases by providing tools for executing read-only SQL queries, getting table schemas, and listing database tables.
                  Last updated -
                  685
                  2
                  JavaScript
                • -
                  security
                  A
                  license
                  -
                  quality
                  A FastMCP-based server that enables executing Microsoft SQL Server data queries and table structure queries through a standardized MCP protocol interface.
                  Last updated -
                  3
                  Python
                  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/ralacher/mssql-mcp'

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