MS SQL Server MCP Server v3.0.0
🚀 Model Context Protocol (MCP) server for Microsoft SQL Server - compatible with Claude Desktop, Cursor, Windsurf and VS Code.
Power your agent
คำสั่งของผู้เผยแพร่เอง ไม่ใช่เอนด์พอยต์ของ PlugMCP
Host a copy with our keys and logs.
npx -y [email protected]Claude Code ไม่มีลิงก์ติดตั้งสำหรับคำสั่งแบบโลคัล ให้คัดลอกคำสั่งด้านล่างแล้วรันในเทอร์มินัล
claude mcp add mssql-mcp -- npx -y mssql-mcp@3.0.0รันในเทอร์มินัล
{ "mcpServers": { "mssql-mcp": { "command": "npx", "args": [ "-y", "[email protected]" ] } }}claude_desktop_config.json
URL แบบรีโมตหรือคำสั่งบนเครื่องของคุณ? การติดตั้งสองแบบต่างกันอย่างไร
รันบน PlugMCP
A new server you create. It is not this listing's official endpoint. Use the publisher install when you want their URL and their credentials.
เปิด@modelcontextprotocol/server / @modelcontextprotocol/client / @modelcontextprotocol/node v2 (2.0.0), targeting the 2026-07-28 MCP specnpm install -g mssql-mcp
Claude Desktop (claude_desktop_config.json):
{
"mcpServers": {
"mssql": {
"command": "npx",
"args": ["-y", "mssql-mcp@latest"],
"env": {
"DB_SERVER": "your-server.com",
"DB_DATABASE": "your-database",
"DB_USER": "your-username",
"DB_PASSWORD": "your-password",
"DB_ENCRYPT": "true",
"DB_TRUST_SERVER_CERTIFICATE": "true"
}
}
}
}
Cursor/Windsurf/VS Code (.vscode/mcp.json):
{
"servers": {
"mssql": {
"command": "npx",
"args": ["-y", "mssql-mcp@latest"],
"env": {
"DB_SERVER": "your-server.com",
"DB_DATABASE": "your-database",
"DB_USER": "your-username",
"DB_PASSWORD": "your-password",
"DB_ENCRYPT": "true",
"DB_TRUST_SERVER_CERTIFICATE": "true"
}
}
}
}
HTTP transport (remote/hosted scenarios):
{
"servers": {
"mssql": {
"type": "http",
"url": "http://127.0.0.1:3001",
"env": {}
}
}
}
Replace with your actual database credentials. Credentials are read from the server environment only — never passed as tool parameters.
All data tools accept a response_format parameter ("json" | "markdown", default "json"). Use "markdown" to get human-readable table output.
These are the only alias tool names the server actually registers (in src/tools/*.ts).
They behave the same as their replacement but are not documented in new integrations —
use the primary tool names above instead.
# stdio (default)
node dist/src/index.js
# HTTP on 127.0.0.1:3001
MCP_TRANSPORT=http node dist/src/index.js
# Custom HTTP host/port
MCP_TRANSPORT=http MCP_HOST=0.0.0.0 MCP_PORT=8080 node dist/src/index.js
@paramName — never embedded in query strings.Origin and Host headers against an allowlist (localhost, [::1], and the configured bind host by default), guarding against DNS rebinding.run_sql_query and execute_stored_procedure are explicitly labeled as non-read-only and open-world.run_sql_query accepts arbitrary SQL including DDL and DML. To minimize risk:
sysadmin or sa accountAll list tools return a pagination object:
{
"count": 20,
"limit": 20,
"offset": 0,
"has_more": true,
"next_offset": 20,
"total_count": 150
}
Default page size: 20 rows. Maximum: 200 rows.
Results are also truncated if the serialized payload exceeds 100KB, with a truncation_message explaining how many rows were dropped.
src/
index.ts ← bootstrap (env, transport selection)
server.ts ← createServer() factory
constants.ts ← limits, defaults, protocol strings
config.ts ← env parsing
types.ts ← shared TypeScript interfaces
db/
connection.ts ← connection pool singleton
validators.ts ← SQL identifier validation
query-builders.ts ← safe parameterized query construction
tools/ ← one file per tool group
resources/ ← MCP resource handlers
transports/ ← stdio and HTTP transports
utils/
errors.ts ← error normalization helpers
format.ts ← JSON formatting, payload truncation
markdown.ts ← markdown table/list rendering helpers
pagination.ts ← pagination metadata helpers
npx @modelcontextprotocol/inspector
Expected:
mssql_connection_status returns JSON without a connectionmssql_connect_database works when env variables are setnpm install
cp .env.example .env # fill in your test DB credentials
npm run typecheck # type check only
npm run build # compile TypeScript
npm test # run unit tests
npm run ci # typecheck + build + test
MIT © BYMCS
MCP Server for MS SQL Server integration with Claude Desktop, Cursor, Windsurf and VS Code
{ "mcpServers": { "mssql-mcp": { "command": "npx", "args": [ "-y", "[email protected]" ] } }}เครื่องมือ
ยังไม่มีรายการเครื่องมือ เซิร์ฟเวอร์แบบรีโมตจะได้รายการหลังการตรวจสอบสถานะครั้งแรก
FAQ
คัดลอกคอนฟิก stdio สำหรับ Cursor, Claude Desktop, Claude Code หรือ VS Code ได้ในหน้านี้ คอนฟิกนี้ใช้การติดตั้งของผู้เผยแพร่ ไม่ใช่พร็อกซีของ PlugMCP
ระเบียนนี้ไม่ได้ระบุตัวแปรสภาพแวดล้อมที่จำเป็น
Mssql ทำงานแบบโลคัลผ่าน stdio
ตรวจสอบล่าสุดเมื่อ 2026-11-16 MCP Server for MS SQL Server integration with Claude Desktop, Cursor, Windsurf and VS Code