@mcpjam/cli 1.1.6 → 2.0.1

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/README.md CHANGED
@@ -1,104 +1,144 @@
1
- # MCPJam Evals Testing CLI
1
+ # @mcpjam/cli
2
2
 
3
- We built a CLI that performs MCP evals and End to End (E2E) testing. The CLI creates a simulated end user’s environment and tests popular user flows.
3
+ Test, debug, and validate MCP servers — health checks, OAuth conformance, tool-surface diffing, and structured triage from the terminal or CI.
4
4
 
5
- Evals helps you:
5
+ ## Install
6
6
 
7
- - Discover workflows that are breaking your server and get actionable ways on resolving them.
8
- - Benchmark your server’s performance and catch regressions in future changes.
9
- - Programatically test queries on a MCP server with a command. No more doing QA one by one.
7
+ ```bash
8
+ npm i -g @mcpjam/cli
9
+ ```
10
10
 
11
- ### Install
11
+ Or run without installing:
12
12
 
13
13
  ```bash
14
- npm install -g @mcpjam/cli
14
+ npx -y @mcpjam/cli@latest --help
15
15
  ```
16
16
 
17
- ### Set up tests
17
+ ## Commands
18
+
19
+ ```
20
+ $ mcpjam --help
21
+
22
+ Usage: mcpjam [options] [command]
23
+
24
+ Test, debug, and validate MCP servers — health checks, OAuth conformance,
25
+ tool-surface diffing, and structured triage from the terminal or CI
26
+
27
+ Options:
28
+ -v, --version output the CLI version
29
+ --timeout <ms> Request timeout in milliseconds (default: 30000)
30
+ --rpc Include RPC logs in JSON output
31
+ --format <format> Output format
32
+ -h, --help display help for command
33
+
34
+ Commands:
35
+ server Inspect MCP server connectivity and capabilities
36
+ tools List and invoke MCP server tools
37
+ resources List and read MCP resources
38
+ prompts List and fetch MCP prompts
39
+ apps Fetch MCP App and ChatGPT App widget content
40
+ oauth Run MCP OAuth login, proxy, and conformance flows
41
+ protocol MCP protocol inspection and conformance checks
42
+ ```
18
43
 
19
- To set up, create a new folder directory for your test. In that directory, create three files:
44
+ ## Quick start
20
45
 
21
- - `environment.json` to set up your MCP server connections
22
- - `tests.json` to configure your tests
23
- - `llms.json` to store your LLM API keys
46
+ ```bash
47
+ # Probe: is the server reachable? What transport? Is OAuth configured?
48
+ mcpjam server probe --url https://your-server.com/mcp
24
49
 
25
- ### Server connection file (environment.json)
50
+ # Health check: MCP handshake, tool/resource/prompt sweep, exit code 0 or fail
51
+ mcpjam server doctor --url https://your-server.com/mcp --access-token $TOKEN
26
52
 
27
- This file is configured very similar to a `mcp.json` file. For servers with OAuth, you must provide your own `Bearer` API tokens. MCPJam CLI does not handle OAuth flows / DCR. For bearer tokens, make sure to wrap your header with `requestInit`.
53
+ # OAuth login
54
+ mcpjam oauth login --url https://your-server.com/mcp --protocol-version 2025-11-25
28
55
 
29
- ```json
30
- {
31
- "servers": {
32
- "asana": {
33
- "url": "https://mcp.asana.com/sse",
34
- "requestInit": {
35
- "headers": {
36
- "Authorization": "Bearer <ASANA_API_KEY>"
37
- }
38
- }
39
- },
40
- "sequential-thinking": {
41
- "command": "npx",
42
- "args": ["-y", "@modelcontextprotocol/server-sequential-thinking"],
43
- "env": {
44
- "ENV_1": "<ENV_1>"
45
- }
46
- }
47
- }
48
- }
56
+ # List tools with full schemas
57
+ mcpjam tools list --url https://your-server.com/mcp --access-token $TOKEN --format json
49
58
  ```
50
59
 
51
- ### Tests file (tests.json)
60
+ ## Why
52
61
 
53
- The test file is an array of tests.
62
+ MCP servers ship without the testing infrastructure REST APIs take for granted. No health checks, no OAuth conformance tests, no deploy-time regression detection. `mcpjam` fills that gap.
54
63
 
55
- ```json
56
- [
57
- {
58
- "title": "Workspace test",
59
- "query": "What is my asana workspace?",
60
- "runs": 1, // Number of times to run this test
61
- "model": "anthropic/claude-3.7-sonnet",
62
- "provider": "openrouter", // Provider name: "anthropic" | "openai" | "openrouter"
63
- "expectedToolCalls": ["asana_list_workspaces"]
64
- },
65
- {
66
- "title": "Workspace users test",
67
- "query": "Can you figure out who is in the workspace?",
68
- "runs": 1,
69
- "model": "anthropic/claude-3.7-sonnet",
70
- "provider": "openrouter",
71
- "expectedToolCalls": ["asana_list_workspaces", "asana_get_workspace_users"]
72
- }
73
- ]
64
+ ## What it does
65
+
66
+ ### CI gate on every deploy
67
+
68
+ Run `server doctor` in your pipeline. It probes connectivity, runs the MCP handshake, and sweeps every tool, resource, and prompt. Exit code 0 or the build fails.
69
+
70
+ ```bash
71
+ mcpjam server doctor --url $MCP_SERVER_URL --access-token $TOKEN --format json
72
+ ```
73
+
74
+ ### Catch breaking changes before they ship
75
+
76
+ `server export` snapshots your entire tool surface — names, schemas, descriptions, capabilities — as diffable JSON. A renamed parameter or changed description shows up in the diff.
77
+
78
+ ```bash
79
+ mcpjam server export --url $URL --access-token $TOKEN > before.json
80
+ # deploy...
81
+ mcpjam server export --url $URL --access-token $TOKEN > after.json
82
+ diff <(jq -S . before.json) <(jq -S . after.json)
74
83
  ```
75
84
 
76
- ### LLM API key file (llms.json)
85
+ ### OAuth conformance across the full matrix
86
+
87
+ Cover the full registration × protocol version × auth mode matrix from a single config file. Outputs JUnit XML.
88
+
89
+ ```bash
90
+ mcpjam oauth conformance-suite --config ./oauth-matrix.json --format junit-xml > report.xml
91
+ ```
92
+
93
+ ### Verify tokens work end-to-end
94
+
95
+ OAuth can succeed while `tools/list` returns 401 because the audience, scope, or session init is wrong. `--verify-call-tool` completes the full chain — OAuth, MCP connect, tool call — and reports which step fails.
96
+
97
+ ```bash
98
+ mcpjam oauth conformance --url $URL --protocol-version 2025-11-25 \
99
+ --registration dcr --verify-call-tool your_critical_tool
100
+ ```
101
+
102
+ ### Protocol version compatibility
103
+
104
+ MCP has shipped three protocol versions (2025-03-26, 2025-06-18, 2025-11-25). Clients upgrade on their own schedule. Declare the version matrix once and test on every push.
77
105
 
78
106
  ```json
79
107
  {
80
- "anthropic": "<ANTHROPIC_API_KEY>",
81
- "openai": "<OPENAI_API_KEY>",
82
- "openrouter": "<OPENROUTER_API_KEY>"
108
+ "flows": [
109
+ { "label": "2025-03-26/dcr", "protocolVersion": "2025-03-26", "registrationStrategy": "dcr" },
110
+ { "label": "2025-06-18/dcr", "protocolVersion": "2025-06-18", "registrationStrategy": "dcr" },
111
+ { "label": "2025-11-25/cimd", "protocolVersion": "2025-11-25", "registrationStrategy": "cimd" }
112
+ ]
83
113
  }
84
114
  ```
85
115
 
86
- ### Run MCP Eval
116
+ ### Structured debug artifacts
117
+
118
+ `--debug-out` captures a JSON artifact with every request and response in the OAuth and MCP flow. Attach it to a ticket — no reproduction steps required.
87
119
 
88
120
  ```bash
89
- mcpjam evals run --tests tests.json --environment environment.json --llms llms.json
121
+ mcpjam oauth login --url $URL --protocol-version 2025-11-25 \
122
+ --registration dcr --debug-out oauth-debug.json
90
123
  ```
91
124
 
92
- #### Short flags
125
+ ### Incident triage
126
+
127
+ Separate your failures from host-side failures. `--rpc` records what your server returned — transport type, status codes, raw JSON-RPC pairs — as a structured artifact for postmortems.
128
+
129
+ ```bash
130
+ mcpjam server doctor --url $URL --access-token $TOKEN --rpc --out incident-triage.json
131
+ ```
132
+
133
+ ### Tool surface audit
134
+
135
+ Pipe the full schema inventory into your own linter, review it in a PR, or check whether descriptions are clear enough for tool selection.
93
136
 
94
137
  ```bash
95
- mcpjam evals run -t tests.json -e environment.json -l llms.json
138
+ mcpjam tools list --url $URL --access-token $TOKEN --format json \
139
+ | jq '.tools[] | {name, description, inputSchema}'
96
140
  ```
97
141
 
98
- #### CLI Options
142
+ ## Documentation
99
143
 
100
- - `--tests, -t <file>`: Path to the tests configuration file (required)
101
- - `--environment, -e <file>`: Path to the environment configuration file (required)
102
- - `--llms, -l <file>`: Path to the LLM API key configuration file
103
- - `--help, -h`: Show help information
104
- - `--version, -V`: Display version number
144
+ Full docs at [docs.mcpjam.com/cli](https://docs.mcpjam.com/cli).