mcp-mssqlserver
The mcp-mssqlserver server enables interaction with Microsoft SQL Server databases through the following tools:
Execute SQL Queries (
execute_query): Run any SQL statement includingSELECT,INSERT,UPDATE, andDELETE, returning recordsets or affected row counts.List Databases (
list_databases): Enumerate all available databases on the connected SQL Server instance.List Tables (
list_tables): Discover all tables in the current database, with an optional filter by schema name.Describe Table (
describe_table): Inspect a table's structure, including column names, data types, nullability, default values, and primary key markers.Get Table Indexes (
get_table_indexes): Retrieve index information for a table, including index type, uniqueness, primary key status, and indexed columns.Get Foreign Keys (
get_foreign_keys): List all foreign key constraints on a table along with their referenced tables and columns.
Provides a remote MCP endpoint for n8n's MCP Client Tool node to interact with SQL Server databases.
Click on "Install 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., "@mcp-mssqlserverlist all tables in the 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.
mcp-mssqlserver
Production-oriented MCP server for Microsoft SQL Server, exposing database operations to MCP clients (Claude Desktop, VS Code Copilot, Cursor, and compatible hosts).
Features
Query execution (
SELECT,INSERT,UPDATE,DELETE)Database discovery and schema introspection
Table metadata inspection (columns, types, nullability, defaults, PK)
Index and foreign key discovery
Environment-driven configuration for secure deployment
Related MCP server: sql-mcp-server
Available Tools
Tool | Description |
| Executes a SQL statement and returns recordsets or affected rows |
| Lists tables from |
| Returns table column metadata and primary key markers |
| Lists all SQL Server databases |
| Lists table indexes, type, uniqueness, PK, and indexed columns |
| Lists table foreign keys and referenced targets |
Requirements
Node.js 18+
Access to a Microsoft SQL Server instance
Network connectivity from MCP host to SQL Server (
host:port)
Configuration
Set connection settings using environment variables:
Variable | Required | Default | Description |
| No |
| SQL Server host or IP |
| No |
| SQL Server TCP port |
| Yes | — | Default database |
| No |
| Authentication mode: |
| Yes* | — | SQL login user (required only in |
| Yes* | — | SQL login password (required only in |
| No |
| Enables encrypted connection |
| No |
| Trusts server certificate when encryption is enabled |
* Required when MSSQL_AUTH_MODE=sql.
| MCP_TRANSPORT | No | stdio | Transport mode: stdio (default, for npx/Claude Desktop/VS Code) or http (Streamable HTTP, for Docker/remote clients such as n8n) |
| MCP_HTTP_PORT | No | 3001 | Port for the HTTP server (only used when MCP_TRANSPORT=http) |
| MCP_HTTP_HOST | No | 0.0.0.0 | Bind address for the HTTP server (only used when MCP_TRANSPORT=http) |
Note: the published Docker image always runs in
httpmode and does not build themsnodesqlv8native driver (used only forMSSQL_AUTH_MODE=windows). Windows Authentication is only available when running the server directly on a Windows host vianpx/npm start.
Usage
Run directly from GitHub
npx github:ferronicardoso/mcp-mssqlserverClaude Desktop configuration
%APPDATA%\\Claude\\claude_desktop_config.json:
{
"mcpServers": {
"mssqlserver": {
"command": "npx",
"args": ["github:ferronicardoso/mcp-mssqlserver"],
"env": {
"MSSQL_HOST": "localhost",
"MSSQL_PORT": "1433",
"MSSQL_DATABASE": "master",
"MSSQL_AUTH_MODE": "sql",
"MSSQL_USER": "sa",
"MSSQL_PASSWORD": "your-password"
}
}
}
}VS Code MCP configuration
.vscode/mcp.json:
{
"servers": {
"mssqlserver": {
"command": "npx",
"args": ["github:ferronicardoso/mcp-mssqlserver"],
"env": {
"MSSQL_HOST": "localhost",
"MSSQL_PORT": "1433",
"MSSQL_DATABASE": "master",
"MSSQL_AUTH_MODE": "sql",
"MSSQL_USER": "sa",
"MSSQL_PASSWORD": "your-password"
}
}
}
}Run with Docker (HTTP transport)
The published image runs in Streamable HTTP mode by default, for use as a remote MCP endpoint (e.g. from n8n's MCP Client Tool node or any Streamable HTTP-compatible client):
docker run -d --name mcp-mssqlserver \
-p 3001:3001 \
-e MSSQL_HOST=host.docker.internal \
-e MSSQL_PORT=1433 \
-e MSSQL_DATABASE=master \
-e MSSQL_AUTH_MODE=sql \
-e MSSQL_USER=sa \
-e MSSQL_PASSWORD=your-password \
ghcr.io/ferronicardoso/mcp-mssqlserver:latestThe MCP endpoint is then available at http://localhost:3001/mcp.
Local Development
git clone https://github.com/ferronicardoso/mcp-mssqlserver
cd mcp-mssqlserver
npm install
npm run buildStart the compiled server:
npm startBuild and Commit Workflow
This repository intentionally tracks dist/ to support npx github:user/repo usage.
The project uses a Husky pre-commit hook to:
build TypeScript (
npm run build)stage generated artifacts (
git add dist)
Manual fallback:
npm run build
git add distSecurity Notes
Never commit real credentials or
.envfiles.Prefer least-privilege SQL users for production use.
For public or untrusted networks, enable encryption (
MSSQL_ENCRYPT=true) and configure certificates appropriately.
Windows Authentication (Integrated Security)
To use Windows Authentication with Integrated Security (process account), configure:
MSSQL_AUTH_MODE=windows
MSSQL_HOST=sqlserver.company.local
MSSQL_PORT=1433
MSSQL_DATABASE=masterMaintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/ferronicardoso/mcp-mssqlserver'
If you have feedback or need assistance with the MCP directory API, please join our Discord server