MS SQL Server MCP Server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MS SQL Server MCP Server List all tables in the Sales database."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MS SQL Server MCP Server
Model Context Protocol (MCP) Server for MS SQL Server designed to connect seamlessly to database instances located locally or remotely (e.g. inside Remote Desktop Connection, VPN, or remote cloud servers).
🚀 Features
🔌 Universal Connectivity: Connect to local instances (
localhost,127.0.0.1,.\SQLEXPRESS) or remote servers via IP, Domain, or Custom Port.🛡️ Remote & SSL Support: Full support for
trustServerCertificate: trueto seamlessly connect across VPNs and remote hosts with self-signed SSL certificates.🧰 Comprehensive MCP Tools:
mssql_test_connection: Test connection and get server metadata (SQL Server version, host, database name).mssql_list_databases: List all available databases on the instance.mssql_list_tables: List tables & views in a database or schema.mssql_describe_table: Detailed table schema inspection (columns, data types, nullability, primary keys).mssql_execute_query: Run custom T-SQL queries (SELECT,INSERT,UPDATE,DELETE,EXEC).
Related MCP server: mcp-server-mssql
📋 Remote Desktop / Remote Server Prerequisites
If your MS SQL Server is located inside a Remote Desktop Connection / Remote Host, make sure:
TCP/IP Protocol Enabled: Open SQL Server Configuration Manager on the remote machine -> SQL Server Network Configuration -> Protocols for MSSQLSERVER -> Enable TCP/IP.
Inbound Firewall Rule: Allow TCP Port
1433in Windows Firewall on the remote machine.SQL Server Authentication (Mixed Mode): Ensure SQL Server Authentication is enabled and an active user account (e.g.
saor a dedicated DB user) is configured.
🛠️ Installation & Building
# 1. Install dependencies
npm install
# 2. Build TypeScript project
npm run build⚙️ Configuration (.env)
Edit .env or set environment variables:
MSSQL_SERVER=192.168.1.100 # Localhost or Remote IP/Hostname
MSSQL_PORT=1433
MSSQL_DATABASE=master
MSSQL_USER=sa
MSSQL_PASSWORD=YourPassword123
MSSQL_ENCRYPT=true
MSSQL_TRUST_SERVER_CERTIFICATE=true🔌 Integrating with AI Clients (Claude Desktop, Cursor, Antigravity, VS Code)
Add this configuration to your client's MCP configuration file (e.g. claude_desktop_config.json or mcp_config.json):
{
"mcpServers": {
"mssql": {
"command": "node",
"args": [
"c:/Users/muhammad.alg_ext/Documents/mssql-mcp/dist/index.js"
],
"env": {
"MSSQL_SERVER": "192.168.1.100",
"MSSQL_PORT": "1433",
"MSSQL_DATABASE": "your_database_name",
"MSSQL_USER": "sa",
"MSSQL_PASSWORD": "YourPassword123",
"MSSQL_TRUST_SERVER_CERTIFICATE": "true"
}
}
}
}🛠️ MCP Tools Overview
Tool Name | Parameters | Description |
|
| Tests connection & returns SQL Server version & info |
|
| Lists all online databases |
|
| Lists tables and views in a database |
|
| Returns full table column schemas & PKs |
|
| Executes T-SQL queries & returns result sets |
📄 License
MIT
mssql-mcp
Available Tools
5 toolsmssql_describe_tableA
Get table metadata including columns, data types, nullability, max length, and primary keys.
Inputs: table_name (required), schema, database.
mssql_execute_queryA
Execute a T-SQL query (SELECT, INSERT, UPDATE, DELETE, EXEC) on the MS SQL database.
Inputs: query (required), database.
mssql_list_databasesC
List all online databases on the MS SQL Server.
Inputs: server, database.
mssql_list_tablesB
List all tables and views in a specified MS SQL database.
Inputs: schema, database.
mssql_test_connectionB
Test connection to MS SQL Server and retrieve server version and metadata.
Inputs: port, user, server, database, +1 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
Each tool has a clearly distinct purpose: testing connectivity, listing databases, listing tables/views, describing schema, and executing arbitrary queries. There is no meaningful overlap between the metadata exploration tools and the general query execution tool.
All tools follow the same mssql_<verb>_<noun> pattern using snake_case. The names are predictable and make the action and target of each tool immediately clear.
Five tools is a well-scoped size for a database-focused MCP server. Each tool covers a distinct aspect of SQL Server interaction without unnecessary duplication or bloat.
The toolset covers the core database workflow: connection verification, database discovery, table discovery, schema inspection, and arbitrary query execution. The execute_query tool effectively fills gaps for any DML, DDL, or EXEC operations not explicitly wrapped.
Maintenance
Related MCP Connectors
Explore, query, and inspect SQLite databases with ease. List tables, preview results, and view det…
SQL validation, formatting, parsing, metadata extraction, linting, and security analysis.
Explore your Messages SQLite database to browse tables and inspect schemas with ease. Run flexible…
Run SOQL queries to explore and retrieve Salesforce data. Inspect records, fields, and relationshi…
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables interaction with Microsoft SQL Server databases through T-SQL query execution, table exploration, and schema inspection. Supports configurable write protection and row limiting for safe database operations.1,551 npmMIT
- AlicenseNot gradedqualityDmaintenanceProvides tools to connect, query, and manage Microsoft SQL Server databases through the MCP protocol, including support for stored procedures, transactions, and schema inspection.54 PyPIMIT
- AlicenseBqualityCmaintenanceEnables AI assistants to connect to Microsoft SQL Server for schema discovery, querying, stored procedures, DDL, performance diagnostics, and developer utilities with configurable security modes.3540 npmMIT
- AlicenseNot gradedqualityBmaintenanceEnables interaction with Microsoft SQL Server by executing queries, statements, and stored procedures, as well as retrieving schema metadata through the Model Context Protocol.10 npmMIT