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): write complete config_json matching Rust ConnectionConfig schema

t8y2b899d9897732
diff --git a/mcp/package.json b/mcp/package.json
index 65a5640a2c..cd2a520cfb 100644
--- a/mcp/package.json
+++ b/mcp/package.json
@@ -1,6 +1,6 @@
{
"name": "@dbx-app/mcp-server",
- "version": "0.2.1",
+ "version": "0.2.2",
"mcpName": "io.github.t8y2/dbx",
"description": "MCP server for DBX \u2014 query databases from Claude Code, Cursor, and other AI agents",
"type": "module",
diff --git a/mcp/src/connections.ts b/mcp/src/connections.ts
index fbb07da6d6..c9640aa538 100644
--- a/mcp/src/connections.ts
+++ b/mcp/src/connections.ts
@@ -69,8 +69,32 @@ export async function addConnection(config: Omit<ConnectionConfig, "id">): Promi
const id = randomUUID();
const db = openDb();
- const sanitized = { ...config, id, password: "" };
- const configJson = JSON.stringify(sanitized);
+ const full = {
+ id,
+ name: config.name,
+ db_type: config.db_type,
+ driver_profile: config.driver_profile ?? config.db_type,
+ driver_label: null,
+ url_params: config.url_params ?? "",
+ host: config.host,
+ port: config.port,
+ username: config.username,
+ password: "",
+ database: config.database ?? null,
+ color: null,
+ ssh_enabled: config.ssh_enabled ?? false,
+ ssh_host: "",
+ ssh_port: 22,
+ ssh_user: "",
+ ssh_password: "",
+ ssh_key_path: "",
+ ssh_key_passphrase: "",
+ ssh_expose_lan: false,
+ ssl: config.ssl ?? false,
+ sysdba: false,
+ connection_string: null,
+ };
+ const configJson = JSON.stringify(full);
const insert = db.transaction(() => {
db.prepare("INSERT INTO connections (id, config_json) VALUES (?, ?)").run(id, configJson);