@vibegrid/mcp 0.2.1 → 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.
Files changed (2) hide show
  1. package/dist/index.js +49 -2
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -180,10 +180,23 @@ function createSchema() {
180
180
  hostname TEXT NOT NULL,
181
181
  user TEXT NOT NULL,
182
182
  port INTEGER NOT NULL DEFAULT 22,
183
+ auth_method TEXT DEFAULT 'agent',
183
184
  ssh_key_path TEXT,
185
+ credential_id TEXT,
186
+ encrypted_password TEXT,
184
187
  ssh_options TEXT
185
188
  );
186
189
 
190
+ CREATE TABLE IF NOT EXISTS ssh_keys (
191
+ id TEXT PRIMARY KEY,
192
+ label TEXT NOT NULL,
193
+ encrypted_private_key TEXT NOT NULL,
194
+ public_key TEXT,
195
+ certificate TEXT,
196
+ key_type TEXT,
197
+ created_at TEXT NOT NULL
198
+ );
199
+
187
200
  CREATE TABLE IF NOT EXISTS tasks (
188
201
  id TEXT PRIMARY KEY,
189
202
  project_name TEXT NOT NULL,
@@ -311,6 +324,34 @@ function migrateSchema(d) {
311
324
  })();
312
325
  logger_default.info("[database] migrated schema to version 1 (workspaces)");
313
326
  }
327
+ if (version < 2) {
328
+ d.transaction(() => {
329
+ const hostCols = d.prepare("PRAGMA table_info(remote_hosts)").all();
330
+ if (!hostCols.some((c) => c.name === "auth_method")) {
331
+ d.exec("ALTER TABLE remote_hosts ADD COLUMN auth_method TEXT");
332
+ d.exec("ALTER TABLE remote_hosts ADD COLUMN credential_id TEXT");
333
+ d.exec("ALTER TABLE remote_hosts ADD COLUMN encrypted_password TEXT");
334
+ d.exec(
335
+ "UPDATE remote_hosts SET auth_method = CASE WHEN ssh_key_path IS NOT NULL AND ssh_key_path != '' THEN 'key-file' ELSE 'agent' END"
336
+ );
337
+ }
338
+ d.exec(`
339
+ CREATE TABLE IF NOT EXISTS ssh_keys (
340
+ id TEXT PRIMARY KEY,
341
+ label TEXT NOT NULL,
342
+ encrypted_private_key TEXT NOT NULL,
343
+ public_key TEXT,
344
+ certificate TEXT,
345
+ key_type TEXT,
346
+ created_at TEXT NOT NULL
347
+ )
348
+ `);
349
+ d.prepare(
350
+ "INSERT OR REPLACE INTO schema_meta (key, value) VALUES ('schema_version', '2')"
351
+ ).run();
352
+ })();
353
+ logger_default.info("[database] migrated schema to version 2 (ssh credential vault)");
354
+ }
314
355
  }
315
356
  function loadConfig() {
316
357
  const d = getDb();
@@ -398,7 +439,10 @@ function loadRemoteHosts(d) {
398
439
  hostname: r.hostname,
399
440
  user: r.user,
400
441
  port: r.port,
442
+ ...r.auth_method != null && { authMethod: r.auth_method },
401
443
  ...r.ssh_key_path != null && { sshKeyPath: r.ssh_key_path },
444
+ ...r.credential_id != null && { credentialId: r.credential_id },
445
+ ...r.encrypted_password != null && { encryptedPassword: r.encrypted_password },
402
446
  ...r.ssh_options != null && { sshOptions: r.ssh_options }
403
447
  }));
404
448
  }
@@ -474,7 +518,7 @@ function saveConfig(config) {
474
518
  }
475
519
  d.prepare("DELETE FROM remote_hosts").run();
476
520
  const insertHost = d.prepare(
477
- "INSERT INTO remote_hosts (id, label, hostname, user, port, ssh_key_path, ssh_options) VALUES (?, ?, ?, ?, ?, ?, ?)"
521
+ "INSERT INTO remote_hosts (id, label, hostname, user, port, auth_method, ssh_key_path, credential_id, encrypted_password, ssh_options) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"
478
522
  );
479
523
  for (const h of config.remoteHosts ?? []) {
480
524
  insertHost.run(
@@ -483,7 +527,10 @@ function saveConfig(config) {
483
527
  h.hostname,
484
528
  h.user,
485
529
  h.port,
530
+ h.authMethod ?? "agent",
486
531
  h.sshKeyPath ?? null,
532
+ h.credentialId ?? null,
533
+ h.encryptedPassword ?? null,
487
534
  h.sshOptions ?? null
488
535
  );
489
536
  }
@@ -2460,7 +2507,7 @@ console.warn = (...args) => _origError("[mcp:warn]", ...args);
2460
2507
  console.error = (...args) => _origError("[mcp:error]", ...args);
2461
2508
  async function main() {
2462
2509
  configManager.init();
2463
- const version = true ? "0.2.1" : createRequire(import.meta.url)("../package.json").version;
2510
+ const version = true ? "0.2.2" : createRequire(import.meta.url)("../package.json").version;
2464
2511
  const server = createMcpServer(version);
2465
2512
  const transport = new StdioServerTransport();
2466
2513
  await server.connect(transport);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vibegrid/mcp",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "VibeGrid MCP server — task management, git, and workflow tools for AI coding agents",
5
5
  "type": "module",
6
6
  "license": "MIT",