
SqlServerMcp
io.github.Nithish1206由 GitHub 帳號 Nithish1206 發布v1.0.6更新於 Oct 30, 2026
MCP server for SQL Server: schema inspection, safe read-only queries, query plan analysis
概覽
針對 SQL Server 的本機 MCP 伺服器,讓助理檢視結構、執行唯讀 SELECT 查詢並分析查詢計畫。
- 可以做什麼
- 列出已設定的資料庫及其使用者資料表
- 描述資料表欄位,並回傳含主鍵與外鍵的完整結構
- 依關鍵字搜尋資料表與欄位
- 執行具自動列數限制的唯讀 SELECT 查詢
- 以預估執行計畫解釋 SELECT 查詢
- 適用情境
- 適合想讓助理自行撰寫 SQL 來探索 SQL Server 資料庫並回答資料問題,同時不授予寫入權限的情境。適用於已有連線字串、想在桌面 MCP 用戶端進行結構感知查詢的分析人員與開發者。
- 執行需求
- 以本機 .NET 工具形式透過 dotnet tool 指令安裝,使用 stdio 傳輸,僅支援桌面用戶端。需以名為 ConnectionStrings 的環境變數提供 SQL Server 連線字串(每個資料庫一組),並可選用 QueryDefaultTop 與 Query__MaxTop 設定列數上限。需要能連線至 SQL Server 執行個體的網路。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 SqlServerMcp,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
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
來源:README.md,提交 f11f121
工具
0版本歷史
1- v1.0.6最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分