
SqlServerMcp
io.github.Nithish1206Published by GitHub account Nithish1206v1.0.6Updated Oct 30, 2026
MCP server for SQL Server: schema inspection, safe read-only queries, query plan analysis
Overview
Local MCP server for SQL Server that lets an assistant inspect schemas, run read-only SELECT queries and explain query plans.
- What you can do
- List configured databases and their user tables
- Describe table columns and return full schema details including primary and foreign keys
- Search tables and columns by keyword
- Run read-only SELECT queries with automatic row limiting
- Explain a SELECT query using its estimated execution plan
- When to use it
- Useful when you want an assistant to explore a SQL Server database and answer data questions by writing its own SQL, without giving it write access. Suits analysts and developers who already have connection strings and want schema-aware querying from a desktop MCP client.
- Requirements
- Runs as a local .NET tool installed via the dotnet tool command, over stdio, on desktop clients only. Needs SQL Server connection strings supplied through environment variables named ConnectionStrings (one per database), plus optional QueryDefaultTop and Query__MaxTop row limits. Network access to the SQL Server instance is required.
Installation
In SourceWeft
- Open SqlServerMcp in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
SqlServerMcp
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
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):
Environment Variable Format
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:
Then use the ListDatabases tool to see available names, and pass the database name to any query tool.
Available Tools
Example
Prompt:
"Using the
MyDbdatabase, 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:
Expected output:
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
SELECTqueries 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
Source: README.md at commit f11f121
Tools
0Version history
1- v1.0.6LatestSep 16, 2026
Score
50% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts