SQL Server

v1.2.2Databasesstable

Production-grade MCP server for SQL Server access. Built with Node.js, TypeScript, Express, and the official MCP SDK. Supports SSE and Streamable HTTP transports. Includes Zod-based query validation, connection pooling, and ready-to-use configs for A

csharpdotnetmcpmcp-servermssql
Share:
146
Stars
0
Downloads
0
Weekly
0/5

What is SQL Server?

SQL Server is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to production-grade mcp server for sql server access. built with node.js, typescript, express, and the official mcp sdk. supports sse and streamable http transports. includes zod-based query validation, ...

Production-grade MCP server for SQL Server access. Built with Node.js, TypeScript, Express, and the official MCP SDK. Supports SSE and Streamable HTTP transports. Includes Zod-based query validation, connection pooling, and ready-to-use configs for A

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

Features

  • insert_data
  • delete_data
  • read_data
  • describe_table
  • update_data

Use Cases

Execute SQL queries on SQL Server databases
Inspect database schemas and tables
Perform production-grade database operations
dhipskind253

Maintainer

LicenseMIT License
Languagec#
Versionv1.2.2
UpdatedMay 19, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

NPM

npx -y mssql-mcp-server

Manual Installation

npx -y mssql-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 SQL Server

The mssql-mcp server is a production-grade, read-only MCP server for Microsoft SQL Server that retrieves database credentials securely from AWS Secrets Manager at runtime instead of storing them in configuration files. Built with Node.js and TypeScript, it supports schema discovery, data sampling, and SELECT query execution while enforcing strict read-only access through lexical query validation. It is designed for AI agents and developers who need secure, auditable access to SQL Server databases without exposing credentials in plaintext config files.

Prerequisites

  • Node.js 18+ installed
  • An AWS account with Secrets Manager configured, containing SQL Server connection details
  • AWS credentials available in the environment (via IAM role, AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY, or AWS CLI profile)
  • A Microsoft SQL Server instance accessible from your machine
  • An MCP-compatible client such as Claude Desktop
1

Store SQL Server credentials in AWS Secrets Manager

Create a secret in AWS Secrets Manager containing your SQL Server connection details as JSON. The secret must include host, port, database, username, and password fields.

{
  "host": "your-sql-server.database.windows.net",
  "port": 1433,
  "database": "your_database",
  "username": "your_username",
  "password": "your_password",
  "encrypt": true
}
2

Configure your MCP client

Add the mssql-mcp server to your Claude Desktop configuration. Set AWS_ACCOUNT_ID, SECRET_NAME, and AWS_REGION to point to your Secrets Manager secret.

{
  "mcpServers": {
    "mssql": {
      "command": "npx",
      "args": ["-y", "mssql-mcp-server"],
      "env": {
        "AWS_ACCOUNT_ID": "123456789012",
        "SECRET_NAME": "prod/myapp/sqlserver",
        "AWS_REGION": "us-east-1",
        "TRUST_SERVER_CERTIFICATE": "false"
      }
    }
  }
}
3

Ensure AWS credentials are available

The server uses the AWS SDK to access Secrets Manager. Ensure your environment has valid AWS credentials — either via an IAM role (on EC2/ECS), environment variables, or an AWS CLI profile.

# Option 1: Environment variables
export AWS_ACCESS_KEY_ID=your_key
export AWS_SECRET_ACCESS_KEY=your_secret
export AWS_DEFAULT_REGION=us-east-1

# Option 2: AWS CLI profile
aws configure
4

Test the connection by listing schemas

Once configured, ask your AI assistant to list database schemas. This verifies that credentials are being fetched from Secrets Manager and the SQL Server connection is working.

5

Explore tables and run queries

Use tools like list_tables, describe_table, sample_rows (up to 100 rows), and run_select (capped at 1000 rows) to explore your database through natural language.

SQL Server Examples

Client configuration

Claude Desktop configuration for mssql-mcp using AWS Secrets Manager for credential retrieval.

{
  "mcpServers": {
    "mssql": {
      "command": "npx",
      "args": ["-y", "mssql-mcp-server"],
      "env": {
        "AWS_ACCOUNT_ID": "123456789012",
        "SECRET_NAME": "prod/myapp/sqlserver",
        "AWS_REGION": "us-east-1",
        "TRUST_SERVER_CERTIFICATE": "false"
      }
    }
  }
}

Prompts to try

Example queries to explore your SQL Server database through the AI assistant.

- "List all schemas in the database"
- "Show me the tables in the dbo schema"
- "Describe the structure of the Orders table"
- "Sample 10 rows from the Customers table"
- "Run a query to find all orders placed in the last 30 days"

Troubleshooting SQL Server

Access denied when fetching secret from AWS Secrets Manager

Ensure the IAM user or role has secretsmanager:GetSecretValue permission on the specific secret ARN. Check that AWS_ACCOUNT_ID, SECRET_NAME, and AWS_REGION all match the secret's actual location.

SQL Server connection timeout or refused

Verify the host and port in your Secrets Manager secret are correct and reachable from your machine. For Azure SQL or SQL Server with TLS, set encrypt to true in the secret JSON. If using a self-signed certificate, set TRUST_SERVER_CERTIFICATE to 'true'.

Write operations (INSERT/UPDATE/DELETE) are rejected

This server is read-only by design. It uses lexical validation to block any non-SELECT statements. If you need write access, you will need a different MCP server or direct database access.

Frequently Asked Questions about SQL Server

What is SQL Server?

SQL Server is a Model Context Protocol (MCP) server that production-grade mcp server for sql server access. built with node.js, typescript, express, and the official mcp sdk. supports sse and streamable http transports. includes zod-based query validation, connection pooling, and ready-to-use configs for a It connects AI assistants to external tools and data sources through a standardized interface.

How do I install SQL Server?

Install via npm with the command: npx -y mssql-mcp-server. Then add the server configuration to your AI client's JSON config file (e.g., claude_desktop_config.json or .cursor/mcp.json).

Which AI clients work with SQL Server?

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

Is SQL Server free to use?

Yes, 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": { "mssql": { "command": "npx", "args": ["-y", "mssql-mcp-server"] } } }

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

Read the full setup guide →

Ready to use 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