run-mcp 1.6.2 → 1.6.3
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/dist/index.js +74 -28
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -921,7 +921,7 @@ var TargetManager = class _TargetManager extends EventEmitter {
|
|
|
921
921
|
this.transport = stdioTransport;
|
|
922
922
|
}
|
|
923
923
|
this.client = new Client(
|
|
924
|
-
{ name: "run-mcp", version: "1.6.
|
|
924
|
+
{ name: "run-mcp", version: "1.6.3" },
|
|
925
925
|
{
|
|
926
926
|
capabilities: {
|
|
927
927
|
roots: { listChanged: true },
|
|
@@ -1620,6 +1620,7 @@ import { createInterface } from "readline";
|
|
|
1620
1620
|
import { checkbox, confirm, input as input2, search } from "@inquirer/prompts";
|
|
1621
1621
|
import pc2 from "picocolors";
|
|
1622
1622
|
var KNOWN_COMMANDS = [
|
|
1623
|
+
"menu",
|
|
1623
1624
|
"explore",
|
|
1624
1625
|
"interactive",
|
|
1625
1626
|
"tools/list",
|
|
@@ -2078,7 +2079,7 @@ async function startRepl(targetCommand, opts) {
|
|
|
2078
2079
|
await target.close();
|
|
2079
2080
|
process.exit(0);
|
|
2080
2081
|
} else {
|
|
2081
|
-
|
|
2082
|
+
mainMenuLoop(target, interceptor);
|
|
2082
2083
|
}
|
|
2083
2084
|
}
|
|
2084
2085
|
function startReadlineLoop(target, interceptor) {
|
|
@@ -2174,11 +2175,16 @@ async function handleCommand(input3, target, interceptor) {
|
|
|
2174
2175
|
case "?":
|
|
2175
2176
|
printShortHelp();
|
|
2176
2177
|
return;
|
|
2178
|
+
case "menu":
|
|
2177
2179
|
case "explore":
|
|
2178
2180
|
case "interactive":
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2181
|
+
if (activeRl) {
|
|
2182
|
+
globalPauseReadlineClose = true;
|
|
2183
|
+
activeRl.close();
|
|
2184
|
+
activeRl = null;
|
|
2185
|
+
globalPauseReadlineClose = false;
|
|
2186
|
+
}
|
|
2187
|
+
mainMenuLoop(target, interceptor);
|
|
2182
2188
|
return;
|
|
2183
2189
|
case "tools/list":
|
|
2184
2190
|
await cmdToolsList(target);
|
|
@@ -3299,7 +3305,7 @@ async function pickInteractive(items, message) {
|
|
|
3299
3305
|
throw err;
|
|
3300
3306
|
}
|
|
3301
3307
|
}
|
|
3302
|
-
async function
|
|
3308
|
+
async function showMainMenu(target, interceptor) {
|
|
3303
3309
|
const choices = [];
|
|
3304
3310
|
const caps = target.getServerCapabilities() ?? {};
|
|
3305
3311
|
try {
|
|
@@ -3339,26 +3345,30 @@ async function cmdExplore(target, interceptor) {
|
|
|
3339
3345
|
} catch {
|
|
3340
3346
|
}
|
|
3341
3347
|
}
|
|
3342
|
-
|
|
3343
|
-
|
|
3344
|
-
|
|
3345
|
-
|
|
3346
|
-
|
|
3347
|
-
|
|
3348
|
-
|
|
3349
|
-
|
|
3350
|
-
|
|
3351
|
-
|
|
3352
|
-
|
|
3353
|
-
|
|
3354
|
-
|
|
3355
|
-
|
|
3356
|
-
|
|
3357
|
-
|
|
3358
|
-
|
|
3348
|
+
choices.push({
|
|
3349
|
+
name: "\u2699\uFE0F Check Server Status",
|
|
3350
|
+
value: { type: "command", name: "status" },
|
|
3351
|
+
description: "View connection status and server info"
|
|
3352
|
+
});
|
|
3353
|
+
choices.push({
|
|
3354
|
+
name: "\u{1F504} Reconnect Server",
|
|
3355
|
+
value: { type: "command", name: "reconnect" },
|
|
3356
|
+
description: "Restart the target MCP server"
|
|
3357
|
+
});
|
|
3358
|
+
choices.push({
|
|
3359
|
+
name: "\u2328\uFE0F Type a raw command",
|
|
3360
|
+
value: { type: "raw" },
|
|
3361
|
+
description: "Drop to the traditional REPL prompt (use 'menu' to return)"
|
|
3362
|
+
});
|
|
3363
|
+
choices.push({
|
|
3364
|
+
name: "\u{1F6AA} Exit",
|
|
3365
|
+
value: { type: "command", name: "exit" },
|
|
3366
|
+
description: "Close connection and exit"
|
|
3367
|
+
});
|
|
3368
|
+
if (!process.stdin.isTTY) return false;
|
|
3359
3369
|
try {
|
|
3360
3370
|
const answer = await search({
|
|
3361
|
-
message: "
|
|
3371
|
+
message: "Select an action (start typing to search):",
|
|
3362
3372
|
source: async (term) => {
|
|
3363
3373
|
if (!term) return choices;
|
|
3364
3374
|
const lower = term.toLowerCase();
|
|
@@ -3373,10 +3383,46 @@ async function cmdExplore(target, interceptor) {
|
|
|
3373
3383
|
await cmdResourcesRead(target, answer.uri);
|
|
3374
3384
|
} else if (answer.type === "prompt") {
|
|
3375
3385
|
await cmdPromptsGet(target, answer.name);
|
|
3386
|
+
} else if (answer.type === "command") {
|
|
3387
|
+
if (answer.name === "status") {
|
|
3388
|
+
cmdStatus(target);
|
|
3389
|
+
} else if (answer.name === "reconnect") {
|
|
3390
|
+
await cmdReconnect(target);
|
|
3391
|
+
} else if (answer.name === "exit") {
|
|
3392
|
+
console.log(pc2.dim("\nShutting down..."));
|
|
3393
|
+
await target.close();
|
|
3394
|
+
process.exit(0);
|
|
3395
|
+
}
|
|
3396
|
+
} else if (answer.type === "raw") {
|
|
3397
|
+
return true;
|
|
3376
3398
|
}
|
|
3399
|
+
return false;
|
|
3377
3400
|
} catch (err) {
|
|
3378
|
-
if (
|
|
3379
|
-
|
|
3401
|
+
if (isAbortError(err)) {
|
|
3402
|
+
console.log(pc2.dim("\nShutting down..."));
|
|
3403
|
+
await target.close();
|
|
3404
|
+
process.exit(0);
|
|
3405
|
+
}
|
|
3406
|
+
throw err;
|
|
3407
|
+
}
|
|
3408
|
+
}
|
|
3409
|
+
async function mainMenuLoop(target, interceptor) {
|
|
3410
|
+
if (isScriptMode || !process.stdin.isTTY) {
|
|
3411
|
+
startReadlineLoop(target, interceptor);
|
|
3412
|
+
return;
|
|
3413
|
+
}
|
|
3414
|
+
while (true) {
|
|
3415
|
+
try {
|
|
3416
|
+
const dropToRaw = await showMainMenu(target, interceptor);
|
|
3417
|
+
if (dropToRaw) {
|
|
3418
|
+
console.log(pc2.dim(" Entering raw command mode. Type 'menu' to return."));
|
|
3419
|
+
startReadlineLoop(target, interceptor);
|
|
3420
|
+
break;
|
|
3421
|
+
}
|
|
3422
|
+
} catch (err) {
|
|
3423
|
+
console.error(pc2.red(`Error in menu: ${err.message}`));
|
|
3424
|
+
startReadlineLoop(target, interceptor);
|
|
3425
|
+
break;
|
|
3380
3426
|
}
|
|
3381
3427
|
}
|
|
3382
3428
|
}
|
|
@@ -3444,7 +3490,7 @@ async function startServer(opts) {
|
|
|
3444
3490
|
mediaThresholdKb: opts.mediaThresholdKb
|
|
3445
3491
|
});
|
|
3446
3492
|
const mcpServer = new McpServer(
|
|
3447
|
-
{ name: "run-mcp", version: "1.6.
|
|
3493
|
+
{ name: "run-mcp", version: "1.6.3" },
|
|
3448
3494
|
{
|
|
3449
3495
|
capabilities: {
|
|
3450
3496
|
tools: {},
|
|
@@ -4732,7 +4778,7 @@ program.command("close-session").argument("<session_name>", "Session name").desc
|
|
|
4732
4778
|
}
|
|
4733
4779
|
}
|
|
4734
4780
|
});
|
|
4735
|
-
program.name("run-mcp").description("A smart interactive REPL and live test harness for MCP servers").version("1.6.
|
|
4781
|
+
program.name("run-mcp").description("A smart interactive REPL and live test harness for MCP servers").version("1.6.3").passThroughOptions().allowUnknownOption().argument(
|
|
4736
4782
|
"[target_command...]",
|
|
4737
4783
|
"Command to spawn the target MCP server (starts REPL if provided, Agent server otherwise)"
|
|
4738
4784
|
).option("-o, --out-dir <path>", "Directory to save intercepted images and audio").option(
|