mssql-mcp
An MCP (Model Context Protocol) server for Microsoft SQL Server databases. Enables AI assistants like Claude to interact with SQL Server through a standardized protocol.
Features
Query Execution: Run SELECT queries with safety limits
Schema Discovery: List tables, views, and column information
CRUD Operations: Read, insert, update, and delete rows
Stored Procedures: Execute stored procedures with parameters
Export: Export query results to JSON or CSV
Safety Controls: Command blocklist, read-only mode, row limits, query timeouts
Installation
Or install from source:
Configuration
Copy .env.sample to .env and configure your settings:
Required environment variables:
Variable | Description |
| SQL Server hostname |
| Database username |
| Database password |
| Database name |
Optional settings:
Variable | Default | Description |
|
| Server port |
|
| Block write operations |
|
| Query row limit |
|
| Query timeout (seconds) |
Usage
With Claude Code
Add to your Claude Code MCP configuration:
Standalone
Available Tools
Tool | Description |
| Run a SELECT query |
| Check if a query is safe to execute |
| List tables and views |
| Get column information for a table |
| Read rows by ID or filter |
| Insert a new row |
| Update an existing row |
| Delete a row |
| Execute a stored procedure |
| Export query results to JSON |
| Export query results to CSV |
Development
License
Apache-2.0