MCP server for Microsoft SQL Server

MCP server for Microsoft SQL Server

mcp-server-mssql•byterraco89

A Model Context Protocol server that gives LLM agents structured access to Microsoft SQL Server, offering schema inspection and row-level CRUD tools with parameterized, logged operations.

License: MIT•Runtime: Awaiting documentation review•Category: databases storage

WHAT IT DOES

  • •Exposes six tools: list_tables, get_table_schema, read_table_rows, create_table_records, update_table_records, and delete_table_records.
  • •All queries are parameterized, and table and column names are validated against the live schema before any statement runs.
  • •Connects to a single database via environment-variable configuration and does only what the configured SQL login is permitted to do.
  • •Read rows with optional column selection, WHERE filters, ORDER BY, and LIMIT.

BEST FOR

  • •LLM agents that need to inspect schema and perform row-level CRUD against a Microsoft SQL Server database.
  • •Answering natural-language questions about business data by discovering tables, inspecting schema, and reading filtered rows.

ABOUT MCP-SERVER-MSSQL

MCP server for Microsoft SQL Server is cataloged as an MCP server attributed to terraco89. A Model Context Protocol server that gives LLM agents structured access to Microsoft SQL Server, offering schema inspection and row-level CRUD tools with parameterized, logged operations. It is categorized under databases storage. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.

HOW TO INSTALL

Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.

LICENSE

Catalog license label: MIT. Check the source repository's current license and terms before using, modifying or distributing this software.

能力检查器

能力定义尚未审核。未核验的采集内容不会作为可信接口展示。

Tools (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Resources (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Prompts (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

NEWSLETTER - COMING LATER

Newsletter subscriptions are not open yet

Email delivery is not connected. This page does not collect email addresses or create subscriptions.

Browse the registry for current listings instead.

Community Reviews

Coming later

Reviews for MCP server for Microsoft SQL Server are not available yet

Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.

FREQUENTLY ASKED QUESTIONS

How many databases can one server instance connect to?

A single database per server instance, configured via environment variables.

Does the server prevent identifier-based SQL injection?

Yes; all queries are parameterized and table and column names are validated against the live schema before any statement runs, so an agent cannot inject through identifiers.

上游原版 README

在 GitHub 查看同一版本原文

README.md · 9c46d19faf9d · 采集于 2026-11-13 11:03:15 UTC

保留上游原文,不做 AI 改写。为安全起见过滤脚本、表单和不安全链接。

当前显示最后一次成功采集的文档快照,请以来源页面为准。

mcp-server-mssql

License: MIT TypeScript MCP

A Model Context Protocol server that gives LLM agents safe, structured access to Microsoft SQL Server: schema inspection plus row-level CRUD, every operation parameterized and logged.

Built because agents working against real business databases need more than "run this SQL string" — they need typed tools with predictable failure modes.

How it works

flowchart LR
    A[MCP client<br/>Claude Desktop / Claude Code] -- stdio --> B[mcp-server-mssql]
    B --> C[connection pool<br/>mssql driver]
    C --> D[(SQL Server)]
    B -. structured logs .-> E[logs/]

The server connects to a single database configured via environment variables and exposes six tools. All queries are parameterized — table and column names are validated against the live schema before any statement runs, so an agent cannot inject through identifiers.

Tools

ToolWhat it does
list_tablesList all user tables in the configured database
get_table_schemaColumn names, types, nullability, and defaults for a table
read_table_rowsRead rows with optional column selection, WHERE filters, ORDER BY, and LIMIT
create_table_recordsInsert one or more rows (column/value validated against schema)
update_table_recordsUpdate rows matching a filter; returns affected count
delete_table_recordsDelete rows matching a filter; returns affected count

Example interaction

User: "Which customers signed up this month?"

Agent calls list_tables → finds Customers → calls get_table_schema {"table_name": "Customers"} → sees CreatedAt datetime2 → calls read_table_rows {"table_name": "Customers", "filters": {"CreatedAt": {">=": "2026-07-01"}}, "limit": 50} → answers with the rows.

Setup

Requires Node.js 18+ and network access to a SQL Server instance.

git clone https://github.com/TerraCo89/mcp-server-mssql.git
cd mcp-server-mssql
npm install
cp .env.example .env   # fill in connection details
npm run build

Configuration (environment variables)

VariableRequiredNotes
MSSQL_HOST / MSSQL_PORTyes / noPort defaults to 1433
MSSQL_USER / MSSQL_PASSWORDyesSQL auth credentials
MSSQL_DATABASEyesSingle database per server instance
MSSQL_ENCRYPT, MSSQL_TRUST_SERVER_CERTIFICATEnoTLS options
LOG_LEVELnoinfo by default

Use with Claude Desktop / Claude Code

{
  "mcpServers": {
    "mssql": {
      "command": "node",
      "args": ["/path/to/mcp-server-mssql/dist/server.js"],
      "env": {
        "MSSQL_HOST": "localhost",
        "MSSQL_USER": "agent_reader",
        "MSSQL_PASSWORD": "...",
        "MSSQL_DATABASE": "MyDb"
      }
    }
  }
}

Tip: point it at a least-privilege SQL login — the server can only do what the login can.

Development

npm run dev    # ts-node with live reload
npm test       # jest test suite (src/*.test.ts, tests/)
npm run build  # emit dist/

Docker: docker build -t mcp-server-mssql . then run with the same environment variables.

License

MIT

Install configuration

Are you the maintainer?

Claim this server with your GitHub account to request manual ownership verification.

README Embed Badge
Markdown

Link to the catalog listing for MCP server for Microsoft SQL Server from your README. This badge does not certify ownership, compatibility or security.

[![MCP catalog listing](https://img.shields.io/badge/MCP-awesome--mcp-orange?style=flat-square)](https://awesome-mcp.com/servers/mcp-server-mssql)

REPOSITORY STATS

GitHub StarsUnavailable
ForksUnavailable

Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.

下载与拉取统计

来源、范围和时段分别列出;不相加,不代表安装人数、活跃用户或安全审核。

尚无已审核的包 / 镜像标识,暂不展示下载统计。

Related databases storage MCP Servers

Alternative and complementary servers in the same category

View all in databases storage →
AIStor MCP server
mcp-server-aistor•minio

This is a Model Context Protocol (MCP) server for interacting with AIStor object stores.

Repository stats unavailable
Databases & Storage
InfluxDB v2 MCP Server
influxdb-mcp-server•idoru

A Model Context Protocol (MCP) server that exposes access to an InfluxDB v2 instance using the InfluxDB OSS API v2.

Repository stats unavailable
Databases & Storage