SQL Server
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
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
Maintainer
Works with
Installation
NPM
npx -y mssql-mcp-serverManual Installation
npx -y mssql-mcp-serverConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
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
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
}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"
}
}
}
}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 configureTest 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.
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.
SQL Server Alternatives — Similar Databases Servers
Looking for alternatives to SQL Server? Here are other popular databases servers you can use with Claude, Cursor, and VS Code.
Excelize
★ 20.6kGo language library for reading and writing Microsoft Excel™ (XLAM / XLSM / XLSX / XLTM / XLTX) spreadsheets
MCP Toolbox for Databases
★ 15.3kOpen source MCP server specializing in easy, fast, and secure tools for Databases.
DBHub
★ 2.8kA universal database gateway MCP server that enables AI assistants to connect to and query multiple databases (PostgreSQL, MySQL, MariaDB, SQL Server, SQLite) with support for schema exploration, SQL execution, and secure connections via SSH tunnels.
Tabularis
★ 2.1kA lightweight, cross-platform database client for developers. Supports MySQL, PostgreSQL and SQLite. Hackable with plugins. Built for speed, security, and aesthetics.
Postgres AI Guide
★ 1.7kMCP server and Claude plugin for Postgres skills and documentation. Helps AI coding tools generate better PostgreSQL code.
Anyquery
★ 1.7k🏎️ 🏠 ☁️ - Query more than 40 apps with one binary using SQL. It can also connect to your PostgreSQL, MySQL, or SQLite compatible database. Local-first and private by design.
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.
Set Up SQL Server in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
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.