@dbx-app/mcp-server 0.1.0 → 0.1.1

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 (2) hide show
  1. package/README.md +83 -0
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  MCP server for [DBX](https://github.com/t8y2/dbx) — lets AI agents (Claude Code, Cursor, etc.) query your databases using connections already configured in DBX.
4
4
 
5
+ [中文](#中文说明) | English
6
+
5
7
  ## Features
6
8
 
7
9
  - **Zero config** — Automatically reads your DBX connections (including passwords from system keyring)
@@ -101,3 +103,84 @@ The `dbx_open_table` tool communicates with the running DBX app to open tables d
101
103
  ## License
102
104
 
103
105
  MIT
106
+
107
+ ---
108
+
109
+ ## 中文说明
110
+
111
+ [DBX](https://github.com/t8y2/dbx) 的 MCP Server,让 AI 编程助手(Claude Code、Cursor 等)直接使用 DBX 中已配置的数据库连接查询数据。
112
+
113
+ ### 特性
114
+
115
+ - **零配置** — 自动读取 DBX 的连接配置(包括系统钥匙串中的密码)
116
+ - **5 个工具** — 列出连接、列出表、查看表结构、执行 SQL、在 DBX 中打开表
117
+ - **连接池** — 跨查询复用数据库连接
118
+ - **PostgreSQL 和 MySQL** — 支持 PostgreSQL、MySQL 及兼容数据库(Doris、StarRocks 等)
119
+ - **DBX UI 联动** — 从 AI 助手直接在 DBX 桌面端打开表
120
+
121
+ ### 快速开始
122
+
123
+ #### 1. 安装
124
+
125
+ ```bash
126
+ npm install -g @dbx-app/mcp-server
127
+ ```
128
+
129
+ 或直接运行:
130
+
131
+ ```bash
132
+ npx @dbx-app/mcp-server
133
+ ```
134
+
135
+ #### 2. 配置 Claude Code
136
+
137
+ 在项目的 `.mcp.json` 中添加:
138
+
139
+ ```json
140
+ {
141
+ "mcpServers": {
142
+ "dbx": {
143
+ "command": "dbx-mcp-server"
144
+ }
145
+ }
146
+ }
147
+ ```
148
+
149
+ #### 3. 使用
150
+
151
+ 在 Claude Code 中直接说:
152
+
153
+ - "列出我的数据库连接"
154
+ - "查看 local-pg 上有哪些表"
155
+ - "查看 users 表的结构"
156
+ - "查询最近 7 天的订单数量"
157
+ - "打开 orders 表"
158
+
159
+ ### 工具列表
160
+
161
+ | 工具 | 说明 |
162
+ |---|---|
163
+ | `dbx_list_connections` | 列出 DBX 中所有已配置的数据库连接 |
164
+ | `dbx_list_tables` | 列出指定连接的表和视图 |
165
+ | `dbx_describe_table` | 获取表的列定义 |
166
+ | `dbx_execute_query` | 执行 SQL 查询(最多返回 100 行) |
167
+ | `dbx_open_table` | 在 DBX 桌面端打开指定表 |
168
+
169
+ ### 工作原理
170
+
171
+ MCP Server 从 DBX 的配置目录读取连接信息:
172
+
173
+ - **macOS**: `~/Library/Application Support/com.dbx.app/connections.json`
174
+ - **Linux**: `~/.config/com.dbx.app/connections.json`
175
+ - **Windows**: `%APPDATA%\com.dbx.app\connections.json`
176
+
177
+ 密码从系统钥匙串中获取(macOS Keychain / Linux Secret Service / Windows 凭据管理器)。
178
+
179
+ ### DBX UI 联动
180
+
181
+ `dbx_open_table` 工具通过本地 HTTP 接口与运行中的 DBX 应用通信,直接在 UI 中打开表。需要 DBX 正在运行。
182
+
183
+ ### 系统要求
184
+
185
+ - 已安装 [DBX](https://github.com/t8y2/dbx) 并配置了至少一个数据库连接
186
+ - Node.js 18+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dbx-app/mcp-server",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "MCP server for DBX — query databases from Claude Code, Cursor, and other AI agents",
5
5
  "type": "module",
6
6
  "bin": {