daedalus-cli 1.17.0 → 1.18.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.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ ## [1.18.1](https://github.com/bgill55/daedalus/compare/v1.18.0...v1.18.1) (2026-06-22)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * parse raw JSON first during fact extraction to avoid cleaning corruption ([5c94fde](https://github.com/bgill55/daedalus/commit/5c94fdef70bf7a18d26feb14332cdbaab508e86c))
7
+
8
+ # [1.18.0](https://github.com/bgill55/daedalus/compare/v1.17.0...v1.18.0) (2026-06-22)
9
+
10
+
11
+ ### Features
12
+
13
+ * /mcp command — discover, install, and manage MCP servers from the REPL ([60eb672](https://github.com/bgill55/daedalus/commit/60eb67262bdbd7056e8adc714cbfcb11f5bce563))
14
+
1
15
  # [1.17.0](https://github.com/bgill55/daedalus/compare/v1.16.0...v1.17.0) (2026-06-22)
2
16
 
3
17
 
package/README.md CHANGED
@@ -124,6 +124,7 @@ AI assistance without:
124
124
  | `/config [set <key> = <val>]` | Show current configuration |
125
125
  | `/doctor` | Diagnose connection and discovery |
126
126
  | `/help` / `?` / `help` | Show available commands |
127
+ | `/mcp` | Manage MCP servers: explore, search, install, list, remove, info |
127
128
  | `exit` / `quit` | Save session and exit |
128
129
  <!-- END_COMMANDS_TABLE -->
129
130
 
@@ -1 +1 @@
1
- {"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../src/commands.ts"],"names":[],"mappings":"AAGA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAKhC,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACrE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,KAAK,EAAE,WAAW,EAAE,MA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zF"}
package/dist/commands.js CHANGED
@@ -1348,6 +1348,252 @@ Once you have finished making changes, I will automatically re-run the command t
1348
1348
  console.log();
1349
1349
  }
1350
1350
  },
1351
+ {
1352
+ name: '/mcp',
1353
+ description: 'Manage MCP servers: explore, search, install, list, remove, info',
1354
+ execute: async (args, ctx) => {
1355
+ const parts = args.trim().split(/\s+/);
1356
+ const sub = parts[0]?.toLowerCase();
1357
+ const rest = parts.slice(1).join(' ').trim();
1358
+ const { searchRegistry, fetchServerByName, fetchAllServers, registryEntryToConfig, addServerToConfig, removeServerFromConfig, listInstalledServers, toggleServer } = await import('./tools/mcp/manager.js');
1359
+ const { mcpRegistry } = await import('./tools/mcp/registry.js');
1360
+ switch (sub) {
1361
+ case 'search':
1362
+ case 's': {
1363
+ if (!rest) {
1364
+ console.log(pc.yellow(' Usage: /mcp search <query>'));
1365
+ return;
1366
+ }
1367
+ console.log(pc.dim(` Searching registry for "${rest}"...`));
1368
+ try {
1369
+ const results = await searchRegistry(rest, 15);
1370
+ if (results.length === 0) {
1371
+ console.log(pc.yellow(' No servers found. Try a broader search.'));
1372
+ return;
1373
+ }
1374
+ console.log(`\n ${pc.bold(`Found ${results.length} server(s):`)}`);
1375
+ for (const s of results) {
1376
+ const label = s.title || s.name;
1377
+ const desc = s.description.length > 80 ? s.description.slice(0, 80) + '…' : s.description;
1378
+ const remote = s.remotes?.[0]?.url || '';
1379
+ const pkg = s.packages?.[0]?.identifier || '';
1380
+ const source = remote || pkg || '(no install info)';
1381
+ const installType = s.packages ? 'stdio' : s.remotes ? 'http' : '?';
1382
+ console.log(` ${pc.cyan(label)}`);
1383
+ console.log(` ${pc.dim(desc)}`);
1384
+ console.log(` ${pc.gray('Install:')} ${pc.dim(source)} (${installType})`);
1385
+ console.log();
1386
+ }
1387
+ }
1388
+ catch (err) {
1389
+ console.log(pc.red(` Search failed: ${err.message}`));
1390
+ }
1391
+ return;
1392
+ }
1393
+ case 'install':
1394
+ case 'i': {
1395
+ if (!rest) {
1396
+ console.log(pc.yellow(' Usage: /mcp install <server-name>'));
1397
+ console.log(pc.dim(' First search for a server with: /mcp search <query>'));
1398
+ return;
1399
+ }
1400
+ console.log(pc.dim(` Fetching "${rest}" from registry...`));
1401
+ try {
1402
+ const entry = await fetchServerByName(rest);
1403
+ if (!entry) {
1404
+ console.log(pc.yellow(` Server "${rest}" not found in registry. Try /mcp search first.`));
1405
+ return;
1406
+ }
1407
+ const config = registryEntryToConfig(entry);
1408
+ if (!config) {
1409
+ console.log(pc.yellow(` Cannot install "${rest}": no stdio package or remote URL found.`));
1410
+ return;
1411
+ }
1412
+ const result = addServerToConfig(config);
1413
+ if (result.success) {
1414
+ console.log(pc.green(` ${result.message}`));
1415
+ console.log(pc.dim(' Restart Daedalus or reconnect to load the new server.'));
1416
+ }
1417
+ else {
1418
+ console.log(pc.yellow(` ${result.message}`));
1419
+ }
1420
+ }
1421
+ catch (err) {
1422
+ console.log(pc.red(` Install failed: ${err.message}`));
1423
+ }
1424
+ return;
1425
+ }
1426
+ case 'explore':
1427
+ case 'ex': {
1428
+ console.log(pc.dim(' Browsing the MCP registry...\n'));
1429
+ try {
1430
+ const all = await fetchAllServers(100);
1431
+ const local = all.filter(s => s.packages && s.packages.length > 0);
1432
+ const remote = all.filter(s => s.remotes && s.remotes.length > 0);
1433
+ console.log(` ${pc.bold(`Found ${all.length} servers in registry`)}`);
1434
+ const showSample = (list, label, max = 5) => {
1435
+ if (list.length === 0)
1436
+ return;
1437
+ console.log(`\n ${pc.underline(label)} (${list.length} available)`);
1438
+ for (const s of list.slice(0, max)) {
1439
+ const pkg = s.packages?.[0]?.identifier || '';
1440
+ const url = s.remotes?.[0]?.url || '';
1441
+ const source = pkg || url;
1442
+ const info = s.description.length > 55 ? s.description.slice(0, 53) + '…' : s.description;
1443
+ const showName = s.name.length > 28 ? s.name.slice(0, 26) + '…' : s.name;
1444
+ console.log(` ${pc.cyan(showName.padEnd(30))} ${pc.dim(info)}`);
1445
+ console.log(` ${' '.repeat(30)} ${pc.gray('→')} ${pc.dim(source)}`);
1446
+ }
1447
+ if (list.length > max) {
1448
+ console.log(` ${' '.repeat(30)} ${pc.dim(`… and ${list.length - max} more`)}`);
1449
+ }
1450
+ };
1451
+ showSample(local, 'Local (stdio — install & run)', 6);
1452
+ showSample(remote, 'Remote (HTTP — cloud API)', 6);
1453
+ console.log(`\n ${pc.dim('Tip: /mcp search <query> to find specific servers')}`);
1454
+ }
1455
+ catch (err) {
1456
+ console.log(pc.red(` Explore failed: ${err.message}`));
1457
+ }
1458
+ return;
1459
+ }
1460
+ case 'list':
1461
+ case 'ls':
1462
+ case 'l': {
1463
+ const servers = listInstalledServers();
1464
+ if (servers.length === 0) {
1465
+ console.log(pc.yellow(' No MCP servers installed.'));
1466
+ console.log(pc.dim(' Try /mcp explore to see what\'s available.'));
1467
+ return;
1468
+ }
1469
+ const connected = mcpRegistry.getConnectedServers();
1470
+ console.log(`\n ${pc.bold('Installed MCP Servers:')}`);
1471
+ for (const s of servers) {
1472
+ const status = connected.includes(s.name) ? pc.green('●') : s.enabled ? pc.yellow('○') : pc.red('○');
1473
+ const state = connected.includes(s.name) ? pc.green('connected')
1474
+ : s.enabled ? pc.yellow('pending')
1475
+ : pc.red('disabled');
1476
+ console.log(` ${status} ${pc.cyan(s.name.padEnd(20))} ${pc.dim(s.transport.padEnd(6))} ${state}`);
1477
+ }
1478
+ console.log();
1479
+ return;
1480
+ }
1481
+ case 'remove':
1482
+ case 'rm':
1483
+ case 'r': {
1484
+ if (!rest) {
1485
+ console.log(pc.yellow(' Usage: /mcp remove <server-name>'));
1486
+ return;
1487
+ }
1488
+ const result = removeServerFromConfig(rest);
1489
+ if (result.success) {
1490
+ console.log(pc.green(` ${result.message}`));
1491
+ }
1492
+ else {
1493
+ console.log(pc.yellow(` ${result.message}`));
1494
+ }
1495
+ return;
1496
+ }
1497
+ case 'info': {
1498
+ if (!rest) {
1499
+ console.log(pc.yellow(' Usage: /mcp info <server-name>'));
1500
+ return;
1501
+ }
1502
+ try {
1503
+ console.log(pc.dim(` Fetching "${rest}" from registry...`));
1504
+ const entry = await fetchServerByName(rest);
1505
+ if (!entry) {
1506
+ console.log(pc.yellow(` Server "${rest}" not found.`));
1507
+ return;
1508
+ }
1509
+ console.log(`\n ${pc.bold(entry.title || entry.name)}`);
1510
+ console.log(` ${pc.dim(entry.description)}`);
1511
+ console.log(` ${pc.gray('Name:')} ${entry.name}`);
1512
+ console.log(` ${pc.gray('Version:')} ${entry.version}`);
1513
+ if (entry.websiteUrl)
1514
+ console.log(` ${pc.gray('Website:')} ${entry.websiteUrl}`);
1515
+ if (entry.repository?.url)
1516
+ console.log(` ${pc.gray('Source:')} ${entry.repository.url}`);
1517
+ if (entry.remotes && entry.remotes.length > 0) {
1518
+ console.log(`\n ${pc.bold('Remote endpoints:')}`);
1519
+ for (const r of entry.remotes) {
1520
+ console.log(` ${pc.cyan(r.type)} ${pc.dim(r.url)}`);
1521
+ if (r.headers) {
1522
+ for (const h of r.headers) {
1523
+ const req = h.isRequired ? pc.yellow(' (required)') : '';
1524
+ const secret = h.isSecret ? pc.dim(' [secret]') : '';
1525
+ console.log(` ${pc.gray('Header:')} ${h.name}${req}${secret}`);
1526
+ }
1527
+ }
1528
+ }
1529
+ }
1530
+ if (entry.packages && entry.packages.length > 0) {
1531
+ console.log(`\n ${pc.bold('Packages:')}`);
1532
+ for (const p of entry.packages) {
1533
+ const [cmd, ...args] = p.registryType === 'npm' ? ['npx', '-y', p.identifier]
1534
+ : p.registryType === 'pypi' ? ['uvx', p.identifier]
1535
+ : [p.identifier];
1536
+ console.log(` ${pc.cyan(p.registryType)} ${pc.dim(`${cmd} ${args.join(' ')}`)}`);
1537
+ if (p.environmentVariables) {
1538
+ for (const env of p.environmentVariables) {
1539
+ const req = env.isRequired ? pc.yellow(' (required)') : '';
1540
+ const secret = env.isSecret ? pc.dim(' [secret]') : '';
1541
+ console.log(` ${pc.gray('Env:')} ${env.name}${req}${secret}`);
1542
+ if (env.description)
1543
+ console.log(` ${pc.dim(env.description)}`);
1544
+ }
1545
+ }
1546
+ }
1547
+ }
1548
+ console.log();
1549
+ }
1550
+ catch (err) {
1551
+ console.log(pc.red(` Info fetch failed: ${err.message}`));
1552
+ }
1553
+ return;
1554
+ }
1555
+ case 'enable':
1556
+ case 'e': {
1557
+ if (!rest) {
1558
+ console.log(pc.yellow(' Usage: /mcp enable <server-name>'));
1559
+ return;
1560
+ }
1561
+ const enableResult = toggleServer(rest, true);
1562
+ console.log(enableResult.success ? pc.green(` ${enableResult.message}`) : pc.yellow(` ${enableResult.message}`));
1563
+ return;
1564
+ }
1565
+ case 'disable':
1566
+ case 'd': {
1567
+ if (!rest) {
1568
+ console.log(pc.yellow(' Usage: /mcp disable <server-name>'));
1569
+ return;
1570
+ }
1571
+ const disableResult = toggleServer(rest, false);
1572
+ console.log(disableResult.success ? pc.green(` ${disableResult.message}`) : pc.yellow(` ${disableResult.message}`));
1573
+ return;
1574
+ }
1575
+ default:
1576
+ console.log(pc.bold('\n MCP Server Manager'));
1577
+ console.log(` ${pc.cyan('/mcp explore')} ${pc.dim('Browse available servers in the registry')}`);
1578
+ console.log(` ${pc.cyan('/mcp search <query>')} ${pc.dim('Search the official MCP registry')}`);
1579
+ console.log(` ${pc.cyan('/mcp install <name>')} ${pc.dim('Install a server from the registry')}`);
1580
+ console.log(` ${pc.cyan('/mcp list')} ${pc.dim('List installed servers')}`);
1581
+ console.log(` ${pc.cyan('/mcp remove <name>')} ${pc.dim('Remove an installed server')}`);
1582
+ console.log(` ${pc.cyan('/mcp info <name>')} ${pc.dim('Show server details')}`);
1583
+ console.log(` ${pc.cyan('/mcp enable <name>')} ${pc.dim('Enable a disabled server')}`);
1584
+ console.log(` ${pc.cyan('/mcp disable <name>')} ${pc.dim('Disable a server without removing it')}`);
1585
+ console.log(`\n ${pc.bold('Zero-config starters (no API keys needed):')}`);
1586
+ console.log(` ${pc.gray('→')} ${pc.cyan('io.github/modelcontextprotocol/sequential-thinking')} ${pc.dim('Step-by-step reasoning')}`);
1587
+ console.log(` ${pc.gray('→')} ${pc.cyan('io.github/modelcontextprotocol/filesystem')} ${pc.dim('Read/write files in allowed dirs')}`);
1588
+ console.log(` ${pc.gray('→')} ${pc.cyan('io.github/modelcontextprotocol/memory')} ${pc.dim('Persistent key-value store')}`);
1589
+ console.log(` ${pc.gray('→')} ${pc.cyan('io.github/modelcontextprotocol/fetch')} ${pc.dim('Fetch URLs and extract content')}`);
1590
+ console.log(` ${pc.gray('→')} ${pc.cyan('io.github/modelcontextprotocol/puppeteer')} ${pc.dim('Browser automation')}`);
1591
+ console.log(` ${pc.gray('→')} ${pc.cyan('ai.ankimcp/anki-mcp-server')} ${pc.dim('Anki flashcard management')}`);
1592
+ console.log(` ${pc.dim(' /mcp install <name> to install any of the above')}`);
1593
+ console.log();
1594
+ }
1595
+ }
1596
+ },
1351
1597
  {
1352
1598
  name: 'exit',
1353
1599
  aliases: ['quit'],