mcp-agents 0.5.3 → 0.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.
- package/README.md +8 -4
- package/package.json +1 -1
- package/server.js +27 -7
package/README.md
CHANGED
|
@@ -57,7 +57,9 @@ Each `--provider` flag maps to a single exposed tool:
|
|
|
57
57
|
| Parameter | Type | Required | Description |
|
|
58
58
|
|-----------|------|----------|-------------|
|
|
59
59
|
| `prompt` | `string` | yes | The prompt to send to Claude Code |
|
|
60
|
-
| `timeout_ms` | `integer` | no | Timeout in ms (default:
|
|
60
|
+
| `timeout_ms` | `integer` | no | Timeout in ms (default: 300 000 / 5 minutes) |
|
|
61
|
+
|
|
62
|
+
Any additional `tools/call` arguments are ignored (for example `model` or `model_reasoning_effort`).
|
|
61
63
|
|
|
62
64
|
### `gemini` parameters
|
|
63
65
|
|
|
@@ -65,7 +67,9 @@ Each `--provider` flag maps to a single exposed tool:
|
|
|
65
67
|
|-----------|------|----------|-------------|
|
|
66
68
|
| `prompt` | `string` | yes | The prompt to send to Gemini CLI |
|
|
67
69
|
| `sandbox` | `boolean` | no | Run in sandbox mode (`-s` flag, default: false) |
|
|
68
|
-
| `timeout_ms` | `integer` | no | Timeout in ms (default:
|
|
70
|
+
| `timeout_ms` | `integer` | no | Timeout in ms (default: 300 000 / 5 minutes) |
|
|
71
|
+
|
|
72
|
+
Any additional `tools/call` arguments are ignored (for example `model` or `model_reasoning_effort`).
|
|
69
73
|
|
|
70
74
|
### `codex` (pass-through)
|
|
71
75
|
|
|
@@ -98,14 +102,14 @@ Add entries to your project's `.mcp.json` (requires `npm i -g mcp-agents`):
|
|
|
98
102
|
}
|
|
99
103
|
```
|
|
100
104
|
|
|
101
|
-
Override codex defaults:
|
|
105
|
+
Override codex defaults at server startup (not via `tools/call` arguments):
|
|
102
106
|
|
|
103
107
|
```json
|
|
104
108
|
{
|
|
105
109
|
"mcpServers": {
|
|
106
110
|
"codex": {
|
|
107
111
|
"command": "mcp-agents",
|
|
108
|
-
"args": ["--provider", "codex", "--model", "
|
|
112
|
+
"args": ["--provider", "codex", "--model", "gpt-5.3-codex", "--model_reasoning_effort", "medium"]
|
|
109
113
|
}
|
|
110
114
|
}
|
|
111
115
|
}
|
package/package.json
CHANGED
package/server.js
CHANGED
|
@@ -29,7 +29,8 @@ const CLI_BACKENDS = {
|
|
|
29
29
|
claude: {
|
|
30
30
|
command: "claude",
|
|
31
31
|
toolName: "claude_code",
|
|
32
|
-
description:
|
|
32
|
+
description:
|
|
33
|
+
"Run Claude Code CLI with a prompt (via stdin). Supports prompt + optional timeout_ms only; other arguments are ignored.",
|
|
33
34
|
stdinPrompt: true,
|
|
34
35
|
buildArgs: () => ["--no-session-persistence", "-p"],
|
|
35
36
|
extraProperties: {},
|
|
@@ -37,7 +38,8 @@ const CLI_BACKENDS = {
|
|
|
37
38
|
gemini: {
|
|
38
39
|
command: "gemini",
|
|
39
40
|
toolName: "gemini",
|
|
40
|
-
description:
|
|
41
|
+
description:
|
|
42
|
+
"Run Gemini CLI (gemini -p) with a prompt. Supports prompt + optional timeout_ms/sandbox only; other arguments are ignored.",
|
|
41
43
|
stdinPrompt: false,
|
|
42
44
|
buildArgs: (prompt, opts) => {
|
|
43
45
|
const args = [];
|
|
@@ -352,7 +354,7 @@ async function main() {
|
|
|
352
354
|
const properties = {
|
|
353
355
|
prompt: {
|
|
354
356
|
type: "string",
|
|
355
|
-
description: `Prompt for ${backend.command}
|
|
357
|
+
description: `Prompt for ${backend.command}. Unsupported extra arguments are ignored.`,
|
|
356
358
|
},
|
|
357
359
|
timeout_ms: {
|
|
358
360
|
type: "integer",
|
|
@@ -379,7 +381,7 @@ async function main() {
|
|
|
379
381
|
description: backend.description,
|
|
380
382
|
inputSchema: {
|
|
381
383
|
type: "object",
|
|
382
|
-
additionalProperties:
|
|
384
|
+
additionalProperties: true,
|
|
383
385
|
properties,
|
|
384
386
|
required: ["prompt"],
|
|
385
387
|
},
|
|
@@ -404,8 +406,26 @@ async function main() {
|
|
|
404
406
|
};
|
|
405
407
|
}
|
|
406
408
|
|
|
407
|
-
const
|
|
408
|
-
|
|
409
|
+
const rawArgs =
|
|
410
|
+
params.arguments && typeof params.arguments === "object"
|
|
411
|
+
? params.arguments
|
|
412
|
+
: {};
|
|
413
|
+
const allowedArgKeys = new Set([
|
|
414
|
+
"prompt",
|
|
415
|
+
"timeout_ms",
|
|
416
|
+
...Object.keys(backend.extraProperties),
|
|
417
|
+
]);
|
|
418
|
+
const ignoredArgKeys = Object.keys(rawArgs).filter(
|
|
419
|
+
(key) => !allowedArgKeys.has(key),
|
|
420
|
+
);
|
|
421
|
+
if (ignoredArgKeys.length > 0) {
|
|
422
|
+
logErr(
|
|
423
|
+
`[mcp-agents] tools/call: ignoring unsupported args: ${ignoredArgKeys.join(", ")}`,
|
|
424
|
+
);
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
const prompt = toStringArg(rawArgs.prompt);
|
|
428
|
+
const timeoutMsRaw = rawArgs.timeout_ms;
|
|
409
429
|
const timeoutMs = Number.isInteger(timeoutMsRaw)
|
|
410
430
|
? timeoutMsRaw
|
|
411
431
|
: effectiveTimeout;
|
|
@@ -424,7 +444,7 @@ async function main() {
|
|
|
424
444
|
|
|
425
445
|
const extraOpts = {};
|
|
426
446
|
for (const key of Object.keys(backend.extraProperties)) {
|
|
427
|
-
extraOpts[key] =
|
|
447
|
+
extraOpts[key] = rawArgs[key] ?? backend.extraProperties[key].default;
|
|
428
448
|
}
|
|
429
449
|
|
|
430
450
|
const cliArgs = backend.stdinPrompt
|