Skip to content

armgit / dbx

Public Imported from GitHub
0

25 MB lightweight cross-platform database client for 100+ databases, including MySQL, PostgreSQL, SQLite, Redis, MongoDB, DuckDB, SQL Server, and Dameng. Built-in AI, MCP Server, CLI, desktop and Docker. | 轻量级跨平台数据库管理工具,支持 MySQL、PostgreSQL、SQLite、Redis、MongoDB、达梦等 100+ 数据库,提供桌面端、Docker、CLI、内置 AI 助手和 MCP。

fix(mcp): document portable data directory

t8y2c2b687b271a0
diff --git a/README.md b/README.md
index 5355454f09..c808a60b88 100644
--- a/README.md
+++ b/README.md
@@ -156,6 +156,8 @@ Add to your `.mcp.json`:
}
```
+Windows portable builds need `DBX_DATA_DIR` in the MCP config, pointing to the `data` directory next to `DBX.exe` (the folder that contains `dbx.db`).
+
Works with Claude Code, Cursor, Windsurf, and any MCP-compatible agent. Supports listing connections, browsing tables, executing SQL, and opening tables directly in DBX's UI.
DBX also provides a dedicated CLI package for terminal, script, and Codex workflows:
diff --git a/README.zh-CN.md b/README.zh-CN.md
index 9db69c54d1..c4e00027c7 100644
--- a/README.zh-CN.md
+++ b/README.zh-CN.md
@@ -157,6 +157,8 @@ npx @dbx-app/mcp-server
}
```
+Windows 便携版需要在 MCP 配置中设置 `DBX_DATA_DIR`,指向 `DBX.exe` 同级的 `data` 目录(即包含 `dbx.db` 的文件夹)。
+
支持 Claude Code、Cursor、Windsurf 等 MCP 兼容的 AI 助手。可列出连接、浏览表、执行 SQL,还能直接在 DBX 界面中打开表。
DBX 也提供独立 CLI 包,适合终端、脚本和 Codex 工作流:
diff --git a/docs/content/docs/mcp.cn.mdx b/docs/content/docs/mcp.cn.mdx
index 3af5b42565..adba4a5c60 100644
--- a/docs/content/docs/mcp.cn.mdx
+++ b/docs/content/docs/mcp.cn.mdx
@@ -44,6 +44,22 @@ AI 助手 → MCP Server → 你的数据库 → 返回结果
}
```
+ Windows 便携版需要额外设置 `DBX_DATA_DIR`,指向 `DBX.exe` 同级的 `data` 目录:
+
+ ```json
+ {
+ "mcpServers": {
+ "dbx": {
+ "command": "npx",
+ "args": ["-y", "@dbx-app/mcp-server"],
+ "env": {
+ "DBX_DATA_DIR": "D:\\DBX_x64-portable\\data"
+ }
+ }
+ }
+ }
+ ```
+
</Step>
<Step>
### 开始使用
@@ -205,6 +221,8 @@ MCP Server 从 DBX 的 SQLite 数据库读取连接信息:
| Linux | `~/.local/share/com.dbx.app/dbx.db` |
| Windows | `%APPDATA%\com.dbx.app\dbx.db` |
+Windows 便携版的数据通常在 `DBX.exe` 同级的 `data\dbx.db`。如果 MCP 列出的连接不是当前 DBX 中的最新连接,请在 MCP 配置中设置 `DBX_DATA_DIR`,值为包含 `dbx.db` 的 `data` 文件夹,例如 `D:\DBX_x64-portable\data`。不要手工复制 `dbx.db` 到默认目录,否则两个连接库会分叉。
+
### UI 联动
`dbx_open_table` 和 `dbx_execute_and_show` 通过本地 HTTP 接口与运行中的 DBX 应用通信:
diff --git a/docs/content/docs/mcp.mdx b/docs/content/docs/mcp.mdx
index 048d1dee1c..323adfa399 100644
--- a/docs/content/docs/mcp.mdx
+++ b/docs/content/docs/mcp.mdx
@@ -44,6 +44,22 @@ AI Agent → MCP Server → Your Database → Results
}
```
+ Windows portable builds need `DBX_DATA_DIR` set to the `data` directory next to `DBX.exe`:
+
+ ```json
+ {
+ "mcpServers": {
+ "dbx": {
+ "command": "npx",
+ "args": ["-y", "@dbx-app/mcp-server"],
+ "env": {
+ "DBX_DATA_DIR": "D:\\DBX_x64-portable\\data"
+ }
+ }
+ }
+ }
+ ```
+
</Step>
<Step>
### Start Using
@@ -205,6 +221,8 @@ The MCP Server reads DBX's SQLite database:
| Linux | `~/.local/share/com.dbx.app/dbx.db` |
| Windows | `%APPDATA%\com.dbx.app\dbx.db` |
+Windows portable builds usually store data in `data\dbx.db` next to `DBX.exe`. If MCP lists older connections than the running DBX app, set `DBX_DATA_DIR` in the MCP config to the `data` folder that contains `dbx.db`, for example `D:\DBX_x64-portable\data`. Do not copy `dbx.db` into the default directory, because that creates two diverging connection stores.
+
### UI Integration
`dbx_open_table` and `dbx_execute_and_show` communicate with the running DBX app via a local HTTP interface:
diff --git a/docs/public/llms.txt b/docs/public/llms.txt
index 6fe6726a16..b20a8e0bd4 100644
--- a/docs/public/llms.txt
+++ b/docs/public/llms.txt
@@ -33,6 +33,7 @@ Configure `.mcp.json` to let AI agents query databases through DBX connections:
}
}
```
+For Windows portable builds, set DBX_DATA_DIR to the portable data directory that contains dbx.db, for example D:\DBX_x64-portable\data.
## Key Links
- Documentation: https://dbxio.com/en/docs/what-is-dbx
diff --git a/packages/mcp-server/README.md b/packages/mcp-server/README.md
index da40f68d45..03f5b550b0 100644
--- a/packages/mcp-server/README.md
+++ b/packages/mcp-server/README.md
@@ -41,6 +41,21 @@ Add to your project's `.mcp.json`:
}
```
+For Windows portable builds, set `DBX_DATA_DIR` to the portable data directory that contains `dbx.db`:
+
+```json
+{
+ "mcpServers": {
+ "dbx": {
+ "command": "dbx-mcp-server",
+ "env": {
+ "DBX_DATA_DIR": "D:\\DBX_x64-portable\\data"
+ }
+ }
+ }
+}
+```
+
Or for development (from source):
```json
@@ -123,6 +138,8 @@ The MCP server reads your database connections from DBX's SQLite database:
- **Linux**: `~/.local/share/com.dbx.app/dbx.db`
- **Windows**: `%APPDATA%\com.dbx.app\dbx.db`
+Windows portable builds store data next to `DBX.exe`, usually in `data\dbx.db`. Set `DBX_DATA_DIR` to that `data` folder instead of copying `dbx.db` into the default directory.
+
## DBX UI Integration
The `dbx_open_table` tool communicates with the running DBX app to open tables directly in the UI. This requires DBX to be running. If DBX is not running, the tool will return an error message.
@@ -181,6 +198,21 @@ npx @dbx-app/mcp-server
}
```
+Windows 便携版需要在 MCP 配置中设置 `DBX_DATA_DIR`,指向包含 `dbx.db` 的便携版数据目录:
+
+```json
+{
+ "mcpServers": {
+ "dbx": {
+ "command": "dbx-mcp-server",
+ "env": {
+ "DBX_DATA_DIR": "D:\\DBX_x64-portable\\data"
+ }
+ }
+ }
+}
+```
+
#### 3. 使用
在 Claude Code 中直接说:
@@ -243,6 +275,8 @@ MCP Server 从 DBX 的 SQLite 数据库读取连接信息:
- **Linux**: `~/.local/share/com.dbx.app/dbx.db`
- **Windows**: `%APPDATA%\com.dbx.app\dbx.db`
+Windows 便携版的数据通常在 `DBX.exe` 同级的 `data\dbx.db`。请把 `DBX_DATA_DIR` 设置为这个 `data` 文件夹,不要手工复制 `dbx.db` 到默认目录。
+
### DBX UI 联动
`dbx_open_table` 工具通过本地 HTTP 接口与运行中的 DBX 应用通信,直接在 UI 中打开表。需要 DBX 正在运行。