MsSqlMCP
@jdlemes
About MsSqlMCP
MCP to query SQL Server database schema, such as tables, columns, and relationships
Config
No standard config provided
This server doesn't expose a parseable MCP config block in its README. See the repository for install instructions.
RepositoryTools
5Get all table names in the database
Get columns (fields) for a specific table
Get foreign key relationships between tables
Get stored procedure definition
Execute a read-only SELECT query
Overview
What is MsSqlMCP?
MsSqlMCP is an MCP Server for SQL Server database schema inspection and read-only query execution. It provides safe, validated SELECT-only SQL access and schema discovery for use with MCP clients like VS Code Copilot and Claude Desktop.
How to use MsSqlMCP?
Configure the SQL Server connection string in appsettings.json, then run dotnet run for console mode. For HTTP transport, use dotnet run -- --http-only. The server supports both stdio and HTTP/SSE protocols for integration with MCP clients.
Key features of MsSqlMCP
- Read-only access: blocks all data modification statements.
- Schema discovery: tables, columns, relationships, stored procedures.
- Safe SQL execution: only SELECT queries allowed.
- Dual transport: stdio and HTTP/SSE protocols.
- Windows Service support for production deployments.
- Compatible with VS Code Copilot and Claude Desktop.
Use cases of MsSqlMCP
- Inspect database schema from AI-powered code editors.
- Execute read-only queries safely through chat interfaces.
- Integrate SQL Server data with MCP-compatible automation tools.
- Deploy as a Windows Service for enterprise database monitoring.
FAQ from MsSqlMCP
What SQL statements are blocked?
The ExecuteSql tool only allows SELECT queries. Blocked statements include INSERT, UPDATE, DELETE, MERGE, TRUNCATE, CREATE, ALTER, DROP, GRANT, REVOKE, DENY, EXEC, EXECUTE, SP_EXECUTESQL, XP_, BACKUP, RESTORE, BULK, OPENROWSET, OPENQUERY, and OPENDATASOURCE.
Can I run MsSqlMCP as a Windows Service?
Yes. Publish the application with dotnet publish -c Release -r win-x64 --self-contained true, then create the service using sc.exe create MsSqlMCP and manage it with net start/stop.
What are the prerequisites?
.NET 10 (or .NET 9 with minor adjustments) and SQL Server. For development, the project runs in console mode; for production, it can be published as a self-contained Windows Service.
Which MCP clients are supported?
MsSqlMCP works with any MCP client, including VS Code Copilot and Claude Desktop. Configuration examples for both stdio and HTTP transport are provided.
How do I troubleshoot startup issues?
Check logs in C:\Services\MsSqlMCP\logs\ (if run as a service), verify the connection string in appsettings.json, ensure SQL Server is accessible from the service account, and test by running MsSqlMCP.exe --http-only manually to see errors.
Frequently asked questions
What SQL statements are blocked?
The `ExecuteSql` tool only allows SELECT queries. Blocked statements include INSERT, UPDATE, DELETE, MERGE, TRUNCATE, CREATE, ALTER, DROP, GRANT, REVOKE, DENY, EXEC, EXECUTE, SP_EXECUTESQL, XP_, BACKUP, RESTORE, BULK, OPENROWSET, OPENQUERY, and OPENDATASOURCE.
Can I run MsSqlMCP as a Windows Service?
Yes. Publish the application with `dotnet publish -c Release -r win-x64 --self-contained true`, then create the service using `sc.exe create MsSqlMCP` and manage it with `net start/stop`.
What are the prerequisites?
.NET 10 (or .NET 9 with minor adjustments) and SQL Server. For development, the project runs in console mode; for production, it can be published as a self-contained Windows Service.
Which MCP clients are supported?
MsSqlMCP works with any MCP client, including VS Code Copilot and Claude Desktop. Configuration examples for both stdio and HTTP transport are provided.
How do I troubleshoot startup issues?
Check logs in `C:\Services\MsSqlMCP\logs\` (if run as a service), verify the connection string in `appsettings.json`, ensure SQL Server is accessible from the service account, and test by running `MsSqlMCP.exe --http-only` manually to see errors.
Basic information
More Databases MCP servers
Database Gateway
centralmindUniversal MCP-Server for your Databases optimized for LLMs and AI-Agents.
Postgres Mcp
crystaldbaPostgres MCP Pro provides configurable read/write access and performance analysis for you and your AI agents.
Elasticsearch MCP Server
elastic
nuzur
nuzur is a model-first database platform for MySQL and PostgreSQL. The MCP server lets any AI assistant or agent (Claude, Cursor, Gemini, or anything else that speaks MCP) design your schema, query your data, generate mi
Dbhub
bytebaseZero-dependency, token-efficient database MCP server for Postgres, MySQL, SQL Server, MariaDB, SQLite.
Comments