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.
Last updated: N/A
What is MCP-SqlServer?
MCP-SqlServer is a server that acts as an intermediary between a Large Language Model (LLM) and a Microsoft SQL Server database. It allows the LLM to execute commands and retrieve information from the database through a defined set of tools.
How to use MCP-SqlServer?
- Configure the connection string in the env.database file.
- Compile the C# project.
- Configure Claude Desktop to use the server by adding the server configuration to the claude_desktop_config.json file, specifying the command to run the compiled project.
- Restart Claude Desktop and interact with the database through the provided tools.
Key features of MCP-SqlServer
HealthCheck: Tests the database connection.
GetSchema: Retrieves table schemas, columns, and types.
Query: Executes SQL queries and returns results as JSON.
STDIO communication
Logging to mcp_server.log
Use cases of MCP-SqlServer
Allowing LLMs to query data from a SQL Server database.
Enabling LLMs to understand the structure of a SQL Server database.
Integrating SQL Server data into LLM-powered applications.
Automating database tasks through LLM commands.
Generating reports and insights from SQL Server data using LLMs.
FAQ from MCP-SqlServer
What is an MCP Server?
What is an MCP Server?
An MCP (Multi-Context Processing) Server facilitates communication between an LLM and external tools or services.
What database versions are supported?
What database versions are supported?
The server is designed for Microsoft SQL Server, but specific version compatibility may vary.
Where are the logs stored?
Where are the logs stored?
Logs are stored in the mcp_server.log file.
Is it safe to allow an LLM to modify my database?
Is it safe to allow an LLM to modify my database?
Caution is advised. The README explicitly warns that the LLM can modify the database. Implement appropriate security measures and access controls.
Can I use this with other LLMs besides Claude?
Can I use this with other LLMs besides Claude?
While tested with Claude Desktop, the server may be adaptable to other LLMs that support similar MCP or tool-calling mechanisms. Further configuration and testing may be required.