SQL Server MCP
This server enables interaction with a Microsoft SQL Server database, providing capabilities for database introspection, query execution, and transaction management.
Get tables: List all tables in the database
Get a specific table: Retrieve details of a table by name
Get stored procedures: List all stored procedures in the database
Get a specific stored procedure: Retrieve details of a stored procedure by name
Query the database: Execute SQL queries against the database
Start a transaction: Initiate a new database transaction
Commit a transaction: Commit an existing transaction by ID
Rollback a transaction: Rollback an existing transaction by ID
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., "@SQL Server MCPshow me the top 10 customers by total order amount"
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.
mcp-node-mssql
Usage
Cursor
See the official Cursor docs for more information.
Open (or create) the
mcp.jsonfile (it should be in~/.cursor/mcp.jsonor<project-root>/.cursor/mcp.json, but see Cursor docs for more details).Add the following details and save the file:
{
"mcpServers": {
"mssql": {
"command": "npx",
"args": [
"-y",
"mcp-node-mssql"
],
"env": {
"DB_HOST": "localhost",
"DB_PORT": "1433",
"DB_USERNAME": "<username>",
"DB_PASSWORD": "<password>",
"DB_DATABASE": "<database>",
"CONNECTION_TIMEOUT": 600000,
"REQUEST_TIMEOUT": 300000
"DB_ENCRYPT": "false",
"DB_ENABLE_ARITH_ABORT": "false",
"DB_TRUST_SERVER_CERTIFICATE": "false",
"TRUSTED_CONNECTION": "false"
}
}
}
}Windsurf
See the official Windsurf docs for more information.
Open the
Windsurf MCP Configuration PanelClick
Add custom server.Add the following details and save the file:
{
"mcpServers": {
"mssql": {
"command": "npx",
"args": [
"-y",
"mcp-node-mssql"
],
"env": {
"DB_HOST": "localhost",
"DB_PORT": "1433",
"DB_USERNAME": "<username>",
"DB_PASSWORD": "<password>",
"DB_DATABASE": "<database>",
"CONNECTION_TIMEOUT": 600000,
"REQUEST_TIMEOUT": 300000
"DB_ENCRYPT": "false",
"DB_ENABLE_ARITH_ABORT": "false",
"DB_TRUST_SERVER_CERTIFICATE": "false",
"TRUSTED_CONNECTION": "false"
}
}
}
}Claude Code
See the official Claude Code docs for more information.
You can add a new MCP server from the Claude Code CLI. But modifying the json file directly is simpler!
Open the Claude Code configuration file (it should be in
~/.claude.json).Find the
projects>mcpServerssection and add the following details and save the file:
{
"projects": {
"mcpServers": {
"mssql": {
"command": "npx",
"args": [
"-y",
"mcp-node-mssql"
],
"env": {
"DB_HOST": "localhost",
"DB_PORT": "1433",
"DB_USERNAME": "<username>",
"DB_PASSWORD": "<password>",
"DB_DATABASE": "<database>",
"CONNECTION_TIMEOUT": 600000,
"REQUEST_TIMEOUT": 300000
"DB_ENCRYPT": "false",
"DB_ENABLE_ARITH_ABORT": "false",
"DB_TRUST_SERVER_CERTIFICATE": "false",
"TRUSTED_CONNECTION": "false"
}
}
}
}
}Related MCP server: Microsoft SQL Server MCP Server
Issues and Troubleshooting
Before doing anything else, please make sure you are running the latest version!
If you run into problems using this MCP server, please open an issue on GitHub!
Development
Installation
npm installBuild
npm run buildRunning the Development Server Locally
To test your local development version of the MCP server rather than using the published package, follow these steps:
Build the project:
npm run buildCreate or modify your
mcp.jsonfile to reference your local build:
{
"mcpServers": {
"mssql": {
"command": "node",
"args": [
"/path/to/your/local/mcp-node-mssql/dist/index.js"
],
"env": {
"DB_HOST": "localhost",
"DB_PORT": "1433",
"DB_USERNAME": "<username>",
"DB_PASSWORD": "<password>",
"DB_DATABASE": "<database>",
"CONNECTION_TIMEOUT": 600000,
"REQUEST_TIMEOUT": 300000
"DB_ENCRYPT": "false",
"DB_ENABLE_ARITH_ABORT": "false",
"DB_TRUST_SERVER_CERTIFICATE": "false",
"TRUSTED_CONNECTION": "false"
}
}
}
}Place this
mcp.jsonfile in one of the following locations:For Cursor: In your home directory (
~/.cursor/mcp.json) or in your project directory (.cursor/mcp.json)For Windsurf: Use the MCP Configuration Panel to add the custom server
Restart your AI assistant (Cursor or Windsurf) to load the new configuration.
This allows you to instantly test changes to the MCP server without having to publish a new version.
Available Tools
8 toolscommit-transactionC
Commit a transaction
| Name | Required | Description | Default |
|---|---|---|---|
| transactionId | Yes | The ID of the transaction to commit. |
get-stored-procedureC
Get a specific stored procedure by name
| Name | Required | Description | Default |
|---|---|---|---|
| procedureName | Yes | The name of the stored procedure to retrieve |
get-stored-proceduresB
Get a list of all stored procedures in the database
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
get-tableC
Get a specific table by name
| Name | Required | Description | Default |
|---|---|---|---|
| tableName | Yes | The name of the table to retrieve |
get-tablesB
Get a list of all tables in the database
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
queryC
Query the database with a SQL statement
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | The SQL query to execute |
rollback-transactionC
Rollback a transaction
| Name | Required | Description | Default |
|---|---|---|---|
| transactionId | Yes | The ID of the transaction to rollback. |
start-transactionC
Start a new transaction
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
8 tool updates
v1.0.0- First observed
commit-transaction - First observed
get-stored-procedure - First observed
get-stored-procedures - First observed
get-table - First observed
get-tables - First observed
query - First observed
rollback-transaction - First observed
start-transaction
TDQS
Scored across 8 tools
Every tool has a clearly distinct purpose with no ambiguity. Tools are clearly separated by resource type (tables vs stored procedures) and action type (get specific vs get list vs transaction operations vs query). The query tool stands alone as a general-purpose operation.
All tools follow a consistent verb-noun pattern with hyphens. Transaction tools use verb-transaction pattern (start-transaction, commit-transaction, rollback-transaction), get operations use get-noun pattern (get-table, get-tables), and query stands alone as a clear single verb. The naming is perfectly predictable throughout.
8 tools is well-scoped for a database server. Each tool earns its place with clear responsibilities: 4 for data/metadata retrieval, 3 for transaction management, and 1 for general querying. This provides comprehensive coverage without bloat.
The toolset covers core database operations well with querying, transaction management, and metadata retrieval. Minor gaps exist in write operations beyond transactions (no explicit insert/update/delete tools) and schema modification (no create/alter/drop tools), but the query tool provides a workaround for most of these operations.
Maintenance
Related MCP Connectors
Hosted SQL Server MCP server for Claude, ChatGPT and Cursor, with each action switched per account.
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
A Model Context Protocol server for Wix AI tools
Text-to-SQL MCP server: read-only queries on PostgreSQL, MySQL and SQL Server with your real schema
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceA Model Context Protocol server that enables secure and structured interaction with Microsoft SQL Server databases, allowing AI assistants to list tables, read data, and execute SQL queries with controlled access.60MIT
- AlicenseBqualityBmaintenanceA Model Context Protocol server that enables secure interaction with Microsoft SQL Server databases, allowing AI assistants to list tables, read data, and execute SQL queries through a controlled interface.1402MIT
- FlicenseNot gradedqualityCmaintenanceA Model Context Protocol server that allows Large Language Models like Claude to execute SQL queries, explore database schemas, and maintain persistent connections to SQL Server databases.-
- AlicenseAqualityCmaintenanceA Model Context Protocol server that enables LLMs like Claude to interact with Microsoft SQL Server databases through natural language, supporting queries, data manipulation, and table management.82,530 npmMIT