mcpjam CLI is two invocations. Local MCP testing stays at the top level: inspect, debug, and test MCP servers from the command line or CI (connectivity, OAuth, MCP Apps, tools/resources/prompts, protocol conformance). Most local commands are one-shot; mcpjam mcp and subscriptions listen keep a process open. Account-bound commands live under mcpjam cloud and talk to your MCPJam account. There are no compatibility aliases for the old Cloud paths — see Migrating to CLI 4.0.
Recommended: Use with Agent Skills
The easiest way to use the CLI is through the MCPJam skill, which gives your agent full context on every command and workflow.mcpjam commands automatically.
Install
All examples in these docs use
mcpjam directly. If you installed via npx,
replace mcpjam with npx -y @mcpjam/cli@latest.Command groups
Local MCP testing
These stay at the program root. They reject--api-key / --api-url / --project.
MCPJam Cloud
Account-bound commands. Declare--api-key / --api-url on mcpjam cloud (before or after descendants). mcpjam oauth login is MCP-server OAuth; mcpjam cloud login is your MCPJam account.
Also under
mcpjam cloud: journeys, scenarios, personas, swarms, user-testing. Full flag tables are in the command reference.
Cloud credentials and API URL
--api-key and --api-url are declared on mcpjam cloud and work before or after descendants (mcpjam cloud --api-key sk_… eval list and mcpjam cloud eval list --api-key sk_… are the same). Local commands, including hosted readiness, reject those flags at the program root. Hosted readiness still takes leaf --api-key.
Credential precedence for Cloud commands:
--api-key— must be ansk_key. Amcpjam_…legacy key is a usage error.MCPJAM_API_KEY— samesk_rule. A legacy value in this env var is ignored (with a warning) so SDK eval reporting can still use it.- Stored OAuth from
mcpjam cloud login - Missing — Cloud commands fail with login guidance before they hit the network (
mcpjam cloud statusreportsmissinginstead)
--api-urlMCPJAM_API_URL- The
apiUrlstored with the OAuth login (only when that login is the credential) https://app.mcpjam.com/api/v1
--api-url or MCPJAM_API_URL that is not an http(s) URL is a usage error for commands that talk to the network (exit 2). mcpjam cloud status uses the same checks but stays network-free: it still emits the complete JSON report, sets ok: false, includes credential.valid / deployment.valid plus an error string, and exits 1. Missing credentials are informational (credential.valid: null) and successful.
Successful Cloud commands print an audience line to stderr (Using MCPJam Cloud as … · project: … · <apiUrl>). --quiet suppresses it. Machine-readable JSON stays on stdout. cloud status redacts API keys.
Cloud project scope
Most Cloud commands pick one project:--project <id-or-name>- An explicit
projectfield in--file/--json MCPJAM_PROJECT- The nearest valid
.mcpjam/project.json - Automatic — the most recently updated project you can see
--project or MCPJAM_PROJECT is a usage error. MCPJAM_PROJECT_ID does not select a Cloud CLI project (it is SDK eval reporting only).
mcpjam cloud eval run-inspection commands (status, cancel, judge, iterations, gate, compare, trace, steps, screenshot, video) follow the same rule — --project is optional. mcpjam cloud sessions list does too; --all-projects restores a cross-project listing and cannot be combined with --project. Hosted readiness never reads the project link.
What --host means
--host is not one flag. The meaning depends on the command:
--host on a local command is mutually exclusive with --client-capabilities. A Cloud --host is mutually exclusive with --server / --environment when those already supply a closed server set.
Global flags
These flags apply to every command. Cloud credentials--api-key / --api-url are declared on mcpjam cloud, not the program root.
Output formats
The CLI auto-detects whether stdout is a terminal:- Interactive terminal — defaults to
--format human. For most commands this is pretty-printed JSON;server doctorand the OAuth conformance commands provide dedicated human-readable summaries. - Piped or redirected (CI,
| jq, agent invocation) — defaults to--format json, the full structured result. - Conformance in CI —
protocol conformance,protocol conformance-suite,oauth conformance,oauth conformance-suite,apps conformance, andapps conformance-suitesupport--reporter junit-xmland--reporter json-summary. - Explicit
--formatalways wins over the auto-detected default.
--quiet --format json.
JSON-valued flags accept inline JSON, @path, or - for stdin. tools call also accepts --tool-args-stdin as a shorthand for --tool-args -. Use files or stdin for large payloads to avoid shell escaping issues:
Connecting to servers
The CLI supports two transport modes, selected by which flags you pass:--url ...selects HTTP.--command ...selects stdio.--transport http|stdiois optional and acts as an explicit override/validator when you want the CLI to reject mismatched flags early.
HTTP (Streamable HTTP / SSE)
Stdio (local subprocess)
-e/--env to add values or override inherited ones for the spawned server.
Structured debug artifacts only record the explicit env keys you pass through
-e/--env; inherited shell variables are not enumerated.
oauth ... and protocol ... are HTTP-only command groups. They do
not accept stdio targets.Update notifications
After a successful command, the CLI checks whether a newer version of@mcpjam/cli is available and prints a notice to stderr when one is found:
Exit codes
Quick triage workflow
The fastest path from “I have a server URL” to “I know what’s wrong”:Use from an MCP client instead of a shell
If your agent speaks MCP but can’t run shell commands (Claude Desktop, chat clients), run the same testing engine as a stdio MCP server:What’s next
- MCPJam as an MCP server — give MCP clients the testing engine over stdio
- Server inspection — probe, doctor, and diagnostics
- OAuth conformance — test your OAuth implementation
- OAuth login — authenticate and debug OAuth flows
- MCP Apps conformance — validate
_meta.ui.resourceUriandui://resource wiring - Tools, resources & prompts — exercise the connected surface
- Migrating to CLI 4.0 — command-path and flag changes under
mcpjam cloud - Full command reference — every flag for every command

