# Microsoft SQL Server

Lets your agent read a SQL Server schema, run SELECT-only queries and inspect execution plans. Writes stay off until you turn them on per profile.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed · ★ 9
- Author: alyiox
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/alyiox/mcp-mssql/tree/HEAD/src/alyio.mcpmssql
- Updated: 2026-10-10
- HTML: https://affpapa.org/en/nevibecode/mcp/microsoft-sql-server

## What it does

The server starts read-only. An agent can pull metadata, run a parameterized query and look at how the plan executes. Writing is a separate switch, set through `AllowWrite` on a given profile.

A profile holds one connection: the connection string, row and timeout caps, and whether writes are permitted. `default` always exists; other profiles come from `appsettings.json` or variables shaped like `McpMssql__Profiles__<NAME>__<FIELD>`. One deployment can reach several servers.

You need .NET 8.0 or later and a connection string. Without one the server will not boot — a profile missing `ConnectionString`, even an unconfigured `default`, fails at startup. Caps are enforced: `Query:MaxRows` cannot go past 1000 and `Query:CommandTimeoutSeconds` past 300, so an oversized value gets clamped and logged to stderr. Treat `AllowWrite` as a soft guard rather than a database permission; a `db_datareader` login is what actually blocks writes.

## Requirements
- Environment variables: `MCPMSSQL_CONNECTION_STRING`, `MCPMSSQL_DESCRIPTION`, `MCPMSSQL_QUERY_MAX_ROWS`, `MCPMSSQL_QUERY_COMMAND_TIMEOUT_SECONDS`, `MCPMSSQL_QUERY_SNAPSHOT_MAX_ROWS`, `MCPMSSQL_QUERY_SNAPSHOT_COMMAND_TIMEOUT_SECONDS`, `MCPMSSQL_ANALYZE_COMMAND_TIMEOUT_SECONDS`, `MCPMSSQL_ALLOW_WRITE`, `MCPMSSQL_WRITE_COMMAND_TIMEOUT_SECONDS`, `DOTNET_ENVIRONMENT` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Install**
- The MCP registry has no launch command for it: see the repository README

## When to use it
- inspect tables and relationships without opening SSMS
- run a parameterized SELECT safely
- find out why a slow query drags
- reach several MSSQL servers from one agent setup
- allow writes for a migrations profile only

## Example prompts
- List the tables in the dbo schema with their columns
- Run this against the `warehouse` profile: monthly revenue for last year
- Explain the execution plan and tell me where it slows down

## Similar
- [World Monitor](https://affpapa.org/en/nevibecode/mcp/world-monitor.md) — MCP server · ★ 89408
- [Scrapling MCP Server](https://affpapa.org/en/nevibecode/mcp/scrapling-mcp-server.md) — MCP server · ★ 89433
- [MCP Toolbox for Databases](https://affpapa.org/en/nevibecode/mcp/googleapis-mcp-toolbox-for-databases.md) — MCP server · ★ 16717
- [PostHog MCP Server](https://affpapa.org/en/nevibecode/mcp/posthog-mcp-server.md) — MCP server · ★ 40409
- [dbx](https://affpapa.org/en/nevibecode/mcp/dbx.md) — MCP server · ★ 27669
- [Metabase](https://affpapa.org/en/nevibecode/mcp/metabase.md) — MCP server · ★ 49845

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
