MCP-SqlServer

by RodrigoPAml

16 104 downloads Not rated yet MIT
GitHub

About

A MCP Server implementation in C# for LLM integration with SQL Server tested with Claude Desktop

Details

License
MIT

Explore

- HealthCheck tool to test SQL Server connectivity.
- GetSchema tool to list tables, schemas, columns, and types.
- Query tool to execute SQL queries and return JSON results.
- Logs server activity to mcp_server.log.
- Caution: the LLM can modify your database.
- Written in C# for .NET.

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name MCP-SqlServer
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

1. Fill the _env.database_ with the connection string from your SQL Server
2. Compile the project
3. In the Claude Destkop Go _File->Configurations->Developer_ and edit the MCP configuration (_claude_desktop_config.json_)
4. Paste the json as:

{
    "mcpServers": {
        "database": {
            "command": "dotnet",
            "args": [
                "run",
                "--project",
                "C:\\Users\\{USER}\\Desktop\\MCP-SqlServer",
                "--no-build"
            ]
        }
    }
}
5. Restart Claude Desktop

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.

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "mcp-sqlserver": {
            "database": {
                "command": "dotnet",
                "args": [
                    "run",
                    "--project",
                    "C:\\Users\\{USER}\\Desktop\\MCP-SqlServer",
                    "--no-build"
                ]
            }
        }
    }
}

McpServers

{
    "database": {
        "command": "dotnet",
        "args": [
            "run",
            "--project",
            "C:\\Users\\{USER}\\Desktop\\MCP-SqlServer",
            "--no-build"
        ]
    }
}

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

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.