@dbx-app/mcp-server 0.4.75 → 0.4.77

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +112 -2
  2. package/package.json +7 -7
  3. package/server.json +2 -2
package/README.md CHANGED
@@ -17,10 +17,11 @@ The MCP protocol, connection loading, SQL safety, schema access, Redis support,
17
17
 
18
18
  ## Features
19
19
 
20
- - **10 MCP tools** for connections, schemas, SQL, Redis, and DBX UI integration
20
+ - **15 MCP tools** for connection and database discovery, schemas, SQL, Redis, sessions, messages, and DBX UI integration
21
21
  - **Precompiled native binaries** with no local Rust, Cargo, Python, or C/C++ build requirement
22
22
  - **No `better-sqlite3` runtime dependency** and no Node native-addon ABI coupling
23
23
  - **Local, Web, and Docker modes** using the same tool interface
24
+ - **Optional Streamable HTTP transport** protected by a bearer token, while stdio remains the default
24
25
  - **Direct native execution** for supported SQL, Redis, and MongoDB connections
25
26
  - **Agent/JDBC database support** through DBX agent infrastructure when the required agent and JRE are installed
26
27
  - **DBX-managed access policy** with a connection allowlist and three execution modes
@@ -142,18 +143,25 @@ Ask the MCP client to:
142
143
  | Tool | Description |
143
144
  | --- | --- |
144
145
  | `dbx_list_connections` | List connections visible to the MCP session |
146
+ | `dbx_list_databases` | List databases available through a connection, respecting its MCP database scope |
145
147
  | `dbx_add_connection` | Add a connection to DBX storage |
148
+ | `dbx_duplicate_connection` | Duplicate a DBX connection with its complete settings |
146
149
  | `dbx_remove_connection` | Remove a connection from DBX storage |
147
150
  | `dbx_list_tables` | List tables, views, collections, or message queue topics |
148
151
  | `dbx_describe_table` | Return columns and table metadata |
149
152
  | `dbx_get_schema_context` | Return compact schema context suitable for an AI model |
150
153
  | `dbx_execute_query` | Execute SQL or a supported MongoDB shell command, returning at most 100 rows |
154
+ | `dbx_open_session` | Open a stateful SQL query session pinned to one backend connection |
155
+ | `dbx_close_session` | Close a session and release its pinned connection resources |
151
156
  | `dbx_execute_redis_command` | Execute a Redis command |
157
+ | `dbx_send_message` | Send a message to a supported message queue topic |
152
158
  | `dbx_open_table` | Open a table in the running DBX desktop application |
153
159
  | `dbx_execute_and_show` | Execute a query and display the result in the DBX desktop application |
154
160
 
155
161
  When connection scoping is enabled, mutating connection tools and desktop UI tools are hidden.
156
162
 
163
+ `dbx_list_databases` returns only database names allowed by the selected connection's MCP database scope. `dbx_send_message` is available when message-queue support is included in the server build.
164
+
157
165
  ## Execution Modes
158
166
 
159
167
  ### Local native mode
@@ -202,6 +210,40 @@ DBX Web requests honor the standard system proxy environment variables (`HTTP_PR
202
210
 
203
211
  Docker and DBX Web also require the standalone DuckDB driver. Install it from Driver Manager after the first launch; when `/app/data` is persisted, the driver is stored under `/app/data/agents` and survives container upgrades.
204
212
 
213
+ ### Native Streamable HTTP
214
+
215
+ The native server uses stdio by default. To host a local Streamable HTTP endpoint instead, start it with a bearer token:
216
+
217
+ ```bash
218
+ DBX_MCP_HTTP_TOKEN=replace-with-a-long-random-secret dbx-mcp-server --http
219
+ ```
220
+
221
+ It listens on `http://127.0.0.1:5225/mcp` by default. Configure an HTTP-capable MCP client with that URL and `Authorization: Bearer <token>`:
222
+
223
+ ```json
224
+ {
225
+ "type": "http",
226
+ "url": "http://127.0.0.1:5225/mcp",
227
+ "headers": {
228
+ "Authorization": "Bearer replace-with-a-long-random-secret"
229
+ }
230
+ }
231
+ ```
232
+
233
+ The default loopback address accepts only clients on the same computer. Binding to a non-loopback address requires all of the following: `DBX_MCP_HTTP_ALLOW_REMOTE=1`, the `--http-allow-remote` flag, and non-empty `DBX_MCP_HTTP_ALLOWED_HOSTS` plus `DBX_MCP_HTTP_ALLOWED_ORIGINS` allowlists. Use exact public Host authorities and browser Origins.
234
+
235
+ DBX Web can host native Streamable HTTP on its existing listener, rather than opening a second port. Enable it with `DBX_WEB_MCP_TOKEN` (or `DBX_WEB_MCP_TOKEN_FILE`) and configure the public Host allowlist. For a container published as `4225:4224`, the endpoint is `http://localhost:4225/mcp`:
236
+
237
+ ```yaml
238
+ environment:
239
+ DBX_WEB_MCP_TOKEN: replace-with-a-long-random-secret
240
+ DBX_WEB_MCP_ALLOWED_HOSTS: localhost:4225
241
+ ports:
242
+ - "4225:4224"
243
+ ```
244
+
245
+ Clients send `Authorization: Bearer <DBX_WEB_MCP_TOKEN>`. Browser clients also require an exact `DBX_WEB_MCP_ALLOWED_ORIGINS` entry. When a reverse proxy adds a path prefix, set `DBX_PUBLIC_BASE_PATH`; the endpoint becomes `<base-path>/mcp`. Native HTTP and the `DBX_WEB_URL` stdio adapter can coexist and share the same DBX policy.
246
+
205
247
  ### Windows portable DBX
206
248
 
207
249
  Point `DBX_DATA_DIR` at the portable `data` directory containing `dbx.db`:
@@ -271,6 +313,19 @@ SQL text is not included in normal MCP errors or logged by default. Enable tempo
271
313
  | `DBX_WEB_HEADERS` | JSON object of extra HTTP headers for DBX Web requests, e.g. `{"Authorization":"Bearer token"}` |
272
314
  | `DBX_WEB_INSECURE_SKIP_VERIFY` | `1`/`true` disables TLS certificate verification for self-signed backends |
273
315
  | `DBX_WEB_CA_CERT` | PEM/DER CA file to trust for DBX Web TLS verification |
316
+ | `DBX_WEB_MCP_TOKEN` | Enable native DBX Web Streamable HTTP MCP with this bearer token |
317
+ | `DBX_WEB_MCP_TOKEN_FILE` | Read the native DBX Web MCP token from a file; cannot be combined with `DBX_WEB_MCP_TOKEN` |
318
+ | `DBX_WEB_MCP_ALLOWED_HOSTS` | Required comma-separated public Host authorities for native DBX Web MCP |
319
+ | `DBX_WEB_MCP_ALLOWED_ORIGINS` | Comma-separated browser Origins allowed for native DBX Web MCP |
320
+ | `DBX_MCP_TRANSPORT` | `stdio` (default) or `streamable-http` for the native server |
321
+ | `DBX_MCP_HTTP_HOST` | Native HTTP bind address (default: `127.0.0.1`) |
322
+ | `DBX_MCP_HTTP_PORT` | Native HTTP bind port (default: `5225`) |
323
+ | `DBX_MCP_HTTP_PATH` | Native HTTP endpoint path (default: `/mcp`) |
324
+ | `DBX_MCP_HTTP_TOKEN` | Bearer token required by native Streamable HTTP |
325
+ | `DBX_MCP_HTTP_TOKEN_FILE` | Read the native HTTP bearer token from a file; cannot be combined with `DBX_MCP_HTTP_TOKEN` |
326
+ | `DBX_MCP_HTTP_ALLOW_REMOTE` | Set to `1` together with `--http-allow-remote` before a non-loopback bind is allowed |
327
+ | `DBX_MCP_HTTP_ALLOWED_HOSTS` | Required Host authority allowlist for a non-loopback native bind |
328
+ | `DBX_MCP_HTTP_ALLOWED_ORIGINS` | Required browser Origin allowlist for a non-loopback native bind |
274
329
  | `DBX_MCP_ALLOW_WRITES` | Upgrade compatibility only: `0`/`false` keeps an unconfigured policy read-only |
275
330
  | `DBX_MCP_SCOPE_CONNECTION_ID` | Compatibility scope for one connection ID |
276
331
  | `DBX_MCP_SCOPE_CONNECTION_IDS` | Compatibility scope for multiple connection IDs |
@@ -378,9 +433,10 @@ MCP 协议、连接读取、SQL 安全检查、Schema、Redis、MongoDB、Web
378
433
 
379
434
  ### 主要能力
380
435
 
381
- - 10 个 MCP 工具
436
+ - 15 个 MCP 工具,涵盖连接和数据库发现、Schema、SQL、Redis、会话、消息队列和 DBX 桌面集成
382
437
  - 不依赖 `better-sqlite3`,没有 Node 原生模块 ABI 问题
383
438
  - 支持本地 DBX、DBX Web 和 Docker
439
+ - 可选 Streamable HTTP 传输,使用 Bearer Token 保护;stdio 仍为默认方式
384
440
  - 支持预编译原生二进制和离线运行
385
441
  - 支持常见 SQL、Redis、MongoDB 直连
386
442
  - 支持达梦、金仓、Oracle、DB2、Hive 等 Agent/JDBC 数据库
@@ -460,16 +516,23 @@ MCP 配置:
460
516
  | 工具 | 说明 |
461
517
  | --- | --- |
462
518
  | `dbx_list_connections` | 列出当前 MCP 会话可见的连接 |
519
+ | `dbx_list_databases` | 列出连接中可通过 MCP 访问的数据库,并遵守该连接的数据库范围 |
463
520
  | `dbx_add_connection` | 添加 DBX 连接配置 |
521
+ | `dbx_duplicate_connection` | 复制一个连接及其完整配置 |
464
522
  | `dbx_remove_connection` | 删除 DBX 连接配置 |
465
523
  | `dbx_list_tables` | 列出表、视图、集合或消息队列 Topic |
466
524
  | `dbx_describe_table` | 获取字段和表结构 |
467
525
  | `dbx_get_schema_context` | 获取适合 AI 使用的紧凑 Schema 上下文 |
468
526
  | `dbx_execute_query` | 执行 SQL 或支持的 MongoDB Shell 命令,最多返回 100 行 |
527
+ | `dbx_open_session` | 为 SQL 连接打开固定后端连接的有状态查询会话 |
528
+ | `dbx_close_session` | 关闭会话并释放固定连接资源 |
469
529
  | `dbx_execute_redis_command` | 执行 Redis 命令 |
530
+ | `dbx_send_message` | 向支持的消息队列 Topic 发送消息 |
470
531
  | `dbx_open_table` | 在 DBX 桌面端打开表 |
471
532
  | `dbx_execute_and_show` | 执行查询并在 DBX 桌面端展示结果 |
472
533
 
534
+ `dbx_list_databases` 只返回该连接 MCP 数据库范围内允许访问的名称。`dbx_send_message` 仅在 Server 构建时包含消息队列支持时可用。
535
+
473
536
  ### 本地数据目录
474
537
 
475
538
  - macOS:`~/Library/Application Support/com.dbx.app/dbx.db`
@@ -498,6 +561,40 @@ Web 模式不会读取本机 DBX 桌面存储,也不会暴露桌面 UI 工具
498
561
 
499
562
  DBX Web 请求遵循标准系统代理环境变量:https 地址读取 `HTTPS_PROXY`/`https_proxy`,http 地址读取 `HTTP_PROXY`/`http_proxy`,`ALL_PROXY`/`all_proxy` 作为兜底,`NO_PROXY`/`no_proxy` 作为绕过列表。代理值为空或未设置时直连(不走代理)。需要认证的代理使用标准 `user:password@host:port` URL 形式,例如 `http://admin:admin123@127.0.0.1:7890`。如需为每次 DBX Web 请求附加自定义请求头(例如网关前的令牌认证),将 `DBX_WEB_HEADERS` 设置为 JSON 对象,键为请求头名称、值为字符串,例如 `{"Authorization":"Bearer <token>"}`,该头会附加到包括认证在内的每个请求。
500
563
 
564
+ ### 原生 Streamable HTTP
565
+
566
+ 原生 Server 默认使用 stdio。需要直接提供本机 Streamable HTTP 服务时,启动时传入 Bearer Token:
567
+
568
+ ```bash
569
+ DBX_MCP_HTTP_TOKEN=replace-with-a-long-random-secret dbx-mcp-server --http
570
+ ```
571
+
572
+ 默认监听 `http://127.0.0.1:5225/mcp`。在支持 HTTP 的 MCP 客户端中填写该 URL,并携带 `Authorization: Bearer <token>`:
573
+
574
+ ```json
575
+ {
576
+ "type": "http",
577
+ "url": "http://127.0.0.1:5225/mcp",
578
+ "headers": {
579
+ "Authorization": "Bearer replace-with-a-long-random-secret"
580
+ }
581
+ }
582
+ ```
583
+
584
+ 默认回环地址仅允许同一台电脑上的客户端访问。监听非回环地址时,必须同时设置 `DBX_MCP_HTTP_ALLOW_REMOTE=1`、传入 `--http-allow-remote`,并提供非空的 `DBX_MCP_HTTP_ALLOWED_HOSTS` 和 `DBX_MCP_HTTP_ALLOWED_ORIGINS` 白名单。Host authority 与浏览器 Origin 均应使用精确的公网值。
585
+
586
+ DBX Web 可以通过现有 Web 监听器提供原生 Streamable HTTP,无需额外开放第二个端口。设置 `DBX_WEB_MCP_TOKEN`(或 `DBX_WEB_MCP_TOKEN_FILE`)并配置公网 Host 白名单即可启用。容器映射为 `4225:4224` 时,端点为 `http://localhost:4225/mcp`:
587
+
588
+ ```yaml
589
+ environment:
590
+ DBX_WEB_MCP_TOKEN: replace-with-a-long-random-secret
591
+ DBX_WEB_MCP_ALLOWED_HOSTS: localhost:4225
592
+ ports:
593
+ - "4225:4224"
594
+ ```
595
+
596
+ 客户端必须携带 `Authorization: Bearer <DBX_WEB_MCP_TOKEN>`。浏览器客户端还需要在 `DBX_WEB_MCP_ALLOWED_ORIGINS` 中填写精确 Origin。反向代理添加路径前缀时,设置 `DBX_PUBLIC_BASE_PATH`,端点会变为 `<base-path>/mcp`。原生 HTTP 与 `DBX_WEB_URL` 的 stdio 适配方式可以并存,并共享同一份 DBX 策略。
597
+
501
598
  ### Agent/JDBC 数据库
502
599
 
503
600
  达梦、金仓KingbaseES、Oracle、DB2、Hive、Trino、Snowflake、SAP HANA 等数据库通过 DBX Java Agent/JDBC 基础设施运行,而不是通过 Node.js 数据库驱动运行。
@@ -554,6 +651,19 @@ MongoDB 更新和删除在未启用完全访问时必须提供可验证有效的
554
651
  | `DBX_WEB_HEADERS` | DBX Web 请求附加的请求头 JSON 对象,例如 `{"Authorization":"Bearer token"}` |
555
652
  | `DBX_WEB_INSECURE_SKIP_VERIFY` | `1`/`true` 时跳过 TLS 证书验证(用于自签名后端) |
556
653
  | `DBX_WEB_CA_CERT` | DBX Web TLS 验证时信任的 PEM/DER CA 文件 |
654
+ | `DBX_WEB_MCP_TOKEN` | 使用该 Bearer Token 启用原生 DBX Web Streamable HTTP MCP |
655
+ | `DBX_WEB_MCP_TOKEN_FILE` | 从文件读取原生 DBX Web MCP Token;不能与 `DBX_WEB_MCP_TOKEN` 同时设置 |
656
+ | `DBX_WEB_MCP_ALLOWED_HOSTS` | 原生 DBX Web MCP 必填:允许的公网 Host authority,逗号分隔 |
657
+ | `DBX_WEB_MCP_ALLOWED_ORIGINS` | 原生 DBX Web MCP 的浏览器 Origin 白名单,逗号分隔 |
658
+ | `DBX_MCP_TRANSPORT` | 原生 Server 传输方式:`stdio`(默认)或 `streamable-http` |
659
+ | `DBX_MCP_HTTP_HOST` | 原生 HTTP 监听地址(默认:`127.0.0.1`) |
660
+ | `DBX_MCP_HTTP_PORT` | 原生 HTTP 监听端口(默认:`5225`) |
661
+ | `DBX_MCP_HTTP_PATH` | 原生 HTTP 端点路径(默认:`/mcp`) |
662
+ | `DBX_MCP_HTTP_TOKEN` | 原生 Streamable HTTP 必填的 Bearer Token |
663
+ | `DBX_MCP_HTTP_TOKEN_FILE` | 从文件读取原生 HTTP Bearer Token;不能与 `DBX_MCP_HTTP_TOKEN` 同时设置 |
664
+ | `DBX_MCP_HTTP_ALLOW_REMOTE` | 与 `--http-allow-remote` 同时设置为允许监听非回环地址 |
665
+ | `DBX_MCP_HTTP_ALLOWED_HOSTS` | 监听非回环地址时必填的 Host authority 白名单 |
666
+ | `DBX_MCP_HTTP_ALLOWED_ORIGINS` | 监听非回环地址时必填的浏览器 Origin 白名单 |
557
667
  | `DBX_MCP_ALLOW_WRITES` | 仅用于升级兼容:`0`/`false` 使尚未配置的策略保持只读 |
558
668
  | `DBX_MCP_SCOPE_CONNECTION_ID` | 兼容旧配置:限制到指定连接 ID |
559
669
  | `DBX_MCP_SCOPE_CONNECTION_IDS` | 兼容旧配置:限制到多个连接 ID |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dbx-app/mcp-server",
3
- "version": "0.4.75",
3
+ "version": "0.4.77",
4
4
  "description": "MCP server for DBX — query databases from Claude Code, Cursor, and other AI agents",
5
5
  "keywords": [
6
6
  "ai-agent",
@@ -28,12 +28,12 @@
28
28
  ],
29
29
  "type": "module",
30
30
  "optionalDependencies": {
31
- "@dbx-app/mcp-darwin-arm64": "0.4.75",
32
- "@dbx-app/mcp-darwin-x64": "0.4.75",
33
- "@dbx-app/mcp-linux-arm64-gnu": "0.4.75",
34
- "@dbx-app/mcp-linux-x64-gnu": "0.4.75",
35
- "@dbx-app/mcp-win32-arm64": "0.4.75",
36
- "@dbx-app/mcp-win32-x64": "0.4.75"
31
+ "@dbx-app/mcp-darwin-arm64": "0.4.77",
32
+ "@dbx-app/mcp-darwin-x64": "0.4.77",
33
+ "@dbx-app/mcp-linux-arm64-gnu": "0.4.77",
34
+ "@dbx-app/mcp-linux-x64-gnu": "0.4.77",
35
+ "@dbx-app/mcp-win32-arm64": "0.4.77",
36
+ "@dbx-app/mcp-win32-x64": "0.4.77"
37
37
  },
38
38
  "devDependencies": {
39
39
  "@types/node": "^22.15.21",
package/server.json CHANGED
@@ -6,12 +6,12 @@
6
6
  "url": "https://github.com/t8y2/dbx",
7
7
  "source": "github"
8
8
  },
9
- "version": "0.4.75",
9
+ "version": "0.4.77",
10
10
  "packages": [
11
11
  {
12
12
  "registryType": "npm",
13
13
  "identifier": "@dbx-app/mcp-server",
14
- "version": "0.4.75",
14
+ "version": "0.4.77",
15
15
  "transport": {
16
16
  "type": "stdio"
17
17
  }