Microsoft SQL Server
An easy-to-use bridge that lets AI assistants like Claude and Cursor IDE directly query and explore Microsoft SQL Server databases. No coding experience required!
What is Microsoft SQL Server?
Microsoft SQL Server is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to easy-to-use bridge that lets ai assistants like claude and cursor ide directly query and explore microsoft sql server databases. no coding experience required!
An easy-to-use bridge that lets AI assistants like Claude and Cursor IDE directly query and explore Microsoft SQL Server databases. No coding experience required!
This server falls under the Databases category on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- An easy-to-use bridge that lets AI assistants like Claude an
Use Cases
Maintainer
Works with
Installation
Manual Installation
npx microsoft-sql-server-mcp-server-mssqlConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use Microsoft SQL Server
The Microsoft SQL Server MCP Server (mssql-mcp-server) bridges AI assistants like Claude and Cursor IDE with Microsoft SQL Server databases, allowing natural language database exploration and querying without writing SQL manually. It exposes tools to discover tables, inspect column schemas, execute read-only SELECT queries safely, search tables by name pattern, and paginate through large result sets. Database analysts, backend developers, and non-technical users who need to interrogate SQL Server data through an AI assistant are the primary audience.
Prerequisites
- Node.js 16 or higher and npm installed
- A running Microsoft SQL Server instance (local, remote, or Azure SQL Database)
- Valid SQL Server credentials (username and password) with at least read access to the target database
- An MCP-compatible client such as Claude Desktop or Cursor IDE
- Git to clone the repository (no published npm package)
Clone the repository and install dependencies
Clone the mssql-mcp-server repository and install its Node.js dependencies.
git clone https://github.com/dperussina/mssql-mcp-server.git
cd mssql-mcp-server
npm installConfigure database credentials in .env
Copy the example environment file and fill in your SQL Server connection details. DB_SERVER, DB_USER, DB_PASSWORD, and DB_DATABASE are required. PORT defaults to 3333 if not set.
cp .env.example .env
# Edit .env with your values:
# DB_SERVER=your-server-name-or-ip
# DB_USER=your-sql-username
# DB_PASSWORD=your-sql-password
# DB_DATABASE=your-database-name
# PORT=3333
# TRANSPORT=stdioTest the server starts correctly
Run the server in stdio mode to confirm it connects to your SQL Server instance without errors before wiring it into your MCP client.
npm startAdd the server to your MCP client config
Add the mssql-mcp-server to your claude_desktop_config.json. The server reads all config from environment variables, so pass them in the env block.
{
"mcpServers": {
"mssql": {
"command": "node",
"args": ["/absolute/path/to/mssql-mcp-server/src/index.js"],
"env": {
"DB_SERVER": "your-server.database.windows.net",
"DB_USER": "sqladmin",
"DB_PASSWORD": "your-password",
"DB_DATABASE": "SalesDB",
"TRANSPORT": "stdio"
}
}
}
}Restart your MCP client and explore your database
Restart Claude Desktop. The server exposes tools for database discovery, table inspection, query execution, pattern-based table search, and paginated result retrieval. Start by asking Claude to show you the available tables.
Microsoft SQL Server Examples
Client configuration
Claude Desktop config connecting to an Azure SQL Database in stdio mode.
{
"mcpServers": {
"mssql": {
"command": "node",
"args": ["/Users/you/mssql-mcp-server/src/index.js"],
"env": {
"DB_SERVER": "myserver.database.windows.net",
"DB_USER": "sqladmin",
"DB_PASSWORD": "MySecurePass123!",
"DB_DATABASE": "SalesDB",
"TRANSPORT": "stdio",
"DEBUG": "false"
}
}
}
}Prompts to try
Example natural language prompts for exploring and querying your SQL Server database.
- "Explore my database structure and show me all available tables"
- "Show me the columns and data types of the Orders table"
- "Query the Customers table and return the first 10 records"
- "Find all tables whose names contain the word 'sales'"
- "Find all orders from the past month with a value exceeding $1000"Troubleshooting Microsoft SQL Server
Connection errors: 'Failed to connect to SQL Server' or timeout on startup
Verify DB_SERVER, DB_USER, DB_PASSWORD, and DB_DATABASE are all correct in your .env or MCP env block. For Azure SQL, ensure your client IP is allowed in the Azure SQL firewall rules. Enable DEBUG=true to see detailed connection logs.
Server only supports SELECT queries but user wants to insert or update data
This server is intentionally read-only for safety. It executes only SELECT statements. For write operations you would need to modify the server code or use a different tool.
Large query results are truncated or the response is cut off
Use the pagination tools: mcp_SQL_mcp_get_query_results with a UUID from a previous query, or add FETCH NEXT N ROWS ONLY / OFFSET to your SQL. The QUERY_RESULTS_PATH env var sets where large results are saved as JSON files.
Frequently Asked Questions about Microsoft SQL Server
What is Microsoft SQL Server?
Microsoft SQL Server is a Model Context Protocol (MCP) server that easy-to-use bridge that lets ai assistants like claude and cursor ide directly query and explore microsoft sql server databases. no coding experience required! It connects AI assistants to external tools and data sources through a standardized interface.
How do I install Microsoft SQL Server?
Follow the installation instructions on the Microsoft SQL Server GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.
Which AI clients work with Microsoft SQL Server?
Microsoft SQL Server works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is Microsoft SQL Server free to use?
Yes, Microsoft SQL Server is open source and available under the GPL 3.0 license. You can use it freely in both personal and commercial projects.
Microsoft SQL Server Alternatives — Similar Databases Servers
Looking for alternatives to Microsoft 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 Microsoft 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 Microsoft 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.