mcp-sql-server
by shaharwiener
Overview
A secure Model Context Protocol (MCP) server for Microsoft SQL Server, providing safe, read-only database access with comprehensive protection layers, SQL script review, schema discovery, and execution plan analysis.
Installation
docker exec -i mcp-sql-server python server.pyEnvironment Variables
- MCP_CONFIG_PATH
- MCP_Environment
- MCP_TRANSPORT
- PORT
- HOST
- DB_SERVER_INT
- DB_DATABASE_INT
- DB_USERNAME_INT
- DB_PASSWORD_INT
- DB_SERVER_STG
- DB_DATABASE_STG
- DB_USERNAME_STG
- DB_PASSWORD_STG
- DB_SERVER_PRD
- DB_DATABASE_PRD
- DB_USERNAME_PRD
- DB_PASSWORD_PRD
Security Notes
The server implements robust multi-layer security, including AST validation to enforce read-only queries (blocking INSERT, UPDATE, DELETE, DDL, and multi-statement batches), query cost checking, concurrency throttling, result set size limits, and configurable SQL Server query hints (MAXDOP, MAX_GRANT_PERCENT, NOLOCK, query timeout). It also blocks linked servers. However, the provided `docker-compose.yml` file hardcodes the `sa` password ('McpSql2025!Secure') for the SQL Server, which is a critical security vulnerability for production deployments. Although intended for development/testing, this poses a risk if not properly managed for other environments.
Similar Servers
dbhub
A database gateway that exposes SQL data sources via a RESTful API and the Model Context Protocol (MCP), enabling structured interaction with multiple database types.
teradata-mcp-server
A comprehensive Model Context Protocol (MCP) server for Teradata, exposing a rich suite of database administration, data quality, security, SQL optimization, vector store, plotting, backup/restore, feature store, and LLM chat/RAG capabilities as MCP tools for client applications like AI agents.
mcp_ohmy_sql-project
A Model Context Protocol (MCP) server that connects AI assistants to various SQL databases, providing intelligent query optimization, schema introspection, and secure, token-efficient data interaction.
mysql-mcp-server
Acts as a read-only MySQL server proxy that exposes database introspection and query execution tools to AI clients via the Model Context Protocol (MCP) or a REST API.