mssql
Enterprise MCP server for SQL Server with 20 tools for schema discovery, data operations, and administration.
claude mcp add --transport stdio connorbritain-mssql-mcp-server npx @connorbritain/mssql-mcp-server@latest \ --env READONLY="true" \ --env SERVER_NAME="localhost" \ --env DATABASE_NAME="mydb"
How to use
This MSSQL MCP Server provides enterprise-grade, MCP-native tooling for exploring and managing SQL Server databases with AI-assisted workflows. It exposes a suite of tools for semantic schema discovery, profiling and analyzing data shapes, mapping relationships, and performing safe data operations under governance controls. Tools like search_schema help you locate relevant tables and columns using wildcards and fuzzy matching, describe_table and list_table summarize schema details, and inspect_relationships reveals inbound/outbound foreign key mappings. For data operations, you can read_data with automatic row limits, and perform mutations via insert_data, update_data, and delete_data with preview and confirmation steps to prevent unintended changes. The server supports multi-environment configurations (prod, staging, dev) and audit logging for traceability, making it suitable for regulated environments and UAT testing. It is MCP-native, so it works with MCP clients such as Windsurf, Claude Desktop, or any MCP-compatible client to drive AI-assisted database workflows.
To use it, configure an MCP client to point at the server and environment variables for your SQL Server connection. Typical workflows include discovering schemas, profiling tables to understand data shape, mapping dependencies, and then running data operations under governance controls. You’ll typically start by connecting to a SQL Server instance, selecting the target environment, and then issuing tools like search_schema, describe_table, and profile_table to build context before issuing broader operations like read_data or mutation commands with appropriate confirmations.
How to install
Prerequisites:
- Node.js (minimum 18, recommended 20 LTS) installed on your system.
- Basic Node/npm familiarity to install and run MCP servers.
Option A: Install from npm (recommended)
- Install the MCP server globally:
npm install -g @connorbritain/mssql-mcp-server@latest
- Configure your MCP client to point to this server (example):
{
"mcpServers": {
"mssql": {
"command": "npx",
"args": ["@connorbritain/mssql-mcp-server@latest"],
"env": { "SERVER_NAME": "localhost", "DATABASE_NAME": "mydb", "READONLY": "true" }
}
}
}
Option B: Build from source
- Clone the repository and install dependencies:
git clone https://github.com/ConnorBritain/mssql-mcp-server.git
cd mssql-mcp-server/src/node
npm install
- Build the project (if a build step is provided in the project):
npm run build
- Point your MCP client to the built server entry (e.g., dist/index.js) and provide connection env vars as needed.
Prerequisites recap: ensure Node.js is available (v18+), npm is installed, and you have network access to install packages from npm.
Additional notes
Environment variables to tune behavior:
- SERVER_NAME: SQL Server host name or IP
- DATABASE_NAME: Target database
- SQL_AUTH_MODE: sql, windows, or aad (default: aad)
- SQL_USERNAME / SQL_PASSWORD: credentials for SQL or Windows auth
- SQL_PORT: custom port (default 1433)
- TRUST_SERVER_CERTIFICATE: set to true for self-signed certs
- CONNECTION_TIMEOUT: seconds to wait before timeout (default 30)
- READONLY: true to restrict to read-only tools (no INSERT/UPDATE/DELETE/DROP)
- MAX_ROWS_DEFAULT: default row limit for reads (default 1000)
- REQUIRE_MUTATION_CONFIRMATION: set to false to skip preview/confirm for mutations (default true)
- SCRIPTS_PATH: path to named SQL scripts (with scripts.json)
- AUDIT_LOG_PATH: path to store audit logs in JSON Lines format
Common issues:
- Node version incompatibilities: ensure you’re using a supported Node.js version (v18+). If issues arise, try upgrading Node or using the recommended LTS version.
- Environment configuration: double-check that SERVER_NAME, DATABASE_NAME, and authentication settings are correct for your SQL Server instance.
- Network/Firewall: ensure the server can reach the SQL Server host on the correct port (default 1433).
- Scripts path and governance: if using list_scripts/run_script, ensure SCRIPTS_PATH points to a valid folder containing scripts.json and SQL files.
Related MCP Servers
mcp-telegram
MCP Server for Telegram
Remote
A type-safe solution to remote MCP communication, enabling effortless integration for centralized management of Model Context.
mongodb-lens
🍃🔎 MongoDB Lens: Full Featured MCP Server for MongoDB Databases
openapi
OpenAPI definitions, converters and LLM function calling schema composer.
boilerplate
TypeScript Model Context Protocol (MCP) server boilerplate providing IP lookup tools/resources. Includes CLI support and extensible structure for connecting AI systems (LLMs) to external data sources like ip-api.com. Ideal template for creating new MCP integrations via Node.js.
the-academy
A Socratic dialogue engine for AI agents.