@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.
Files changed (86) hide show
  1. package/CHANGELOG.md +70 -1
  2. package/README.md +188 -190
  3. package/dist/bridge/index.js +190 -13
  4. package/dist/bridge/index.js.map +1 -1
  5. package/dist/cli/commands/auth.d.ts +2 -0
  6. package/dist/cli/commands/auth.d.ts.map +1 -1
  7. package/dist/cli/commands/auth.js +11 -1
  8. package/dist/cli/commands/auth.js.map +1 -1
  9. package/dist/cli/commands/logging.d.ts.map +1 -1
  10. package/dist/cli/commands/logging.js +1 -4
  11. package/dist/cli/commands/logging.js.map +1 -1
  12. package/dist/cli/commands/sessions.d.ts +3 -1
  13. package/dist/cli/commands/sessions.d.ts.map +1 -1
  14. package/dist/cli/commands/sessions.js +47 -8
  15. package/dist/cli/commands/sessions.js.map +1 -1
  16. package/dist/cli/commands/tasks.d.ts +5 -0
  17. package/dist/cli/commands/tasks.d.ts.map +1 -0
  18. package/dist/cli/commands/tasks.js +53 -0
  19. package/dist/cli/commands/tasks.js.map +1 -0
  20. package/dist/cli/commands/tools.d.ts +2 -0
  21. package/dist/cli/commands/tools.d.ts.map +1 -1
  22. package/dist/cli/commands/tools.js +88 -2
  23. package/dist/cli/commands/tools.js.map +1 -1
  24. package/dist/cli/helpers.d.ts +1 -5
  25. package/dist/cli/helpers.d.ts.map +1 -1
  26. package/dist/cli/helpers.js +25 -169
  27. package/dist/cli/helpers.js.map +1 -1
  28. package/dist/cli/index.js +426 -200
  29. package/dist/cli/index.js.map +1 -1
  30. package/dist/cli/output.d.ts +3 -1
  31. package/dist/cli/output.d.ts.map +1 -1
  32. package/dist/cli/output.js +71 -3
  33. package/dist/cli/output.js.map +1 -1
  34. package/dist/cli/parser.d.ts +11 -8
  35. package/dist/cli/parser.d.ts.map +1 -1
  36. package/dist/cli/parser.js +91 -65
  37. package/dist/cli/parser.js.map +1 -1
  38. package/dist/cli/shell.d.ts.map +1 -1
  39. package/dist/cli/shell.js +30 -3
  40. package/dist/cli/shell.js.map +1 -1
  41. package/dist/core/mcp-client.d.ts +10 -2
  42. package/dist/core/mcp-client.d.ts.map +1 -1
  43. package/dist/core/mcp-client.js +165 -0
  44. package/dist/core/mcp-client.js.map +1 -1
  45. package/dist/lib/auth/keychain.d.ts.map +1 -1
  46. package/dist/lib/auth/keychain.js +15 -8
  47. package/dist/lib/auth/keychain.js.map +1 -1
  48. package/dist/lib/auth/oauth-flow.d.ts +4 -1
  49. package/dist/lib/auth/oauth-flow.d.ts.map +1 -1
  50. package/dist/lib/auth/oauth-flow.js +21 -6
  51. package/dist/lib/auth/oauth-flow.js.map +1 -1
  52. package/dist/lib/auth/oauth-provider.d.ts +5 -0
  53. package/dist/lib/auth/oauth-provider.d.ts.map +1 -1
  54. package/dist/lib/auth/oauth-provider.js +16 -1
  55. package/dist/lib/auth/oauth-provider.js.map +1 -1
  56. package/dist/lib/bridge-client.d.ts +1 -1
  57. package/dist/lib/bridge-client.d.ts.map +1 -1
  58. package/dist/lib/bridge-client.js +17 -3
  59. package/dist/lib/bridge-client.js.map +1 -1
  60. package/dist/lib/bridge-manager.d.ts +1 -0
  61. package/dist/lib/bridge-manager.d.ts.map +1 -1
  62. package/dist/lib/bridge-manager.js +39 -17
  63. package/dist/lib/bridge-manager.js.map +1 -1
  64. package/dist/lib/errors.js +2 -2
  65. package/dist/lib/errors.js.map +1 -1
  66. package/dist/lib/file-lock.d.ts.map +1 -1
  67. package/dist/lib/file-lock.js +4 -2
  68. package/dist/lib/file-lock.js.map +1 -1
  69. package/dist/lib/session-client.d.ts +12 -2
  70. package/dist/lib/session-client.d.ts.map +1 -1
  71. package/dist/lib/session-client.js +113 -14
  72. package/dist/lib/session-client.js.map +1 -1
  73. package/dist/lib/sessions.d.ts.map +1 -1
  74. package/dist/lib/sessions.js +9 -4
  75. package/dist/lib/sessions.js.map +1 -1
  76. package/dist/lib/types.d.ts +30 -5
  77. package/dist/lib/types.d.ts.map +1 -1
  78. package/dist/lib/types.js +2 -0
  79. package/dist/lib/types.js.map +1 -1
  80. package/dist/lib/utils.d.ts +0 -2
  81. package/dist/lib/utils.d.ts.map +1 -1
  82. package/dist/lib/utils.js +1 -19
  83. package/dist/lib/utils.js.map +1 -1
  84. package/docs/TODOs.md +89 -35
  85. package/package.json +3 -2
  86. 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 login
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 use persistent MCP session
93
- mcpc mcp.apify.com connect @test
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
- # Interact with a local MCP server package (stdio) referenced from config file
98
- mcpc --config ~/.vscode/mcp.json filesystem tools-list
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] <target> [command]
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 Output in JSON format for scripting
112
- -c, --config <file> Path to MCP config JSON file (e.g. ".vscode/mcp.json")
113
- -H, --header <header> HTTP header for remote MCP server (can be repeated)
114
- -v, --version Output the version number
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
- --proxy <[host:]port> Start proxy MCP server for session (with "connect" command)
121
- --proxy-bearer-token <token> Require authentication for access to proxy server
122
- --x402 Enable x402 auto-payment using the configured wallet
123
- --clean[=types] Clean up mcpc data (types: sessions, logs, profiles, all)
124
- -h, --help Display general help
125
-
126
- Targets:
127
- @<session> Named persistent session (e.g. "@apify")
128
- <config-entry> Entry in MCP config file specified by --config (e.g. "fs")
129
- <server-url> Remote MCP server URL (e.g. "mcp.apify.com")
130
-
131
- Management commands:
132
- login Create OAuth profile with credentials for remote server
133
- logout Remove OAuth profile for remote server
134
- connect @<session> Connect to server and create named persistent session
135
- restart Kill and restart a session
136
- close Close a session
137
-
138
- MCP server commands:
139
- help Show server info ("help" can be omitted)
140
- shell Open interactive shell
141
- tools-list [--full] Send "tools/list" MCP request...
142
- tools-get <tool-name>
143
- tools-call <tool-name> [arg1:=val1 arg2:=val2 ... | <args-json> | <stdin]
144
- prompts-list
145
- prompts-get <prompt-name> [arg1:=val1 arg2:=val2 ... | <args-json> | <stdin]
146
- resources
147
- resources-list
148
- resources-read <uri>
149
- resources-subscribe <uri>
150
- resources-unsubscribe <uri>
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
- When `<target>` is omitted, `mcpc` provides general actions:
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 expired sessions and old log files (see below for details)
179
- mcpc --clean
169
+ # Clean stale sessions and old log files
170
+ mcpc clean
180
171
  ```
181
172
 
182
- ### Targets
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
- - **Entry in a config file** (e.g. `--config .vscode/mcp.json filesystem`) - see [Config file](#mcp-server-config-file)
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
- `mcpc` automatically selects the transport protocol based on the server (stdio or Streamable HTTP),
191
- connects, and enables you to interact with it.
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
- When `<target>` is provided, `mcpc` sends MCP requests to the target server:
182
+ All MCP commands go through a named session created with `connect`:
202
183
 
203
184
  ```bash
204
- # Server from config file (stdio)
205
- mcpc --config .vscode/mcp.json fileSystem
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 <target> tools-call <tool-name> greeting:="hello world" count:=10 enabled:=true
229
- mcpc <target> tools-call <tool-name> config:='{"key":"value"}' items:='[1,2,3]'
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 <target> tools-call <tool-name> id:='"123"' flag:='"true"'
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 <target> tools-call <tool-name> '{"greeting":"hello world","count":10}'
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 <target> tools-call <tool-name>
239
- cat args.json | mcpc <target> tools-call <tool-name>
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 mcp.apify.com shell # Direct connection
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\?tools=docs connect @apify
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
- # One-shot command
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
- # One-time command with Bearer token
408
- mcpc --header "Authorization: Bearer ${APIFY_TOKEN}" https://mcp.apify.com tools-list
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 login
411
+ mcpc login mcp.apify.com
444
412
 
445
413
  # Use named authentication profile instead of 'default'
446
- mcpc mcp.apify.com login --profile work
414
+ mcpc login mcp.apify.com --profile work
447
415
 
448
416
  # Create two sessions using the two different credentials
449
- mcpc https://mcp.apify.com connect @apify-personal
450
- mcpc https://mcp.apify.com connect @apify-work --profile work
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 login --profile work
425
+ mcpc login mcp.apify.com --profile work
458
426
 
459
427
  # Delete "default" and "work" authentication profiles
460
- mcpc mcp.apify.com logout
461
- mcpc mcp.apify.com logout --profile work
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
- `mcpc` automatically handles authentication based on whether you specify a profile:
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 `--profile` is specified:**
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
- - You only authenticate when necessary
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 connect @apify-work --profile work
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 connect @apify-personal
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
- # Public server - no authentication needed:
514
- mcpc mcp.apify.com\?tools=docs tools-list
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 login
512
+ mcpc login mcp.apify.com
527
513
 
528
514
  # Create authenticated session with proxy server on localhost:8080
529
- mcpc mcp.apify.com connect @open-relay --proxy 8080
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 tools-list
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 connect @secure-relay --proxy 8081 --proxy-bearer-token secret123
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 connect @sandboxed2 --header "Authorization: Bearer secret123"
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 connect @relay --proxy 8080
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 connect @relay --proxy 0.0.0.0:8080
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 connect @relay --proxy 192.168.1.100:8080
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 login --profile ai-access`
665
- 2. **Human creates session**: `mcpc mcp.apify.com connect @ai-sandbox --profile ai-access --proxy 8080`
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 connect @apify --x402
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 <target> --json` under the `_mcpc.notifications`
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
- You can point to an existing config file with `--config`:
940
+ Use the `file:entry` syntax to reference a server from a config file:
959
941
 
960
942
  ```bash
961
- # One-shot command to an MCP server configured in Visual Studio Code
962
- mcpc --config .vscode/mcp.json apify tools-list
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
- When `--config` is provided, you can reference servers by name:
990
+ Reference servers by their name using the `file:entry` syntax:
1011
991
 
1012
992
  ```bash
1013
- # With config file, use server names directly
1014
- mcpc --config .vscode/mcp.json filesystem tools-list
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 ${API_TOKEN}",
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 `--clean` option:
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 --clean
1042
+ mcpc clean
1065
1043
 
1066
- # Clean specific resources (comma-separated)
1067
- mcpc --clean=sessions # Kill bridges, delete all sessions
1068
- mcpc --clean=profiles # Delete all authentication profiles
1069
- mcpc --clean=logs # Delete all log files
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 --clean=all # Delete all sessions, profiles, logs, and sockets
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 <target> connect @<session-name>`
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> login [--profile <name>]`
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
- - MCP CLI clients
1170
- - https://github.com/chrishayuk/mcp-cli
1171
- - https://github.com/wong2/mcp-cli
1172
- - https://github.com/f/mcptools
1173
- - https://github.com/adhikasp/mcp-client-cli
1174
- - https://github.com/mattzcarey/cloudflare-mcp
1175
- - https://github.com/thellimist/clihub (see https://news.ycombinator.com/item?id=47157398)
1176
- - https://github.com/EstebanForge/mcp-cli-ent
1177
- - https://github.com/assimelha/cmcp
1178
- - Code mode
1179
- - https://blog.cloudflare.com/code-mode/
1180
- - https://www.anthropic.com/engineering/code-execution-with-mcp
1181
- - https://github.com/steipete/mcporter
1182
- - Dynamic tool discovery
1183
- - https://www.anthropic.com/engineering/advanced-tool-use
1184
- - https://platform.claude.com/docs/en/agents-and-tools/tool-use/tool-search-tool
1185
- - https://cursor.com/blog/dynamic-context-discovery
1186
- - https://github.com/philschmid/mcp-cli (https://www.philschmid.de/mcp-cli)
1187
- - Other
1188
- - https://github.com/TeamSparkAI/mcpGraph
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