@apify/mcpc 0.1.11-beta.3 → 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 +67 -1
  2. package/README.md +184 -189
  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 +2 -2
  86. package/renovate.json +2 -1
package/README.md CHANGED
@@ -84,21 +84,21 @@ dbus-run-session -- bash -c "echo -n 'password' | gnome-keyring-daemon --unlock
84
84
  mcpc
85
85
 
86
86
  # Login to remote MCP server and save OAuth credentials for future use
87
- mcpc mcp.apify.com login
87
+ mcpc login mcp.apify.com
88
88
 
89
- # Show information about a remote MCP server
90
- mcpc mcp.apify.com
91
-
92
- # Use JSON mode for scripting
93
- mcpc mcp.apify.com tools-list --json
94
-
95
- # Create and use persistent MCP session
96
- 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
97
93
  mcpc @test tools-call search-actors keywords:="website crawler"
98
94
  mcpc @test shell
99
95
 
100
- # Interact with a local MCP server package (stdio) referenced from config file
101
- 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
102
102
  ```
103
103
 
104
104
  ## Usage
@@ -106,68 +106,56 @@ mcpc --config ~/.vscode/mcp.json filesystem tools-list
106
106
  <!-- AUTO-GENERATED: mcpc --help -->
107
107
 
108
108
  ```
109
- Usage: mcpc [options] <target> [command]
109
+ Usage: mcpc [options] [<@session>] [<command>]
110
110
 
111
111
  Universal command-line client for the Model Context Protocol (MCP).
112
112
 
113
113
  Options:
114
- -j, --json Output in JSON format for scripting
115
- -c, --config <file> Path to MCP config JSON file (e.g. ".vscode/mcp.json")
116
- -H, --header <header> HTTP header for remote MCP server (can be repeated)
117
- -v, --version Output the version number
118
- --verbose Enable debug logging
119
- --profile <name> OAuth profile for the server ("default" if not provided)
120
- --schema <file> Validate tool/prompt schema against expected schema
121
- --schema-mode <mode> Schema validation mode: strict, compatible (default), ignore
122
- --timeout <seconds> Request timeout in seconds (default: 300)
123
- --proxy <[host:]port> Start proxy MCP server for session (with "connect" command)
124
- --proxy-bearer-token <token> Require authentication for access to proxy server
125
- --x402 Enable x402 auto-payment using the configured wallet
126
- --clean[=types] Clean up mcpc data (types: sessions, logs, profiles, all)
127
- -h, --help Display general help
128
-
129
- Targets:
130
- @<session> Named persistent session (e.g. "@apify")
131
- <config-entry> Entry in MCP config file specified by --config (e.g. "fs")
132
- <server-url> Remote MCP server URL (e.g. "mcp.apify.com")
133
-
134
- Management commands:
135
- login Create OAuth profile with credentials for remote server
136
- logout Remove OAuth profile for remote server
137
- connect @<session> Connect to server and create named persistent session
138
- restart Kill and restart a session
139
- close Close a session
140
-
141
- MCP server commands:
142
- help Show server info ("help" can be omitted)
143
- shell Open interactive shell
144
- tools-list [--full] Send "tools/list" MCP request...
145
- tools-get <tool-name>
146
- tools-call <tool-name> [arg1:=val1 arg2:=val2 ... | <args-json> | <stdin]
147
- prompts-list
148
- prompts-get <prompt-name> [arg1:=val1 arg2:=val2 ... | <args-json> | <stdin]
149
- resources
150
- resources-list
151
- resources-read <uri>
152
- resources-subscribe <uri>
153
- resources-unsubscribe <uri>
154
- resources-templates-list
155
- logging-set-level <level>
156
- ping
157
-
158
- x402 payment commands (no target needed):
159
- x402 init Create a new x402 wallet
160
- x402 import <key> Import wallet from private key
161
- x402 info Show wallet info
162
- x402 sign -r <base64> Sign payment from PAYMENT-REQUIRED header
163
- x402 remove Remove the wallet
164
-
165
- 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.
166
154
  ```
167
155
 
168
156
  ### General actions
169
157
 
170
- When `<target>` is omitted, `mcpc` provides general actions:
158
+ With no arguments, `mcpc` lists all active sessions and saved OAuth profiles:
171
159
 
172
160
  ```bash
173
161
  # List all sessions and OAuth profiles (also in JSON mode)
@@ -178,46 +166,31 @@ mcpc --json
178
166
  mcpc --help
179
167
  mcpc --version
180
168
 
181
- # Clean expired sessions and old log files (see below for details)
182
- mcpc --clean
169
+ # Clean stale sessions and old log files
170
+ mcpc clean
183
171
  ```
184
172
 
185
- ### Targets
186
-
187
- To connect and interact with an MCP server, you need to specify a `<target>`, which can be one of (in this order of precedence):
188
-
189
- - **Entry in a config file** (e.g. `--config .vscode/mcp.json filesystem`) - see [Config file](#mcp-server-config-file)
190
- - **Remote MCP server URL** (e.g. `https://mcp.apify.com`)
191
- - **Named session** (e.g. `@apify`) - see [Sessions](#sessions)
173
+ ### Server formats
192
174
 
193
- `mcpc` automatically selects the transport protocol based on the server (stdio or Streamable HTTP),
194
- connects, and enables you to interact with it.
175
+ The `connect`, `login`, and `logout` commands accept a `<server>` argument in these formats:
195
176
 
196
- **URL handling:**
197
-
198
- - URLs without a scheme (e.g. `mcp.apify.com`) default to `https://`
199
- - `localhost` and `127.0.0.1` addresses without a scheme default to `http://` (for local dev/proxy servers)
200
- - 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
201
179
 
202
180
  ### MCP commands
203
181
 
204
- When `<target>` is provided, `mcpc` sends MCP requests to the target server:
182
+ All MCP commands go through a named session created with `connect`:
205
183
 
206
184
  ```bash
207
- # Server from config file (stdio)
208
- mcpc --config .vscode/mcp.json fileSystem
209
- mcpc --config .vscode/mcp.json fileSystem tools-list
210
- mcpc --config .vscode/mcp.json fileSystem tools-call list_directory path:=/
211
-
212
- # Remote server (Streamable HTTP)
213
- mcpc mcp.apify.com\?tools=docs
214
- mcpc mcp.apify.com\?tools=docs tools-list
215
- mcpc mcp.apify.com\?tools=docs tools-call search-apify-docs query:="What are Actors?"
216
-
217
- # Session
218
- 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
219
187
  mcpc @apify tools-list
220
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:=/
221
194
  ```
222
195
 
223
196
  See [MCP feature support](#mcp-feature-support) for details about all supported MCP features and commands.
@@ -228,18 +201,18 @@ The `tools-call` and `prompts-get` commands accept arguments as positional param
228
201
 
229
202
  ```bash
230
203
  # Key:=value pairs (auto-parsed: tries JSON, falls back to string)
231
- mcpc <target> tools-call <tool-name> greeting:="hello world" count:=10 enabled:=true
232
- 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]'
233
206
 
234
207
  # Force string type with JSON quotes
235
- mcpc <target> tools-call <tool-name> id:='"123"' flag:='"true"'
208
+ mcpc @session tools-call <tool-name> id:='"123"' flag:='"true"'
236
209
 
237
210
  # Inline JSON object (if first arg starts with { or [)
238
- mcpc <target> tools-call <tool-name> '{"greeting":"hello world","count":10}'
211
+ mcpc @session tools-call <tool-name> '{"greeting":"hello world","count":10}'
239
212
 
240
213
  # Read from stdin (automatic when no positional args and input is piped)
241
- echo '{"greeting":"hello","count":10}' | mcpc <target> tools-call <tool-name>
242
- 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>
243
216
  ```
244
217
 
245
218
  **Rules:**
@@ -286,8 +259,7 @@ mcpc @server tools-call search "query:=hello world"
286
259
  `mcpc` provides an interactive shell for discovery and testing of MCP servers.
287
260
 
288
261
  ```bash
289
- mcpc mcp.apify.com shell # Direct connection
290
- mcpc @apify shell # Use existing session
262
+ mcpc @apify shell
291
263
  ```
292
264
 
293
265
  Shell commands: `help`, `exit`/`quit`/Ctrl+D, Ctrl+C to cancel.
@@ -317,7 +289,7 @@ which then serve as unique reference in commands.
317
289
 
318
290
  ```bash
319
291
  # Create a persistent session
320
- mcpc mcp.apify.com\?tools=docs connect @apify
292
+ mcpc connect mcp.apify.com @apify
321
293
 
322
294
  # List all sessions and OAuth profiles
323
295
  mcpc
@@ -327,10 +299,10 @@ mcpc @apify tools-list
327
299
  mcpc @apify shell
328
300
 
329
301
  # Restart the session (kills and restarts the bridge process)
330
- mcpc @apify restart
302
+ mcpc @apify restart # or: mcpc restart @apify
331
303
 
332
304
  # Close the session, terminates bridge process
333
- mcpc @apify close
305
+ mcpc @apify close # or: mcpc close @apify
334
306
 
335
307
  # ...now session name "@apify" is forgotten and available for future use
336
308
  ```
@@ -371,14 +343,14 @@ and any future attempts to use them will fail.
371
343
  To **remove the session from the list**, you need to explicitly close it:
372
344
 
373
345
  ```bash
374
- mcpc @apify close
346
+ mcpc @apify close # or: mcpc close @apify
375
347
  ```
376
348
 
377
349
  You can restart a session anytime, which kills the bridge process
378
350
  and opens new connection with new `MCP-Session-Id`, by running:
379
351
 
380
352
  ```bash
381
- mcpc @apify restart
353
+ mcpc @apify restart # or: mcpc restart @apify
382
354
  ```
383
355
 
384
356
  ## Authentication
@@ -391,11 +363,7 @@ For local servers (stdio) or remote servers (Streamable HTTP) which do not requi
391
363
  `mcpc` can be used without authentication:
392
364
 
393
365
  ```bash
394
- # One-shot command
395
- mcpc mcp.apify.com\?tools=docs tools-list
396
-
397
- # Session command
398
- mcpc mcp.apify.com\?tools=docs connect @test
366
+ mcpc connect mcp.apify.com @test
399
367
  mcpc @test tools-list
400
368
  ```
401
369
 
@@ -407,11 +375,8 @@ All headers are stored securely in the OS keychain for the session, but they are
407
375
  running a one-shot command or connecting new session.
408
376
 
409
377
  ```bash
410
- # One-time command with Bearer token
411
- mcpc --header "Authorization: Bearer ${APIFY_TOKEN}" https://mcp.apify.com tools-list
412
-
413
- # Create session with Bearer token (saved to keychain for this session only)
414
- 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}"
415
380
 
416
381
  # Use the session (Bearer token is loaded from keychain automatically)
417
382
  mcpc @apify tools-list
@@ -443,25 +408,25 @@ Key concepts:
443
408
 
444
409
  ```bash
445
410
  # Login to server and save 'default' authentication profile for future use
446
- mcpc mcp.apify.com login
411
+ mcpc login mcp.apify.com
447
412
 
448
413
  # Use named authentication profile instead of 'default'
449
- mcpc mcp.apify.com login --profile work
414
+ mcpc login mcp.apify.com --profile work
450
415
 
451
416
  # Create two sessions using the two different credentials
452
- mcpc https://mcp.apify.com connect @apify-personal
453
- 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
454
419
 
455
420
  # Both sessions now work independently
456
421
  mcpc @apify-personal tools-list # Uses personal account
457
422
  mcpc @apify-work tools-list # Uses work account
458
423
 
459
424
  # Re-authenticate existing profile (e.g., to refresh or change scopes)
460
- mcpc mcp.apify.com login --profile work
425
+ mcpc login mcp.apify.com --profile work
461
426
 
462
427
  # Delete "default" and "work" authentication profiles
463
- mcpc mcp.apify.com logout
464
- mcpc mcp.apify.com logout --profile work
428
+ mcpc logout mcp.apify.com
429
+ mcpc logout mcp.apify.com --profile work
465
430
  ```
466
431
 
467
432
  ### Authentication precedence
@@ -473,7 +438,16 @@ When multiple authentication methods are available, `mcpc` uses this precedence
473
438
  3. **Config file headers** - Headers from `--config` file for the server
474
439
  4. **No authentication** - Attempts unauthenticated connection
475
440
 
476
- `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)
477
451
 
478
452
  **When `--profile <name>` is specified:**
479
453
 
@@ -482,7 +456,13 @@ When multiple authentication methods are available, `mcpc` uses this precedence
482
456
  - If authentication fails (expired/invalid) → Fail with an error
483
457
  2. **Profile doesn't exist**: Fail with an error
484
458
 
485
- **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):**
486
466
 
487
467
  1. **`default` profile exists for the server**: Use its stored credentials
488
468
  - If authentication succeeds → Continue with command/session
@@ -495,7 +475,7 @@ On failure, the error message includes instructions on how to login and save the
495
475
 
496
476
  This flow ensures:
497
477
 
498
- - You only authenticate when necessary
478
+ - Explicit CLI flags always take precedence over stored profiles
499
479
  - Credentials are never silently mixed up (personal → work) or downgraded (authenticated → unauthenticated)
500
480
  - You can mix authenticated sessions (with named profiles) and public access on the same server
501
481
 
@@ -505,16 +485,19 @@ This flow ensures:
505
485
  # With specific profile - always authenticated:
506
486
  # - Uses 'work' if it exists
507
487
  # - Fails if it doesn't exist
508
- mcpc mcp.apify.com connect @apify-work --profile work
488
+ mcpc connect mcp.apify.com @apify-work --profile work
509
489
 
510
490
  # Without profile - opportunistic authentication:
511
491
  # - Uses 'default' if it exists
512
492
  # - Tries unauthenticated if 'default' doesn't exist
513
493
  # - Fails if the server requires authentication
514
- mcpc mcp.apify.com connect @apify-personal
494
+ mcpc connect mcp.apify.com @apify-personal
515
495
 
516
- # Public server - no authentication needed:
517
- mcpc mcp.apify.com\?tools=docs tools-list
496
+ # Explicit bearer token - skips profile auto-detection:
497
+ mcpc connect mcp.apify.com @apify --header "Authorization: Bearer ${APIFY_TOKEN}"
498
+
499
+ # Anonymous - skips default profile even if it exists:
500
+ mcpc connect mcp.apify.com @apify-anon --no-profile
518
501
  ```
519
502
 
520
503
  ## MCP proxy
@@ -526,25 +509,21 @@ See also [AI sandboxes](#ai-sandboxes).
526
509
 
527
510
  ```bash
528
511
  # Human authenticates to a remote server
529
- mcpc mcp.apify.com login
512
+ mcpc login mcp.apify.com
530
513
 
531
514
  # Create authenticated session with proxy server on localhost:8080
532
- mcpc mcp.apify.com connect @open-relay --proxy 8080
515
+ mcpc connect mcp.apify.com @open-relay --proxy 8080
533
516
 
534
517
  # Now any MCP client can connect to proxy like to a regular MCP server
535
518
  # The client has NO access to the original OAuth tokens or HTTP headers
536
519
  # Note: localhost/127.0.0.1 URLs default to http:// (no scheme needed)
537
- mcpc localhost:8080 tools-list
538
- mcpc 127.0.0.1:8080 tools-call search-actors keywords:="web scraper"
539
-
540
- # Or create a new session from the proxy for convenience
541
- mcpc localhost:8080 connect @sandboxed
520
+ mcpc connect localhost:8080 @sandboxed
542
521
  mcpc @sandboxed tools-call search-actors keywords:="web scraper"
543
522
 
544
523
  # Optionally protect proxy with bearer token for better security (stored in OS keychain)
545
- 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
546
525
  # To use the proxy, caller needs to pass the bearer token in HTTP header
547
- mcpc localhost:8081 connect @sandboxed2 --header "Authorization: Bearer secret123"
526
+ mcpc connect localhost:8081 @sandboxed2 --header "Authorization: Bearer secret123"
548
527
  ```
549
528
 
550
529
  **Proxy options for `connect` command:**
@@ -565,13 +544,13 @@ mcpc localhost:8081 connect @sandboxed2 --header "Authorization: Bearer secret12
565
544
 
566
545
  ```bash
567
546
  # Localhost only (default, most secure)
568
- mcpc mcp.apify.com connect @relay --proxy 8080
547
+ mcpc connect mcp.apify.com @relay --proxy 8080
569
548
 
570
549
  # Bind to all interfaces (allows network access - use with caution!)
571
- 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
572
551
 
573
552
  # Bind to specific interface
574
- 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
575
554
  ```
576
555
 
577
556
  When listing sessions, proxy info is displayed prominently:
@@ -664,8 +643,8 @@ it's always a good idea to run them in a code sandbox with limited access to you
664
643
 
665
644
  The [proxy MCP server](#mcp-proxy) feature provides a security boundary for AI agents:
666
645
 
667
- 1. **Human creates authentication profile**: `mcpc mcp.apify.com login --profile ai-access`
668
- 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`
669
648
  3. **AI runs inside a sandbox**: If sandbox has access limited to `localhost:8080`,
670
649
  it can only interact with the MCP server through the `@ai-sandbox` session,
671
650
  without access to the original OAuth credentials, HTTP headers, or `mcpc` configuration.
@@ -732,7 +711,7 @@ Pass the `--x402` flag when connecting to a session or running direct commands:
732
711
 
733
712
  ```bash
734
713
  # Create a session with x402 payment support
735
- mcpc mcp.apify.com connect @apify --x402
714
+ mcpc connect mcp.apify.com @apify --x402
736
715
 
737
716
  # The session now automatically handles 402 responses
738
717
  mcpc @apify tools-call expensive-tool query:="hello"
@@ -904,7 +883,7 @@ When connected via a [session](#sessions), `mcpc` automatically handles `list_ch
904
883
  notifications for tools, resources, and prompts.
905
884
  The bridge process tracks when each notification type was last received.
906
885
  In [shell mode](#interactive-shell), notifications are displayed in real-time.
907
- 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`
908
887
  field - see [Server instructions](#server-instructions).
909
888
 
910
889
  #### Server logs
@@ -958,14 +937,12 @@ You can configure `mcpc` using a config file, environment variables, or command-
958
937
 
959
938
  `mcpc` supports the ["standard"](https://gofastmcp.com/integrations/mcp-json-configuration)
960
939
  MCP server JSON config file, compatible with Claude Desktop, VS Code, and other MCP clients.
961
- You can point to an existing config file with `--config`:
940
+ Use the `file:entry` syntax to reference a server from a config file:
962
941
 
963
942
  ```bash
964
- # One-shot command to an MCP server configured in Visual Studio Code
965
- mcpc --config .vscode/mcp.json apify tools-list
966
-
967
- # Open a session to a server specified in the custom config file
968
- 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
969
946
  ```
970
947
 
971
948
  **Example MCP config JSON file:**
@@ -1010,14 +987,12 @@ For **stdio servers:**
1010
987
 
1011
988
  **Using servers from config file:**
1012
989
 
1013
- When `--config` is provided, you can reference servers by name:
990
+ Reference servers by their name using the `file:entry` syntax:
1014
991
 
1015
992
  ```bash
1016
- # With config file, use server names directly
1017
- mcpc --config .vscode/mcp.json filesystem tools-list
1018
-
1019
- # Create a named session from server in config
1020
- 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
1021
996
  mcpc @fs tools-call search
1022
997
  ```
1023
998
 
@@ -1060,20 +1035,19 @@ Config files support environment variable substitution using `${VAR_NAME}` synta
1060
1035
 
1061
1036
  ### Cleanup
1062
1037
 
1063
- 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:
1064
1039
 
1065
1040
  ```bash
1066
1041
  # Safe non-destructive cleanup: remove expired sessions, delete old orphaned logs
1067
- mcpc --clean
1042
+ mcpc clean
1068
1043
 
1069
- # Clean specific resources (comma-separated)
1070
- mcpc --clean=sessions # Kill bridges, delete all sessions
1071
- mcpc --clean=profiles # Delete all authentication profiles
1072
- mcpc --clean=logs # Delete all log files
1073
- 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
1074
1048
 
1075
1049
  # Nuclear option: remove everything
1076
- mcpc --clean=all # Delete all sessions, profiles, logs, and sockets
1050
+ mcpc clean all # Delete all sessions, profiles, logs, and sockets
1077
1051
  ```
1078
1052
 
1079
1053
  ## Security
@@ -1152,12 +1126,12 @@ The main `mcpc` process doesn't save log files, but supports [verbose mode](#ver
1152
1126
  **"Session not found"**
1153
1127
 
1154
1128
  - List existing sessions: `mcpc`
1155
- - 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>`
1156
1130
 
1157
1131
  **"Authentication failed"**
1158
1132
 
1159
1133
  - List saved OAuth profiles: `mcpc`
1160
- - Re-authenticate: `mcpc <server> login [--profile <name>]`
1134
+ - Re-authenticate: `mcpc login <server> [--profile <name>]`
1161
1135
  - For bearer tokens: provide `--header "Authorization: Bearer ${TOKEN}"` again
1162
1136
 
1163
1137
  ## Development
@@ -1169,26 +1143,47 @@ See [CONTRIBUTING](./CONTRIBUTING.md) for development setup, architecture overvi
1169
1143
 
1170
1144
  ## Related work
1171
1145
 
1172
- - MCP CLI clients
1173
- - https://github.com/chrishayuk/mcp-cli
1174
- - https://github.com/wong2/mcp-cli
1175
- - https://github.com/f/mcptools
1176
- - https://github.com/adhikasp/mcp-client-cli
1177
- - https://github.com/mattzcarey/cloudflare-mcp
1178
- - https://github.com/thellimist/clihub (see https://news.ycombinator.com/item?id=47157398)
1179
- - https://github.com/EstebanForge/mcp-cli-ent
1180
- - https://github.com/assimelha/cmcp
1181
- - Code mode
1182
- - https://blog.cloudflare.com/code-mode/
1183
- - https://www.anthropic.com/engineering/code-execution-with-mcp
1184
- - https://github.com/steipete/mcporter
1185
- - Dynamic tool discovery
1186
- - https://www.anthropic.com/engineering/advanced-tool-use
1187
- - https://platform.claude.com/docs/en/agents-and-tools/tool-use/tool-search-tool
1188
- - https://cursor.com/blog/dynamic-context-discovery
1189
- - https://github.com/philschmid/mcp-cli (https://www.philschmid.de/mcp-cli)
1190
- - Other
1191
- - 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
1192
1187
 
1193
1188
  ## License
1194
1189