@infinitedusky/indusk-mcp 1.5.3 → 1.5.4
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.
|
@@ -78,6 +78,7 @@ export async function extensionsEnable(projectRoot, names) {
|
|
|
78
78
|
// Check if already enabled
|
|
79
79
|
if (isEnabled(projectRoot, name)) {
|
|
80
80
|
console.info(` ${name}: already enabled`);
|
|
81
|
+
printMcpSetup(projectRoot, name);
|
|
81
82
|
continue;
|
|
82
83
|
}
|
|
83
84
|
// Try to move from disabled
|
|
@@ -85,6 +86,7 @@ export async function extensionsEnable(projectRoot, names) {
|
|
|
85
86
|
console.info(` ${name}: enabled (was disabled)`);
|
|
86
87
|
runHook(projectRoot, name, "on_init");
|
|
87
88
|
installSkill(projectRoot, name);
|
|
89
|
+
printMcpSetup(projectRoot, name);
|
|
88
90
|
continue;
|
|
89
91
|
}
|
|
90
92
|
// Try to copy from built-in
|
|
@@ -96,6 +98,7 @@ export async function extensionsEnable(projectRoot, names) {
|
|
|
96
98
|
console.info(` ${name}: enabled (built-in)`);
|
|
97
99
|
runHook(projectRoot, name, "on_init");
|
|
98
100
|
installSkill(projectRoot, name);
|
|
101
|
+
printMcpSetup(projectRoot, name);
|
|
99
102
|
continue;
|
|
100
103
|
}
|
|
101
104
|
console.info(` ${name}: not found — use 'extensions add ${name} --from <source>' for third-party`);
|
|
@@ -480,6 +483,56 @@ function runHook(projectRoot, name, hook) {
|
|
|
480
483
|
console.info(` ${name}: ${hook} hook failed`);
|
|
481
484
|
}
|
|
482
485
|
}
|
|
486
|
+
function printMcpSetup(projectRoot, name) {
|
|
487
|
+
const manifestPath = resolveManifestPath(extensionsDir(projectRoot), name);
|
|
488
|
+
if (!manifestPath) {
|
|
489
|
+
// Try built-in
|
|
490
|
+
const builtinPath = join(builtinDir, name, "manifest.json");
|
|
491
|
+
if (!existsSync(builtinPath))
|
|
492
|
+
return;
|
|
493
|
+
const manifest = loadExtension(builtinPath);
|
|
494
|
+
if (!manifest?.mcp_server)
|
|
495
|
+
return;
|
|
496
|
+
printMcpInstructions(name, manifest);
|
|
497
|
+
return;
|
|
498
|
+
}
|
|
499
|
+
const manifest = loadExtension(manifestPath);
|
|
500
|
+
if (!manifest?.mcp_server)
|
|
501
|
+
return;
|
|
502
|
+
printMcpInstructions(name, manifest);
|
|
503
|
+
}
|
|
504
|
+
function printMcpInstructions(name, manifest) {
|
|
505
|
+
const server = manifest.mcp_server;
|
|
506
|
+
if (!server)
|
|
507
|
+
return;
|
|
508
|
+
const needsAuth = server.headers && Object.keys(server.headers).length > 0;
|
|
509
|
+
// Auto-run claude mcp add for no-auth HTTP servers
|
|
510
|
+
if (!needsAuth && server.type === "http" && server.url) {
|
|
511
|
+
const cmd = `claude mcp add -t http -s project -- ${name} ${server.url}`;
|
|
512
|
+
console.info(`\n ${name}: adding MCP server...`);
|
|
513
|
+
try {
|
|
514
|
+
execSync(cmd, { timeout: 15000, stdio: ["ignore", "pipe", "pipe"] });
|
|
515
|
+
console.info(` ${name}: MCP server added (restart Claude Code to load)`);
|
|
516
|
+
}
|
|
517
|
+
catch {
|
|
518
|
+
console.info(` ${name}: auto-add failed. Run manually:`);
|
|
519
|
+
console.info(` ${cmd}`);
|
|
520
|
+
}
|
|
521
|
+
return;
|
|
522
|
+
}
|
|
523
|
+
// For servers needing auth, print setup instructions
|
|
524
|
+
if (server.setup_instructions?.length) {
|
|
525
|
+
console.info(`\n ${name} MCP setup:`);
|
|
526
|
+
for (const instruction of server.setup_instructions) {
|
|
527
|
+
console.info(` ${instruction}`);
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
else if (server.type === "http" && server.url) {
|
|
531
|
+
console.info(`\n ${name} MCP setup:`);
|
|
532
|
+
console.info(` claude mcp add -t http -- ${name} ${server.url}`);
|
|
533
|
+
}
|
|
534
|
+
console.info("");
|
|
535
|
+
}
|
|
483
536
|
function installSkill(projectRoot, name) {
|
|
484
537
|
const manifestPath = resolveManifestPath(extensionsDir(projectRoot), name);
|
|
485
538
|
if (!manifestPath)
|