@apify/mcpc 0.1.11-beta.2 → 0.1.11-beta.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/CHANGELOG.md +70 -1
- package/README.md +188 -190
- package/dist/bridge/index.js +190 -13
- package/dist/bridge/index.js.map +1 -1
- package/dist/cli/commands/auth.d.ts +2 -0
- package/dist/cli/commands/auth.d.ts.map +1 -1
- package/dist/cli/commands/auth.js +11 -1
- package/dist/cli/commands/auth.js.map +1 -1
- package/dist/cli/commands/logging.d.ts.map +1 -1
- package/dist/cli/commands/logging.js +1 -4
- package/dist/cli/commands/logging.js.map +1 -1
- package/dist/cli/commands/sessions.d.ts +3 -1
- package/dist/cli/commands/sessions.d.ts.map +1 -1
- package/dist/cli/commands/sessions.js +47 -8
- package/dist/cli/commands/sessions.js.map +1 -1
- package/dist/cli/commands/tasks.d.ts +5 -0
- package/dist/cli/commands/tasks.d.ts.map +1 -0
- package/dist/cli/commands/tasks.js +53 -0
- package/dist/cli/commands/tasks.js.map +1 -0
- package/dist/cli/commands/tools.d.ts +2 -0
- package/dist/cli/commands/tools.d.ts.map +1 -1
- package/dist/cli/commands/tools.js +88 -2
- package/dist/cli/commands/tools.js.map +1 -1
- package/dist/cli/helpers.d.ts +1 -5
- package/dist/cli/helpers.d.ts.map +1 -1
- package/dist/cli/helpers.js +25 -169
- package/dist/cli/helpers.js.map +1 -1
- package/dist/cli/index.js +426 -200
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/output.d.ts +3 -1
- package/dist/cli/output.d.ts.map +1 -1
- package/dist/cli/output.js +71 -3
- package/dist/cli/output.js.map +1 -1
- package/dist/cli/parser.d.ts +11 -8
- package/dist/cli/parser.d.ts.map +1 -1
- package/dist/cli/parser.js +91 -65
- package/dist/cli/parser.js.map +1 -1
- package/dist/cli/shell.d.ts.map +1 -1
- package/dist/cli/shell.js +30 -3
- package/dist/cli/shell.js.map +1 -1
- package/dist/core/mcp-client.d.ts +10 -2
- package/dist/core/mcp-client.d.ts.map +1 -1
- package/dist/core/mcp-client.js +165 -0
- package/dist/core/mcp-client.js.map +1 -1
- package/dist/lib/auth/keychain.d.ts.map +1 -1
- package/dist/lib/auth/keychain.js +15 -8
- package/dist/lib/auth/keychain.js.map +1 -1
- package/dist/lib/auth/oauth-flow.d.ts +4 -1
- package/dist/lib/auth/oauth-flow.d.ts.map +1 -1
- package/dist/lib/auth/oauth-flow.js +21 -6
- package/dist/lib/auth/oauth-flow.js.map +1 -1
- package/dist/lib/auth/oauth-provider.d.ts +5 -0
- package/dist/lib/auth/oauth-provider.d.ts.map +1 -1
- package/dist/lib/auth/oauth-provider.js +16 -1
- package/dist/lib/auth/oauth-provider.js.map +1 -1
- package/dist/lib/bridge-client.d.ts +1 -1
- package/dist/lib/bridge-client.d.ts.map +1 -1
- package/dist/lib/bridge-client.js +17 -3
- package/dist/lib/bridge-client.js.map +1 -1
- package/dist/lib/bridge-manager.d.ts +1 -0
- package/dist/lib/bridge-manager.d.ts.map +1 -1
- package/dist/lib/bridge-manager.js +39 -17
- package/dist/lib/bridge-manager.js.map +1 -1
- package/dist/lib/errors.js +2 -2
- package/dist/lib/errors.js.map +1 -1
- package/dist/lib/file-lock.d.ts.map +1 -1
- package/dist/lib/file-lock.js +4 -2
- package/dist/lib/file-lock.js.map +1 -1
- package/dist/lib/session-client.d.ts +12 -2
- package/dist/lib/session-client.d.ts.map +1 -1
- package/dist/lib/session-client.js +113 -14
- package/dist/lib/session-client.js.map +1 -1
- package/dist/lib/sessions.d.ts.map +1 -1
- package/dist/lib/sessions.js +9 -4
- package/dist/lib/sessions.js.map +1 -1
- package/dist/lib/types.d.ts +30 -5
- package/dist/lib/types.d.ts.map +1 -1
- package/dist/lib/types.js +2 -0
- package/dist/lib/types.js.map +1 -1
- package/dist/lib/utils.d.ts +0 -2
- package/dist/lib/utils.d.ts.map +1 -1
- package/dist/lib/utils.js +1 -19
- package/dist/lib/utils.js.map +1 -1
- package/docs/TODOs.md +89 -35
- package/package.json +3 -2
- package/renovate.json +2 -1
package/README.md
CHANGED
|
@@ -47,6 +47,9 @@ After all, UNIX-compatible shell script is THE most universal coding language.
|
|
|
47
47
|
|
|
48
48
|
```bash
|
|
49
49
|
npm install -g @apify/mcpc
|
|
50
|
+
|
|
51
|
+
# Or with Bun
|
|
52
|
+
bun install -g @apify/mcpc
|
|
50
53
|
```
|
|
51
54
|
|
|
52
55
|
**Linux users:** `mcpc` uses the OS keychain for secure credential storage via the
|
|
@@ -81,21 +84,21 @@ dbus-run-session -- bash -c "echo -n 'password' | gnome-keyring-daemon --unlock
|
|
|
81
84
|
mcpc
|
|
82
85
|
|
|
83
86
|
# Login to remote MCP server and save OAuth credentials for future use
|
|
84
|
-
mcpc mcp.apify.com
|
|
85
|
-
|
|
86
|
-
# Show information about a remote MCP server
|
|
87
|
-
mcpc mcp.apify.com
|
|
88
|
-
|
|
89
|
-
# Use JSON mode for scripting
|
|
90
|
-
mcpc mcp.apify.com tools-list --json
|
|
87
|
+
mcpc login mcp.apify.com
|
|
91
88
|
|
|
92
|
-
# Create and
|
|
93
|
-
mcpc mcp.apify.com
|
|
89
|
+
# Create a persistent session and interact with it
|
|
90
|
+
mcpc connect mcp.apify.com @test
|
|
91
|
+
mcpc @test # show server info
|
|
92
|
+
mcpc @test tools-list
|
|
94
93
|
mcpc @test tools-call search-actors keywords:="website crawler"
|
|
95
94
|
mcpc @test shell
|
|
96
95
|
|
|
97
|
-
#
|
|
98
|
-
mcpc --
|
|
96
|
+
# Use JSON mode for scripting
|
|
97
|
+
mcpc --json @test tools-list
|
|
98
|
+
|
|
99
|
+
# Use a local MCP server package (stdio) referenced from config file
|
|
100
|
+
mcpc connect ./.vscode/mcp.json:filesystem @fs
|
|
101
|
+
mcpc @fs tools-list
|
|
99
102
|
```
|
|
100
103
|
|
|
101
104
|
## Usage
|
|
@@ -103,68 +106,56 @@ mcpc --config ~/.vscode/mcp.json filesystem tools-list
|
|
|
103
106
|
<!-- AUTO-GENERATED: mcpc --help -->
|
|
104
107
|
|
|
105
108
|
```
|
|
106
|
-
Usage: mcpc [options]
|
|
109
|
+
Usage: mcpc [options] [<@session>] [<command>]
|
|
107
110
|
|
|
108
111
|
Universal command-line client for the Model Context Protocol (MCP).
|
|
109
112
|
|
|
110
113
|
Options:
|
|
111
|
-
-j, --json
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
--
|
|
116
|
-
--
|
|
117
|
-
--
|
|
118
|
-
|
|
119
|
-
--
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
resources-templates-list
|
|
152
|
-
logging-set-level <level>
|
|
153
|
-
ping
|
|
154
|
-
|
|
155
|
-
x402 payment commands (no target needed):
|
|
156
|
-
x402 init Create a new x402 wallet
|
|
157
|
-
x402 import <key> Import wallet from private key
|
|
158
|
-
x402 info Show wallet info
|
|
159
|
-
x402 sign -r <base64> Sign payment from PAYMENT-REQUIRED header
|
|
160
|
-
x402 remove Remove the wallet
|
|
161
|
-
|
|
162
|
-
Run "mcpc" without <target> to show available sessions and profiles.
|
|
114
|
+
-j, --json Output in JSON format for scripting
|
|
115
|
+
--verbose Enable debug logging
|
|
116
|
+
--profile <name> OAuth profile for the server ("default" if not provided)
|
|
117
|
+
--schema <file> Validate tool/prompt schema against expected schema
|
|
118
|
+
--schema-mode <mode> Schema validation mode: strict, compatible (default), ignore
|
|
119
|
+
--timeout <seconds> Request timeout in seconds (default: 300)
|
|
120
|
+
--insecure Skip TLS certificate verification (for self-signed certs)
|
|
121
|
+
-v, --version Output the version number
|
|
122
|
+
-h, --help Display help
|
|
123
|
+
|
|
124
|
+
Commands:
|
|
125
|
+
connect <server> <@session> Connect to an MCP server and start a new named @session
|
|
126
|
+
close <@session> Close a session
|
|
127
|
+
restart <@session> Restart a session (losing all state)
|
|
128
|
+
shell <@session> Open interactive shell for a session
|
|
129
|
+
login <server> Interactively login to a server using OAuth and save profile
|
|
130
|
+
logout <server> Delete an authentication profile for a server
|
|
131
|
+
clean [resources...] Clean up mcpc data (sessions, profiles, logs, all)
|
|
132
|
+
x402 [subcommand] [args...] Configure an x402 payment wallet (EXPERIMENTAL)
|
|
133
|
+
help [command] Show help for a specific command
|
|
134
|
+
|
|
135
|
+
MCP session commands (after connecting):
|
|
136
|
+
<@session> Show MCP server info and capabilities
|
|
137
|
+
<@session> tools-list List MCP tools
|
|
138
|
+
<@session> tools-get <name>
|
|
139
|
+
<@session> tools-call <name> [arg:=val ... | <json> | <stdin]
|
|
140
|
+
<@session> prompts-list
|
|
141
|
+
<@session> prompts-get <name> [arg:=val ... | <json> | <stdin]
|
|
142
|
+
<@session> resources-list
|
|
143
|
+
<@session> resources-read <uri>
|
|
144
|
+
<@session> resources-subscribe <uri>
|
|
145
|
+
<@session> resources-unsubscribe <uri>
|
|
146
|
+
<@session> resources-templates-list
|
|
147
|
+
<@session> tasks-list
|
|
148
|
+
<@session> tasks-get <taskId>
|
|
149
|
+
<@session> tasks-cancel <taskId>
|
|
150
|
+
<@session> logging-set-level <level>
|
|
151
|
+
<@session> ping
|
|
152
|
+
|
|
153
|
+
Run "mcpc" without arguments to show active sessions and OAuth profiles.
|
|
163
154
|
```
|
|
164
155
|
|
|
165
156
|
### General actions
|
|
166
157
|
|
|
167
|
-
|
|
158
|
+
With no arguments, `mcpc` lists all active sessions and saved OAuth profiles:
|
|
168
159
|
|
|
169
160
|
```bash
|
|
170
161
|
# List all sessions and OAuth profiles (also in JSON mode)
|
|
@@ -175,46 +166,31 @@ mcpc --json
|
|
|
175
166
|
mcpc --help
|
|
176
167
|
mcpc --version
|
|
177
168
|
|
|
178
|
-
# Clean
|
|
179
|
-
mcpc
|
|
169
|
+
# Clean stale sessions and old log files
|
|
170
|
+
mcpc clean
|
|
180
171
|
```
|
|
181
172
|
|
|
182
|
-
###
|
|
183
|
-
|
|
184
|
-
To connect and interact with an MCP server, you need to specify a `<target>`, which can be one of (in this order of precedence):
|
|
173
|
+
### Server formats
|
|
185
174
|
|
|
186
|
-
|
|
187
|
-
- **Remote MCP server URL** (e.g. `https://mcp.apify.com`)
|
|
188
|
-
- **Named session** (e.g. `@apify`) - see [Sessions](#sessions)
|
|
175
|
+
The `connect`, `login`, and `logout` commands accept a `<server>` argument in these formats:
|
|
189
176
|
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
**URL handling:**
|
|
194
|
-
|
|
195
|
-
- URLs without a scheme (e.g. `mcp.apify.com`) default to `https://`
|
|
196
|
-
- `localhost` and `127.0.0.1` addresses without a scheme default to `http://` (for local dev/proxy servers)
|
|
197
|
-
- To override the default, specify the scheme explicitly (e.g. `http://example.com`)
|
|
177
|
+
- **Remote URL** (e.g. `mcp.apify.com` or `https://mcp.apify.com`) — scheme defaults to `https://`
|
|
178
|
+
- **Config file entry** (e.g. `~/.vscode/mcp.json:filesystem`) — `file:entry-name` syntax
|
|
198
179
|
|
|
199
180
|
### MCP commands
|
|
200
181
|
|
|
201
|
-
|
|
182
|
+
All MCP commands go through a named session created with `connect`:
|
|
202
183
|
|
|
203
184
|
```bash
|
|
204
|
-
#
|
|
205
|
-
mcpc
|
|
206
|
-
mcpc --config .vscode/mcp.json fileSystem tools-list
|
|
207
|
-
mcpc --config .vscode/mcp.json fileSystem tools-call list_directory path:=/
|
|
208
|
-
|
|
209
|
-
# Remote server (Streamable HTTP)
|
|
210
|
-
mcpc mcp.apify.com\?tools=docs
|
|
211
|
-
mcpc mcp.apify.com\?tools=docs tools-list
|
|
212
|
-
mcpc mcp.apify.com\?tools=docs tools-call search-apify-docs query:="What are Actors?"
|
|
213
|
-
|
|
214
|
-
# Session
|
|
215
|
-
mcpc mcp.apify.com\?tools=docs connect @apify
|
|
185
|
+
# Connect to a remote server and create a session
|
|
186
|
+
mcpc connect mcp.apify.com @apify
|
|
216
187
|
mcpc @apify tools-list
|
|
217
188
|
mcpc @apify tools-call search-apify-docs query:="What are Actors?"
|
|
189
|
+
|
|
190
|
+
# Connect to a local server via config file entry
|
|
191
|
+
mcpc connect ~/.vscode/mcp.json:filesystem @fs
|
|
192
|
+
mcpc @fs tools-list
|
|
193
|
+
mcpc @fs tools-call list_directory path:=/
|
|
218
194
|
```
|
|
219
195
|
|
|
220
196
|
See [MCP feature support](#mcp-feature-support) for details about all supported MCP features and commands.
|
|
@@ -225,18 +201,18 @@ The `tools-call` and `prompts-get` commands accept arguments as positional param
|
|
|
225
201
|
|
|
226
202
|
```bash
|
|
227
203
|
# Key:=value pairs (auto-parsed: tries JSON, falls back to string)
|
|
228
|
-
mcpc
|
|
229
|
-
mcpc
|
|
204
|
+
mcpc @session tools-call <tool-name> greeting:="hello world" count:=10 enabled:=true
|
|
205
|
+
mcpc @session tools-call <tool-name> config:='{"key":"value"}' items:='[1,2,3]'
|
|
230
206
|
|
|
231
207
|
# Force string type with JSON quotes
|
|
232
|
-
mcpc
|
|
208
|
+
mcpc @session tools-call <tool-name> id:='"123"' flag:='"true"'
|
|
233
209
|
|
|
234
210
|
# Inline JSON object (if first arg starts with { or [)
|
|
235
|
-
mcpc
|
|
211
|
+
mcpc @session tools-call <tool-name> '{"greeting":"hello world","count":10}'
|
|
236
212
|
|
|
237
213
|
# Read from stdin (automatic when no positional args and input is piped)
|
|
238
|
-
echo '{"greeting":"hello","count":10}' | mcpc
|
|
239
|
-
cat args.json | mcpc
|
|
214
|
+
echo '{"greeting":"hello","count":10}' | mcpc @session tools-call <tool-name>
|
|
215
|
+
cat args.json | mcpc @session tools-call <tool-name>
|
|
240
216
|
```
|
|
241
217
|
|
|
242
218
|
**Rules:**
|
|
@@ -283,8 +259,7 @@ mcpc @server tools-call search "query:=hello world"
|
|
|
283
259
|
`mcpc` provides an interactive shell for discovery and testing of MCP servers.
|
|
284
260
|
|
|
285
261
|
```bash
|
|
286
|
-
mcpc
|
|
287
|
-
mcpc @apify shell # Use existing session
|
|
262
|
+
mcpc @apify shell
|
|
288
263
|
```
|
|
289
264
|
|
|
290
265
|
Shell commands: `help`, `exit`/`quit`/Ctrl+D, Ctrl+C to cancel.
|
|
@@ -314,7 +289,7 @@ which then serve as unique reference in commands.
|
|
|
314
289
|
|
|
315
290
|
```bash
|
|
316
291
|
# Create a persistent session
|
|
317
|
-
mcpc mcp.apify.com
|
|
292
|
+
mcpc connect mcp.apify.com @apify
|
|
318
293
|
|
|
319
294
|
# List all sessions and OAuth profiles
|
|
320
295
|
mcpc
|
|
@@ -324,10 +299,10 @@ mcpc @apify tools-list
|
|
|
324
299
|
mcpc @apify shell
|
|
325
300
|
|
|
326
301
|
# Restart the session (kills and restarts the bridge process)
|
|
327
|
-
mcpc @apify restart
|
|
302
|
+
mcpc @apify restart # or: mcpc restart @apify
|
|
328
303
|
|
|
329
304
|
# Close the session, terminates bridge process
|
|
330
|
-
mcpc @apify close
|
|
305
|
+
mcpc @apify close # or: mcpc close @apify
|
|
331
306
|
|
|
332
307
|
# ...now session name "@apify" is forgotten and available for future use
|
|
333
308
|
```
|
|
@@ -368,14 +343,14 @@ and any future attempts to use them will fail.
|
|
|
368
343
|
To **remove the session from the list**, you need to explicitly close it:
|
|
369
344
|
|
|
370
345
|
```bash
|
|
371
|
-
mcpc @apify close
|
|
346
|
+
mcpc @apify close # or: mcpc close @apify
|
|
372
347
|
```
|
|
373
348
|
|
|
374
349
|
You can restart a session anytime, which kills the bridge process
|
|
375
350
|
and opens new connection with new `MCP-Session-Id`, by running:
|
|
376
351
|
|
|
377
352
|
```bash
|
|
378
|
-
mcpc @apify restart
|
|
353
|
+
mcpc @apify restart # or: mcpc restart @apify
|
|
379
354
|
```
|
|
380
355
|
|
|
381
356
|
## Authentication
|
|
@@ -388,11 +363,7 @@ For local servers (stdio) or remote servers (Streamable HTTP) which do not requi
|
|
|
388
363
|
`mcpc` can be used without authentication:
|
|
389
364
|
|
|
390
365
|
```bash
|
|
391
|
-
|
|
392
|
-
mcpc mcp.apify.com\?tools=docs tools-list
|
|
393
|
-
|
|
394
|
-
# Session command
|
|
395
|
-
mcpc mcp.apify.com\?tools=docs connect @test
|
|
366
|
+
mcpc connect mcp.apify.com @test
|
|
396
367
|
mcpc @test tools-list
|
|
397
368
|
```
|
|
398
369
|
|
|
@@ -404,11 +375,8 @@ All headers are stored securely in the OS keychain for the session, but they are
|
|
|
404
375
|
running a one-shot command or connecting new session.
|
|
405
376
|
|
|
406
377
|
```bash
|
|
407
|
-
#
|
|
408
|
-
mcpc --header "Authorization: Bearer ${APIFY_TOKEN}"
|
|
409
|
-
|
|
410
|
-
# Create session with Bearer token (saved to keychain for this session only)
|
|
411
|
-
mcpc --header "Authorization: Bearer ${APIFY_TOKEN}" https://mcp.apify.com connect @apify
|
|
378
|
+
# Create session with Bearer token (token saved to keychain for this session only)
|
|
379
|
+
mcpc connect https://mcp.apify.com @apify --header "Authorization: Bearer ${APIFY_TOKEN}"
|
|
412
380
|
|
|
413
381
|
# Use the session (Bearer token is loaded from keychain automatically)
|
|
414
382
|
mcpc @apify tools-list
|
|
@@ -440,25 +408,25 @@ Key concepts:
|
|
|
440
408
|
|
|
441
409
|
```bash
|
|
442
410
|
# Login to server and save 'default' authentication profile for future use
|
|
443
|
-
mcpc mcp.apify.com
|
|
411
|
+
mcpc login mcp.apify.com
|
|
444
412
|
|
|
445
413
|
# Use named authentication profile instead of 'default'
|
|
446
|
-
mcpc mcp.apify.com
|
|
414
|
+
mcpc login mcp.apify.com --profile work
|
|
447
415
|
|
|
448
416
|
# Create two sessions using the two different credentials
|
|
449
|
-
mcpc
|
|
450
|
-
mcpc
|
|
417
|
+
mcpc connect mcp.apify.com @apify-personal
|
|
418
|
+
mcpc connect mcp.apify.com @apify-work --profile work
|
|
451
419
|
|
|
452
420
|
# Both sessions now work independently
|
|
453
421
|
mcpc @apify-personal tools-list # Uses personal account
|
|
454
422
|
mcpc @apify-work tools-list # Uses work account
|
|
455
423
|
|
|
456
424
|
# Re-authenticate existing profile (e.g., to refresh or change scopes)
|
|
457
|
-
mcpc mcp.apify.com
|
|
425
|
+
mcpc login mcp.apify.com --profile work
|
|
458
426
|
|
|
459
427
|
# Delete "default" and "work" authentication profiles
|
|
460
|
-
mcpc mcp.apify.com
|
|
461
|
-
mcpc mcp.apify.com
|
|
428
|
+
mcpc logout mcp.apify.com
|
|
429
|
+
mcpc logout mcp.apify.com --profile work
|
|
462
430
|
```
|
|
463
431
|
|
|
464
432
|
### Authentication precedence
|
|
@@ -470,7 +438,16 @@ When multiple authentication methods are available, `mcpc` uses this precedence
|
|
|
470
438
|
3. **Config file headers** - Headers from `--config` file for the server
|
|
471
439
|
4. **No authentication** - Attempts unauthenticated connection
|
|
472
440
|
|
|
473
|
-
`
|
|
441
|
+
**Note:** `--profile` and `--header "Authorization: ..."` cannot be combined — they are mutually
|
|
442
|
+
exclusive. Providing both will result in a clear error. Use one or the other.
|
|
443
|
+
|
|
444
|
+
`mcpc` automatically handles authentication based on what you specify:
|
|
445
|
+
|
|
446
|
+
**When `--header "Authorization: ..."` is provided:**
|
|
447
|
+
|
|
448
|
+
- The explicit header is always used, and OAuth profile auto-detection is skipped entirely
|
|
449
|
+
- This works even if a `default` profile exists for the server
|
|
450
|
+
- Cannot be combined with `--profile` (returns an error)
|
|
474
451
|
|
|
475
452
|
**When `--profile <name>` is specified:**
|
|
476
453
|
|
|
@@ -479,7 +456,13 @@ When multiple authentication methods are available, `mcpc` uses this precedence
|
|
|
479
456
|
- If authentication fails (expired/invalid) → Fail with an error
|
|
480
457
|
2. **Profile doesn't exist**: Fail with an error
|
|
481
458
|
|
|
482
|
-
**When no
|
|
459
|
+
**When `--no-profile` is specified:**
|
|
460
|
+
|
|
461
|
+
- Skip all OAuth profile detection and connect anonymously
|
|
462
|
+
- Useful when a `default` profile exists but you want an unauthenticated session
|
|
463
|
+
- Can be combined with `--header "Authorization: ..."` for explicit bearer token without profile
|
|
464
|
+
|
|
465
|
+
**When no flags are specified (default):**
|
|
483
466
|
|
|
484
467
|
1. **`default` profile exists for the server**: Use its stored credentials
|
|
485
468
|
- If authentication succeeds → Continue with command/session
|
|
@@ -492,7 +475,7 @@ On failure, the error message includes instructions on how to login and save the
|
|
|
492
475
|
|
|
493
476
|
This flow ensures:
|
|
494
477
|
|
|
495
|
-
-
|
|
478
|
+
- Explicit CLI flags always take precedence over stored profiles
|
|
496
479
|
- Credentials are never silently mixed up (personal → work) or downgraded (authenticated → unauthenticated)
|
|
497
480
|
- You can mix authenticated sessions (with named profiles) and public access on the same server
|
|
498
481
|
|
|
@@ -502,16 +485,19 @@ This flow ensures:
|
|
|
502
485
|
# With specific profile - always authenticated:
|
|
503
486
|
# - Uses 'work' if it exists
|
|
504
487
|
# - Fails if it doesn't exist
|
|
505
|
-
mcpc mcp.apify.com
|
|
488
|
+
mcpc connect mcp.apify.com @apify-work --profile work
|
|
506
489
|
|
|
507
490
|
# Without profile - opportunistic authentication:
|
|
508
491
|
# - Uses 'default' if it exists
|
|
509
492
|
# - Tries unauthenticated if 'default' doesn't exist
|
|
510
493
|
# - Fails if the server requires authentication
|
|
511
|
-
mcpc mcp.apify.com
|
|
494
|
+
mcpc connect mcp.apify.com @apify-personal
|
|
495
|
+
|
|
496
|
+
# Explicit bearer token - skips profile auto-detection:
|
|
497
|
+
mcpc connect mcp.apify.com @apify --header "Authorization: Bearer ${APIFY_TOKEN}"
|
|
512
498
|
|
|
513
|
-
#
|
|
514
|
-
mcpc mcp.apify.com
|
|
499
|
+
# Anonymous - skips default profile even if it exists:
|
|
500
|
+
mcpc connect mcp.apify.com @apify-anon --no-profile
|
|
515
501
|
```
|
|
516
502
|
|
|
517
503
|
## MCP proxy
|
|
@@ -523,25 +509,21 @@ See also [AI sandboxes](#ai-sandboxes).
|
|
|
523
509
|
|
|
524
510
|
```bash
|
|
525
511
|
# Human authenticates to a remote server
|
|
526
|
-
mcpc mcp.apify.com
|
|
512
|
+
mcpc login mcp.apify.com
|
|
527
513
|
|
|
528
514
|
# Create authenticated session with proxy server on localhost:8080
|
|
529
|
-
mcpc mcp.apify.com
|
|
515
|
+
mcpc connect mcp.apify.com @open-relay --proxy 8080
|
|
530
516
|
|
|
531
517
|
# Now any MCP client can connect to proxy like to a regular MCP server
|
|
532
518
|
# The client has NO access to the original OAuth tokens or HTTP headers
|
|
533
519
|
# Note: localhost/127.0.0.1 URLs default to http:// (no scheme needed)
|
|
534
|
-
mcpc localhost:8080
|
|
535
|
-
mcpc 127.0.0.1:8080 tools-call search-actors keywords:="web scraper"
|
|
536
|
-
|
|
537
|
-
# Or create a new session from the proxy for convenience
|
|
538
|
-
mcpc localhost:8080 connect @sandboxed
|
|
520
|
+
mcpc connect localhost:8080 @sandboxed
|
|
539
521
|
mcpc @sandboxed tools-call search-actors keywords:="web scraper"
|
|
540
522
|
|
|
541
523
|
# Optionally protect proxy with bearer token for better security (stored in OS keychain)
|
|
542
|
-
mcpc mcp.apify.com
|
|
524
|
+
mcpc connect mcp.apify.com @secure-relay --proxy 8081 --proxy-bearer-token secret123
|
|
543
525
|
# To use the proxy, caller needs to pass the bearer token in HTTP header
|
|
544
|
-
mcpc localhost:8081
|
|
526
|
+
mcpc connect localhost:8081 @sandboxed2 --header "Authorization: Bearer secret123"
|
|
545
527
|
```
|
|
546
528
|
|
|
547
529
|
**Proxy options for `connect` command:**
|
|
@@ -562,13 +544,13 @@ mcpc localhost:8081 connect @sandboxed2 --header "Authorization: Bearer secret12
|
|
|
562
544
|
|
|
563
545
|
```bash
|
|
564
546
|
# Localhost only (default, most secure)
|
|
565
|
-
mcpc mcp.apify.com
|
|
547
|
+
mcpc connect mcp.apify.com @relay --proxy 8080
|
|
566
548
|
|
|
567
549
|
# Bind to all interfaces (allows network access - use with caution!)
|
|
568
|
-
mcpc mcp.apify.com
|
|
550
|
+
mcpc connect mcp.apify.com @relay --proxy 0.0.0.0:8080
|
|
569
551
|
|
|
570
552
|
# Bind to specific interface
|
|
571
|
-
mcpc mcp.apify.com
|
|
553
|
+
mcpc connect mcp.apify.com @relay --proxy 192.168.1.100:8080
|
|
572
554
|
```
|
|
573
555
|
|
|
574
556
|
When listing sessions, proxy info is displayed prominently:
|
|
@@ -661,8 +643,8 @@ it's always a good idea to run them in a code sandbox with limited access to you
|
|
|
661
643
|
|
|
662
644
|
The [proxy MCP server](#mcp-proxy) feature provides a security boundary for AI agents:
|
|
663
645
|
|
|
664
|
-
1. **Human creates authentication profile**: `mcpc mcp.apify.com
|
|
665
|
-
2. **Human creates session**: `mcpc mcp.apify.com
|
|
646
|
+
1. **Human creates authentication profile**: `mcpc login mcp.apify.com --profile ai-access`
|
|
647
|
+
2. **Human creates session**: `mcpc connect mcp.apify.com @ai-sandbox --profile ai-access --proxy 8080`
|
|
666
648
|
3. **AI runs inside a sandbox**: If sandbox has access limited to `localhost:8080`,
|
|
667
649
|
it can only interact with the MCP server through the `@ai-sandbox` session,
|
|
668
650
|
without access to the original OAuth credentials, HTTP headers, or `mcpc` configuration.
|
|
@@ -729,7 +711,7 @@ Pass the `--x402` flag when connecting to a session or running direct commands:
|
|
|
729
711
|
|
|
730
712
|
```bash
|
|
731
713
|
# Create a session with x402 payment support
|
|
732
|
-
mcpc mcp.apify.com
|
|
714
|
+
mcpc connect mcp.apify.com @apify --x402
|
|
733
715
|
|
|
734
716
|
# The session now automatically handles 402 responses
|
|
735
717
|
mcpc @apify tools-call expensive-tool query:="hello"
|
|
@@ -901,7 +883,7 @@ When connected via a [session](#sessions), `mcpc` automatically handles `list_ch
|
|
|
901
883
|
notifications for tools, resources, and prompts.
|
|
902
884
|
The bridge process tracks when each notification type was last received.
|
|
903
885
|
In [shell mode](#interactive-shell), notifications are displayed in real-time.
|
|
904
|
-
The timestamps are available in JSON output of `mcpc
|
|
886
|
+
The timestamps are available in JSON output of `mcpc @session --json` under the `_mcpc.notifications`
|
|
905
887
|
field - see [Server instructions](#server-instructions).
|
|
906
888
|
|
|
907
889
|
#### Server logs
|
|
@@ -955,14 +937,12 @@ You can configure `mcpc` using a config file, environment variables, or command-
|
|
|
955
937
|
|
|
956
938
|
`mcpc` supports the ["standard"](https://gofastmcp.com/integrations/mcp-json-configuration)
|
|
957
939
|
MCP server JSON config file, compatible with Claude Desktop, VS Code, and other MCP clients.
|
|
958
|
-
|
|
940
|
+
Use the `file:entry` syntax to reference a server from a config file:
|
|
959
941
|
|
|
960
942
|
```bash
|
|
961
|
-
#
|
|
962
|
-
mcpc
|
|
963
|
-
|
|
964
|
-
# Open a session to a server specified in the custom config file
|
|
965
|
-
mcpc --config .vscode/mcp.json apify connect @my-apify
|
|
943
|
+
# Open a session to a server specified in the Visual Studio Code config
|
|
944
|
+
mcpc connect .vscode/mcp.json:apify @my-apify
|
|
945
|
+
mcpc @my-apify tools-list
|
|
966
946
|
```
|
|
967
947
|
|
|
968
948
|
**Example MCP config JSON file:**
|
|
@@ -1007,14 +987,12 @@ For **stdio servers:**
|
|
|
1007
987
|
|
|
1008
988
|
**Using servers from config file:**
|
|
1009
989
|
|
|
1010
|
-
|
|
990
|
+
Reference servers by their name using the `file:entry` syntax:
|
|
1011
991
|
|
|
1012
992
|
```bash
|
|
1013
|
-
#
|
|
1014
|
-
mcpc
|
|
1015
|
-
|
|
1016
|
-
# Create a named session from server in config
|
|
1017
|
-
mcpc --config .vscode/mcp.json filesystem connect @fs
|
|
993
|
+
# Create a named session from a server in the config
|
|
994
|
+
mcpc connect .vscode/mcp.json:filesystem @fs
|
|
995
|
+
mcpc @fs tools-list
|
|
1018
996
|
mcpc @fs tools-call search
|
|
1019
997
|
```
|
|
1020
998
|
|
|
@@ -1028,7 +1006,7 @@ Config files support environment variable substitution using `${VAR_NAME}` synta
|
|
|
1028
1006
|
"secure-server": {
|
|
1029
1007
|
"url": "https://mcp.apify.com",
|
|
1030
1008
|
"headers": {
|
|
1031
|
-
"Authorization": "Bearer ${
|
|
1009
|
+
"Authorization": "Bearer ${APIFY_TOKEN}",
|
|
1032
1010
|
"X-User-ID": "${USER_ID}"
|
|
1033
1011
|
}
|
|
1034
1012
|
}
|
|
@@ -1057,20 +1035,19 @@ Config files support environment variable substitution using `${VAR_NAME}` synta
|
|
|
1057
1035
|
|
|
1058
1036
|
### Cleanup
|
|
1059
1037
|
|
|
1060
|
-
You can clean up the `mcpc` state and data using the
|
|
1038
|
+
You can clean up the `mcpc` state and data using the `clean` command:
|
|
1061
1039
|
|
|
1062
1040
|
```bash
|
|
1063
1041
|
# Safe non-destructive cleanup: remove expired sessions, delete old orphaned logs
|
|
1064
|
-
mcpc
|
|
1042
|
+
mcpc clean
|
|
1065
1043
|
|
|
1066
|
-
# Clean specific resources
|
|
1067
|
-
mcpc
|
|
1068
|
-
mcpc
|
|
1069
|
-
mcpc
|
|
1070
|
-
mcpc --clean=sessions,logs # Clean multiple resource types
|
|
1044
|
+
# Clean specific resources
|
|
1045
|
+
mcpc clean sessions # Kill bridges, delete all sessions
|
|
1046
|
+
mcpc clean profiles # Delete all authentication profiles
|
|
1047
|
+
mcpc clean logs # Delete all log files
|
|
1071
1048
|
|
|
1072
1049
|
# Nuclear option: remove everything
|
|
1073
|
-
mcpc
|
|
1050
|
+
mcpc clean all # Delete all sessions, profiles, logs, and sockets
|
|
1074
1051
|
```
|
|
1075
1052
|
|
|
1076
1053
|
## Security
|
|
@@ -1149,12 +1126,12 @@ The main `mcpc` process doesn't save log files, but supports [verbose mode](#ver
|
|
|
1149
1126
|
**"Session not found"**
|
|
1150
1127
|
|
|
1151
1128
|
- List existing sessions: `mcpc`
|
|
1152
|
-
- Create new session if expired: `mcpc @<session-name> close` and `mcpc <
|
|
1129
|
+
- Create new session if expired: `mcpc @<session-name> close` and `mcpc connect <server> @<session-name>`
|
|
1153
1130
|
|
|
1154
1131
|
**"Authentication failed"**
|
|
1155
1132
|
|
|
1156
1133
|
- List saved OAuth profiles: `mcpc`
|
|
1157
|
-
- Re-authenticate: `mcpc <server>
|
|
1134
|
+
- Re-authenticate: `mcpc login <server> [--profile <name>]`
|
|
1158
1135
|
- For bearer tokens: provide `--header "Authorization: Bearer ${TOKEN}"` again
|
|
1159
1136
|
|
|
1160
1137
|
## Development
|
|
@@ -1166,26 +1143,47 @@ See [CONTRIBUTING](./CONTRIBUTING.md) for development setup, architecture overvi
|
|
|
1166
1143
|
|
|
1167
1144
|
## Related work
|
|
1168
1145
|
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1146
|
+
### MCP CLI clients
|
|
1147
|
+
|
|
1148
|
+
<!-- Stars and activity as of March 2026. -->
|
|
1149
|
+
|
|
1150
|
+
| Tool | Lang | Stars | Active | Tools | Resources | Prompts | Code mode | Sessions | OAuth | Stdio | HTTP | Tool search | LLM |
|
|
1151
|
+
|---|---|--:|---|---|---|---|---|---|---|---|---|---|---|
|
|
1152
|
+
| **[apify/mcpc](https://github.com/apify/mcpc)** | TS | ~350 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | — | — |
|
|
1153
|
+
| [steipete/mcporter](https://github.com/steipete/mcporter) | TS | ~2.6k | ✅ | ✅ | — | — | ✅ | ✅ | ✅ | ✅ | ✅ | — | — |
|
|
1154
|
+
| [IBM/mcp-cli](https://github.com/IBM/mcp-cli) | Python | ~1.9k | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | — | ✅ |
|
|
1155
|
+
| [f/mcptools](https://github.com/f/mcptools) | Go | ~1.5k | ⚠️ | ✅ | ✅ | ✅ | ✅ | — | — | ✅ | ✅ | — | — |
|
|
1156
|
+
| [philschmid/mcp-cli](https://github.com/philschmid/mcp-cli) | TS | ~950 | ✅ | ✅ | — | — | ✅ | ✅ | — | ✅ | ✅ | ✅ | — |
|
|
1157
|
+
| [adhikasp/mcp-client-cli](https://github.com/adhikasp/mcp-client-cli) | Python | ~670 | ⚠️ | ✅ | ✅ | ✅ | — | — | — | ✅ | — | — | ✅ |
|
|
1158
|
+
| [thellimist/clihub](https://github.com/thellimist/clihub) | Go | ~590 | ✅ | ✅ | — | — | — | — | ✅ | ✅ | ✅ | ✅ | — |
|
|
1159
|
+
| [wong2/mcp-cli](https://github.com/wong2/mcp-cli) | JS | ~420 | ⚠️ | ✅ | ✅ | ✅ | — | — | ✅ | — | ✅ | — | — |
|
|
1160
|
+
| [knowsuchagency/mcp2cli](https://github.com/knowsuchagency/mcp2cli) | Python | ~170 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | — |
|
|
1161
|
+
| [mcpshim/mcpshim](https://github.com/mcpshim/mcpshim) | Go | ~46 | ✅ | ✅ | — | — | ✅ | ✅ | ✅ | — | ✅ | ✅ | — |
|
|
1162
|
+
| [EstebanForge/mcp-cli-ent](https://github.com/EstebanForge/mcp-cli-ent) | Go | ~13 | ✅ | ✅ | — | — | ✅ | ✅ | — | ✅ | ✅ | ✅ | — |
|
|
1163
|
+
|
|
1164
|
+
**Legend:** ✅ = supported, ⚠️ = stale (no commits in 3+ months), **LLM** = requires/uses an LLM.
|
|
1165
|
+
|
|
1166
|
+
**Notes:**
|
|
1167
|
+
- [thellimist/clihub](https://github.com/thellimist/clihub) is a code generator that compiles MCP tools into standalone CLI binaries, rather than a runtime client ([HN discussion](https://news.ycombinator.com/item?id=47157398)).
|
|
1168
|
+
- [knowsuchagency/mcp2cli](https://github.com/knowsuchagency/mcp2cli) also supports OpenAPI specs directly and uses a custom TOON encoding for token-efficient tool schemas.
|
|
1169
|
+
- [IBM/mcp-cli](https://github.com/IBM/mcp-cli) and [mcp-client-cli](https://github.com/adhikasp/mcp-client-cli) integrate an LLM (Ollama, OpenAI, etc.) for chat-style interaction, while the other tools are pure CLI clients.
|
|
1170
|
+
|
|
1171
|
+
### Code mode and dynamic tool discovery
|
|
1172
|
+
|
|
1173
|
+
These resources describe the "code mode" pattern (replacing many tool definitions with `search` + `execute`) and dynamic tool discovery:
|
|
1174
|
+
|
|
1175
|
+
- [Code mode](https://www.anthropic.com/engineering/code-execution-with-mcp) - Anthropic's blog post on code execution with MCP
|
|
1176
|
+
- [Code mode at Cloudflare](https://blog.cloudflare.com/code-mode/) - Cloudflare's implementation of the code mode pattern
|
|
1177
|
+
- [Advanced tool use](https://www.anthropic.com/engineering/advanced-tool-use) - Anthropic's engineering post on tool search
|
|
1178
|
+
- [Claude tool search](https://platform.claude.com/docs/en/agents-and-tools/tool-use/tool-search-tool) - Claude platform docs
|
|
1179
|
+
- [Dynamic context discovery](https://cursor.com/blog/dynamic-context-discovery) - Cursor's approach to dynamic tool discovery
|
|
1180
|
+
- [cmcp](https://github.com/assimelha/cmcp) (~27 stars, Rust) - MCP proxy aggregating servers behind `search()` + `execute()`
|
|
1181
|
+
- [cloudflare-mcp](https://github.com/mattzcarey/cloudflare-mcp) (~124 stars, TS) - MCP server for the Cloudflare API using code mode
|
|
1182
|
+
- [infinite-mcp](https://github.com/day50-dev/infinite-mcp) (Python) - Meta-MCP server that exposes 1000+ pre-indexed MCP servers via semantic search and dynamic tool discovery
|
|
1183
|
+
|
|
1184
|
+
### Other
|
|
1185
|
+
|
|
1186
|
+
- [mcpGraph](https://github.com/TeamSparkAI/mcpGraph) - MCP server that orchestrates directed graphs of MCP tool calls
|
|
1189
1187
|
|
|
1190
1188
|
## License
|
|
1191
1189
|
|