@dbx-app/mcp-server 0.2.0 → 0.2.2

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.
@@ -47,8 +47,32 @@ export async function findConnection(name) {
47
47
  export async function addConnection(config) {
48
48
  const id = randomUUID();
49
49
  const db = openDb();
50
- const sanitized = { ...config, id, password: "" };
51
- const configJson = JSON.stringify(sanitized);
50
+ const full = {
51
+ id,
52
+ name: config.name,
53
+ db_type: config.db_type,
54
+ driver_profile: config.driver_profile ?? config.db_type,
55
+ driver_label: null,
56
+ url_params: config.url_params ?? "",
57
+ host: config.host,
58
+ port: config.port,
59
+ username: config.username,
60
+ password: "",
61
+ database: config.database ?? null,
62
+ color: null,
63
+ ssh_enabled: config.ssh_enabled ?? false,
64
+ ssh_host: "",
65
+ ssh_port: 22,
66
+ ssh_user: "",
67
+ ssh_password: "",
68
+ ssh_key_path: "",
69
+ ssh_key_passphrase: "",
70
+ ssh_expose_lan: false,
71
+ ssl: config.ssl ?? false,
72
+ sysdba: false,
73
+ connection_string: null,
74
+ };
75
+ const configJson = JSON.stringify(full);
52
76
  const insert = db.transaction(() => {
53
77
  db.prepare("INSERT INTO connections (id, config_json) VALUES (?, ?)").run(id, configJson);
54
78
  if (config.password) {
package/dist/index.js CHANGED
@@ -36,7 +36,7 @@ function mdTable(headers, rows) {
36
36
  }
37
37
  const server = new McpServer({
38
38
  name: "dbx",
39
- version: "0.2.0",
39
+ version: "0.2.1",
40
40
  });
41
41
  server.tool("dbx_list_connections", "List all database connections configured in DBX", {}, async () => {
42
42
  const connections = await backend.loadConnections();
@@ -114,6 +114,7 @@ server.tool("dbx_add_connection", "Add a new database connection to DBX", {
114
114
  name, db_type, host, port, username, password,
115
115
  database, ssl, ssh_enabled: false,
116
116
  });
117
+ await notifyReload();
117
118
  return text(`Connection "${config.name}" added (id: ${config.id}).`);
118
119
  });
119
120
  server.tool("dbx_remove_connection", "Remove a database connection from DBX", {
@@ -122,6 +123,7 @@ server.tool("dbx_remove_connection", "Remove a database connection from DBX", {
122
123
  const removed = await backend.removeConnection(connection_name);
123
124
  if (!removed)
124
125
  return text(`Connection "${connection_name}" not found.`);
126
+ await notifyReload();
125
127
  return text(`Connection "${connection_name}" removed.`);
126
128
  });
127
129
  function formatCell(value) {
@@ -147,6 +149,13 @@ async function getBridgeUrl() {
147
149
  const port = (await readFile(portFile, "utf-8")).trim();
148
150
  return `http://127.0.0.1:${port}`;
149
151
  }
152
+ async function notifyReload() {
153
+ try {
154
+ const bridgeUrl = await getBridgeUrl();
155
+ await fetch(`${bridgeUrl}/reload-connections`, { method: "POST" });
156
+ }
157
+ catch { }
158
+ }
150
159
  // Desktop-only tools: open table and execute-and-show require the Tauri bridge
151
160
  if (!isWebMode) {
152
161
  server.tool("dbx_open_table", "Open a table in DBX desktop app UI. Requires DBX to be running.", {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dbx-app/mcp-server",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "mcpName": "io.github.t8y2/dbx",
5
5
  "description": "MCP server for DBX \u2014 query databases from Claude Code, Cursor, and other AI agents",
6
6
  "type": "module",