@apify/mcpc 0.3.0-beta.1 → 0.3.1-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +28 -2
- package/README.md +141 -66
- package/dist/bridge/index.js +32 -40
- package/dist/bridge/index.js.map +1 -1
- package/dist/cli/commands/clean.d.ts.map +1 -1
- package/dist/cli/commands/clean.js +3 -2
- package/dist/cli/commands/clean.js.map +1 -1
- package/dist/cli/commands/logs.d.ts +8 -0
- package/dist/cli/commands/logs.d.ts.map +1 -0
- package/dist/cli/commands/logs.js +143 -0
- package/dist/cli/commands/logs.js.map +1 -0
- package/dist/cli/commands/sessions.d.ts +6 -4
- package/dist/cli/commands/sessions.d.ts.map +1 -1
- package/dist/cli/commands/sessions.js +141 -85
- package/dist/cli/commands/sessions.js.map +1 -1
- package/dist/cli/commands/skills.d.ts +20 -0
- package/dist/cli/commands/skills.d.ts.map +1 -0
- package/dist/cli/commands/skills.js +160 -0
- package/dist/cli/commands/skills.js.map +1 -0
- package/dist/cli/commands/x402.d.ts.map +1 -1
- package/dist/cli/commands/x402.js +14 -4
- package/dist/cli/commands/x402.js.map +1 -1
- package/dist/cli/index.js +113 -24
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/output.d.ts +13 -0
- package/dist/cli/output.d.ts.map +1 -1
- package/dist/cli/output.js +114 -20
- package/dist/cli/output.js.map +1 -1
- package/dist/cli/parser.d.ts +1 -1
- package/dist/cli/parser.d.ts.map +1 -1
- package/dist/cli/parser.js +25 -2
- package/dist/cli/parser.js.map +1 -1
- package/dist/cli/shell.js.map +1 -1
- package/dist/core/capabilities.d.ts +3 -0
- package/dist/core/capabilities.d.ts.map +1 -0
- package/dist/core/capabilities.js +14 -0
- package/dist/core/capabilities.js.map +1 -0
- package/dist/core/index.d.ts +1 -0
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +1 -0
- package/dist/core/index.js.map +1 -1
- package/dist/core/mcp-client.d.ts +4 -0
- package/dist/core/mcp-client.d.ts.map +1 -1
- package/dist/core/mcp-client.js +34 -12
- package/dist/core/mcp-client.js.map +1 -1
- package/dist/lib/bridge-client.d.ts +4 -1
- package/dist/lib/bridge-client.d.ts.map +1 -1
- package/dist/lib/bridge-client.js +29 -3
- package/dist/lib/bridge-client.js.map +1 -1
- package/dist/lib/bridge-manager.d.ts +2 -2
- package/dist/lib/bridge-manager.d.ts.map +1 -1
- package/dist/lib/bridge-manager.js +31 -15
- package/dist/lib/bridge-manager.js.map +1 -1
- package/dist/lib/cleanup.d.ts.map +1 -1
- package/dist/lib/cleanup.js +20 -19
- package/dist/lib/cleanup.js.map +1 -1
- package/dist/lib/config.d.ts +14 -0
- package/dist/lib/config.d.ts.map +1 -1
- package/dist/lib/config.js +41 -27
- package/dist/lib/config.js.map +1 -1
- package/dist/lib/errors.d.ts +0 -1
- package/dist/lib/errors.d.ts.map +1 -1
- package/dist/lib/errors.js +2 -4
- package/dist/lib/errors.js.map +1 -1
- package/dist/lib/index.d.ts +1 -0
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/index.js +1 -0
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/log-reader.d.ts +28 -0
- package/dist/lib/log-reader.d.ts.map +1 -0
- package/dist/lib/log-reader.js +278 -0
- package/dist/lib/log-reader.js.map +1 -0
- package/dist/lib/session-client.d.ts.map +1 -1
- package/dist/lib/session-client.js +3 -5
- package/dist/lib/session-client.js.map +1 -1
- package/dist/lib/stderr-tail.d.ts +10 -0
- package/dist/lib/stderr-tail.d.ts.map +1 -0
- package/dist/lib/stderr-tail.js +28 -0
- package/dist/lib/stderr-tail.js.map +1 -0
- package/dist/lib/types.d.ts +6 -1
- package/dist/lib/types.d.ts.map +1 -1
- package/dist/lib/types.js +1 -0
- package/dist/lib/types.js.map +1 -1
- package/dist/lib/utils.d.ts +1 -0
- package/dist/lib/utils.d.ts.map +1 -1
- package/dist/lib/utils.js +12 -2
- package/dist/lib/utils.js.map +1 -1
- package/dist/lib/x402/fetch-middleware.d.ts +3 -2
- package/dist/lib/x402/fetch-middleware.d.ts.map +1 -1
- package/dist/lib/x402/fetch-middleware.js +37 -24
- package/dist/lib/x402/fetch-middleware.js.map +1 -1
- package/dist/lib/x402/signer.d.ts +7 -1
- package/dist/lib/x402/signer.d.ts.map +1 -1
- package/dist/lib/x402/signer.js +249 -5
- package/dist/lib/x402/signer.js.map +1 -1
- package/docs/README.md +1 -0
- package/docs/claude-skill/SKILL.md +151 -117
- package/docs/examples/company-lookup.sh +6 -6
- package/docs/vhs/README.md +79 -0
- package/docs/vhs/grep.tape +56 -0
- package/docs/vhs/mcpc-demo.tape +179 -0
- package/docs/vhs/proxy.tape +69 -0
- package/docs/vhs/quickstart.tape +59 -0
- package/docs/vhs/scripting.tape +69 -0
- package/docs/vhs/tools.tape +66 -0
- package/package.json +20 -20
|
@@ -1,184 +1,218 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: mcpc
|
|
3
|
-
description: Use mcpc CLI to
|
|
3
|
+
description: Use the mcpc CLI to work with MCP (Model Context Protocol) servers from the shell - connect to a server as a persistent session, then list and call tools, read resources, get prompts, and run async tasks. Use --json for scripting and code mode. Reach for this whenever interacting with MCP servers, calling MCP tools, or accessing MCP resources programmatically.
|
|
4
4
|
allowed-tools: Bash(mcpc:*), Bash(node dist/cli/index.js:*), Read, Grep
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# mcpc: MCP command-line client
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
`mcpc` maps every MCP operation to a shell command. For agents this is often more
|
|
10
|
+
efficient than function calling: discover the right tool on demand, then generate
|
|
11
|
+
shell commands (ideally with `--json`) instead of carrying tool definitions in context.
|
|
11
12
|
|
|
12
|
-
##
|
|
13
|
+
## Mental model
|
|
14
|
+
|
|
15
|
+
1. **Connect once** to a server — this creates a persistent, named `@session`. A
|
|
16
|
+
background bridge process keeps the connection (and its state) alive.
|
|
17
|
+
2. **Run commands against the `@session`**: list/call tools, read resources, get
|
|
18
|
+
prompts, run async tasks. There is no one-shot `mcpc <url> tools-list` — connect first.
|
|
19
|
+
3. **Default output is human-readable**; add `--json` for machine-readable, MCP-spec
|
|
20
|
+
shaped output that composes with `jq` and shell pipelines (code mode).
|
|
21
|
+
|
|
22
|
+
Everything is self-documenting — when unsure, ask the CLI:
|
|
13
23
|
|
|
14
24
|
```bash
|
|
15
|
-
#
|
|
16
|
-
mcpc
|
|
17
|
-
|
|
18
|
-
# Show server info
|
|
19
|
-
mcpc <server>
|
|
20
|
-
mcpc @<session>
|
|
21
|
-
|
|
22
|
-
# Tools
|
|
23
|
-
mcpc <target> tools-list
|
|
24
|
-
mcpc <target> tools-get <tool-name>
|
|
25
|
-
mcpc <target> tools-call <tool-name> key:=value key2:="string value"
|
|
26
|
-
|
|
27
|
-
# Resources
|
|
28
|
-
mcpc <target> resources-list
|
|
29
|
-
mcpc <target> resources-read <uri>
|
|
30
|
-
|
|
31
|
-
# Prompts
|
|
32
|
-
mcpc <target> prompts-list
|
|
33
|
-
mcpc <target> prompts-get <prompt-name> arg1:=value1
|
|
34
|
-
|
|
35
|
-
# Sessions (persistent connections)
|
|
36
|
-
mcpc <server> connect @<name>
|
|
37
|
-
mcpc @<name> <command>
|
|
38
|
-
mcpc @<name> close
|
|
39
|
-
|
|
40
|
-
# Authentication
|
|
41
|
-
mcpc <server> login
|
|
42
|
-
mcpc <server> logout
|
|
25
|
+
mcpc --help # all commands + global options
|
|
26
|
+
mcpc help connect # help for one command
|
|
27
|
+
mcpc @apify tools-call foo --help # print a specific tool's input schema
|
|
43
28
|
```
|
|
44
29
|
|
|
45
|
-
##
|
|
30
|
+
## First steps
|
|
46
31
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
32
|
+
```bash
|
|
33
|
+
mcpc # list sessions + auth profiles (start here)
|
|
34
|
+
mcpc connect mcp.apify.com @apify # connect, create the @apify session
|
|
35
|
+
mcpc @apify # server info, capabilities, tools overview
|
|
36
|
+
mcpc @apify tools-list # list tools
|
|
37
|
+
mcpc @apify tools-call <tool> q:="hi" # call a tool
|
|
38
|
+
```
|
|
51
39
|
|
|
52
|
-
##
|
|
40
|
+
## Connecting
|
|
53
41
|
|
|
54
|
-
|
|
42
|
+
Server formats accepted by `connect` / `login` / `logout`:
|
|
55
43
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
44
|
+
- `mcp.example.com` — remote HTTP server (`https://` is added automatically)
|
|
45
|
+
- `localhost:8080` or `127.0.0.1:8080` — local HTTP server (`http://` is the default for localhost)
|
|
46
|
+
- `~/.vscode/mcp.json:filesystem` — a single entry from a config file (`file:entry`)
|
|
47
|
+
- `~/.vscode/mcp.json` — connect **every** entry in a config file
|
|
48
|
+
- _(no server)_ — auto-discover standard configs and connect all of them
|
|
59
49
|
|
|
60
|
-
|
|
61
|
-
mcpc @
|
|
62
|
-
|
|
63
|
-
#
|
|
64
|
-
mcpc
|
|
50
|
+
```bash
|
|
51
|
+
mcpc connect mcp.apify.com @apify # remote server, explicit session name
|
|
52
|
+
mcpc connect mcp.apify.com # auto-name the session → @apify
|
|
53
|
+
mcpc connect ./.vscode/mcp.json:fs @fs # one config entry (stdio or http)
|
|
54
|
+
mcpc connect # discover standard configs + connect everything
|
|
55
|
+
```
|
|
65
56
|
|
|
66
|
-
|
|
67
|
-
|
|
57
|
+
- `@session` is optional — omit it to auto-generate a name from the server
|
|
58
|
+
(`mcp.apify.com` → `@apify`). A matching session (same server + auth) is reused.
|
|
59
|
+
- **Stdio (command-based) entries launch a local process on connect** — only connect
|
|
60
|
+
to configs you trust. Bulk connects skip stdio entries unless you pass `--stdio`.
|
|
61
|
+
- Set `APIFY_API_TOKEN` to auto-connect `mcp.apify.com` as `@apify` (used as a Bearer token).
|
|
68
62
|
|
|
69
|
-
|
|
70
|
-
mcpc @s tools-call search '{"query":"hello","limit":10}'
|
|
63
|
+
## Sessions
|
|
71
64
|
|
|
72
|
-
|
|
73
|
-
|
|
65
|
+
```bash
|
|
66
|
+
mcpc # list all sessions and their state
|
|
67
|
+
mcpc @apify # session details, capabilities, tools (also reports the
|
|
68
|
+
# negotiated protocol version and stateful vs stateless)
|
|
69
|
+
mcpc restart @apify # restart (after server updates, or to recover an 'expired' session)
|
|
70
|
+
mcpc close @apify # tear the session down
|
|
74
71
|
```
|
|
75
72
|
|
|
76
|
-
|
|
73
|
+
**Session states:**
|
|
77
74
|
|
|
78
|
-
|
|
75
|
+
- 🟢 **live** — ready to use
|
|
76
|
+
- 🟡 **connecting** / **reconnecting** — transient; retry in a moment
|
|
77
|
+
- 🟡 **crashed** — bridge process died; auto-restarts on next use
|
|
78
|
+
- 🔴 **unauthorized** — auth failed; run `mcpc login <server>` then `mcpc restart @session`
|
|
79
|
+
- 🔴 **expired** — server dropped the session; run `mcpc restart @session`
|
|
79
80
|
|
|
80
|
-
|
|
81
|
-
# Get tools as JSON
|
|
82
|
-
mcpc --json @apify tools-list
|
|
81
|
+
## Discovering and inspecting tools
|
|
83
82
|
|
|
84
|
-
|
|
85
|
-
mcpc
|
|
83
|
+
```bash
|
|
84
|
+
mcpc @apify tools-list # compact list with inline param signatures
|
|
85
|
+
mcpc @apify tools-list --full # full JSON schemas
|
|
86
|
+
mcpc @apify tools-get <tool> # one tool's details + schema
|
|
87
|
+
mcpc @apify tools-call <tool> --help # shortcut: print just that tool's input schema
|
|
86
88
|
|
|
87
|
-
#
|
|
88
|
-
mcpc
|
|
89
|
+
mcpc grep "search" # search tools + instructions across ALL sessions
|
|
90
|
+
mcpc @apify grep "actor" --resources # search one session; --tools/--resources/--prompts, -E regex
|
|
89
91
|
```
|
|
90
92
|
|
|
91
|
-
|
|
93
|
+
Prefer progressive discovery: `grep` to find the right tool, then `tools-get` for its
|
|
94
|
+
schema. This keeps token use low instead of dumping every tool definition.
|
|
92
95
|
|
|
93
|
-
|
|
96
|
+
## Calling tools (passing arguments)
|
|
94
97
|
|
|
95
|
-
|
|
96
|
-
# Create session (or reconnect if exists)
|
|
97
|
-
mcpc mcp.apify.com connect @apify
|
|
98
|
+
Arguments go after the tool name. Three interchangeable styles:
|
|
98
99
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
mcpc @apify tools-call search query:="
|
|
100
|
+
```bash
|
|
101
|
+
# 1) key:=value — values are auto-parsed as JSON, falling back to string
|
|
102
|
+
mcpc @apify tools-call search query:="hello world" limit:=10 enabled:=true
|
|
103
|
+
mcpc @apify tools-call search config:='{"nested":"value"}' items:='[1,2,3]'
|
|
104
|
+
mcpc @apify tools-call search id:='"123"' # force a string with JSON quotes
|
|
102
105
|
|
|
103
|
-
#
|
|
104
|
-
mcpc @apify
|
|
106
|
+
# 2) inline JSON — when the first arg starts with { or [
|
|
107
|
+
mcpc @apify tools-call search '{"query":"hello","limit":10}'
|
|
105
108
|
|
|
106
|
-
#
|
|
107
|
-
mcpc @apify
|
|
109
|
+
# 3) stdin — auto-detected when piped and no positional args are given
|
|
110
|
+
echo '{"query":"hello"}' | mcpc @apify tools-call search
|
|
108
111
|
```
|
|
109
112
|
|
|
110
|
-
|
|
111
|
-
- 🟢 **live** - Bridge running, server might or might not be responding
|
|
112
|
-
- 🟡 **crashed** - Bridge crashed; auto-restarts on next use
|
|
113
|
-
- 🔴 **expired** - Server rejected session; needs `close` and reconnect
|
|
113
|
+
## JSON output (code mode)
|
|
114
114
|
|
|
115
|
-
|
|
115
|
+
Add `--json` for machine-readable output: results on stdout, errors on stderr,
|
|
116
|
+
shaped strictly per the MCP spec.
|
|
116
117
|
|
|
117
|
-
**OAuth (interactive login)**:
|
|
118
118
|
```bash
|
|
119
|
-
mcpc
|
|
120
|
-
mcpc
|
|
121
|
-
```
|
|
119
|
+
mcpc --json @apify tools-list | jq -r '.[].name'
|
|
120
|
+
mcpc --json @apify tools-call search query:="test" | jq -r '.content[0].text'
|
|
122
121
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
122
|
+
# chain tools across calls/sessions
|
|
123
|
+
mcpc --json @apify tools-call search-actors keywords:="scraper" \
|
|
124
|
+
| jq -r '.content[0].text | fromjson | .items[0].id' \
|
|
125
|
+
| xargs -I{} mcpc --json @apify tools-call get-actor actorId:="{}"
|
|
127
126
|
```
|
|
128
127
|
|
|
129
|
-
|
|
128
|
+
`mcpc --json` with no command returns `{ "sessions": [...], "profiles": [...] }`.
|
|
130
129
|
|
|
131
|
-
|
|
130
|
+
## Resources and prompts
|
|
132
131
|
|
|
133
132
|
```bash
|
|
134
|
-
|
|
135
|
-
mcpc
|
|
133
|
+
mcpc @apify resources-list
|
|
134
|
+
mcpc @apify resources-read "file:///path/to/file" # -o <file> to save, --max-size <bytes>
|
|
135
|
+
mcpc @apify resources-templates-list
|
|
136
|
+
mcpc @apify resources-subscribe <uri> # and resources-unsubscribe <uri>
|
|
136
137
|
|
|
137
|
-
|
|
138
|
-
#
|
|
139
|
-
mcpc localhost:8080 tools-list
|
|
140
|
-
mcpc 127.0.0.1:8080 connect @sandboxed
|
|
138
|
+
mcpc @apify prompts-list
|
|
139
|
+
mcpc @apify prompts-get <name> arg1:=value1 # same argument styles as tools-call
|
|
141
140
|
```
|
|
142
141
|
|
|
143
|
-
##
|
|
142
|
+
## Async tasks (long-running tools)
|
|
144
143
|
|
|
145
|
-
**List and inspect tools**:
|
|
146
144
|
```bash
|
|
147
|
-
mcpc @
|
|
148
|
-
|
|
145
|
+
mcpc @apify tools-call <tool> --task <args> # run as a task with a progress spinner;
|
|
146
|
+
# Ctrl+C leaves it running and prints the task ID
|
|
147
|
+
mcpc @apify tools-call <tool> --detach <args> # start and return the task ID immediately
|
|
148
|
+
mcpc @apify tasks-list
|
|
149
|
+
mcpc @apify tasks-get <taskId> # status
|
|
150
|
+
mcpc @apify tasks-result <taskId> # block until the final result is ready
|
|
151
|
+
mcpc @apify tasks-cancel <taskId>
|
|
149
152
|
```
|
|
150
153
|
|
|
151
|
-
|
|
152
|
-
```bash
|
|
153
|
-
mcpc --json @s tools-call my-tool | jq -r '.content[0].text'
|
|
154
|
-
```
|
|
154
|
+
## Authentication
|
|
155
155
|
|
|
156
|
-
**Read resource content**:
|
|
157
156
|
```bash
|
|
158
|
-
|
|
157
|
+
# OAuth — interactive browser login, saved as a reusable profile
|
|
158
|
+
mcpc login mcp.apify.com # "default" profile
|
|
159
|
+
mcpc login mcp.apify.com --profile work # a named profile (multiple accounts per server)
|
|
160
|
+
mcpc connect mcp.apify.com @apify --profile work
|
|
161
|
+
mcpc logout mcp.apify.com
|
|
162
|
+
|
|
163
|
+
# Bearer token — not stored as a profile; kept per-session
|
|
164
|
+
mcpc connect mcp.apify.com @s -H "Authorization: Bearer $TOKEN"
|
|
165
|
+
mcpc @s tools-list
|
|
159
166
|
```
|
|
160
167
|
|
|
161
|
-
|
|
168
|
+
With no auth flags, mcpc uses the `default` profile if one exists, otherwise it
|
|
169
|
+
connects anonymously. Use `--no-profile` to force an anonymous connection, or
|
|
170
|
+
`--profile <name>` to require a specific one.
|
|
171
|
+
|
|
172
|
+
## Proxy for AI isolation
|
|
173
|
+
|
|
174
|
+
Expose an authenticated session as a local MCP server, so sandboxed AI code can use it
|
|
175
|
+
without ever seeing your real credentials:
|
|
176
|
+
|
|
162
177
|
```bash
|
|
163
|
-
|
|
178
|
+
# Human: authenticated session + proxy listening on :8080
|
|
179
|
+
mcpc connect mcp.apify.com @ai-proxy --profile ai-access --proxy 8080
|
|
180
|
+
|
|
181
|
+
# AI in a sandbox limited to localhost: no access to the original tokens
|
|
182
|
+
mcpc connect localhost:8080 @sandboxed
|
|
183
|
+
mcpc @sandboxed tools-list
|
|
164
184
|
```
|
|
165
185
|
|
|
166
|
-
|
|
186
|
+
A proxy does not make an untrusted server safe — stdio servers still touch your system,
|
|
187
|
+
and HTTP servers still hold your credentials. Only connect to servers you trust.
|
|
188
|
+
|
|
189
|
+
## Agent skills (experimental)
|
|
167
190
|
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
191
|
+
Some servers publish agent skills (draft MCP extension, SEP-2640):
|
|
192
|
+
|
|
193
|
+
```bash
|
|
194
|
+
mcpc @apify skills-list
|
|
195
|
+
mcpc @apify skills-get <name> --raw # print the SKILL.md markdown (pipe to a file or an LLM)
|
|
196
|
+
```
|
|
173
197
|
|
|
174
198
|
## Debugging
|
|
175
199
|
|
|
176
200
|
```bash
|
|
177
|
-
|
|
178
|
-
mcpc
|
|
201
|
+
mcpc --verbose @apify tools-call <tool> # protocol-level detail (JSON-RPC, transport)
|
|
202
|
+
mcpc @apify logs # bridge log; -n <N>, --follow, --since 1h
|
|
203
|
+
mcpc @apify ping # round-trip health check
|
|
204
|
+
mcpc clean # tidy stale sessions/logs (also: mcpc clean all)
|
|
179
205
|
```
|
|
180
206
|
|
|
207
|
+
## Exit codes
|
|
208
|
+
|
|
209
|
+
- `0` — success
|
|
210
|
+
- `1` — client error (invalid arguments, unknown command)
|
|
211
|
+
- `2` — server error (tool failed, resource not found)
|
|
212
|
+
- `3` — network error
|
|
213
|
+
- `4` — authentication error
|
|
214
|
+
|
|
181
215
|
## Example script
|
|
182
216
|
|
|
183
|
-
See [`docs/examples/company-lookup.sh`](../examples/company-lookup.sh) for a complete
|
|
184
|
-
|
|
217
|
+
See [`docs/examples/company-lookup.sh`](../examples/company-lookup.sh) for a complete,
|
|
218
|
+
AI-generated "code mode" script that validates prerequisites and calls MCP tools with `--json`.
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
#
|
|
8
8
|
# Prerequisites:
|
|
9
9
|
# 1. Install mcpc: npm install -g @apify/mcpc
|
|
10
|
-
# 2. Login to Apify MCP server: mcpc mcp.apify.com
|
|
11
|
-
# 3. Create a session: mcpc mcp.apify.com
|
|
10
|
+
# 2. Login to Apify MCP server: mcpc login mcp.apify.com
|
|
11
|
+
# 3. Create a session: mcpc connect mcp.apify.com @apify
|
|
12
12
|
#
|
|
13
13
|
# Usage:
|
|
14
14
|
# ./company-lookup.sh "Company Name"
|
|
@@ -66,16 +66,16 @@ if [ -z "$SESSION_STATUS" ]; then
|
|
|
66
66
|
error "Session ${SESSION} not found.
|
|
67
67
|
|
|
68
68
|
To set up the required session:
|
|
69
|
-
1. Login to Apify: mcpc mcp.apify.com
|
|
70
|
-
2. Create session: mcpc mcp.apify.com
|
|
69
|
+
1. Login to Apify: mcpc login mcp.apify.com
|
|
70
|
+
2. Create session: mcpc connect mcp.apify.com ${SESSION}
|
|
71
71
|
|
|
72
72
|
Or use a different session by setting MCPC_SESSION environment variable."
|
|
73
73
|
fi
|
|
74
74
|
|
|
75
75
|
if [ "$SESSION_STATUS" = "expired" ]; then
|
|
76
76
|
error "Session ${SESSION} has expired. Please recreate it:
|
|
77
|
-
mcpc ${SESSION}
|
|
78
|
-
mcpc mcp.apify.com
|
|
77
|
+
mcpc close ${SESSION}
|
|
78
|
+
mcpc connect mcp.apify.com ${SESSION}"
|
|
79
79
|
fi
|
|
80
80
|
|
|
81
81
|
if [ "$SESSION_STATUS" = "crashed" ]; then
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# mcpc demo recordings (VHS)
|
|
2
|
+
|
|
3
|
+
This folder contains [VHS](https://github.com/charmbracelet/vhs) tape files
|
|
4
|
+
that record terminal GIFs of mcpc. Each `.tape` is a small script that drives
|
|
5
|
+
a real shell session; VHS replays it, captures the output, and renders a GIF
|
|
6
|
+
(or MP4 / WebM) — no manual screen recording needed.
|
|
7
|
+
|
|
8
|
+
## Prerequisites
|
|
9
|
+
|
|
10
|
+
- **VHS** — `brew install vhs` (or see [installation guide](https://github.com/charmbracelet/vhs#installation))
|
|
11
|
+
- **mcpc** — `npm install -g @apify/mcpc`
|
|
12
|
+
- **jq** — needed by `scripting.tape`
|
|
13
|
+
- **Auth (optional)** — `export APIFY_TOKEN=...` if you want the demos to hit
|
|
14
|
+
the authenticated Apify MCP server. Drop the `--header` line from the tape
|
|
15
|
+
to record an anonymous session against any public MCP server instead.
|
|
16
|
+
|
|
17
|
+
## Tapes
|
|
18
|
+
|
|
19
|
+
| File | Records | Notes |
|
|
20
|
+
| ---- | ------- | ----- |
|
|
21
|
+
| [`mcpc-demo.tape`](./mcpc-demo.tape) | Flagship overview: discover → connect → tools → grep → call → JSON → close | Source for `docs/images/mcpc-demo.gif` |
|
|
22
|
+
| [`quickstart.tape`](./quickstart.tape) | Minimal "connect, list, call" flow | Hero-sized GIF for README top |
|
|
23
|
+
| [`tools.tape`](./tools.tape) | `tools-list`, `tools-get`, `tools-call`, inline JSON, stdin | |
|
|
24
|
+
| [`scripting.tape`](./scripting.tape) | `--json` piped through `jq` and `xargs` (code mode) | |
|
|
25
|
+
| [`grep.tape`](./grep.tape) | Dynamic tool discovery with `mcpc grep` | |
|
|
26
|
+
| [`proxy.tape`](./proxy.tape) | MCP proxy / AI sandboxing | |
|
|
27
|
+
|
|
28
|
+
## Recording
|
|
29
|
+
|
|
30
|
+
Each tape outputs a GIF in this directory. Run from inside `docs/vhs/`:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
cd docs/vhs
|
|
34
|
+
vhs mcpc-demo.tape # → mcpc-demo.gif
|
|
35
|
+
vhs quickstart.tape # → quickstart.gif
|
|
36
|
+
# ... etc
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
To refresh the demo embedded in the main README:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
cd docs/vhs
|
|
43
|
+
vhs mcpc-demo.tape
|
|
44
|
+
cp mcpc-demo.gif ../images/mcpc-demo.gif
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
You can also render `.mp4` or `.webm` by editing the `Output` directive
|
|
48
|
+
inside the tape file (VHS infers the format from the extension).
|
|
49
|
+
|
|
50
|
+
## Customising
|
|
51
|
+
|
|
52
|
+
`mcpc-demo.tape` is the template — copy it, trim the sections you don't need,
|
|
53
|
+
and adjust:
|
|
54
|
+
|
|
55
|
+
- `Output <file>` — destination GIF / MP4 / WebM
|
|
56
|
+
- `Set Width / Set Height` — frame size (current default: 1100×650)
|
|
57
|
+
- `Set FontSize` / `Set FontFamily` / `Set Theme` — appearance
|
|
58
|
+
- `Set TypingSpeed` / `Sleep` — pacing
|
|
59
|
+
- Server URL and `--header` — point at your own MCP server
|
|
60
|
+
- Tool / argument names — swap for tools your audience cares about
|
|
61
|
+
|
|
62
|
+
The other tapes use the same Set block so they look consistent side by side.
|
|
63
|
+
|
|
64
|
+
## Tips
|
|
65
|
+
|
|
66
|
+
- Use `Hide` / `Show` around setup commands (clearing the screen, closing
|
|
67
|
+
stale sessions, exporting `PS1`) so they don't appear in the GIF.
|
|
68
|
+
- Add `Sleep` after each `Enter` so viewers have time to read the output
|
|
69
|
+
before the next command runs.
|
|
70
|
+
- `Set PlaybackSpeed 1.5` speeds up the final GIF without changing the
|
|
71
|
+
recording cadence — handy for long demos.
|
|
72
|
+
- Run the tape locally first (`vhs <file>.tape`) and inspect the generated
|
|
73
|
+
GIF before committing. VHS does not run inside CI by default; the tapes
|
|
74
|
+
are version-controlled but the GIFs they produce are not (the main
|
|
75
|
+
`docs/images/mcpc-demo.gif` is checked in separately).
|
|
76
|
+
|
|
77
|
+
See the [VHS documentation](https://github.com/charmbracelet/vhs#vhs-command-reference)
|
|
78
|
+
for the full list of directives (`Type`, `Sleep`, `Enter`, `Hide`, `Show`,
|
|
79
|
+
`Wait`, `Screenshot`, all `Set …` options, etc.).
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# mcpc grep — dynamic tool discovery across sessions
|
|
2
|
+
#
|
|
3
|
+
# cd docs/vhs && vhs grep.tape
|
|
4
|
+
|
|
5
|
+
Output grep.gif
|
|
6
|
+
|
|
7
|
+
Require mcpc
|
|
8
|
+
|
|
9
|
+
Set Shell "bash"
|
|
10
|
+
Set FontFamily "JetBrains Mono"
|
|
11
|
+
Set FontSize 16
|
|
12
|
+
Set Width 1100
|
|
13
|
+
Set Height 600
|
|
14
|
+
Set Padding 20
|
|
15
|
+
Set TypingSpeed 50ms
|
|
16
|
+
Set Theme "Catppuccin Mocha"
|
|
17
|
+
Set WindowBar Colorful
|
|
18
|
+
Set WindowBarSize 32
|
|
19
|
+
Set BorderRadius 8
|
|
20
|
+
|
|
21
|
+
Hide
|
|
22
|
+
Type "export PS1='$ '"
|
|
23
|
+
Enter
|
|
24
|
+
Type "mcpc connect mcp.apify.com @apify --header \"Authorization: Bearer ${APIFY_TOKEN}\" >/dev/null 2>&1 || true"
|
|
25
|
+
Enter
|
|
26
|
+
Type "clear"
|
|
27
|
+
Enter
|
|
28
|
+
Show
|
|
29
|
+
|
|
30
|
+
Type "# Find tools by keyword across every live session"
|
|
31
|
+
Sleep 600ms
|
|
32
|
+
Enter
|
|
33
|
+
Type 'mcpc grep "scraper"'
|
|
34
|
+
Sleep 400ms
|
|
35
|
+
Enter
|
|
36
|
+
Sleep 4s
|
|
37
|
+
|
|
38
|
+
Type "clear"
|
|
39
|
+
Enter
|
|
40
|
+
Type "# Regex + case-sensitive, limited results"
|
|
41
|
+
Sleep 500ms
|
|
42
|
+
Enter
|
|
43
|
+
Type 'mcpc grep "search|find" -E -m 5'
|
|
44
|
+
Sleep 400ms
|
|
45
|
+
Enter
|
|
46
|
+
Sleep 4s
|
|
47
|
+
|
|
48
|
+
Type "clear"
|
|
49
|
+
Enter
|
|
50
|
+
Type "# Search resources and prompts too"
|
|
51
|
+
Sleep 500ms
|
|
52
|
+
Enter
|
|
53
|
+
Type 'mcpc grep "config" --resources --prompts'
|
|
54
|
+
Sleep 400ms
|
|
55
|
+
Enter
|
|
56
|
+
Sleep 4s
|