MCP server for Microsoft SQL Server - schema discovery, profiling, and safe data operations
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
We haven't yet run this listing's install command through our automated sandbox check. This isn't a red flag β we're steadily working through the catalog.
π‘ Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
Inspect callable tools, capabilities, and parameters exposed to AI agents by Mssql.
SEARCH_SCHEMA_DEFAULT_LIMITCallable MCP tool function
search_schemaCallable MCP tool function
tableOffsetCallable MCP tool function
columnOffsetCallable MCP tool function
PROFILE_SAMPLE_SIZE_DEFAULTCallable MCP tool function
PROFILE_SAMPLE_RETURN_LIMITCallable MCP tool function
Enterprise-grade Model Context Protocol server for Microsoft SQL Server.
A production-ready MCP server built for real-world database work: exploring unfamiliar schemas, profiling data shape, validating pipelines in UAT, and moving confidently to production. If you work with SQL Server and want AI tooling that understands enterprise database workflows, this is for you.
| Package | npm | Tools | Use Case |
|---|---|---|---|
| mssql-mcp-reader | @connorbritain/mssql-mcp-reader | 14 read-only | Analysts, auditors, safe exploration |
| mssql-mcp-writer | @connorbritain/mssql-mcp-writer | 17 (reader + data ops) | Data engineers, ETL developers |
| mssql-mcp-server (this) | @connorbritain/mssql-mcp-server | 20 (all tools) | DBAs, full admin access |
Choose the tier that matches your security requirements. All tiers share the same governance controls, audit logging, and multi-environment support.
Most SQL + AI demos stop at "generate a query." That's table stakes. Real database work means:
This server is built around those realities. It's stable, secure by default, and designed to make AI assistants genuinely useful on enterprise SQL Server instances.
search_schema finds tables/columns via wildcards with fuzzy matching and paginated results so large databases donβt blow up your context window.profile_table summarizes column shape (null %, cardinality, min/max/avg/median/p90) and can return a capped sample of rows.inspect_relationships enumerates inbound/outbound FKs with column mappings, so you can follow dependencies before touching data.read_data, describe_table, list_table, plus write tools (insert_data, update_data, delete_data, create_table, create_index, drop_table) when you need full agent-mode workflows.update_data and delete_data show affected rows before execution; require explicit confirmation to proceed.Discovery & Schema:
search_schema β Wildcard/fuzzy search across tables and columns with pagination.describe_table β Column definitions, types, nullability, keys.list_table β List all tables in a database with optional filtering.list_databases β List databases on server-level environments.list_environments β Show configured environments and their policies.Profiling & Analysis:
profile_table β Column stats (null %, cardinality, min/max/avg/median/p90) with optional sample rows.inspect_relationships β FK mappings in both directions.inspect_dependencies β Full dependency analysis (views, procs, functions, triggers referencing an object).explain_query β Execution plan analysis via SHOWPLAN.Data Operations:
read_data β Safe SELECT with automatic row limits.insert_data β Parameterized inserts (single or batch).update_data β Preview affected rows, require confirmation.delete_data β Preview affected rows, require confirmation.DDL Operations:
create_table β Create tables with column definitions.create_index β Create indexes on existing tables.drop_table β Drop tables (requires confirmation).Named Scripts:
list_scripts β Show available pre-approved SQL scripts.run_script β Execute named scripts with parameters and governance controls.scripts.json + .sql files by setting SCRIPTS_PATH (env var) or "scriptsPath" inside your environment entry. list_scripts/run_script remain disabled until this location is configured.Operations:
test_connection β Verify connectivity and latency.validate_environment_config β Check environment configuration for errors.Youβll need a current Node.js runtime (minimum 18, recommended 20 LTS). The tooling now shims legacy APIs so it also works on the newest Node releases, but installing an LTS build avoids surprises on fresh machines.
| Platform | Command (installs Node 20 LTS) |
|---|---|
| Windows | winget install --id OpenJS.NodeJS.LTS -e |
| macOS | brew install node@20 && brew link --overwrite --force node@20 |
| Ubuntu/Debian | curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash - && sudo apt-get install -y nodejs |
Verify with node -v (should show v20.x). If you already have a newer Node version installed, the server will still run thanks to the built-in SlowBuffer shim.
Then configure your MCP client:
Then point your MCP client to src/node/dist/index.js with your connection env vars.
| Variable | Required | Description |
|---|---|---|
SERVER_NAME | SQL Server hostname or IP (e.g., localhost, 127.0.0.1, myserver.database.windows.net) | |
DATABASE_NAME | Target database name | |
SQL_AUTH_MODE | Authentication mode: sql, windows, or aad (default: aad) | |
SQL_USERNAME | Username for SQL or Windows auth | |
SQL_PASSWORD | Password for SQL or Windows auth | |
SQL_DOMAIN | Domain for Windows/NTLM auth (optional) | |
SQL_PORT | Custom port (default: 1433). Useful for named instances or Docker containers on non-standard ports. | |
TRUST_SERVER_CERTIFICATE | Set to true for self-signed certificates or dev environments | |
CONNECTION_TIMEOUT | Connection timeout in seconds (default: 30) | |
READONLY | Set to true to restrict to read-only tools (no INSERT, UPDATE, DELETE, DROP) | |
MAX_ROWS_DEFAULT | Auto-limit for SELECT queries without TOP/LIMIT (default: 1000, range: 1-100000) | |
REQUIRE_MUTATION_CONFIRMATION | Set to false to skip preview/confirm for mutations (default: true) | |
ENVIRONMENTS_CONFIG_PATH | Path to JSON file defining multiple named database environments | |
SCRIPTS_PATH | Path to named SQL scripts directory (must contain scripts.json) | |
AUDIT_LOG_PATH | Path for audit log file (default: logs/audit.jsonl) | |
AUDIT_LOGGING | Set to false to disable audit logging (default: true) | |
AUDIT_REDACT_SENSITIVE | Set to false to disable redaction of sensitive args (default: true) | |
PROFILE_SAMPLE_SIZE_DEFAULT | Default sample size for profile_table (defaults to 50, max 1000) | |
PROFILE_SAMPLE_RETURN_LIMIT | Max number of sample rows returned in responses (defaults to 10, max 100) | |
SEARCH_SCHEMA_DEFAULT_LIMIT | Default row limit per section for search_schema pagination (defaults to 50, max 200) |
SQL Server Authentication (SQL_AUTH_MODE=sql)
Standard username/password auth against SQL Server. Works with local instances, Docker containers, and Azure SQL with SQL auth enabled.
Windows Authentication (SQL_AUTH_MODE=windows)
NTLM-based auth using domain credentials. Ideal for on-prem SQL Server in Active Directory environments.
The server auto-parses DOMAIN\username format β you can provide the domain either as a separate SQL_DOMAIN field or embedded in SQL_USERNAME (e.g., CORP\svc_account). If both are present, the explicit SQL_DOMAIN takes precedence and the prefix is stripped from the username.
Azure AD Authentication (SQL_AUTH_MODE=aad or omit)
Interactive browser-based Azure AD authentication. Opens a browser window on first connection to authenticate. Best for Azure SQL Database with AAD-only auth.
Factual signals from GitHub, npm, and our automated checks β not a rating.
No reviews yet β be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/mssql)<a href="https://allmcps.com/mcp/mssql"><img src="https://allmcps.com/api/badge/mssql?style=directory" alt="Mssql on AllMCPs" /></a>