mcprigor 1.5.0 → 1.5.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.
@@ -19,7 +19,7 @@ Creates an editable plain-language example. Existing files are protected unless
19
19
  mcprigor author server.mcpr --out tests/customer.mcpr
20
20
  ```
21
21
 
22
- Connects to the target in `server.mcpr` and guides you through creating a test.
22
+ Connects to the target in `server.mcpr` and guides you through creating a test. Alias: `create`.
23
23
 
24
24
  ## Validate and run
25
25
 
@@ -91,6 +91,15 @@ mcprigor workspace ./acceptance-tests --port 4173
91
91
 
92
92
  Starts a loopback-only QA interface. Alias: `web`.
93
93
 
94
+ ## MCP server for agents
95
+
96
+ ```bash
97
+ mcprigor serve
98
+ mcprigor serve path/to/project
99
+ ```
100
+
101
+ Exposes MCP Rigor itself as an MCP server over stdio so coding agents can write, validate, and run suites. Alias: `mcp`. See the [MCP server guide](MCP-SERVER.md).
102
+
94
103
  ## Transport parity
95
104
 
96
105
  ```bash
@@ -126,7 +126,7 @@ mcp-acceptance-tests/
126
126
 
127
127
  ## Next steps
128
128
 
129
- - [Plain-language cookbook](PLAIN-LANGUAGE-COOKBOOK.md)
129
+ - [Natural-language cookbook](NATURAL-LANGUAGE-COOKBOOK.md)
130
130
  - [QA workspace](QA-WORKSPACE.md)
131
131
  - [Engineer setup and CI](ENGINEER-SETUP.md)
132
132
  - [Troubleshooting](TROUBLESHOOTING.md)
@@ -1,6 +1,6 @@
1
1
  # GitHub Action and pull-request reports
2
2
 
3
- > Available on `main`; publish by pinning the next MCP Rigor release tag.
3
+ > Available since `v1.5.0`; pin `@v1` for the latest 1.x or `@v1.5.0` for full reproducibility.
4
4
 
5
5
  The MCP Rigor Action runs deterministic suites, optionally gates contract drift, includes flaky-history warnings, writes a rich job summary, and creates or updates one pull-request comment.
6
6
 
@@ -64,6 +64,42 @@ Server options:
64
64
  Authorization: "Bearer ${env.QA_TOKEN}"
65
65
  ```
66
66
 
67
+ An HTTP target may fetch a bearer token at run time with `Token from` (a command whose single-line stdout becomes the `Authorization` header), or drive an interactive browser login with `OAuth`:
68
+
69
+ ```text
70
+ Server options:
71
+ OAuth: oauth
72
+ ```
73
+
74
+ `OAuth: oauth` performs an authorization-code + PKCE browser login once at the start of the run and carries the in-memory session (with automatic refresh) into every test. The block form takes optional `clientId`, `clientSecret` (use `${env.NAME}`), and `scope`. Tokens are never written to disk and are always redacted. See the [Authentication guide](AUTHENTICATION.md).
75
+
76
+ ### Environment variables and secrets
77
+
78
+ Any string value in a target block — a header, a URL, a `cwd`, an `env` entry, a `Server options` field — may contain `${env.NAME}` placeholders. Before the suite connects, each placeholder is replaced with the value of the operating-system environment variable `NAME`:
79
+
80
+ ```text
81
+ MCP URL: ${env.MCP_URL}
82
+
83
+ Server options:
84
+ headers:
85
+ Authorization: "Bearer ${env.MCP_TOKEN}"
86
+ X-Api-Key: "${env.API_KEY}"
87
+ ```
88
+
89
+ ```bash
90
+ MCP_URL=https://qa.example.com/mcp MCP_TOKEN=... API_KEY=... mcprigor test suite.mcpr
91
+ ```
92
+
93
+ Rules:
94
+
95
+ - The syntax is exactly `${env.NAME}`. `NAME` is a literal environment-variable name; there is no shell, no command substitution, and no default-value syntax.
96
+ - A placeholder may be embedded in a larger string (`"Bearer ${env.MCP_TOKEN}"`) or be the whole value (`"${env.API_KEY}"`), and a value may contain several placeholders.
97
+ - If `NAME` is not set, the run stops immediately with `Environment variable not found: NAME` — it never sends an empty header or a half-substituted URL.
98
+ - Never write a literal secret into a suite. Keep tokens and keys in the environment (locally) or in CI secrets, and reference them with `${env.NAME}` so the committed `.mcpr` file carries no credentials.
99
+ - Header values are registered with the redactor automatically, so a resolved token never appears in reports, evidence bundles, or published URLs.
100
+
101
+ The same `${env.NAME}` placeholders work in every target surface: single-server `Server options`, per-server `Server options for "name"` in compositions, and `Target options for "name"` in parity comparisons.
102
+
67
103
  Multi-server compositions use named server declarations and per-test routing:
68
104
 
69
105
  ```text
@@ -16,7 +16,7 @@ Or with an explicit root:
16
16
  mcprigor serve path/to/project
17
17
  ```
18
18
 
19
- The server speaks MCP over stdio. Typical client configuration:
19
+ The server speaks MCP over stdio (`mcp` is an alias for `serve`). Typical client configuration:
20
20
 
21
21
  ```json
22
22
  {
@@ -1,4 +1,4 @@
1
- # Plain-language cookbook
1
+ # Natural-language cookbook
2
2
 
3
3
  Copy a pattern, replace the names and values, then run `mcprigor check FILE`.
4
4
 
@@ -187,7 +187,7 @@ Run with `mcprigor parity FILE`.
187
187
 
188
188
  ## Test a server that needs a bearer token
189
189
 
190
- Point the suite at the deployed endpoint and pass the token through an environment variable. Never paste a real token into a test file.
190
+ Point the suite at the deployed endpoint and pass the token through an environment variable. The `${env.NAME}` placeholder is replaced with the value of the `NAME` environment variable before the suite connects, so no real token ever lives in the test file.
191
191
 
192
192
  ```text
193
193
  MCP Test 1
@@ -210,6 +210,15 @@ Run it with the token in the environment:
210
210
  QA_TOKEN=... mcprigor test orders.mcpr
211
211
  ```
212
212
 
213
+ The placeholder can sit inside a larger string (`"Bearer ${env.QA_TOKEN}"`) or be the whole value, and any header works the same way — API keys, custom tenant headers, and so on:
214
+
215
+ ```text
216
+ Server options:
217
+ headers:
218
+ X-Api-Key: "${env.API_KEY}"
219
+ X-Tenant: "acme"
220
+ ```
221
+
213
222
  Three guarantees come with this pattern:
214
223
 
215
224
  - if `QA_TOKEN` is not set, the run stops with `Environment variable not found: QA_TOKEN` instead of sending an empty header;
@@ -238,7 +247,7 @@ Test: "Search behaves the same"
238
247
 
239
248
  ## When the token must be fetched first
240
249
 
241
- MCP Rigor does not perform OAuth login flows or token exchanges itself; tests stay deterministic and secrets stay outside test files. When a short-lived token must be acquired (client-credentials exchange, cloud CLI, vault), fetch it in the step before the run:
250
+ When a short-lived token must be acquired non-interactively (client-credentials exchange, cloud CLI, vault), fetch it in the step before the run:
242
251
 
243
252
  ```bash
244
253
  QA_TOKEN=$(curl -s -X POST https://auth.example.com/oauth/token \
@@ -256,7 +265,29 @@ In CI, do the same in the workflow:
256
265
  run: npx mcprigor test tests/*.mcpr
257
266
  ```
258
267
 
259
- Interactive browser-redirect OAuth is out of scope by design: an acceptance run must be repeatable without a human in the loop.
268
+ For CI and other unattended runs, obtain the token non-interactively as above. When a real user must sign in through a browser, use interactive OAuth instead (next recipe).
269
+
270
+ ## Sign in through the browser (interactive OAuth)
271
+
272
+ When a server requires a real user login, let MCP Rigor run the browser authorization-code flow once and carry the authorized session — with automatic refresh — into every test in the run:
273
+
274
+ ```text
275
+ MCP URL: https://app.example.com/mcp
276
+
277
+ Server options:
278
+ OAuth: oauth
279
+
280
+ Test: "an authenticated call succeeds"
281
+ Call tool "find_order" with:
282
+ orderId: "A-1001"
283
+ Expect "structuredContent.status" equals "shipped"
284
+ ```
285
+
286
+ ```bash
287
+ mcprigor test orders.mcpr
288
+ ```
289
+
290
+ Your browser opens to the identity provider; after you sign in, the tokens are held in memory (never written to disk, always redacted) and reused for the whole suite. For pre-registered clients or specific scopes, use the block form with `clientId`, `clientSecret: "${env.…}"`, and `scope`. Because it needs a human, keep interactive OAuth for local runs and use a non-interactive credential in CI. See the [Authentication guide](AUTHENTICATION.md) for the full flow.
260
291
 
261
292
  ## Fetch an OAuth token before connecting
262
293
 
package/docs/QA-GUIDE.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # QA guide
2
2
 
3
- Use this page as a short everyday checklist. For examples, open the [plain-language cookbook](PLAIN-LANGUAGE-COOKBOOK.md).
3
+ Use this page as a short everyday checklist. For examples, open the [natural-language cookbook](NATURAL-LANGUAGE-COOKBOOK.md).
4
4
 
5
5
  ## Everyday workflow
6
6
 
@@ -121,7 +121,7 @@ Use values as `${row.input}` and `${row.expected}`.
121
121
  ## Where to go next
122
122
 
123
123
  - [Getting started](GETTING-STARTED.md)
124
- - [Plain-language cookbook](PLAIN-LANGUAGE-COOKBOOK.md)
124
+ - [Natural-language cookbook](NATURAL-LANGUAGE-COOKBOOK.md)
125
125
  - [Guided authoring](GUIDED-AUTHORING.md)
126
126
  - [Data and reusable flows](DATA-AND-REUSE.md)
127
127
  - [Troubleshooting](TROUBLESHOOTING.md)
package/docs/README.md CHANGED
@@ -5,7 +5,7 @@ Choose the path that matches your role.
5
5
  ## QA authors
6
6
 
7
7
  1. [Getting started](GETTING-STARTED.md) — install, connect, and run your first test.
8
- 2. [Plain-language cookbook](PLAIN-LANGUAGE-COOKBOOK.md) — copy-ready scenarios and assertions.
8
+ 2. [Natural-language cookbook](NATURAL-LANGUAGE-COOKBOOK.md) — copy-ready scenarios and assertions.
9
9
  3. [QA workspace](QA-WORKSPACE.md) — edit and run tests in a browser.
10
10
  4. [Data and reusable flows](DATA-AND-REUSE.md) — tables, files, functions, and shared flows.
11
11
  5. [Troubleshooting](TROUBLESHOOTING.md) — understand errors and fix common failures.
@@ -13,8 +13,9 @@ Choose the path that matches your role.
13
13
  ## Test and platform engineers
14
14
 
15
15
  - [Engineer setup](ENGINEER-SETUP.md) — targets, credentials, project layout, and CI.
16
+ - [Authentication and secrets](AUTHENTICATION.md) — test protected servers with bearer tokens, API keys, OAuth, and `${env.NAME}` placeholders.
16
17
  - [CLI reference](CLI-REFERENCE.md) — commands, options, outputs, and exit codes.
17
- - [Language reference](LANGUAGE-SPEC.md) — complete deterministic `.mcpr` syntax.
18
+ - [Language reference](LANGUAGE-SPEC.md) — complete deterministic `.mcpr` syntax, in enforced parity with YAML via `mcprigor convert`.
18
19
  - [State and dependencies](STATE-AND-DEPENDENCIES.md) — share outputs across tests and runs.
19
20
  - [Data engineering](DATA-ENGINEERING.md) — types, filters, joins, samples, and caches.
20
21
  - [Transport parity](TRANSPORT-PARITY.md) — compare stdio and Streamable HTTP.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mcprigor",
3
- "version": "1.5.0",
3
+ "version": "1.5.1",
4
4
  "description": "Plain-language MCP testing with isolated extensions and a local QA workspace",
5
5
  "type": "module",
6
6
  "bin": {
@@ -38,7 +38,7 @@
38
38
  <button id="batch-clear" class="ghost small">Clear selection</button>
39
39
  </div>
40
40
  <div class="sidebar-foot">
41
- <a href="https://mcprigor.com/docs/plain-language-cookbook.html" target="_blank" rel="noreferrer">📖 Cookbook — copy-ready examples</a>
41
+ <a href="https://mcprigor.com/docs/natural-language-cookbook.html" target="_blank" rel="noreferrer">📖 Cookbook — copy-ready examples</a>
42
42
  </div>
43
43
  </aside>
44
44
  <div class="splitter" id="split-left" role="separator" aria-orientation="vertical" aria-label="Resize file list" tabindex="0"></div>