@mcpcloud/cli 0.9.1 → 0.10.0-next-20260715004701

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 (3) hide show
  1. package/README.md +350 -142
  2. package/dist/index.js +500 -198
  3. package/package.json +3 -2
package/README.md CHANGED
@@ -1,222 +1,429 @@
1
1
  # @mcpcloud/cli
2
2
 
3
- The official command-line interface for [MCPCloud](https://mcpcloud.sh) — manage projects, MCP servers, skills, and API keys from your terminal.
3
+ The official command-line interface for [MCPCloud](https://mcpcloud.sh) — build, deploy, and operate MCP servers and Skills from your terminal. Everything the dashboard does, scriptable: ingest an OpenAPI/GraphQL spec into a typed MCP server, deploy it to the edge, watch metrics, manage custom domains, and wire skills into your coding agent.
4
4
 
5
5
  ```sh
6
6
  npm install -g @mcpcloud/cli
7
- export MCPCLOUD_BASE_URL=https://your-deployment.example.com # ask your admin
8
- mcp login
9
- mcp whoami
7
+ mcp login # opens the browser sign-in — works out of the box
8
+ mcp whoami # confirm your identity, org, and active profile
10
9
  ```
11
10
 
12
- > **Note**
13
- > MCPCloud is in private beta. The CLI does **not** ship with a default API base URL — set `MCPCLOUD_BASE_URL` (or `mcp config set-url <url>`) using the URL provided by your MCPCloud admin. A built-in default will be added when the platform launches publicly.
14
-
15
- The package installs three equivalent binaries: `mcp` (primary), `mcpsh`, and `mcpcloud`. They all point at the same executable — use whichever you prefer.
11
+ The package installs three equivalent binaries — `mcp` (primary), `mcpsh`, and `mcpcloud`. They all point at the same executable; use whichever you prefer.
16
12
 
17
13
  ## Requirements
18
14
 
19
15
  - Node.js 18 or newer
20
- - An MCPCloud account and API key (create one at https://mcpcloud.sh)
16
+ - An MCPCloud account (sign up at https://mcpcloud.sh)
21
17
 
22
18
  ## Installation
23
19
 
24
20
  ```sh
25
21
  # global install
26
22
  npm install -g @mcpcloud/cli
27
- bun add -g @mcpcloud/cli
23
+ bun add -g @mcpcloud/cli
28
24
 
29
25
  # one-off invocation (no install)
30
- npx -y @mcpcloud/cli whoami
31
- bunx --bun @mcpcloud/cli whoami
26
+ npx -y @mcpcloud/cli whoami
27
+ bunx --bun @mcpcloud/cli whoami
32
28
  ```
33
29
 
34
- ## Configuration
35
-
36
- The CLI needs **two** values to talk to your MCPCloud deployment: an API base URL and an API key. Either or both can come from environment variables, the saved config file, or per-invocation flags.
37
-
38
- ### 1. Set the API base URL
30
+ ## Quick start
39
31
 
40
- The CLI does not assume any default base URL. Use whichever method fits your environment:
32
+ The CLI ships with the **MCPCloud production base URL baked in**, so a fresh machine works with zero configuration — just sign in:
41
33
 
42
34
  ```sh
43
- # environment variable (recommended for CI / scripts)
44
- export MCPCLOUD_BASE_URL=https://your-deployment.example.com
45
-
46
- # persist for your user account (writes to ~/.mcpcloud/config.json)
47
- mcp config set-url https://your-deployment.example.com
35
+ mcp login # browser sign-in (recommended)
36
+ mcp login --key mck_xxx # non-interactive (writes to shell history — prefer the env var)
37
+ export MCPCLOUD_API_KEY=mck_xxx # or use an env var for CI
48
38
 
49
- # one-off override
50
- mcp --base-url https://your-deployment.example.com whoami
39
+ mcp whoami # identity, resolved base URL (marked "(production)"), active profile
40
+ mcp servers list # your deployed MCP servers
41
+ mcp servers get srv_123 # detail view
42
+ mcp tools list --server srv_123 # tools that server exposes
43
+ mcp skills connect skl_123 --agent claude-code --apply
44
+ # auto-register a skill with Claude Code
51
45
  ```
52
46
 
53
- The lookup order is: `--base-url` flag `MCPCLOUD_BASE_URL` env var → saved `baseUrl` in `~/.mcpcloud/config.json`. If none are set the CLI exits with code `3` and a clear message.
47
+ Run `mcp <command> --help` for the full option list, or `mcp help <topic>` for guided walkthroughs.
54
48
 
55
- ### 2. Authenticate
49
+ ### Pointing at staging or a self-host
56
50
 
57
- ```sh
58
- # Save a key to ~/.mcpcloud/config.json (mode 0600)
59
- mcp login # interactive prompt (recommended)
60
- mcp login --key mck_xxx # non-interactive (avoid: writes to shell history)
51
+ The production default is only a default — override it per environment. Precedence is `--base-url` flag → `MCPCLOUD_BASE_URL` → the saved profile's `baseUrl` → the built-in production default:
61
52
 
62
- # Or use an environment variable (recommended for CI)
63
- export MCPCLOUD_API_KEY=mck_xxx
53
+ ```sh
54
+ export MCPCLOUD_BASE_URL=https://staging.example.com # env (CI / scripts)
55
+ mcp config set-url https://staging.example.com # persist to the active profile
56
+ mcp --base-url https://staging.example.com whoami # one-off override
64
57
  ```
65
58
 
66
- `mcp logout` removes the saved key. `mcp config show` prints the current resolved config (with the API key redacted).
59
+ ## Authentication & config
67
60
 
68
- ## Quick start
61
+ Credentials and settings live in `~/.mcpcloud/config.json` (mode `0600`; respects `XDG_CONFIG_HOME` on Linux):
69
62
 
70
63
  ```sh
71
- mcp whoami # show current key + organizations
72
- mcp projects list # list projects in your default org
73
- mcp servers list # list MCP servers
74
- mcp servers get srv_123 # detail view
75
- mcp servers logs srv_123 # recent deployment events
76
- mcp tools list srv_123 # tools exposed by a server
77
- mcp skills list # list skills
78
- mcp skills connect skl_123 --agent claude-code --apply
79
- # auto-register a skill with Claude Code
80
- mcp api-keys list # personal API keys
81
- mcp api-keys create --name CI # mint a new key (secret shown once)
82
- mcp api-keys revoke key_456
64
+ mcp login # save an API key (interactive browser flow)
65
+ mcp logout # remove the saved key
66
+ mcp config show # print the resolved config (key redacted)
67
+ mcp config current # alias of `config show`
68
+ mcp config set-org <name|id> # persist a default organization (accepts name, slug, or id)
83
69
  ```
84
70
 
85
- Run `mcp <command> --help` on any command for the full option list.
71
+ `MCPCLOUD_API_KEY` overrides the saved key; `MCPCLOUD_ORG_ID` overrides the saved default org.
86
72
 
87
- ## Global flags
73
+ ## Profiles
88
74
 
89
- | Flag | Description |
90
- | ------------------ | --------------------------------------------------------------------------------------- |
91
- | `--json` | Emit raw JSON on stdout. Errors come back as `{ "error": { "code", "message", ... } }`. |
92
- | `--base-url <url>` | Override the API base URL for one invocation (useful for staging). |
93
- | `-v, --version` | Print the CLI version. |
94
- | `-h, --help` | Show help for any command. |
75
+ Keep separate credentials + base URLs for prod, staging, and self-host, and always know which one you're about to mutate:
95
76
 
96
- ## Environment variables
97
-
98
- | Variable | Description |
99
- | ------------------- | ------------------------------------------------------------- |
100
- | `MCPCLOUD_API_KEY` | API key used for authentication (overrides the saved config). |
101
- | `MCPCLOUD_BASE_URL` | API base URL. **Required** — there is no built-in default. |
102
- | `MCPCLOUD_ORG_ID` | Default organization ID for commands that require one. |
77
+ ```sh
78
+ mcp config profile add staging --url https://staging.example.com --key mck_stg
79
+ mcp config profile list # ✓ marks the active profile
80
+ mcp config use staging # switch the active profile
81
+ mcp --profile prod servers list # one-off override
82
+ export MCPCLOUD_PROFILE=staging # or select via env
83
+ ```
103
84
 
104
- The organization for each command is resolved in this order:
85
+ `mcp whoami` prints the active profile and its source, and appends `(production)` to the base URL when it resolves to the production host — so a profile named "local" pointed at prod can't surprise you. `mcp doctor` runs the same resolution as an 8-point health check.
105
86
 
106
- 1. The `--org` flag (when supported).
107
- 2. `MCPCLOUD_ORG_ID`.
108
- 3. `defaultOrganizationId` saved in `~/.mcpcloud/config.json`.
109
- 4. The server-side default returned from `/api/v1/organizations`.
87
+ ## The dev loop
110
88
 
111
- ## Commands
89
+ `mcp dev` runs a deployed server **locally** with hot reload: it downloads the server's generated bundle, serves it on `localhost` (HTTP/SSE/stdio), watches your files (and optionally an OpenAPI spec) to regenerate on change, auto-wires the running instance into your coding agent (`--auto-connect claude-code`), and exposes an inspector UI at `/__inspect`. Pair it with the round-trip tool editors (`tools pull` / `tools edit` / `tools diff` / `tools reset-handler`) to iterate on tool metadata and handler source against the live bundle.
112
90
 
113
- ### Authentication & config
91
+ ## Scripting & CI
114
92
 
115
- ```sh
116
- mcp login [--key <secret>] # save an API key locally
117
- mcp logout # remove the saved key
118
- mcp whoami # show current key, base URL, and accessible orgs
93
+ Every command honors a machine-readable output contract, registered globally so it's uniform across the tree.
119
94
 
120
- mcp config show # print resolved config (key redacted)
121
- mcp config set-url <url> # persist the API base URL
122
- mcp config clear-url # remove the saved base URL
123
- mcp config set-org <orgId> # persist a default organization
124
- mcp config clear-org # remove the saved default organization
125
- ```
95
+ ### Output formats
126
96
 
127
- ### Projects
97
+ | Flag | Effect |
98
+ | -------------------- | ----------------------------------------------------------------------------------- |
99
+ | `--json` | Emit a single JSON document on success; errors become a `{ "error": {…} }` envelope. No human text is mixed in. |
100
+ | `--format <mode>` | List output as `table` (default), `tsv`, `jsonl`, or `json`. |
101
+ | `--no-table` | Shorthand for `--format tsv` — tab-separated rows for `awk`/`cut`/`grep`. |
102
+ | `--field <names>` | Comma-separated columns to include in list output (repeatable). |
103
+ | `--filter <k=substr>`| Case-insensitive substring filter on list rows (repeatable). |
104
+ | `--quiet` | Suppress success/step/info chrome; data and errors still print. Pairs with exit codes for gates. |
105
+ | `--non-interactive` | Refuse prompts (fail fast on missing input) without the color/glyph changes of `--ci`. |
106
+ | `--ci` | Force CI mode (auto-detected when `CI=true`): no color, ASCII glyphs, no prompts, always surface request IDs. |
107
+ | `--warnings-as-errors` | Exit non-zero if any warning is emitted. |
128
108
 
129
109
  ```sh
130
- mcp projects list [--org <id>] [--limit <n>]
131
- mcp projects get <projectId> [--org <id>]
110
+ mcp --json servers list | jq '.servers[].id'
111
+ mcp servers list --field id,name,status --format jsonl
112
+ mcp servers list --filter status=active --no-table | cut -f1
132
113
  ```
133
114
 
134
- ### Servers
135
-
136
- ```sh
137
- mcp servers list [--org <id>] [--project <id>] [--limit <n>]
138
- mcp servers get <serverId> [--org <id>]
139
- mcp servers logs <serverId> [--org <id>] [--limit <n>]
140
- ```
115
+ ### Exit codes
141
116
 
142
- ### Tools
117
+ | Code | Meaning |
118
+ | ---- | ---------------------------------------------------------------------------------------- |
119
+ | `0` | Success. |
120
+ | `1` | Generic failure (API error, validation error, network error). |
121
+ | `2` | No API key configured. Run `mcp login` or set `MCPCLOUD_API_KEY`. |
122
+ | `3` | No API base URL configured (only reachable if you clear the built-in default and set nothing). |
143
123
 
144
- ```sh
145
- mcp tools list --project <projectId> [--org <id>]
146
- mcp tools list --server <serverId> [--org <id>] # looks up the project for you
147
- ```
124
+ ### Error envelope
148
125
 
149
- ### Skills
126
+ Structured API errors are surfaced consistently. In `--json` mode:
150
127
 
151
- ```sh
152
- mcp skills list [--org <id>] [--project <id>] [--limit <n>]
153
- mcp skills get <skillId> [--org <id>]
154
-
155
- # Print or apply the MCP configuration that wires a skill into your coding agent.
156
- mcp skills connect <skillId>
157
- [--org <id>]
158
- [--agent claude-code|codex|claude-desktop|vscode|cursor|windsurf|antigravity]
159
- [--name <connection-name>]
160
- [--apply] # for claude-code only: runs `claude mcp add`
128
+ ```json
129
+ { "error": { "code": "server_not_found", "message": "Server not found", "requestId": "api_018f…", "docsUrl": "https://mcpcloud.sh/docs/errors#server_not_found" } }
161
130
  ```
162
131
 
163
- ### API keys
132
+ In human mode the same fields print as `code`, a one-line remediation, the `request id` (always shown under `--ci`, even when the upstream response omitted one), and an absolute `docs:` link.
164
133
 
165
- ```sh
166
- mcp api-keys list
167
- mcp api-keys create --name <displayName>
168
- mcp api-keys revoke <apiKeyId>
169
- ```
134
+ ### Idempotency
170
135
 
171
- The secret returned by `api-keys create` is shown **once**. Save it immediately you cannot retrieve it again.
136
+ Mutations accept `--idempotency-key <key>` (1–255 ASCII chars, no whitespace). When omitted, the CLI auto-generates a UUID per invocation so its own internal retries on transient failures stay safe. Pass a stable key from your pipeline to make a whole step re-runnable.
172
137
 
173
- ## JSON mode
138
+ ### CI deploy gate
174
139
 
175
- Every command supports `--json` for piping into another tool. In JSON mode the CLI emits a single JSON document on success and a `{ "error": { ... } }` envelope on failure. No human-readable text is mixed in.
140
+ The observability commands compose into a deploy gate that exits non-zero on failure no output parsing required:
176
141
 
177
142
  ```sh
178
- mcp --json projects list | jq '.projects[].slug'
179
-
180
- mcp --json skills connect skl_123 --agent cursor \
181
- | jq '.snippet'
143
+ mcp servers deploy srv_123 --wait # block until the deploy is terminal
144
+ mcp deployments health <deploymentId> --quiet # exit non-zero unless healthy
145
+ mcp metrics deployment <deploymentId> --since 15m --max-error-rate 0.02
146
+ # exit non-zero if the error rate breaches the budget
182
147
  ```
183
148
 
184
- ## Exit codes
185
-
186
- | Code | Meaning |
187
- | ---- | ---------------------------------------------------------------------------------------- |
188
- | `0` | Success. |
189
- | `1` | Generic failure (API error, validation error, network error). |
190
- | `2` | No API key configured. Run `mcp login` or set `MCPCLOUD_API_KEY`. |
191
- | `3` | No API base URL configured. Set `MCPCLOUD_BASE_URL` or run `mcp config set-url <url>`. |
192
-
193
- When an API call fails, the CLI prints the response code, status, and request id (when present) to make debugging easier:
194
-
195
- ```
196
- Error: Server not found (code: not_found) (status: 404)
197
- request id: api_018f...
198
- docs: https://mcpcloud.sh/docs/errors#not_found
199
- ```
149
+ Resolve the deployment id from `mcp servers get srv_123 --json` (or `mcp deployments list`) after the deploy completes.
150
+
151
+ ## Command reference
152
+
153
+ Run `mcp <command> --help` for full options on any of these.
154
+
155
+ <!-- BEGIN GENERATED COMMANDS -->
156
+ _Generated from the live command tree by `bun run docs:readme` do not edit by hand._
157
+
158
+ ### Top-level commands
159
+
160
+ | Command | Description |
161
+ | --- | --- |
162
+ | `mcp completion <shell>` | Print a shell completion script (bash, zsh, or fish) |
163
+ | `mcp doctor` | Diagnose the CLI environment: Node, config, base URL, API key, claude CLI, and updates |
164
+ | `mcp help [topic]` | Show extended help for a topic (auth, profiles, agents, errors) |
165
+ | `mcp init` | Guided onboarding: pick org → pick/create project → create a server (empty skeleton, or generated from an OpenAPI/GraphQL spec via --from-spec) |
166
+ | `mcp invoke <serverId> <tool>` | Call a tool on a deployed MCP server. Exchanges runtime-auth if needed, sends JSON-RPC `tools/call`, and prints the response. |
167
+ | `mcp login` | Sign in via browser (default) or paste an API key |
168
+ | `mcp logout` | Remove the saved API key from ~/.mcpcloud/config.json |
169
+ | `mcp ui` | Interactive terminal UI: browse orgs/servers/skills, tail deployment logs, and watch the live `mcp dev` inspector |
170
+ | `mcp update` | Check for a newer @mcpcloud/cli release and re-install it via your package manager |
171
+ | `mcp whoami` | Show the caller identity, API key, base URL, and organizations you can access |
172
+
173
+ ### `mcp api-keys` — Manage personal API keys
174
+
175
+ | Command | Description |
176
+ | --- | --- |
177
+ | `mcp api-keys create` | Create a new API key (the secret is shown once) |
178
+ | `mcp api-keys describe <apiKeyId>` | Show one API key (status, expiry, last used) — never the secret |
179
+ | `mcp api-keys list` | List active API keys for the current user |
180
+ | `mcp api-keys revoke <apiKeyId>` | Permanently revoke an API key |
181
+ | `mcp api-keys rotate <apiKeyId>` | Mint a replacement key and grace-expire the old one (24h window). The new secret is shown once. |
182
+
183
+ ### `mcp audit` — Workspace audit log (admin/owner only)
184
+
185
+ | Command | Description |
186
+ | --- | --- |
187
+ | `mcp audit list` | List recent audit events for an organization |
188
+
189
+ ### `mcp config` — Manage CLI configuration in ~/.mcpcloud/config.json
190
+
191
+ | Command | Description |
192
+ | --- | --- |
193
+ | `mcp config clear-app-url` | Forget the saved dashboard URL (falls back to MCPCLOUD_APP_URL or auto-derive) |
194
+ | `mcp config clear-editor` | Forget the editor open preference, the picked editor command, AND the saved target (mcp dev will re-detect and prompt next session) |
195
+ | `mcp config clear-org` | Remove the saved default organization ID |
196
+ | `mcp config clear-url` | Remove the saved base URL (falls back to MCPCLOUD_BASE_URL) |
197
+ | `mcp config current` | Alias for `config show` — print the active profile |
198
+ | `mcp config profile` | Manage named config profiles (apiKey + baseUrl + defaultOrganizationId) |
199
+ | `mcp config profile add <name>` | Create a new profile (use --url / --key / --app / --org to seed values) |
200
+ | `mcp config profile list` | List all configured profiles |
201
+ | `mcp config profile remove <name>` | Delete a profile (cannot remove the active or only-remaining profile) |
202
+ | `mcp config set-app-url <url>` | Save the dashboard origin used by `mcp login` browser flow |
203
+ | `mcp config set-editor <pref>` | Save the dev-runner editor open preference: always \| never |
204
+ | `mcp config set-editor-command <command>` | Override the editor launch command (default: code; e.g. cursor, code-insiders) |
205
+ | `mcp config set-org <organization>` | Save a default organization (by name, slug, or id) |
206
+ | `mcp config set-url <url>` | Save the API base URL to ~/.mcpcloud/config.json |
207
+ | `mcp config show` | Print the active profile (API key is redacted) |
208
+ | `mcp config use <name>` | Switch the active profile (e.g. staging, prod) |
209
+
210
+ ### `mcp connections` — Manage your per-server upstream API keys (BYOK) from the terminal
211
+
212
+ | Command | Description |
213
+ | --- | --- |
214
+ | `mcp connections add <serverId>` | Save (or replace) your upstream API key for a server — rotation is just adding again |
215
+ | `mcp connections list` | List your stored upstream keys across servers (hints only) |
216
+ | `mcp connections remove <serverId>` | Revoke your stored upstream key for a server |
217
+
218
+ ### `mcp deployments` — Inspect deployments
219
+
220
+ | Command | Description |
221
+ | --- | --- |
222
+ | `mcp deployments get <deploymentId>` | Show one deployment by id |
223
+ | `mcp deployments health <deploymentId>` | Show a deployment's last health-check result (status, HTTP code, when it was checked) |
224
+ | `mcp deployments list` | List deployments in an organization |
225
+ | `mcp deployments logs <deploymentId>` | Show recent deployment events; pass --follow to tail new ones as they arrive |
226
+ | `mcp deployments rollback <deploymentId>` | Roll back to a prior deployment — flips a paused/undeployed deployment back to active and demotes the current latest in one shot. |
227
+ | `mcp deployments runtime-auth <deploymentId>` | Inspect a deployment's runtime-auth posture (access mode, exchange path, edge policy) |
228
+
229
+ ### `mcp dev` — Run a deployed MCP server locally with hot reload + agent auto-wire
230
+
231
+ | Command | Description |
232
+ | --- | --- |
233
+ | `mcp dev init` | Interactively pick an organization + server and write .mcpcloud/state.json (forces the picker even if state already exists) |
234
+ | `mcp dev invoke <tool>` | Call a tool against the running `mcp dev` session in this directory. No auth — local runtime accepts anonymous JSON-RPC. |
235
+ | `mcp dev kill <pid>` | Stop a running mcp dev session by PID (or "all" to stop every session) |
236
+ | `mcp dev list` | List running mcp dev sessions on this machine |
237
+ | `mcp dev replay` | Replay one or more recorded calls against the running mcp dev server |
238
+ | `mcp dev tail` | Stream new mcp dev inspector records to stdout as JSON lines (Ctrl+C to stop) |
239
+
240
+ ### `mcp domains` — Serve servers from custom domains you own (Pro+)
241
+
242
+ | Command | Description |
243
+ | --- | --- |
244
+ | `mcp domains add <hostname>` | Attach a custom domain to a server (admin role required) |
245
+ | `mcp domains list` | List the custom domains in an organization |
246
+ | `mcp domains namespaces` | Verify a parent domain once, then attach subdomains to any server with no further DNS work |
247
+ | `mcp domains namespaces add <parentDomain>` | Register a domain namespace and print its one-time DNS records (admin role required) |
248
+ | `mcp domains namespaces list` | List the domain namespaces in an organization |
249
+ | `mcp domains namespaces remove <parentDomain>` | Remove a domain namespace — existing attached hostnames keep working (admin role required) |
250
+ | `mcp domains namespaces verify <parentDomain>` | Check the namespace verification records now |
251
+ | `mcp domains remove <hostname>` | Remove a custom domain — traffic on it stops immediately (admin role required) |
252
+ | `mcp domains status <hostname>` | Recheck a custom domain against Cloudflare and show status |
253
+ | `mcp domains transfer <hostname>` | Move a custom domain to another server without certificate churn (admin role required) |
254
+
255
+ ### `mcp installation` — Manage your skill / artifact installations
256
+
257
+ | Command | Description |
258
+ | --- | --- |
259
+ | `mcp installation disable <installationId>` | Disable an installation by id (replay-as-success on already-disabled rows) |
260
+ | `mcp installation list` | List your active installations and their ids |
261
+ | `mcp installation remove <installationId>` | Mark an installation as removed by id |
262
+
263
+ ### `mcp marketplace` — Browse the public registry of MCP servers and skills
264
+
265
+ | Command | Description |
266
+ | --- | --- |
267
+ | `mcp marketplace fork <artifactId>` | Fork a registry artifact into one of your projects as an editable draft |
268
+ | `mcp marketplace get <artifactId>` | Show full details for one registry artifact (readme, recent versions) |
269
+ | `mcp marketplace install <artifactId>` | Install a published registry artifact (server or skill) into your organization |
270
+ | `mcp marketplace list` | List published artifacts in the registry |
271
+ | `mcp marketplace publish <serverId|skillId>` | Publish a deployed server or a versioned skill to the registry (requires org admin) |
272
+ | `mcp marketplace version <artifactId> <versionId>` | Show details for one published version of a registry artifact |
273
+ | `mcp marketplace versions <artifactId>` | List published versions of a registry artifact (paginated) |
274
+
275
+ ### `mcp metrics` — Aggregate deployment metrics (request volume, error rate)
276
+
277
+ | Command | Description |
278
+ | --- | --- |
279
+ | `mcp metrics deployment <deploymentId>` | Show aggregate request metrics for a deployment over a window (CI deploy gate) |
280
+
281
+ ### `mcp oauth` — Manage OAuth provider connections
282
+
283
+ | Command | Description |
284
+ | --- | --- |
285
+ | `mcp oauth connection` | Inspect or revoke individual OAuth connections |
286
+ | `mcp oauth connection delete <connectionId>` | Revoke an OAuth connection (best-effort upstream revoke; replay-as-success on already-revoked rows) |
287
+ | `mcp oauth connections` | List OAuth provider connections across the organization |
288
+
289
+ ### `mcp orgs` — List and inspect the organizations you belong to
290
+
291
+ | Command | Description |
292
+ | --- | --- |
293
+ | `mcp orgs get [organizationId]` | Show one organization (defaults to your active org) |
294
+ | `mcp orgs list` | List organizations you can access |
295
+ | `mcp orgs members [organizationId]` | List members of an organization |
296
+ | `mcp orgs usage [organizationId]` | Show request-volume usage for an organization |
297
+ | `mcp orgs use <organizationId>` | Set the default organization for this profile (discoverable alias of `mcp config set-org`) |
298
+
299
+ ### `mcp plugin` — Manage @mcpcloud/cli plugins (third-party command extensions)
300
+
301
+ | Command | Description |
302
+ | --- | --- |
303
+ | `mcp plugin install <package>` | Install a plugin from npm (uses npm under the hood) |
304
+ | `mcp plugin list` | List installed plugins |
305
+ | `mcp plugin remove <name>` | Remove an installed plugin |
306
+
307
+ ### `mcp projects` — Manage projects
308
+
309
+ | Command | Description |
310
+ | --- | --- |
311
+ | `mcp projects api-source <apiSourceId>` | Show details for a single imported API spec |
312
+ | `mcp projects api-sources <projectId>` | List imported API specs / source material for a project |
313
+ | `mcp projects create` | Create a new project in an organization |
314
+ | `mcp projects delete <projectId>` | Permanently delete a project. Requires --confirm "<exact name>" and that the project is empty of servers/skills. |
315
+ | `mcp projects get <projectId>` | Get details for a single project |
316
+ | `mcp projects list` | List projects in an organization |
317
+ | `mcp projects update <projectId>` | Update a project (RFC 7396 merge patch — only listed fields change) |
318
+
319
+ ### `mcp servers` — Manage MCP servers
320
+
321
+ | Command | Description |
322
+ | --- | --- |
323
+ | `mcp servers create` | Create an empty server skeleton in a project |
324
+ | `mcp servers delete <serverId>` | Permanently delete a server and all its data. Requires --confirm "<exact name>". |
325
+ | `mcp servers deploy <serverId>` | Deploy a server's generated bundle to Cloudflare Workers (closes the spec → deploy loop) |
326
+ | `mcp servers deployments <serverId>` | List a server's deployment history |
327
+ | `mcp servers env` | Manage server runtime environment bindings (encrypted secrets injected by the proxy). |
328
+ | `mcp servers env get <serverId> <bindingName>` | Show metadata for one env binding. Plaintext is never returned — values are write-only. |
329
+ | `mcp servers env list <serverId>` | List a server's env bindings (metadata only; values are never returned). |
330
+ | `mcp servers env set <serverId> <bindingName> [value]` | Create or replace an env binding's value. Schedules a Cloudflare-runtime push when the server has an active deployment. |
331
+ | `mcp servers env unset <serverId> <bindingName>` | Remove an env binding. Idempotent — succeeds even if the binding is already gone. |
332
+ | `mcp servers export <serverId>` | Export a self-host bundle (Dockerfile + node entry + config) for a server |
333
+ | `mcp servers generate <serverId>` | Generate the server's TypeScript bundle (the exact code `deploy` ships) and optionally write it to disk — a dry-run for the codegen path. Wraps POST /api/v1/server/generate. |
334
+ | `mcp servers get <serverId>` | Get details for a single server |
335
+ | `mcp servers ingest` | Create a server from an OpenAPI spec (file, URL, or @- stdin) or a GraphQL endpoint. Wraps POST /api/v1/server/ingest. |
336
+ | `mcp servers list` | List servers |
337
+ | `mcp servers logs <serverId>` | Show recent deployment events for a server's latest deployment |
338
+ | `mcp servers oauth-connections <serverId>` | List OAuth provider connections bound to this server |
339
+ | `mcp servers pause <serverId>` | Pause the server's latest active deployment (traffic stops; worker is preserved) |
340
+ | `mcp servers push-spec <serverId>` | Push a local OpenAPI spec to the cloud (regenerates the bundle; optionally deploys) |
341
+ | `mcp servers regenerate <serverId>` | Re-fetch a server's source spec and rebuild its tools with the current codegen (preserves customizations). Wraps POST /api/v1/server/regenerate. |
342
+ | `mcp servers resume <serverId>` | Resume the server's paused deployment (flips dispatch routing back on; only platformWorker deployments support instant resume) |
343
+ | `mcp servers test-runs` | Inspect and trigger server sandbox test runs |
344
+ | `mcp servers test-runs get <testRunId>` | Show one server test run with assertions, trace, and the tool response |
345
+ | `mcp servers test-runs list <serverId>` | List sandbox test runs for a server |
346
+ | `mcp servers test-runs new <serverId>` | Trigger a sandbox test run against a server's latest deployment (synchronous) |
347
+ | `mcp servers test-scenarios` | Inspect server sandbox test scenarios |
348
+ | `mcp servers test-scenarios get <scenarioId>` | Show one server test scenario including its request and expected response |
349
+ | `mcp servers test-scenarios list <serverId>` | List test scenarios bound to a server |
350
+ | `mcp servers test-suites` | Inspect server sandbox test suites (groups of scenarios) |
351
+ | `mcp servers test-suites get <suiteId>` | Show one server test suite including its scenario membership |
352
+ | `mcp servers test-suites list <serverId>` | List test suites bound to a server |
353
+ | `mcp servers update <serverId>` | Update a server (v1 PATCH only carries name and description) |
354
+ | `mcp servers version <serverId> <versionId>` | Show details for a single server version |
355
+ | `mcp servers versions <serverId>` | List published versions of a server |
356
+
357
+ ### `mcp skills` — Manage skills
358
+
359
+ | Command | Description |
360
+ | --- | --- |
361
+ | `mcp skills archive <skillId>` | Archive a skill (replay-as-success on already-archived rows) |
362
+ | `mcp skills connect <skillId>` | Print (or apply) the MCP configuration that connects this skill to your coding agent |
363
+ | `mcp skills create` | Create an empty skill draft in a project |
364
+ | `mcp skills delete <skillId>` | Permanently delete a draft skill. Requires --confirm "<exact name>". Published skills with versions/installs are rejected (archive instead). |
365
+ | `mcp skills get <skillId>` | Get details for a single skill |
366
+ | `mcp skills install <skillId>` | Install a skill into the caller's project |
367
+ | `mcp skills installations <skillId>` | List the installation footprint of a skill (which orgs / users installed it) |
368
+ | `mcp skills invoke <skillId>` | Run a deployed skill from the terminal. Resolves the skill’s MCP endpoint, auto-discovers its single tool, and calls it. |
369
+ | `mcp skills list` | List skills in an organization |
370
+ | `mcp skills test-runs` | Inspect and trigger skill sandbox test runs |
371
+ | `mcp skills test-runs get <testRunId>` | Show one skill test run with assertions, trace, and output |
372
+ | `mcp skills test-runs list <skillId>` | List sandbox test runs for a skill |
373
+ | `mcp skills test-runs new <skillId>` | Trigger a sandbox test run against a skill (synchronous; returns terminal status) |
374
+ | `mcp skills test-scenarios` | Inspect skill sandbox test scenarios |
375
+ | `mcp skills test-scenarios get <scenarioId>` | Show one skill test scenario including its prompt and assertion body |
376
+ | `mcp skills test-scenarios list <skillId>` | List test scenarios bound to a skill |
377
+ | `mcp skills uninstall <skillId>` | Mark the caller's installation of this skill as removed |
378
+ | `mcp skills update <skillId>` | Update skill metadata (name, description, visibility) |
379
+ | `mcp skills version <skillId> <versionId>` | Show details for one published skill version (workflow summary, triggers, deps) |
380
+ | `mcp skills versions <skillId>` | List published versions of a skill |
381
+
382
+ ### `mcp tools` — Inspect and edit tools on a project or server
383
+
384
+ | Command | Description |
385
+ | --- | --- |
386
+ | `mcp tools diff <name>` | Compare a tool's local files (metadata .md + handler .ts) against the cloud version. |
387
+ | `mcp tools edit <name>` | Open a tool's local .md in $EDITOR; pushes your changes to the cloud on save. Requires `mcp dev` to have materialized tools (run `mcp tools pull` first if needed). |
388
+ | `mcp tools enrich <name>` | Run AI enrichment for a tool. Prints the suggested vs applied diff; pass --apply to push the suggestion to the cloud. |
389
+ | `mcp tools handlers` | Inspect tool handler files (the per-tool .ts in src/tools/) |
390
+ | `mcp tools handlers list` | List every tool with its handler override status (default / override / stale). |
391
+ | `mcp tools list` | List tools for a project, or scope to a single server with --server |
392
+ | `mcp tools pull [name]` | Refresh local tool files from the cloud, overwriting any unsaved local edits. Use after `409 conflict` to re-sync. |
393
+ | `mcp tools pull-handler <name>` | Refresh a tool's handler source from the cloud, overwriting any local edits. Use after `409 conflict` to re-sync. |
394
+ | `mcp tools reset-handler <name>` | Drop the cloud handler override for a tool and re-materialize the codegen default. Prompts to confirm unless --yes is passed. |
395
+ | `mcp tools show <name>` | Show a tool's full applied metadata (and any pending AI suggestion). |
396
+
397
+ ### `mcp usage` — Show organization usage (tool-call volume) and credit balance from the terminal
398
+
399
+ | Command | Description |
400
+ | --- | --- |
401
+ | `mcp usage ledger` | List organization credit ledger entries (most recent first) |
402
+
403
+ <!-- END GENERATED COMMANDS -->
404
+
405
+ ## Plugins
406
+
407
+ `mcp plugin install <spec>` extends the CLI with third-party commands. **A plugin runs in your CLI process with your credentials and the same filesystem access — install only plugins you trust.**
200
408
 
201
409
  ## Configuration file
202
410
 
203
- The CLI stores its config at `~/.mcpcloud/config.json` with mode `0600`. Recognised fields:
411
+ `~/.mcpcloud/config.json` (mode `0600`). Environment variables take precedence over its contents. Recognised fields:
204
412
 
205
413
  ```jsonc
206
414
  {
207
- "apiKey": "mck_...", // saved by `mcp login`
208
- "baseUrl": "https://your-deployment...", // saved by `mcp config set-url`
209
- "defaultOrganizationId": "org_...", // saved by `mcp config set-org`
415
+ "apiKey": "mck_...", // saved by `mcp login`
416
+ "baseUrl": "https://your-deployment...", // saved by `mcp config set-url` (omit to use the production default)
417
+ "defaultOrganizationId": "org_...", // saved by `mcp config set-org`
418
+ "profiles": { "staging": { /* apiKey + baseUrl + defaultOrganizationId */ } }
210
419
  }
211
420
  ```
212
421
 
213
- You can edit the file directly or replace it. Environment variables take precedence over its contents.
214
-
215
422
  ## Reliability
216
423
 
217
424
  - **Timeout:** every request is bounded by a 30-second `AbortController`.
218
425
  - **Retry:** transient failures (network errors, HTTP 502/503/504) are retried once with jittered backoff. 4xx responses are never retried.
219
- - **Error envelope:** server errors are surfaced with their `code`, `message`, `requestId`, and `docsUrl` so you can correlate with backend logs.
426
+ - **Error envelope:** server errors carry their `code`, `message`, `requestId`, and `docsUrl` so you can correlate with backend logs.
220
427
 
221
428
  ## Development
222
429
 
@@ -229,9 +436,10 @@ bun run dev -- --help # run from source
229
436
  bun run typecheck # tsc --noEmit
230
437
  bun run test # vitest
231
438
  bun run build # bundle to dist/index.js
439
+ bun run docs:readme # regenerate the command reference above
232
440
  ```
233
441
 
234
- The bundled output is a single Node-compatible ESM file with a `#!/usr/bin/env node` shebang.
442
+ The command reference between the markers is generated from the live Commander tree by `bun run docs:readme`; a conformance test fails if it drifts, so a new command can't ship with a stale README.
235
443
 
236
444
  ## Releasing
237
445