Db Gateway

io.github.sijunkim由 GitHub 帳號 sijunkim 發布v1.0.4更新於 Oct 25, 2026

145+ tools across 8 databases: MySQL, PostgreSQL, Redshift, MongoDB, Redis, Kafka, and more

已驗證STDIO僅桌面資料庫資料與分析

概覽

AI 產生的概覽

在本機執行的 MCP 伺服器,用單一設定為 AI 助理提供 145+ 個工具,可檢視八種資料庫與串流引擎的結構並執行查詢。

可以做什麼
讀取資料表結構與資料表之間的關聯,並對 MySQL、PostgreSQL、Redshift 等關聯式引擎執行查詢。操作 MongoDB、Redis、DynamoDB 等 NoSQL 引擎中的文件、鍵與快取。在 Elasticsearch 中搜尋與管理索引。檢視並操作 Kafka 的主題與訊息。以 alias 指定同一引擎的多個執行個體,未指定時使用預設執行個體。
適用情境
適合希望助理自行探索資料庫結構、而不是由你貼上 DDL 的情境;也適合技術棧橫跨多個引擎(例如應用程式用 MySQL、分析用 Redshift、快取用 Redis、事件用 Kafka),希望只用一個伺服器與一份設定的情況。
執行需求
透過 npx 在本機執行,需要 Node.js 18 以上版本。必須設定 DBS 列出要啟用的引擎。每個啟用的引擎需要對應的連線字串變數(MYSQL、POSTGRESQL、REDSHIFT、MONGODB、REDIS、ELASTICSEARCH、KAFKA),且都必須帶 alias;DynamoDB 改用 DYNAMODB_REGION、DYNAMODB_ACCESS_KEY_ID 和 DYNAMODB_SECRET_ACCESS_KEY。需要能連線到目標資料庫的網路。
安裝前請注意
MYSQL、POSTGRESQL、REDSHIFT、MONGODB、REDIS、ELASTICSEARCH 和 KAFKA 變數中的連線字串含有資料庫憑證,DYNAMODB_ACCESS_KEY_ID 和 DYNAMODB_SECRET_ACCESS_KEY 含有 AWS 金鑰。除非設定 READ_ONLY=true,否則寫入工具可以修改資料;此設定會隱藏寫入工具並把查詢限制為 SELECT 類語句,README 建議對正式環境啟用。助理可讀取所有已設定執行個體的結構與資料。

安裝

在 SourceWeft 中

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

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

其他 MCP 客戶端

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

README

DB Gateway MCP Server

[npm] [MCP Registry] [8 databases] [license]

English | 한국어

An MCP server that gives AI agents direct access to your databases — 145+ tools across 8 engines.

The point is that the agent reads your schema itself instead of you pasting DDL into a prompt:

You: "Find users who signed up last month and never placed an order"
  1. mysql_get_all_schemas          → reads every table definition  2. mysql_get_table_relationships  → finds the users ↔ orders foreign key  3. mysql_execute_query            → runs the LEFT JOIN

Why db-gateway?

Most database MCP servers cover one engine, or a handful of relational ones. If your stack is MySQL for the app, Redshift for analytics, Redis for cache, and Kafka for events, that means four servers with four different config styles.

This is one server, one config block:

EnginesTools
RelationalMySQL, PostgreSQL, Redshift59
NoSQLMongoDB, Redis, DynamoDB48
SearchElasticsearch19
StreamingKafka19

DBS decides which of them are enabled — only those tools get registered, so a MySQL-only setup stays a MySQL-only tool list.

See It Work

Every screenshot below is one real session against a development MySQL database holding 249 rows — unedited output, not mock data. The agent calls a single tool, mysql_execute_query, and never sees a host, port, or password: those stay in the client config, and the agent only ever names the alias.

[Step 1 — READ: query the most recently added item]

[Step 2 — CREATE: insert a new item, and MySQL returns its insertId]

[Step 3 — UPDATE: move it to the freezer, matching exactly one row by primary key]

[Step 4 — DELETE: remove that row by primary key]

[Step 5 — VERIFY: the table is back to its original 249 rows]

Point the same server at production with READ_ONLY=true and steps 2 through 4 simply do not exist — the write tools are never registered, so the agent cannot see them to call them.

Quick Start

Requires Node.js 18+. Register it with your MCP client — no install step:

json
{  "mcpServers": {    "db-gateway": {      "command": "npx",      "args": ["-y", "db-gateway"],      "env": {        "DBS": "mysql,redis",        "MYSQL": "mysql://<user>:<password>@<host>:3306/<database>?alias=dev&default=true",        "REDIS": "redis://:@<host>:6379/0?alias=dev&default=true"      }    }  }}

DBS decides which engines are enabled — only those tools get registered.

Connection strings

One string per engine. Semicolons separate multiple instances.

VariableFormat
MYSQLmysql://<user>:<password>@<host>:<port>/<db>?alias=name
POSTGRESQLpostgresql://<user>:<password>@<host>:<port>/<db>?alias=name&ssl=true
REDISredis://:<password>@<host>:<port>/<db-index>?alias=name
MONGODBmongodb://<user>:<password>@<host>:<port>/<db>?alias=name
REDSHIFTredshift://<user>:<password>@<host>:<port>/<db>?alias=name&ssl=true
ELASTICSEARCHelasticsearch://<user>:<password>@<host>:<port>?alias=name, or http(s)://<host>:<port>?alias=name
KAFKAkafka://<user>:<password>@<broker>:<port>,<broker2>:<port>?alias=name&mechanism=plain

alias is required. It is how tools address a specific instance — omit it and that engine fails to connect.

Several instances of the same engine — separate their connection strings with a semicolon. The agent picks one by passing an alias argument to any tool; default=true marks the one used when no alias is given:

env
MYSQL="mysql://<user>:<password>@<dev-host>:3306/<db>?alias=dev&default=true;mysql://<user>:<password>@<prod-host>:3306/<db>?alias=prod"

DynamoDB is the exception — it takes DYNAMODB_REGION, DYNAMODB_ACCESS_KEY_ID, and DYNAMODB_SECRET_ACCESS_KEY instead. See .env.example for every option.

Read-Only Mode

READ_ONLY=true hides write tools from the tool list entirely and restricts *_execute_query to SELECT-style statements.

Register production as a second MCP server with this flag on. The agent then cannot modify production data — the write tools do not exist as far as it can see.

json
"db-gateway-prod": {  "command": "npx",  "args": ["-y", "db-gateway"],  "env": { "READ_ONLY": "true", "DBS": "mysql", "MYSQL": "..." }}

Documentation

License

MIT

來源:README.md,提交 895c500

工具

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

版本歷史

1
  1. v1.0.4最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

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

  • 近 30 天內可連通25 分

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

  • 已宣告認證方式10 分

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

  • 已列出工具15 分

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

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