mcp-agents 0.5.3 → 0.5.5
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 +39 -8
- package/package.json +1 -1
- package/server.js +27 -7
package/README.md
CHANGED
|
@@ -37,7 +37,9 @@ mcp-agents
|
|
|
37
37
|
# Specific provider
|
|
38
38
|
mcp-agents --provider claude
|
|
39
39
|
mcp-agents --provider gemini
|
|
40
|
-
|
|
40
|
+
|
|
41
|
+
# Optional: enable Gemini sandbox mode
|
|
42
|
+
mcp-agents --provider gemini --sandbox true
|
|
41
43
|
```
|
|
42
44
|
|
|
43
45
|
The server speaks [JSON-RPC over stdio](https://modelcontextprotocol.io/docs/concepts/transports#stdio). It prints `[mcp-agents] ready (provider: <name>)` to stderr when it's listening.
|
|
@@ -57,7 +59,9 @@ Each `--provider` flag maps to a single exposed tool:
|
|
|
57
59
|
| Parameter | Type | Required | Description |
|
|
58
60
|
|-----------|------|----------|-------------|
|
|
59
61
|
| `prompt` | `string` | yes | The prompt to send to Claude Code |
|
|
60
|
-
| `timeout_ms` | `integer` | no | Timeout in ms (default:
|
|
62
|
+
| `timeout_ms` | `integer` | no | Timeout in ms (default: 300 000 / 5 minutes) |
|
|
63
|
+
|
|
64
|
+
Any additional `tools/call` arguments are ignored (for example `model` or `model_reasoning_effort`).
|
|
61
65
|
|
|
62
66
|
### `gemini` parameters
|
|
63
67
|
|
|
@@ -65,7 +69,9 @@ Each `--provider` flag maps to a single exposed tool:
|
|
|
65
69
|
|-----------|------|----------|-------------|
|
|
66
70
|
| `prompt` | `string` | yes | The prompt to send to Gemini CLI |
|
|
67
71
|
| `sandbox` | `boolean` | no | Run in sandbox mode (`-s` flag, default: false) |
|
|
68
|
-
| `timeout_ms` | `integer` | no | Timeout in ms (default:
|
|
72
|
+
| `timeout_ms` | `integer` | no | Timeout in ms (default: 300 000 / 5 minutes) |
|
|
73
|
+
|
|
74
|
+
Any additional `tools/call` arguments are ignored (for example `model` or `model_reasoning_effort`).
|
|
69
75
|
|
|
70
76
|
### `codex` (pass-through)
|
|
71
77
|
|
|
@@ -92,20 +98,33 @@ Add entries to your project's `.mcp.json` (requires `npm i -g mcp-agents`):
|
|
|
92
98
|
},
|
|
93
99
|
"gemini": {
|
|
94
100
|
"command": "mcp-agents",
|
|
95
|
-
"args": ["--provider", "gemini"
|
|
101
|
+
"args": ["--provider", "gemini"]
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
Optional Gemini sandbox mode in `.mcp.json`:
|
|
108
|
+
|
|
109
|
+
```json
|
|
110
|
+
{
|
|
111
|
+
"mcpServers": {
|
|
112
|
+
"gemini": {
|
|
113
|
+
"command": "mcp-agents",
|
|
114
|
+
"args": ["--provider", "gemini", "--sandbox", "true"]
|
|
96
115
|
}
|
|
97
116
|
}
|
|
98
117
|
}
|
|
99
118
|
```
|
|
100
119
|
|
|
101
|
-
Override codex defaults:
|
|
120
|
+
Override codex defaults at server startup (not via `tools/call` arguments):
|
|
102
121
|
|
|
103
122
|
```json
|
|
104
123
|
{
|
|
105
124
|
"mcpServers": {
|
|
106
125
|
"codex": {
|
|
107
126
|
"command": "mcp-agents",
|
|
108
|
-
"args": ["--provider", "codex", "--model", "
|
|
127
|
+
"args": ["--provider", "codex", "--model", "gpt-5.3-codex", "--model_reasoning_effort", "medium"]
|
|
109
128
|
}
|
|
110
129
|
}
|
|
111
130
|
}
|
|
@@ -132,16 +151,28 @@ Override codex defaults:
|
|
|
132
151
|
|
|
133
152
|
## Integration with OpenAI Codex
|
|
134
153
|
|
|
135
|
-
Add two entries to `~/.codex/config.toml` — one per provider you want available
|
|
154
|
+
Add two entries to `~/.codex/config.toml` — one per provider you want available.
|
|
155
|
+
Set `tool_timeout_sec = 300` to avoid Codex MCP's default 60s per-tool timeout:
|
|
136
156
|
|
|
137
157
|
```toml
|
|
138
158
|
[mcp_servers.claude-code]
|
|
139
159
|
command = "mcp-agents"
|
|
140
160
|
args = ["--provider", "claude"]
|
|
161
|
+
tool_timeout_sec = 300
|
|
162
|
+
|
|
163
|
+
[mcp_servers.gemini]
|
|
164
|
+
command = "mcp-agents"
|
|
165
|
+
args = ["--provider", "gemini"]
|
|
166
|
+
tool_timeout_sec = 300
|
|
167
|
+
```
|
|
141
168
|
|
|
169
|
+
Optional Gemini sandbox mode in Codex config:
|
|
170
|
+
|
|
171
|
+
```toml
|
|
142
172
|
[mcp_servers.gemini]
|
|
143
173
|
command = "mcp-agents"
|
|
144
|
-
args = ["--provider", "gemini", "--sandbox", "
|
|
174
|
+
args = ["--provider", "gemini", "--sandbox", "true"]
|
|
175
|
+
tool_timeout_sec = 300
|
|
145
176
|
```
|
|
146
177
|
|
|
147
178
|
Then in a Codex session you can call the `claude_code` or `gemini` tools, which shell out to the respective CLIs.
|
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
|