Raw SQL MCP

io.github.KifoPL由 GitHub 帳號 KifoPL 發布v0.1.0更新於 Oct 24, 2026

Execute raw SQL queries against SQL Server, SQLite, PostgreSQL, MySQL, and MariaDB.

已驗證STDIO僅桌面資料庫開發者工具

概覽

AI 產生的概覽

一個本機 STDIO MCP 伺服器,讓助理對你設定的 SQL Server、SQLite、PostgreSQL、MySQL 與 MariaDB 資料庫執行原始 SQL。

可以做什麼
列出為伺服器設定的資料庫名稱,並讀取其結構描述中繼資料,讓助理在查詢前了解資料表與欄位。對選定的已設定資料庫執行原始 SQL 陳述式。執行參數化查詢與回傳單一值的純量查詢。資料庫透過環境變數命名,因此可同時暴露多個連線。
適用情境
適合在開發、除錯或報表情境中,讓助理檢查結構描述並對你自己的資料庫執行臨時 SQL,且你願意在每次執行前審查查詢。
執行需求
以 STDIO 本機程序執行,透過 dnx 從 RawSqlMcp NuGet 套件啟動,因此需要提供 dnx 的 .NET 工具鏈。每個資料庫需要提供者設定(sqlserver、sqlite、postgres、postgresql、mysql 或 mariadb)與連線字串,透過 RawSqlMcpDatabasesDefaultProvider 與 RawSqlMcpDatabasesDefaultConnectionString 等環境變數提供。連線遠端資料庫伺服器需要網路存取。可設定選用的命令逾時。
安裝前請注意
連線字串包含資料庫認證,透過 RawSqlMcpDatabasesDefault__ConnectionString 等環境變數傳入,請勿放入共用設定。README 警告此伺服器不防護破壞性或高成本查詢、SQL 注入、缺少分頁或不安全的資料暴露,並要求在執行前審查與核准查詢。查詢可能寫入、修改或刪除資料,結果也可能把敏感紀錄暴露給助理。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Raw SQL MCP,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

Raw SQL MCP

[CI] [NuGet] [Latest release]

Raw SQL MCP is a STDIO MCP server for executing raw SQL against SQL Server, SQLite, PostgreSQL, MySQL, and MariaDB.

[!IMPORTANT] Use it carefully. The server does not protect you from destructive queries, expensive queries, SQL injection, missing pagination, or unsafe data exposure. Always review and approve queries before running them.

[Install and run demo]

Installation

Run the server with dnx:

bash
dnx RawSqlMcp

For a specific version:

Package: RawSqlMcp on NuGet

Configuration

Databases are configured with environment variables under RawSqlMcp__Databases__.

SQLite:

bash
export RawSqlMcp__Databases__Local__Provider="sqlite"export RawSqlMcp__Databases__Local__ConnectionString="Data Source=/absolute/path/app.db"

PostgreSQL:

bash
export RawSqlMcp__Databases__Reporting__Provider="postgres"export RawSqlMcp__Databases__Reporting__ConnectionString="Host=localhost;Port=5432;Database=reporting;Username=postgres;Password=postgres"

MySQL/MariaDB:

bash
export RawSqlMcp__Databases__Shop__Provider="mysql"export RawSqlMcp__Databases__Shop__ConnectionString="Server=localhost;Port=3306;Database=shop;User ID=mysql;Password=mysql"

SQL Server:

bash
export RawSqlMcp__Databases__Default__Provider="sqlserver"export RawSqlMcp__Databases__Default__ConnectionString="Server=localhost,1433;Database=master;User Id=sa;Password=Your_password123;TrustServerCertificate=True"

Optional command timeout, in seconds:

bash
export RawSqlMcp__CommandTimeout=30

[!INFO] The legacy RawSqlMcp__ConnectionStrings__Default="..." format is obsolete. It still works for compatibility and is interpreted as SQL Server.

Usage

Register the server in an MCP client as a STDIO server:

json
{  "servers": {    "raw-sql-mcp": {      "command": "dnx",      "args": ["RawSqlMcp"],      "env": {        "RawSqlMcp__Databases__Default__Provider": "sqlserver",        "RawSqlMcp__Databases__Default__ConnectionString": "Server=localhost,1433;Database=master;User Id=sa;Password=Your_password123;TrustServerCertificate=True"      }    }  }}

The server exposes tools for listing configured database names, reading schema metadata, and executing raw, parameterized, and scalar SQL queries.

[Short end-to-end demo]

來源:README.md,提交 41328c9

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v0.1.0最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分