Databridge Kit

io.github.CloudCorpRecords由 GitHub 帳號 CloudCorpRecords 發布v0.1.0更新於 Nov 7, 2026

Execute SQL and inspect tables, views, schemas and more on a configured database.

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

概覽

AI 產生的概覽

本機 MCP 伺服器,可對設定好的 PostgreSQL 資料庫執行 SQL,並檢視資料表、檢視表、結構描述、觸發程序、索引、序列與預存程序。

可以做什麼
  • 對設定的 PostgreSQL 資料庫執行單一 SQL 陳述式,並以 JSON 物件回傳結果列
  • 列出基底資料表、檢視表與結構描述
  • 列出觸發程序、索引、序列與預存程序(常式)
  • 也可當作命令列工具使用,指令相同,結果以 JSON 輸出
適用情境
適合讓助理探索或查詢單一 PostgreSQL 資料庫,例如了解不熟悉的資料庫結構或執行臨時查詢。它是通用橋接工具,也適用於需要助理修改資料的情境。
執行需求
透過 npx 或 Docker 映像以 stdio 在本機執行。需要 PostgreSQL 連線字串,可作為命令列參數傳入,或放在 DATABRIDGE_DATABASE_URL 環境變數中(DATABASE_URL 亦可)。實際查詢需要 PATH 中有 psql 用戶端;缺少 psql 或連線字串時伺服器仍會啟動,但呼叫會回報錯誤。
安裝前請注意
連線字串含有資料庫憑證,會出現在命令列或環境變數中。陳述式類型不受限制,助理既能讀取也能寫入、修改或刪除資料,只應指向允許這類操作的資料庫。每次呼叫只接受一個陳述式,回傳值是 psql 輸出的字串。

安裝

在 SourceWeft 中

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

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

其他 MCP 客戶端

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

README

databridge-kit

databridge-kit is a small bridge between an agent (or a terminal) and one configured PostgreSQL database. It can run a single SQL statement and answer the seven inspection questions that come up constantly while exploring an unfamiliar database: which tables, views, schemas, triggers, indexes, sequences and stored procedures exist.

The toolset mirrors the documented prebuilt Postgres toolset of a config-defined database toolbox: the tools are fixed, the database is whatever the connection string points at. There is no bundled database driver — statements run through the psql command-line client, so a machine that wants live answers needs psql on its PATH. Without it — or without a connection string — the server still starts and lists its tools; only the calls themselves report the problem.

Install

bash
npx @reneturcios/databridge-kit list-tables postgres://user@localhost:5432/mydb

Or run the container image:

bash
docker run -i ghcr.io/cloudcorprecords/databridge-kit

The container defaults to the MCP server (see below). Pass CLI arguments to use it as a CLI instead.

CLI

bash
# Run one SQL statement; rows print as JSONdatabridge-kit execute-sql postgres://alice@localhost/shop "SELECT id, name FROM products ORDER BY id"
# Inspection commands; each prints its rows as JSONdatabridge-kit list-tables postgres://alice@localhost/shopdatabridge-kit list-views postgres://alice@localhost/shopdatabridge-kit list-schemas postgres://alice@localhost/shopdatabridge-kit list-triggers postgres://alice@localhost/shopdatabridge-kit list-indexes postgres://alice@localhost/shopdatabridge-kit list-sequences postgres://alice@localhost/shopdatabridge-kit list-stored-procedures postgres://alice@localhost/shop
# Start the MCP server (connection string optional, see below)databridge-kit mcp postgres://alice@localhost/shop
databridge-kit --version

Exit codes: 0 on success, 1 when the statement, the connection string, or psql itself fails (the error says which), 2 for usage errors.

The connection string is a normal PostgreSQL URL: postgres:// or postgresql://, with host, optional port (default 5432), database name from the path, and optional user and password in the userinfo. For the mcp command the string can be left off the command line and supplied through the DATABRIDGE_DATABASE_URL environment variable instead (plain DATABASE_URL works too).

How statements and inspections work

execute_sql accepts exactly one statement per call. Semicolons inside string literals and comments do not count as statement boundaries, but a second real statement is rejected before anything reaches the database. The statement type is not restricted — this is a general bridge, so a caller who can reach it can write as well as read; point it only at databases where that is intended.

Each inspection tool runs one fixed catalogue query:

ToolCatalogue read
list_tablesinformation_schema.tables (base tables)
list_viewsinformation_schema.views
list_schemasinformation_schema.schemata
list_triggersinformation_schema.triggers
list_indexespg_indexes
list_sequencesinformation_schema.sequences
list_stored_procedureinformation_schema.routines

Statements run as psql -v ON_ERROR_STOP=1 --csv -c <sql> and the CSV output is parsed into row objects. Values come back as the strings psql rendered.

MCP server

One bin serves both faces. The mcp subcommand starts a stdio MCP server:

bash
npx -y @reneturcios/databridge-kit mcp postgres://alice@localhost/shop

MCP client configuration:

json
{  "mcpServers": {    "databridge-kit": {      "command": "npx",      "args": ["-y", "@reneturcios/databridge-kit", "mcp"],      "env": { "DATABRIDGE_DATABASE_URL": "postgres://alice@localhost/shop" }    }  }}

Tools

ToolInputWhat it returns
execute_sqlsql (string, required) — one SQL statementThe result rows as a JSON array of objects keyed by column name.
list_tables—Rows describing the base tables in the configured source.
list_views—Rows describing the views in the configured source.
list_schemas—Rows describing the schemas in the configured source.
list_triggers—Rows describing the triggers in the configured source.
list_indexes—Rows describing the indexes in the configured source.
list_sequences—Rows describing the sequences in the configured source.
list_stored_procedure—Rows describing the stored procedures (routines) in the configured source.

A missing connection, a missing psql, a multi-statement execute_sql, and database errors all come back as tool errors — never as made-up rows.

Development

bash
npm installnpm run build   # tsc -> dist/npm test        # node test runner over test/*.test.ts, no network, no live databasenpm run dev     # run the CLI from source via tsx

The core logic sits behind an injectable executor interface, which is what the test suite drives: connection-string parsing, the single-statement check, pass-through execution, error propagation, and the exact catalogue SQL behind every inspection tool are all covered with a fake executor.

License

MIT — see LICENSE.

來源:README.md,提交 303fded

工具

8

execute_sql

Execute a SQL statement against the configured database source

輸入參數sql必填

list_tables

List tables in the configured database source

無需輸入參數。

list_views

List views in the configured database source

無需輸入參數。

list_schemas

List schemas in the configured database source

無需輸入參數。

list_triggers

List triggers in the configured database source

無需輸入參數。

list_indexes

List indexes in the configured database source

無需輸入參數。

list_sequences

List sequences in the configured database source

無需輸入參數。

list_stored_procedure

List stored procedures in the configured database source

無需輸入參數。

版本歷史

1
  1. v0.1.0最新Oct 31, 2026

評分

已滿足適用檢查項的 90%

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

  • 近 30 天內可連通25 分
  • 已宣告認證方式10 分

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

  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分