@ai-ecoverse/mcpcat 0.15.1 → 0.15.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.
- package/README.md +1 -1
- package/dist/host/mcpcat.mjs +7 -4
- package/dist/kernel/mcpcat.mjs +27 -6
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -22,7 +22,7 @@ Or via npm:
|
|
|
22
22
|
npm install -g @ai-ecoverse/mcpcat
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
-
mcpcat runs natively on macOS, Linux and Windows (Node ≥ 24), and inside Sliccy Seven as a kernel program, with the same flags, the same output and the same config file in both places. Orphan-free shutdown of stdio server trees in the kernel needs slicc-kernel ≥ 1.74.0; on older kernels only the direct child is signalled.
|
|
25
|
+
mcpcat runs natively on macOS, Linux and Windows (Node ≥ 24), and inside Sliccy Seven as a kernel program, with the same flags, the same output and the same config file in both places. Orphan-free shutdown of stdio server trees in the kernel needs slicc-kernel ≥ 1.74.0; on older kernels only the direct child is signalled. A SIGKILLed mcpcat runs no handler. On slicc-kernel ≥ 1.88.0, mcpcat spawns stdio servers and served commands with a parent death signal (like Linux `PR_SET_PDEATHSIG`), so the kernel SIGKILLs each server's process group when mcpcat dies. On older kernels, and on the host, where there is no portable equivalent, servers that exit on stdin EOF (most MCP servers) still stop, but servers that ignore it keep running.
|
|
26
26
|
|
|
27
27
|
## Quick start
|
|
28
28
|
|
package/dist/host/mcpcat.mjs
CHANGED
|
@@ -8177,7 +8177,8 @@ var PlatformStdioTransport = class {
|
|
|
8177
8177
|
this.process = await this.options.platform.spawn({
|
|
8178
8178
|
argv: [this.options.command, ...this.options.args ?? []],
|
|
8179
8179
|
env,
|
|
8180
|
-
cwd: this.options.cwd
|
|
8180
|
+
cwd: this.options.cwd,
|
|
8181
|
+
dieWithParent: true
|
|
8181
8182
|
});
|
|
8182
8183
|
trackStdio(this.process);
|
|
8183
8184
|
}
|
|
@@ -8911,7 +8912,8 @@ async function probeStdioStateless(options) {
|
|
|
8911
8912
|
const proc = await options.platform.spawn({
|
|
8912
8913
|
argv: [options.command, ...options.args ?? []],
|
|
8913
8914
|
env: inheritedEnv,
|
|
8914
|
-
cwd: options.cwd
|
|
8915
|
+
cwd: options.cwd,
|
|
8916
|
+
dieWithParent: true
|
|
8915
8917
|
});
|
|
8916
8918
|
trackStdio(proc);
|
|
8917
8919
|
const rpc = createStdioJsonRpc(proc, options.platform, {
|
|
@@ -12529,7 +12531,8 @@ async function runCommand(platform2, cmdPath, argv, childEnv, stdin, timeoutMs,
|
|
|
12529
12531
|
proc = await platform2.spawn({
|
|
12530
12532
|
argv: [cmdPath, ...argv],
|
|
12531
12533
|
env: childEnv,
|
|
12532
|
-
cwd
|
|
12534
|
+
cwd,
|
|
12535
|
+
dieWithParent: true
|
|
12533
12536
|
});
|
|
12534
12537
|
} catch (err) {
|
|
12535
12538
|
return { stdout: "", stderr: `spawn failed: ${err.message}`, exitCode: 127 };
|
|
@@ -16684,5 +16687,5 @@ try {
|
|
|
16684
16687
|
});
|
|
16685
16688
|
} catch {
|
|
16686
16689
|
}
|
|
16687
|
-
var code = await run(platform, "0.15.
|
|
16690
|
+
var code = await run(platform, "0.15.2", args);
|
|
16688
16691
|
process.exit(code);
|
package/dist/kernel/mcpcat.mjs
CHANGED
|
@@ -7798,7 +7798,8 @@ var PlatformStdioTransport = class {
|
|
|
7798
7798
|
this.process = await this.options.platform.spawn({
|
|
7799
7799
|
argv: [this.options.command, ...this.options.args ?? []],
|
|
7800
7800
|
env: env2,
|
|
7801
|
-
cwd: this.options.cwd
|
|
7801
|
+
cwd: this.options.cwd,
|
|
7802
|
+
dieWithParent: true
|
|
7802
7803
|
});
|
|
7803
7804
|
trackStdio(this.process);
|
|
7804
7805
|
}
|
|
@@ -8532,7 +8533,8 @@ async function probeStdioStateless(options) {
|
|
|
8532
8533
|
const proc = await options.platform.spawn({
|
|
8533
8534
|
argv: [options.command, ...options.args ?? []],
|
|
8534
8535
|
env: inheritedEnv,
|
|
8535
|
-
cwd: options.cwd
|
|
8536
|
+
cwd: options.cwd,
|
|
8537
|
+
dieWithParent: true
|
|
8536
8538
|
});
|
|
8537
8539
|
trackStdio(proc);
|
|
8538
8540
|
const rpc = createStdioJsonRpc(proc, options.platform, {
|
|
@@ -12150,7 +12152,8 @@ async function runCommand(platform2, cmdPath, argv, childEnv, stdin, timeoutMs,
|
|
|
12150
12152
|
proc = await platform2.spawn({
|
|
12151
12153
|
argv: [cmdPath, ...argv],
|
|
12152
12154
|
env: childEnv,
|
|
12153
|
-
cwd
|
|
12155
|
+
cwd,
|
|
12156
|
+
dieWithParent: true
|
|
12154
12157
|
});
|
|
12155
12158
|
} catch (err) {
|
|
12156
12159
|
return { stdout: "", stderr: `spawn failed: ${err.message}`, exitCode: 127 };
|
|
@@ -16094,9 +16097,14 @@ function kernelFs(ctx) {
|
|
|
16094
16097
|
};
|
|
16095
16098
|
}
|
|
16096
16099
|
var groupSpawnSupported;
|
|
16100
|
+
var deathSignalSupported;
|
|
16101
|
+
var PARENT_DEATH_SIGNAL = "SIGKILL";
|
|
16102
|
+
function isInvalid(err) {
|
|
16103
|
+
return err?.code === "EINVAL";
|
|
16104
|
+
}
|
|
16097
16105
|
async function kernelSpawn(ctx, options) {
|
|
16098
16106
|
const tryGroup = groupSpawnSupported !== false;
|
|
16099
|
-
const
|
|
16107
|
+
const base = {
|
|
16100
16108
|
argv: options.argv,
|
|
16101
16109
|
env: options.env,
|
|
16102
16110
|
cwd: options.cwd,
|
|
@@ -16104,7 +16112,20 @@ async function kernelSpawn(ctx, options) {
|
|
|
16104
16112
|
stdout: "pipe",
|
|
16105
16113
|
stderr: "pipe",
|
|
16106
16114
|
...tryGroup ? { pgid: 0 } : {}
|
|
16107
|
-
}
|
|
16115
|
+
};
|
|
16116
|
+
const tryDeath = options.dieWithParent === true && deathSignalSupported !== false;
|
|
16117
|
+
let result;
|
|
16118
|
+
if (tryDeath) {
|
|
16119
|
+
try {
|
|
16120
|
+
result = await ctx.spawn({ ...base, parentDeathSignal: PARENT_DEATH_SIGNAL });
|
|
16121
|
+
} catch (err) {
|
|
16122
|
+
if (!isInvalid(err)) throw err;
|
|
16123
|
+
deathSignalSupported = false;
|
|
16124
|
+
result = await ctx.spawn(base);
|
|
16125
|
+
}
|
|
16126
|
+
} else {
|
|
16127
|
+
result = await ctx.spawn(base);
|
|
16128
|
+
}
|
|
16108
16129
|
const childPid = result.pid;
|
|
16109
16130
|
if (groupSpawnSupported === void 0) {
|
|
16110
16131
|
try {
|
|
@@ -16348,7 +16369,7 @@ async function main(ctx) {
|
|
|
16348
16369
|
packageDir: "/node_modules/@ai-ecoverse/mcpcat"
|
|
16349
16370
|
});
|
|
16350
16371
|
const args = ctx.argv.slice(1);
|
|
16351
|
-
return run(platform2, "0.15.
|
|
16372
|
+
return run(platform2, "0.15.2", args);
|
|
16352
16373
|
}
|
|
16353
16374
|
export {
|
|
16354
16375
|
main as default
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-ecoverse/mcpcat",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.2",
|
|
4
4
|
"description": "A curl for the Model Context Protocol",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"trust:dry": "npx fledgling sync --dry-run -y --skip-publish"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
|
-
"@ai-ecoverse/slicc-kernel": "1.
|
|
59
|
+
"@ai-ecoverse/slicc-kernel": "1.88.0",
|
|
60
60
|
"@ai-ecoverse/slicc-shared-web": "1.13.1",
|
|
61
61
|
"@biomejs/biome": "2.5.15",
|
|
62
62
|
"@earendil-works/pi-codemode": "1.2.0",
|