MCP-SqlServer
by RodrigoPAml
MCP-SqlServer is a C# implementation of an MCP Server (STDIO) for integrating LLMs with SQL Server, specifically tested with Claude Desktop. It provides tools for LLMs to interact with and query a SQL Server database.
View on GitHub
Last updated: N/A
MCP-SqlServer
A MCP Server (STDIO) implementation in C# for LLM integration with SQL Server tested with Claude Desktop
The server register logs into a mcp_server.log file
Caution, the LLM can modify your database
Tools
List of tools provided to the LLM
- HealthCheck: Tests if the Microsoft SQL Server Database connection is good and alive.
- GetSchema: Get a list of all tables with their respective schema, columns and types.
- Query: Execute a query into the Microsoft SQL Server database and return the result as a JSON.
Setup with Claude
- Fill the env.database with the connection string from your SQL Server
- Compile the project
- In the Claude Destkop Go File->Configurations->Developer and edit the MCP configuration (claude_desktop_config.json)
- Paste the json as:
{
"mcpServers": {
"database": {
"command": "dotnet",
"args": [
"run",
"--project",
"C:\\Users\\{USER}\\Desktop\\MCP-SqlServer",
"--no-build"
]
}
}
}
- Restart Claude Desktop
Testing
Open Claude Desktop and if everything is configured well you should be able to see this
image
Click on the icon and you should be able to see the tools
image
Asking for connection check
image
Asking for schema/table informations
image
Asking for read query
image
Asking for modifications
image