@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.
- package/CHANGELOG.md +67 -1
- package/README.md +184 -189
- 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 +2 -2
- 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
|
|
87
|
+
mcpc login mcp.apify.com
|
|
88
88
|
|
|
89
|
-
#
|
|
90
|
-
mcpc mcp.apify.com
|
|
91
|
-
|
|
92
|
-
|
|
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
|
-
#
|
|
101
|
-
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
|
|
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]
|
|
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
|
|
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
|
-
|
|
152
|
-
|
|
153
|
-
|
|
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
|
-
|
|
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
|
|
182
|
-
mcpc
|
|
169
|
+
# Clean stale sessions and old log files
|
|
170
|
+
mcpc clean
|
|
183
171
|
```
|
|
184
172
|
|
|
185
|
-
###
|
|
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
|
-
`
|
|
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
|
|
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
|
-
|
|
182
|
+
All MCP commands go through a named session created with `connect`:
|
|
205
183
|
|
|
206
184
|
```bash
|
|
207
|
-
#
|
|
208
|
-
mcpc
|
|
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
|
|
232
|
-
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]'
|
|
233
206
|
|
|
234
207
|
# Force string type with JSON quotes
|
|
235
|
-
mcpc
|
|
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
|
|
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
|
|
242
|
-
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>
|
|
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
|
|
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
|
|
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
|
-
|
|
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
|
-
#
|
|
411
|
-
mcpc --header "Authorization: Bearer ${APIFY_TOKEN}"
|
|
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
|
|
411
|
+
mcpc login mcp.apify.com
|
|
447
412
|
|
|
448
413
|
# Use named authentication profile instead of 'default'
|
|
449
|
-
mcpc mcp.apify.com
|
|
414
|
+
mcpc login mcp.apify.com --profile work
|
|
450
415
|
|
|
451
416
|
# Create two sessions using the two different credentials
|
|
452
|
-
mcpc
|
|
453
|
-
mcpc
|
|
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
|
|
425
|
+
mcpc login mcp.apify.com --profile work
|
|
461
426
|
|
|
462
427
|
# Delete "default" and "work" authentication profiles
|
|
463
|
-
mcpc mcp.apify.com
|
|
464
|
-
mcpc mcp.apify.com
|
|
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
|
-
`
|
|
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
|
|
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
|
-
-
|
|
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
|
|
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
|
|
494
|
+
mcpc connect mcp.apify.com @apify-personal
|
|
515
495
|
|
|
516
|
-
#
|
|
517
|
-
mcpc mcp.apify.com
|
|
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
|
|
512
|
+
mcpc login mcp.apify.com
|
|
530
513
|
|
|
531
514
|
# Create authenticated session with proxy server on localhost:8080
|
|
532
|
-
mcpc mcp.apify.com
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
668
|
-
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`
|
|
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
|
|
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
|
|
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
|
-
|
|
940
|
+
Use the `file:entry` syntax to reference a server from a config file:
|
|
962
941
|
|
|
963
942
|
```bash
|
|
964
|
-
#
|
|
965
|
-
mcpc
|
|
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
|
-
|
|
990
|
+
Reference servers by their name using the `file:entry` syntax:
|
|
1014
991
|
|
|
1015
992
|
```bash
|
|
1016
|
-
#
|
|
1017
|
-
mcpc
|
|
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
|
|
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
|
|
1042
|
+
mcpc clean
|
|
1068
1043
|
|
|
1069
|
-
# Clean specific resources
|
|
1070
|
-
mcpc
|
|
1071
|
-
mcpc
|
|
1072
|
-
mcpc
|
|
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
|
|
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 <
|
|
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>
|
|
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
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
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
|
|