mcpField
M
MS SQL Server MCP Server

MS SQL Server MCP Server

Local
github.com/TerraCo89Databases1Updated 16w ago

About MS SQL Server MCP Server

An MCP server for LLM agents that need structured access to Microsoft SQL Server. It combines typed schema inspection with parameterized, logged CRUD operations.

Key features

  1. 01List tables and inspect typed schemas
  2. 02Read rows with filters and limits
  3. 03Create, update, and delete records
  4. 04Validate identifiers against live schema
  5. 05Parameterized queries and structured logs

Use cases

  1. 01Inspect a database before querying it
  2. 02Find rows matching specified filters
  3. 03Insert or modify business records
  4. 04Give agents bounded database access

MCP support

Exposes six database tools to MCP clients: table listing, schema inspection, row reading, and record creation, update, and deletion.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

No install method listed yet

We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.

Repository

Tools

No tool list yet

Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.

Details

From the project README

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

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.