run-mcp 1.3.2 → 1.5.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/README.md +50 -39
- package/dist/index.js +2297 -333
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -4,10 +4,10 @@ A smart proxy, interactive REPL, and live test harness for [Model Context Protoc
|
|
|
4
4
|
|
|
5
5
|
`run-mcp` operates in two modes:
|
|
6
6
|
|
|
7
|
-
1. **
|
|
8
|
-
2. **
|
|
7
|
+
1. **Agent MCP Server** (`run-mcp`) — An MCP server that exposes tools (`connect_to_mcp`, `call_mcp_tool`) so AI agents can dynamically connect to and test local MCP projects without hardcoding them in configuration files. This is the **default mode** when you run `npx -y run-mcp`.
|
|
8
|
+
2. **Interactive REPL** (`run-mcp repl`) — A headless CLI for human developers to manually test and explore MCP servers using short, memorable commands (`tools/call`, `status`, etc.).
|
|
9
9
|
|
|
10
|
-
### Interception Rules (Server
|
|
10
|
+
### Interception Rules (Agent Server & REPL)
|
|
11
11
|
|
|
12
12
|
To protect the CLI and parent agents from large payloads, `run-mcp` automatically applies the following rules:
|
|
13
13
|
|
|
@@ -40,6 +40,9 @@ run-mcp repl node path/to/my-mcp-server.js
|
|
|
40
40
|
|
|
41
41
|
# Or use npx without installing globally
|
|
42
42
|
npx . repl node path/to/my-mcp-server.js
|
|
43
|
+
|
|
44
|
+
# Or start it without arguments to open the interactive server discovery menu!
|
|
45
|
+
run-mcp
|
|
43
46
|
```
|
|
44
47
|
|
|
45
48
|
You'll see an interactive prompt:
|
|
@@ -55,47 +58,43 @@ You'll see an interactive prompt:
|
|
|
55
58
|
|
|
56
59
|
## Usage
|
|
57
60
|
|
|
58
|
-
|
|
59
|
-
run-mcp <command> [options]
|
|
60
|
-
|
|
61
|
-
Commands:
|
|
62
|
-
repl <target_command...> Start an interactive REPL session
|
|
63
|
-
server Start as an MCP server for agents
|
|
61
|
+
run-mcp [options] [target_command...]
|
|
64
62
|
|
|
65
63
|
Options:
|
|
66
64
|
-V, --version Show version number
|
|
67
|
-
-
|
|
68
|
-
|
|
65
|
+
-o, --out-dir <path> Directory to save intercepted images and audio
|
|
66
|
+
-t, --timeout <ms> Default tool call timeout in milliseconds (default: 300000) (Agent Mode only)
|
|
67
|
+
--max-text <chars> Max text response length before truncation (default: 50000) (Agent Mode only)
|
|
68
|
+
--mcp Force start Agent Server mode even if run interactively without arguments
|
|
69
|
+
-s, --script <file> Read commands from a file instead of stdin (REPL Mode only)
|
|
70
|
+
-h, --help Display help for command
|
|
69
71
|
|
|
70
|
-
|
|
72
|
+
Examples:
|
|
73
|
+
$ run-mcp # Test harness (agent mode)
|
|
74
|
+
$ run-mcp node my-server.js # Interactive testing (human REPL mode)
|
|
75
|
+
$ run-mcp node my-server.js -s test.txt # Run a script in REPL mode
|
|
76
|
+
$ run-mcp npx -y some-mcp-server # Test an npx server
|
|
77
|
+
$ run-mcp --out-dir ./test-output # Agent mode with options
|
|
78
|
+
$ run-mcp --out-dir ./screenshots node srv.js # REPL mode with options
|
|
71
79
|
|
|
72
|
-
```
|
|
73
|
-
run-mcp repl <target_command...> [options]
|
|
74
80
|
|
|
75
|
-
Options:
|
|
76
|
-
-s, --script <file> Read commands from a file instead of stdin
|
|
77
|
-
-o, --out-dir <path> Directory to save intercepted images (default: $TMPDIR/run-mcp)
|
|
78
|
-
```
|
|
79
81
|
|
|
80
|
-
|
|
82
|
+
## Agent Use Cases
|
|
81
83
|
|
|
82
|
-
|
|
83
|
-
run-mcp server [options]
|
|
84
|
+
### Dynamic Testing
|
|
84
85
|
|
|
85
|
-
|
|
86
|
-
-o, --out-dir <path> Directory to save intercepted images and audio (default: $TMPDIR/run-mcp)
|
|
87
|
-
-t, --timeout <ms> Default tool call timeout in milliseconds (default: 60000)
|
|
88
|
-
--max-text <chars> Max text response length before truncation (default: 50000)
|
|
89
|
-
```
|
|
86
|
+
When an AI agent is actively *developing* an MCP server, it needs to test it. Standard MCP clients require updating a configuration file (`mcp.json`) and restarting the agent session entirely.
|
|
90
87
|
|
|
91
|
-
|
|
88
|
+
`run-mcp` solves this by giving the agent a suite of tools to dynamically spawn, inspect, and test local MCP servers on the fly.
|
|
92
89
|
|
|
90
|
+
**How to use:**
|
|
91
|
+
Add `run-mcp` to your agent's MCP configuration using `npx`:
|
|
93
92
|
```json
|
|
94
93
|
{
|
|
95
94
|
"mcpServers": {
|
|
96
95
|
"run-mcp": {
|
|
97
96
|
"command": "npx",
|
|
98
|
-
"args": ["-y", "run-mcp"
|
|
97
|
+
"args": ["-y", "run-mcp"]
|
|
99
98
|
}
|
|
100
99
|
}
|
|
101
100
|
}
|
|
@@ -105,26 +104,25 @@ Then use these tools from your agent:
|
|
|
105
104
|
|
|
106
105
|
| Tool | Description |
|
|
107
106
|
|------|-------------|
|
|
108
|
-
| `connect_to_mcp` | Spawn and connect to a local MCP server |
|
|
107
|
+
| `connect_to_mcp` | Spawn and connect to a local MCP server. Use `include` to get tools/resources/prompts inline. Shows a diff on reconnect. |
|
|
109
108
|
| `disconnect_from_mcp` | Tear down the connection |
|
|
110
109
|
| `mcp_server_status` | Check connection status |
|
|
111
|
-
| `
|
|
112
|
-
| `
|
|
113
|
-
| `list_mcp_resources` | List resources |
|
|
114
|
-
| `read_mcp_resource` | Read a resource by URI |
|
|
115
|
-
| `list_mcp_prompts` | List prompts |
|
|
116
|
-
| `get_mcp_prompt` | Get a prompt by name |
|
|
110
|
+
| `call_mcp_primitive` | Call a tool, read a resource, or get a prompt. Auto-connects if not already connected. Use `disconnect_after` for one-shot tests. |
|
|
111
|
+
| `list_mcp_primitives` | List tools, resources, and/or prompts on the connected server |
|
|
117
112
|
| `get_mcp_server_stderr` | View target server stderr output |
|
|
113
|
+
| `list_available_mcp_servers`| Discover other local MCP servers configured on the host machine |
|
|
118
114
|
|
|
119
|
-
## REPL Commands
|
|
115
|
+
## REPL Mode Commands
|
|
120
116
|
|
|
121
|
-
Once
|
|
117
|
+
Once connected via `run-mcp <command>`, the following shorthand commands are available:
|
|
122
118
|
|
|
123
119
|
| Command | Description |
|
|
124
120
|
|---------|-------------|
|
|
121
|
+
| `explore` | Open interactive fuzzy-search selector for tools, resources, and prompts |
|
|
125
122
|
| `tools/list` | List all tools exposed by the target server |
|
|
126
123
|
| `tools/describe <name>` | Show a tool's full input schema |
|
|
127
|
-
| `tools/call <name>
|
|
124
|
+
| `tools/call <name> [json] [--clear]` | Call a tool. Launch interactive wizard if no JSON provided. Use `--clear` to ignore remembered arguments. |
|
|
125
|
+
| `tools/forget [name]` | Clear remembered interactive arguments for a tool, or all tools if no name provided. |
|
|
128
126
|
| `status` | Show target server status (PID, uptime, connection) |
|
|
129
127
|
| `help` | Show available commands |
|
|
130
128
|
| `exit` / `quit` | Disconnect and exit |
|
|
@@ -146,6 +144,19 @@ Once in the REPL, these commands are available:
|
|
|
146
144
|
|
|
147
145
|
# Arguments with spaces work fine
|
|
148
146
|
> tools/call send_message {"text": "hello world", "channel": "general"}
|
|
147
|
+
|
|
148
|
+
### Interactive Wizard & Argument Memory
|
|
149
|
+
|
|
150
|
+
If you invoke a tool without JSON arguments, `run-mcp` will guide you through an interactive scaffolding wizard:
|
|
151
|
+
```bash
|
|
152
|
+
> tools/call send_message
|
|
153
|
+
✔ text (string) Message text to send: Hello World!
|
|
154
|
+
✔ Select optional arguments to provide: channel
|
|
155
|
+
✔ channel (string) The Slack channel: general
|
|
156
|
+
✔ Execute? Yes
|
|
157
|
+
Calling send_message...
|
|
158
|
+
```
|
|
159
|
+
`run-mcp` actively **remembers** your inputs across identical interactive calls, scaffolding defaults based on your last execution! Use `tools/forget` or `--clear` if you need a clean slate.
|
|
149
160
|
```
|
|
150
161
|
|
|
151
162
|
### Script Mode
|
|
@@ -261,4 +272,4 @@ node dist/index.js repl <target_command...>
|
|
|
261
272
|
|
|
262
273
|
## License
|
|
263
274
|
|
|
264
|
-
|
|
275
|
+
MIT
|