@moor-sh/mcp 0.3.0 → 0.4.0
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/package.json +1 -1
- package/src/index.ts +15 -3
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -364,15 +364,27 @@ server.registerTool(
|
|
|
364
364
|
"moor_exec",
|
|
365
365
|
{
|
|
366
366
|
title: "Execute Command",
|
|
367
|
-
description:
|
|
367
|
+
description:
|
|
368
|
+
"Run a shell command inside a project's running container. Bounded by a per-call timeout (default 10 min, max 1 h). For jobs that may exceed an hour, wait for the async exec tools to ship.",
|
|
368
369
|
inputSchema: z.object({
|
|
369
370
|
project: z.string().describe("Project name or ID"),
|
|
370
371
|
command: z.string().describe("Shell command to execute"),
|
|
372
|
+
timeout_ms: z
|
|
373
|
+
.number()
|
|
374
|
+
.int()
|
|
375
|
+
.min(1000)
|
|
376
|
+
.max(3_600_000)
|
|
377
|
+
.optional()
|
|
378
|
+
.describe(
|
|
379
|
+
"Max time in milliseconds before the exec is aborted. Default 600000 (10 min). Max 3600000 (1 h).",
|
|
380
|
+
),
|
|
371
381
|
}),
|
|
372
382
|
},
|
|
373
|
-
async ({ project, command }) => {
|
|
383
|
+
async ({ project, command, timeout_ms }) => {
|
|
374
384
|
const p = await resolveProject(project);
|
|
375
|
-
const
|
|
385
|
+
const body: Record<string, unknown> = { command };
|
|
386
|
+
if (timeout_ms !== undefined) body.timeout_ms = timeout_ms;
|
|
387
|
+
const res = await apiPost(`/api/projects/${p.id}/exec`, body);
|
|
376
388
|
if (!res.ok) throw new Error(`Failed: ${await res.text()}`);
|
|
377
389
|
const result = (await res.json()) as {
|
|
378
390
|
exitCode: number;
|