MCP server for Microsoft SQL Server database operations

MCP server for Microsoft SQL Server database operations

mssql-mcp-server-stilllovee•bystilllovee

An MCP server that connects to Microsoft SQL Server to execute queries and stored procedures and to report database connection information, with stdio and Streamable HTTP transport modes.

License: Not specified•Runtime: Awaiting documentation review•Category: databases storage

WHAT IT DOES

  • •Executes SQL queries against a SQL Server database, accepting a query string and optional parameters.
  • •Executes stored procedures, accepting a procedure name and optional parameters.
  • •Retrieves database connection information with no parameters required.
  • •Runs over stdio by default or over Streamable HTTP with session management for web and remote connections.

BEST FOR

  • •Connecting Claude Desktop or other stdio-based MCP clients to a SQL Server database.
  • •Web applications and remote clients that need MCP access to SQL Server over HTTP.
  • •Environments that need to route different clients to different databases by API key.

ABOUT MSSQL-MCP-SERVER-STILLLOVEE

MCP server for Microsoft SQL Server database operations is cataloged as an MCP server attributed to stilllovee. An MCP server that connects to Microsoft SQL Server to execute queries and stored procedures and to report database connection information, with stdio and Streamable HTTP transport modes. It is categorized under databases storage. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.

HOW TO INSTALL

Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.

LICENSE

Catalog license label: Not specified. Check the source repository's current license and terms before using, modifying or distributing this software.

Capability inspector

Capability definitions are not reviewed. Unreviewed imports are not exposed as trusted interfaces.

Tools (0)

No reviewed records to display. This does not establish that upstream lacks this capability.

Resources (0)

No reviewed records to display. This does not establish that upstream lacks this capability.

Prompts (0)

No reviewed records to display. This does not establish that upstream lacks this capability.

NEWSLETTER - COMING LATER

Newsletter subscriptions are not open yet

Email delivery is not connected. This page does not collect email addresses or create subscriptions.

Browse the registry for current listings instead.

Community Reviews

Coming later

Reviews for MCP server for Microsoft SQL Server database operations are not available yet

Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.

FREQUENTLY ASKED QUESTIONS

What authentication methods are supported for connecting to SQL Server?

The server supports both Windows Authentication and SQL Server Authentication.

Can a full connection string be used instead of individual DB_ environment variables?

Yes, DB_CONNECTION_STRING takes priority over all other connection settings.

Upstream README

View this exact version on GitHub

README.md · ae58f740e082 · Fetched 2026-11-13 12:52:32 UTC

Original upstream text, without AI rewriting. Scripts, forms and unsafe links are filtered for safety.

Showing the last retrieved documentation snapshot; check the source for current changes.

MSSQL MCP Server

Model Context Protocol (MCP) server for Microsoft SQL Server database operations.

Features

  • Execute SQL queries against SQL Server
  • Execute stored procedures
  • Get database connection information
  • Support for both Windows Authentication and SQL Server Authentication
  • Flexible configuration via environment variables
  • Streamable HTTP transport for web-based applications and remote connections
  • Support for multiple simultaneous sessions

Usage

The server supports two transport modes:

1. Stdio Transport (Default)

For use with Claude Desktop and other stdio-based MCP clients.

Add to your Claude Desktop configuration:

{
    "mcpServers": {
        "mssql": {
            "command": "npx",
            "args": [
                "github:stilllovee/mssql-mcp-server"
            ],
            "env": {
                "DB_SERVER": "servername",
                "DB_DATABASE": "dbname",
                "DB_USER": "username", //optional
                "DB_PASSWORD": "password",  //optional
                "DB_TRUST_SERVER_CERTIFICATE": "true",  //optional
                "DB_ENCRYPT": "true"  //optional
            }
        }
    }
}

Or install in your own PC

npm install
{
    "mcpServers": {
        "mssql": {
            "command": "node",
            "args": ["/path/to/folder"],
            "env": {
                "DB_SERVER": "servername",
                "DB_DATABASE": "dbname",
                "DB_USER": "username", //optional
                "DB_PASSWORD": "password",  //optional
                "DB_TRUST_SERVER_CERTIFICATE": "true",  //optional
                "DB_ENCRYPT": "true"  //optional
            }
        }
    }
}

Or using a connection string:

{
    "mcpServers": {
        "mssql": {
            "command": "node",
            "args": ["/path/to/folder"],
            "env": {
                "DB_CONNECTION_STRING": "Server=localhost;Database=ecommerce;Trusted_Connection=yes;TrustServerCertificate=yes"
            }
        }
    }
}

2. Streamable HTTP Transport

For web applications, remote connections, and environments where HTTP is preferred.

Start the HTTP Server

Setup .env file with your database configuration:

DB_SERVER=localhost
DB_DATABASE=ecommerce
DB_USE_WINDOWS_AUTH=true
# Or use a full connection string
# DB_CONNECTION_STRING=Server=localhost;Database=ecommerce;Trusted_Connection=yes;TrustServerCertificate=yes

Run the server:

# Using default port 8123
node index-http.js

# Or specify a custom port
node index-http.js --port=3000

The server will be available at http://localhost:8123/mcp (or your custom port).

HTTP Transport Features

  • Session Management: Supports multiple simultaneous client connections with unique session IDs
  • Server-Sent Events (SSE): Real-time notifications via GET endpoint
  • Stateful Connections: Maintains session state across requests
  • Standard HTTP: Works with any HTTP client or proxy
  • API Key-Based Connection Mapping: Map different API keys to different database connections (see below)

API Key-Based Multi-Database Support

The HTTP transport supports API key-based connection mapping using Azure Table Storage, allowing different clients to connect to different databases using unique API keys.

Enable API Key Mapping:

# Set environment variables
USE_API_KEY_MAPPING=true
AZURE_STORAGE_CONNECTION_STRING=your_azure_connection_string

# Start the server
node index-http.js

Configure in Claude Desktop:

"mssql": {
    "type": "http",
    "url": "http://localhost:8123/mcp",
    "headers": {
        "x-api-key": "your-api-key"
    }
},

Making Requests with API Keys:

curl -X POST http://localhost:8123/mcp \
  -H "Content-Type: application/json" \
  -H "x-api-key: your-api-key" \
  -d '{"jsonrpc":"2.0","id":1,"method":"initialize",...}'

Managing API Keys:

# List all API keys
node scripts/manage-api-keys.js list

# Add a new API key
node scripts/manage-api-keys.js add my-api-key

# Delete an API key
node scripts/manage-api-keys.js delete my-api-key

For detailed information about Azure Table Storage setup, API key management, and security best practices, see Azure Table Storage Documentation.

HTTP Endpoints

  • POST /mcp - Send MCP requests and receive responses
  • GET /mcp - Establish SSE connection for receiving notifications (requires mcp-session-id header)

Available Environment Variables

VariableDescriptionDefault
DB_CONNECTION_STRINGFull connection string (overrides all other settings)-
DB_SERVERSQL Server hostname or IPlocalhost
DB_DATABASEDatabase nameecommerce
DB_USERUsername for SQL Server Authentication-
DB_PASSWORDPassword for SQL Server Authentication-
DB_USE_WINDOWS_AUTHUse Windows Authenticationtrue (if user/password not set)
DB_DRIVERODBC driver nameODBC Driver 17 for SQL Server
DB_ENCRYPTEnable connection encryptionfalse
DB_TRUST_SERVER_CERTIFICATETrust server certificatetrue
USE_API_KEY_MAPPINGEnable API key-based connection mappingfalse
AZURE_STORAGE_CONNECTION_STRINGAzure Table Storage connection string (required for API key mapping)-
AZURE_TABLE_NAMEAzure Table name for API key mappingsApiKeyMappings

Available Tools

  1. sql_execute_query - Execute SQL queries

    • Parameters: query (string), params (object, optional)
  2. sql_execute_procedure - Execute stored procedures

    • Parameters: procedure_name (string), params (object, optional)
  3. sql_get_database_info - Get database connection information

    • No parameters required
  4. And more ...

Requirements

  • Node.js 14 or higher
  • SQL Server with ODBC driver installed
  • For Windows Authentication: Running on Windows with appropriate permissions

Install configuration

Are you the maintainer?

Claim this server with your GitHub account to request manual ownership verification.

README Embed Badge
Markdown

Link to the catalog listing for MCP server for Microsoft SQL Server database operations from your README. This badge does not certify ownership, compatibility or security.

[![MCP catalog listing](https://img.shields.io/badge/MCP-awesome--mcp-orange?style=flat-square)](https://awesome-mcp.com/servers/mssql-mcp-server-stilllovee)

REPOSITORY STATS

GitHub StarsUnavailable
ForksUnavailable

Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.

Downloads and pulls

Separate sources, scopes and periods. Never combined or treated as installations, active users or security reviews.

No reviewed package or image identity; download statistics are not listed yet.

Related databases storage MCP Servers

Alternative and complementary servers in the same category

View all in databases storage →
AIStor MCP server
mcp-server-aistor•minio

This is a Model Context Protocol (MCP) server for interacting with AIStor object stores.

Repository stats unavailable
Databases & Storage
InfluxDB v2 MCP Server
influxdb-mcp-server•idoru

A Model Context Protocol (MCP) server that exposes access to an InfluxDB v2 instance using the InfluxDB OSS API v2.

Repository stats unavailable
Databases & Storage