Skip to content
MCP server
Registry

SqlServerMcp MCP Server

MCP server for SQL Server: schema inspection, safe read-only queries, query plan analysis

SqlServerMcp scores 66 (Good), licensed MIT and written in C#. It installs as a local process. It declares 7 tools. Filed under Databases. GitHub shows 0 stars. Install configs are generated for 12 clients. Being listed in the registry is not the same as being vendor-official.

by nithish1206MITC#0 stars
Trust score
66Good
Trust score 66 of 100, Good

Good trust

66 of 100 from six public signals. Nobody can buy a point.

  • Listed in the official MCP registry.
  • OSI-style license: mit.
How we score trust
Scorecard

License, quality and maintenance

How grades work
Trust breakdown

Where the 66 comes from

22 + 20 + 0 + 10 + 4 + 10 = 66. Each factor is capped, so no single signal can carry a listing.

Registry22 / 30

Active in the official MCP registry, plus a known vendor namespace.

Registry: 22 of 30 points.
Maintenance20 / 20

How recently the repository saw a commit or release.

Maintenance: 20 of 20 points.
Popularity0 / 20

GitHub stars and weekly downloads, on a log scale.

Popularity: 0 of 20 points.
License10 / 10

A clear, OSI-style open-source license.

License: 10 of 10 points.
Security4 / 10

Not archived, a secure install path, a pinned version.

Security: 4 of 10 points.
Docs10 / 10

A real summary, a README with depth, listed tools.

Docs: 10 of 10 points.

Install

Pick your client, copy the config, paste it in.

Needs Cursor or VS Code installed on this device. The button opens the app and asks you to confirm before it adds the server.

~/Library/Application Support/Claude/claude_desktop_config.json
{  "mcpServers": {    "nithish1206-sqlservermcp-nuget": {      "command": "dnx",      "args": [        "SqlServerMcp"      ],      "env": {        "ConnectionStrings__MyDb": "",        "Query__DefaultTop": "",        "Query__MaxTop": ""      }    }  }}

Environment variables

NameRequiredNotes
ConnectionStrings__MyDbOptional—
Query__DefaultTopOptional—
Query__MaxTopOptional—

Tools7Tool docs quality grade C

All capabilities
  • Describe columns of a specific table (schema.table format)

  • Explain a SELECT query using estimated execution plan

  • Return full database schema: tables, columns, PKs, FKs

  • List available database names configured in this server

  • List all user tables in a database

  • Execute a safe read-only SELECT query with auto row-limiting

  • Search tables and columns by keyword

About

SqlServerMcp

Sqlservermcp MCP server

A Model Context Protocol (MCP) server for SQL Server. Exposes schema inspection, safe read-only queries, and query plan analysis as MCP tools.

How it works: This server does not accept natural-language questions. Instead, the connected AI tool (the MCP client) decides and generates the SQL query based on the user's intent and the schema it inspects via the tools below. The server only executes the SQL the AI produces, under the safety rules described in Safety.

Install

dotnet tool install -g SqlServerMcp

Configure

Configuration is done entirely through environment variables in your MCP client config. No need to edit any files — just add your connection strings and query settings directly in the env block.

Add the following to your MCP client configuration (e.g. Claude Desktop claude_desktop_config.json):

{
  "mcpServers": {
    "sqlserver": {
      "command": "sqlservermcp",
      "env": {
        "ConnectionStrings__MyDb": "Server=localhost;Database=MyDatabase;Trusted_Connection=True;TrustServerCertificate=True;",
        "Query__DefaultTop": "1000",
        "Query__MaxTop": "500000"
      }
    }
  }
}

Environment Variable Format

VariableDescription
ConnectionStrings__<name>SQL Server connection string. Add multiple with different names.
Query__DefaultTopDefault row limit for queries (default: 1000)
Query__MaxTopMaximum allowed row limit (default: 500000)

Note: Use double underscores (__) as the separator — this is the .NET configuration convention for environment variables.

Multiple Databases

You can configure multiple databases by adding multiple connection string variables:

{
  "env": {
    "ConnectionStrings__Production": "Server=prod-server;Database=ProdDb;...",
    "ConnectionStrings__Staging": "Server=staging-server;Database=StagingDb;..."
  }
}

Then use the ListDatabases tool to see available names, and pass the database name to any query tool.

Available Tools

ToolDescription
ListDatabasesList available database names configured in this server
ListTablesList all user tables in a database
DescribeTableDescribe columns of a specific table (schema.table format)
GetDatabaseSchemaReturn full database schema: tables, columns, PKs, FKs
SearchSchemaSearch tables and columns by keyword
RunQueryExecute a safe read-only SELECT query with auto row-limiting
ExplainQueryExplain a SELECT query using estimated execution plan

Example

Prompt:

"Using the MyDb database, show me the top 5 customers by total order amount in 2025."

The AI generates and executes the query by calling SearchSchema / DescribeTable to discover the tables, then passing this SQL to RunQuery:

SELECT TOP 5 c.CustomerId, c.Name, SUM(o.TotalAmount) AS TotalSpent
FROM dbo.Customers c
JOIN dbo.Orders o ON o.CustomerId = c.CustomerId
WHERE YEAR(o.OrderDate) = 2025
GROUP BY c.CustomerId, c.Name
ORDER BY TotalSpent DESC;

Expected output:

CustomerIdNameTotalSpent
1042Acme Corp184500.00
778Globex Ltd162300.50
2310Initech149875.25
915Soylent Inc138420.00
604Umbrella Co121990.75

Disclaimer: The accuracy of the generated SQL and the final output depends on the AI model you select in your MCP client. More capable models produce more reliable queries; weaker models may misinterpret the schema or the intent of the prompt.

Safety

  • Only SELECT queries are allowed — all write operations are blocked
  • Queries are automatically row-limited to prevent runaway results
  • Connection strings are configured server-side, never exposed to the AI client

License

MIT

Frequently asked questions

What is SqlServerMcp MCP Server?

MCP server for SQL Server: schema inspection, safe read-only queries, query plan analysis

How do I install SqlServerMcp MCP Server in Claude Desktop, Cursor, or VS Code?

Pick your client in the Install section on this page and copy the generated config into the client's config file. Step-by-step guides: Claude Desktop, Cursor, and VS Code. SqlServerMcp MCP Server runs locally from the NuGet package SqlServerMcp with the command dnx SqlServerMcp.

Is SqlServerMcp MCP Server free and open source?

Yes. SqlServerMcp MCP Server is released under the MIT license, an OSI-approved open-source license, so you can use, modify, and self-host it under those terms.

Does SqlServerMcp MCP Server support remote (HTTP) connections?

No remote endpoint is listed for SqlServerMcp MCP Server. It runs locally on your machine over stdio, started by your MCP client.

What tools does SqlServerMcp MCP Server provide?

SqlServerMcp MCP Server provides 7 tools, including DescribeTable, ExplainQuery, GetDatabaseSchema, and ListDatabases. See the full tool list for descriptions and parameters.

How is SqlServerMcp MCP Server's trust score calculated?

SqlServerMcp MCP Server scores 66 out of 100 (Good). The score adds six capped public signals: registry status, maintenance, popularity, license, documentation, and security. Nobody can pay for points. Read the methodology for the full formula.

Reviews

No reviews yet

—Be the first to review

5 star0 reviews at 5 stars
4 star0 reviews at 4 stars
3 star0 reviews at 3 stars
2 star0 reviews at 2 stars
1 star0 reviews at 1 stars

No published reviews yet. Used it? Tell the next person how it went.

Add badge to your README

Paste either snippet into the repository README. The image links to this listing.

Listed on MCPpedia

Top 5 MCP servers

Daily or weekly. Confirm by email, unsubscribe any time.

How often

Manage this listing

Claim this server