@postman/postman-plugin 0.3.0 → 0.4.1-rc.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.
Files changed (48) hide show
  1. package/README.md +46 -9
  2. package/dist/hosts/antigravity.js +47 -0
  3. package/dist/hosts/codex-hooks.js +68 -0
  4. package/dist/hosts/codex.js +87 -8
  5. package/dist/hosts/copilot.js +60 -0
  6. package/dist/hosts/index.js +3 -1
  7. package/dist/json-rpc.js +113 -0
  8. package/dist/system.js +40 -3
  9. package/mcp.pi.json +2 -2
  10. package/package.json +1 -1
  11. package/skills/ai-readiness/SKILL.md +40 -44
  12. package/skills/api-discovery/SKILL.md +64 -145
  13. package/skills/api-discovery/reference/orbit.md +17 -5
  14. package/skills/api-documentation/SKILL.md +41 -46
  15. package/skills/api-engineer/SKILL.md +78 -23
  16. package/skills/api-mocking/SKILL.md +117 -163
  17. package/skills/api-monitoring/SKILL.md +52 -129
  18. package/skills/api-simulation/SKILL.md +130 -178
  19. package/skills/api-simulation/reference/sim_yaml_schema.md +41 -103
  20. package/skills/api-testing/SKILL.md +48 -95
  21. package/skills/bootstrap/SKILL.md +123 -224
  22. package/skills/ci-integration/SKILL.md +53 -113
  23. package/skills/collection-schema-v3/SKILL.md +43 -204
  24. package/skills/collection-schema-v3/reference/http.md +150 -0
  25. package/skills/datasets/SKILL.md +89 -315
  26. package/skills/datasets/reference/spreadsheets.md +25 -0
  27. package/skills/flows/SKILL.md +57 -206
  28. package/skills/flows/reference/flow_cli_flags.md +3 -2
  29. package/skills/performance-testing/SKILL.md +46 -62
  30. package/skills/performance-testing/references/jmeter-import/README.md +82 -0
  31. package/skills/performance-testing/references/jmeter-import/import-report.md +52 -0
  32. package/skills/performance-testing/references/jmeter-import/mapping-table.md +95 -0
  33. package/skills/performance-testing/references/jmeter-import/postman-perf-capabilities.md +56 -0
  34. package/skills/performance-testing/references/jmeter-import/script-translation.md +97 -0
  35. package/skills/postman-mcp-server/SKILL.md +53 -59
  36. package/skills/postman-mcp-server/references/docs.md +0 -1
  37. package/skills/postman-mcp-server/references/learn.md +10 -9
  38. package/skills/postman-mcp-server/references/mock.md +0 -1
  39. package/skills/postman-mcp-server/references/search.md +0 -1
  40. package/skills/postman-mcp-server/references/security.md +0 -1
  41. package/skills/postman-mcp-server/references/setup.md +0 -1
  42. package/skills/postman-mcp-server/references/sync.md +0 -1
  43. package/skills/postman-mcp-server/references/test.md +0 -1
  44. package/skills/variables/SKILL.md +44 -87
  45. package/skills/webhook-testing/SKILL.md +103 -0
  46. package/skills/webhook-testing/reference/forwarding.md +10 -0
  47. package/skills/webhook-testing/reference/outbound_webhooks.md +25 -0
  48. package/skills/webhook-testing/reference/webhook_scripts.md +163 -0
@@ -0,0 +1,95 @@
1
+ # JMeter → Postman mapping table
2
+
3
+ Fidelity: **exact** (behaviour preserved) · **approx** (closest supported equivalent, reported) · **manual** (needs a judgment call, often with the user) · **unsupported** (dropped, reported).
4
+
5
+ ## Structure
6
+
7
+ | JMeter element | XML tag | Postman | Fidelity |
8
+ |---|---|---|---|
9
+ | Test Plan | `TestPlan` | Collection (`info` + `item`) | exact |
10
+ | Thread Group | `ThreadGroup` | load config (VUs/duration/profile) + folder when >1 | approx |
11
+ | setUp/tearDown Thread Group | `SetupThreadGroup`/`PostThreadGroup` | folder; suggest `--setup-collection`/`--teardown-collection` | approx |
12
+ | Concurrency Thread Group | `...ConcurrencyThreadGroup` | VUs=`TargetLevel`, duration=`RampUp`+`Hold`, `ramp-up` | approx |
13
+ | Stepping Thread Group | `kg.apc...SteppingThreadGroup` | VUs=`num_threads`, duration=`flighttime`, `ramp-up` | approx |
14
+ | Ultimate Thread Group | `kg.apc...UltimateThreadGroup` | VUs=max row concurrency, duration=sum of row times | approx |
15
+ | Arrivals Thread Group | `...ArrivalsThreadGroup` | treated like concurrency | approx |
16
+ | Transaction Controller | `TransactionController` | folder | exact |
17
+ | Simple/Generic Controller | `GenericController`/`SimpleController` | folder | exact |
18
+ | Loop Controller | `LoopController` | flattened; loop count → duration | approx |
19
+ | If Controller | `IfController` | each enclosed request gets a pre-request skip guard (`pm.execution.skipRequest`); `${var}` → `pm.variables.get(...)` | approx |
20
+ | While Controller | `WhileController` | flattened, requests run unconditionally; restore looping with `pm.execution.setNextRequest` | approx |
21
+ | Recording Controller | `RecordingController` | transparent (children recursed) | exact |
22
+ | Module / Include Controller | `ModuleController`/`IncludeController` | flattened children if inline; external refs reported | manual |
23
+
24
+ ## Requests
25
+
26
+ | JMeter | XML | Postman | Fidelity |
27
+ |---|---|---|---|
28
+ | HTTP Request | `HTTPSamplerProxy` | request item | exact |
29
+ | method / path / domain / port / protocol | `HTTPSampler.*` | `request.method` + `url` (blank protocol → `http`) | exact |
30
+ | Query/body params | `Arguments`/`HTTPArgument` | query (GET) / urlencoded (POST/PUT/PATCH) / formdata (multipart) | exact |
31
+ | Raw body | `postBodyRaw=true` | `body.mode=raw` | exact |
32
+ | Header Manager | `HeaderManager` | `request.header` (merged by scope, later wins) | exact |
33
+ | HTTP Request Defaults | `ConfigTestElement`/`HttpDefaultsGui` | fallback for blank domain/port/protocol/path | exact |
34
+ | Auth Manager Basic/Digest | `AuthManager` | `request.auth` basic/digest (first entry; multiples reported) | exact |
35
+ | Auth Manager Kerberos/NTLM | `AuthManager` mechanism | — | unsupported |
36
+ | Cookie / Cache / DNS Manager | `CookieManager`/... | auto per-VU cookies; presets not transferred | unsupported |
37
+ | Non-HTTP samplers | `JDBC/FTP/LDAP/Java/TCP/Debug/Dummy...Sampler` | — | unsupported |
38
+
39
+ ## Extractors (post-response → test script `pm.collectionVariables.set`)
40
+
41
+ | JMeter | XML | Fidelity |
42
+ |---|---|---|
43
+ | Regular Expression Extractor | `RegexExtractor` | exact (via `new RegExp`, group from `$n$` template) |
44
+ | Boundary Extractor | `BoundaryExtractor` | exact (left/right → non-greedy regex) |
45
+ | JSON Extractor (native) | `JSONPostProcessor` | exact for dot/index paths; complex → manual |
46
+ | JSON Path Extractor (plugin) | `...JSONPathExtractor` | exact for simple paths |
47
+ | XPath / XPath2 Extractor | `XPathExtractor`/`XPath2Extractor` | manual (no sandbox XPath) |
48
+ | CSS/HTML Extractor | `HtmlExtractor` | manual (no sandbox CSS) |
49
+
50
+ ## Assertions (→ `pm.test`)
51
+
52
+ | JMeter | XML | Maps to | Fidelity |
53
+ |---|---|---|---|
54
+ | Response Assertion | `ResponseAssertion` | status / contains / equals / matches, honouring `test_type` bitmask + NOT | exact |
55
+ | — test_field response_code | | `pm.response.code` | exact |
56
+ | — test_field response_data | | `pm.response.text()` | exact |
57
+ | — test_field headers/message | | `pm.response.headers`/`.status` | exact |
58
+ | Duration Assertion | `DurationAssertion` | `pm.test` responseTime + `--pass-if less_than(p95, ms)` hint | exact |
59
+ | Size Assertion | `SizeAssertion` | `pm.test` on `responseSize` | approx |
60
+ | JSON Assertion | `JSONPathAssertion` | `pm.test` on simple path | approx |
61
+
62
+ `ResponseAssertion.test_type` bits: `MATCH=1, CONTAINS=2, NOT=4, EQUALS=8, SUBSTRING=16, OR=32`.
63
+
64
+ ## Variables & data
65
+
66
+ | JMeter | XML | Postman | Fidelity |
67
+ |---|---|---|---|
68
+ | User Defined Variables | `Arguments` under TestPlan/scope | collection `variable[]` | exact |
69
+ | `${var}` references | inline | `{{var}}` | exact |
70
+ | `${__UUID}` / `${__time}` | function | `{{$guid}}` / `{{$timestamp}}` | exact |
71
+ | `${__Random(...)}` and other `__fn` | function | `{{$randomInt}}` or flagged reference | approx/manual |
72
+ | CSV Data Set Config | `CSVDataSet` | `--data-file` + column list | approx (one file/run; naive CSV) |
73
+ | Counter / Random Variable | `CounterConfig`/`RandomVariableConfig` | pre-request script or `{{$randomInt}}` | manual |
74
+
75
+ ## Scripting
76
+
77
+ | JMeter | XML | Postman | Fidelity |
78
+ |---|---|---|---|
79
+ | JSR223 PreProcessor | `JSR223PreProcessor` | prerequest script (JS, IIFE-wrapped) | manual |
80
+ | JSR223 PostProcessor | `JSR223PostProcessor` | test script | manual |
81
+ | BeanShell Pre/PostProcessor | `BeanShell*Processor` | pre/test script | manual |
82
+ | JSR223 / BeanShell Sampler | `JSR223Sampler`/`BeanShellSampler` | script-only stub (no HTTP) | manual |
83
+
84
+ ## Timing / pacing — not supported, always reported
85
+
86
+ Postman performance runs have no think time and no flag for one. Every timer is
87
+ dropped and listed in the report; none is reproduced.
88
+
89
+ | JMeter | XML |
90
+ |---|---|
91
+ | Constant / Uniform / Gaussian / Poisson Timer | `ConstantTimer`/`UniformRandomTimer`/... |
92
+ | Constant Throughput Timer | `ConstantThroughputTimer` |
93
+ | Throughput Shaping Timer | plugin |
94
+ | Synchronizing Timer | `SyncTimer` |
95
+ | Test Action (pause/stop) | `TestAction` |
@@ -0,0 +1,56 @@
1
+ # What Postman performance testing supports (the import target)
2
+
3
+ Grounded in the `postman-cli`, `performance-test-api`, and `postman-performance-test` source — not the marketing docs. This is the ceiling an import maps onto. When JMeter asks for something not here, it is reported, never faked.
4
+
5
+ ## `postman performance run` CLI flags that matter for import
6
+
7
+ | Concern | Flag | Notes |
8
+ |---------|------|-------|
9
+ | Virtual users | `--vu-count <n>` | default 20; cloud runs enforce a **minimum of 10** |
10
+ | Duration | `-d, --duration <minutes>` | **minutes**, not seconds; default 1; cloud ceiling ~120 min (plan-gated) |
11
+ | Load profile | `-p, --load-profile <p>` | one of `fixed`, `ramp-up`, `spike`, `peak`; default `ramp-up` |
12
+ | Data file | `--data-file <path>` | JSON array or CSV; **local runs only**; distribution is forced to `random` |
13
+ | Dataset | `--dataset-id` + `--dataset-view-id` + `--dataset-distribution` | cloud path; distribution `round-robin`/`fixed`/`random` |
14
+ | Pass/fail | `--pass-if "<fn>(<metric>, <value>)"` | **single, not repeatable** |
15
+ | Environment | `-e, --environment <id>` | |
16
+ | Setup/teardown | `--setup-collection` / `--teardown-collection` | run **once** before/after — not concurrent load |
17
+
18
+ There is **no** `--load-segments`, no `--stages`, no `--iterations`, no think-time flag. A latent YAML "stages" schema exists in the CLI repo but is not wired to the command — do not target it.
19
+
20
+ ## Load profiles
21
+
22
+ Four named shapes only, each derived from `(vu-count, duration)`:
23
+
24
+ - `fixed` — constant VUs.
25
+ - `ramp-up` — ramps from 25% to full over the first quarter.
26
+ - `spike` — low baseline, one spike to full mid-run, back down.
27
+ - `peak` — baseline, ramp up, hold, ramp down.
28
+
29
+ JMeter custom ramp curves, stepping schedules, and arrival-rate shapes **cannot be reproduced**. Pick the closest of the four and report the approximation. Rule: any ramp/stepping/concurrency/ultimate/arrivals group → `ramp-up`; a flat group with zero ramp → `fixed`.
30
+
31
+ ## `--pass-if` metrics and operators
32
+
33
+ - Functions (operators): `less_than`, `greater_than`, `less_than_eq`, `greater_than_eq`.
34
+ - Metrics (CLI): `avg`, `p90`, `p95`, `p99` (ms); `error_rate`, `failure_rate` (%); `rps`.
35
+ - **Server-side (cloud) accepts a narrower set**: `responseTime.average/p90/p95/p99`, `throughput`, `errorRate`. `failure_rate` is local-only — if you emit it, note it won't gate a cloud run.
36
+ - Only one condition per run. A JMeter Duration Assertion is the only clean source (→ `less_than(p95, <ms>)`); otherwise suggest `less_than(error_rate, 5)` and tell the user it's a default.
37
+
38
+ ## Scripts under load
39
+
40
+ - Pre-request / test scripts run per VU per iteration via `postman-runtime`.
41
+ - `postman.setNextRequest(...)` **is supported** — flow control within one VU's iteration works.
42
+ - Vault access **in scripts** is disabled; per-request timeouts are forced to infinite; each VU gets its own cookie jar.
43
+ - Known engine caveat: mutating `pm.request` inside a script can bleed across VUs. `pm.iterationData` / `pm.variables` are correctly isolated. Avoid importing JMeter logic into `pm.request` mutation.
44
+
45
+ ## Data
46
+
47
+ - One `--data-file` (JSON array of objects, or CSV) per run. Multiple JMeter CSV Data Sets must be merged or a primary chosen.
48
+ - Rows map to VUs/iterations; rows < VUs repeat. The CLI CSV parser is a naive comma split — **no quoted-field/escape support**, so JMeter CSVs with embedded commas/quotes need cleaning.
49
+
50
+ ## Hard limits to encode in every import
51
+
52
+ 1. One collection, repeated across VUs. **No concurrent thread groups.**
53
+ 2. Time-based, not iteration-based. **Loop counts → duration.**
54
+ 3. One `--pass-if`.
55
+ 4. **No think time** — timers are not reproduced; each one is reported.
56
+ 5. **HTTP(S) only.**
@@ -0,0 +1,97 @@
1
+ # Translating JSR223 / BeanShell scripts to Postman JavaScript
2
+
3
+ Every JSR223/BeanShell script is translated by hand and treated as a manual task until it's checked. Wrap each translation in an IIFE (`(function () { ... })();`) so a leftover `return` stays legal.
4
+
5
+ ## Execution-context map
6
+
7
+ JMeter runs these inside a sampler's processor. Postman runs them as a request's `prerequest` or `test` event. Equivalents:
8
+
9
+ | JMeter (Groovy/BeanShell) | Postman JS | Context |
10
+ |---|---|---|
11
+ | `vars.get("x")` / `vars["x"]` | `pm.variables.get("x")` | both |
12
+ | `vars.put("x", v)` | `pm.variables.set("x", v)` | both |
13
+ | `props.get/put(...)` | `pm.variables.get/set(...)` (approx) | both |
14
+ | `log.info/warn/error(...)` | `console.log/warn/error(...)` | both |
15
+ | `prev.getResponseDataAsString()` | `pm.response.text()` | post only |
16
+ | `prev.getResponseCode()` | `String(pm.response.code)` | post only |
17
+ | `prev.getResponseMessage()` | `pm.response.status` | post only |
18
+ | `prev.getTime()` | `pm.response.responseTime` | post only |
19
+ | `ctx.getPreviousResult()` | `pm.response` | post only |
20
+ | `sampler.getUrl()` | `pm.request.url.toString()` | pre only |
21
+ | `sampler.addArgument(k,v)` | `pm.request.url.query.add({key:k,value:v})` or body edit | pre only |
22
+ | `System.currentTimeMillis()` | `Date.now()` | both |
23
+ | `UUID.randomUUID().toString()` | `require('uuid').v4()` | both |
24
+ | `Integer.parseInt(x)` | `parseInt(x)` | both |
25
+
26
+ ## What doesn't map line by line
27
+
28
+ - **BeanShell implicit result vars** (`ResponseCode`, `ResponseMessage`, `IsSuccess`, `bsh.args`, `Parameters`). No pm.* equivalent in a processor. For a sampler that sets `IsSuccess=false`, express it as a `pm.test(...)` that fails. For `return X`, delete the return (the IIFE makes it legal, but it's a no-op).
29
+ - **Groovy closures / collection methods** (`.each {}`, `.collect {}`, `->`). Rewrite as `for...of` / `.map()` / arrow functions.
30
+ - **`import` / `new ClassName()` / Java types** (`StringBuilder`, `SimpleDateFormat`, `JsonSlurper`). Replace with JS: string concat, `Date`, `JSON.parse`. `JsonSlurper().parseText(prev...)` → `pm.response.json()`.
31
+ - **`try/catch`, multi-statement logic** — valid JS already; just verify semantics.
32
+ - **GString interpolation** `"${x} and ${y}"` → template literal `` `${x} and ${y}` `` **only if** `x`/`y` are JS locals; if they are JMeter vars use `pm.variables.get`.
33
+
34
+ ## Procedure
35
+
36
+ 1. Read the original `<script>` text in the `.jmx` (note the element's name, so the report can point at it).
37
+ 2. Rewrite line by line using the table. Preserve variable names so `{{var}}` references elsewhere still resolve.
38
+ 3. Mark anything you're unsure of with a `// REVIEW` comment, and remove it once the logic is confirmed.
39
+ 4. Run the syntax check from `README.md` step 4.
40
+
41
+ ## Example
42
+
43
+ JMeter (Groovy post-processor):
44
+ ```groovy
45
+ import groovy.json.JsonSlurper
46
+ def json = new JsonSlurper().parseText(prev.getResponseDataAsString())
47
+ def token = json.data.token
48
+ vars.put("authToken", token)
49
+ log.info("got " + token)
50
+ ```
51
+ Postman (test script):
52
+ ```javascript
53
+ const json = pm.response.json();
54
+ const token = json.data.token;
55
+ pm.collectionVariables.set("authToken", token);
56
+ console.log("got " + token);
57
+ ```
58
+
59
+ ## Canonical JS templates
60
+
61
+ Emit exactly these so every import produces the same code. `<default>` empty-string if JMeter has none. Source is `pm.response.text()` normally, or `pm.response.headers.toString()` when the extractor's `useHeaders` is true.
62
+
63
+ **Regex extractor** (`$n$` template → group `n`):
64
+ ```javascript
65
+ try { var _m = String(pm.response.text()).match(new RegExp("<REGEX>")); pm.collectionVariables.set("<ref>", _m ? _m[<n>] : "<default>"); } catch (e) { pm.collectionVariables.set("<ref>", "<default>"); }
66
+ ```
67
+
68
+ **Boundary extractor** (left/right → non-greedy capture):
69
+ ```javascript
70
+ try { var _b = String(pm.response.text()).match(new RegExp("<lboundary>([\\s\\S]*?)<rboundary>")); pm.collectionVariables.set("<ref>", _b ? _b[1] : "<default>"); } catch (e) { pm.collectionVariables.set("<ref>", "<default>"); }
71
+ ```
72
+
73
+ **JSON extractor** (`JSONPostProcessor` / plugin). Only **simple** paths (`$.a.b`, `$.a[0].c`) import; `$`/`$.` → `pm.response.json()`:
74
+ ```javascript
75
+ try { pm.collectionVariables.set("<ref>", pm.response.json().a.b[0]); } catch (e) { pm.collectionVariables.set("<ref>", "<default>"); }
76
+ ```
77
+ Wildcards / filters / recursive descent (`*`, `..`, `?`, `@`) → do NOT import; emit `// [manual] JSONPath "<expr>" too complex` and add a manual task.
78
+
79
+ **Implicit HTTP success** (first test on every request unless a `response_code`/`response_message` assertion or `assume_success` exists):
80
+ ```javascript
81
+ pm.test('JMeter default success (HTTP 200-399)', function () {
82
+ pm.expect(pm.response.code).to.be.within(200, 399);
83
+ });
84
+ ```
85
+
86
+ **Response Assertion** — decode `test_type` bits (`MATCH=1, CONTAINS=2, NOT=4, EQUALS=8, SUBSTRING=16, OR=32`). Field getter: `response_code`→`pm.response.code`, `response_message`→`pm.response.status`, `response_headers`→`pm.response.headers.toString()`, else `pm.response.text()`. For each test string `s`:
87
+ - **EQUALS (8)** on `response_code`: `pm.expect(pm.response.code).to.eql(<s>)` (number). Other fields: `.to.eql("<s>")`.
88
+ - **SUBSTRING (16)** → literal: `pm.expect(<getter>).to.include("<s>")`.
89
+ - **CONTAINS (2) or MATCH (1)** → regex: `pm.expect(String(<getter>)).to.match(new RegExp("<s>"))`.
90
+ - **NOT (4)** → insert `.not` before `.to`.
91
+ Wrap each in `pm.test("<name>", function () { <expr>; });`.
92
+
93
+ **Duration Assertion** → a test plus a perf `--pass-if` hint:
94
+ ```javascript
95
+ pm.test("Response time < <ms>ms", function () { pm.expect(pm.response.responseTime).to.be.below(<ms>); });
96
+ ```
97
+ and set the run's `--pass-if "less_than(p95, <ms>)"`.
@@ -1,71 +1,65 @@
1
1
  ---
2
2
  name: postman-mcp-server
3
- description: Postman concepts and MCP tool guidance. Loaded when working with Postman MCP tools to make better decisions about tool selection and workarounds.
4
- user-invocable: false
3
+ description: Use when working through Postman MCP tools to inspect or change workspace resources, choose a targeted operation, or handle MCP limitations. Supports hosted workflows when the CLI is unavailable and distinguishes tool completion from a usable result. Use for requests such as "use Postman MCP to inspect this collection".
5
4
  ---
6
5
 
7
- # Postman Knowledge
6
+ # Postman MCP Server
8
7
 
9
- Reference for Postman concepts and MCP tool selection. Use this context when working with Postman MCP tools to make better decisions.
8
+ MCP exposes workspace resources directly to an agent. Existing collections,
9
+ specs, examples, and environments provide maintained API knowledge; fetching
10
+ the relevant entity preserves that context when a local CLI workflow is not
11
+ available. For repository edits and Git review, prefer the local workflows in
12
+ **api-engineer** and **bootstrap** when available.
10
13
 
11
- See `references/setup.md` for how to to setup postman mcp server and auth.
14
+ Each tool definition exposed to the model consumes context whenever it is
15
+ included in a request. Prefer the smallest available toolset that covers the
16
+ task; expanding to every tool can crowd out the API evidence needed to reason.
17
+ When exposed, call `getEnabledTools` to inspect the active toolset before
18
+ diagnosing a missing operation. Otherwise use the host's discovered tools and
19
+ report that limitation. Do not infer availability from reference tool names or
20
+ assume a client can switch a route pinned to a specific MCP endpoint.
12
21
 
13
- ## Core Concepts
22
+ 1. Select tools from the connected server's actual surface. Tool availability
23
+ varies by mode; a name listed in a reference is not proof it is exposed.
24
+ Use [setup](references/setup.md) for connection/auth failures and
25
+ [limitations](references/mcp-limitations.md) when an operation is missing
26
+ or behaves differently from the CLI.
27
+ 2. Search to locate an entity, then fetch enough detail to work on it.
28
+ `searchPostmanElements` finds candidates; collection, spec, and workspace
29
+ detail tools establish IDs, ownership, and content. A search preview is
30
+ insufficient evidence for replacing a collection or declaring an API absent.
31
+ 3. Match the mutation to the intended scope. Request-level updates preserve
32
+ unrelated collection content; whole-collection replacement requires the
33
+ current complete object. A workspace is a container and access boundary,
34
+ not a reason to create duplicate resources whenever a new task begins.
35
+ 4. Preserve the source of truth when synchronizing. Spec-to-collection
36
+ generation reuses the interface, while collection-to-spec sync carries
37
+ changes in the other direction. Choose from the intended contract rather
38
+ than overwriting whichever artifact is easiest to reach. An asynchronous
39
+ acceptance response needs a completed task result before claiming sync.
40
+ 5. Treat publication separately from editing. A collection example can feed
41
+ docs and a classic mock, but neither becomes publicly accessible merely
42
+ because it exists. Apply the user's intended audience and authorization
43
+ before publishing docs or mocks, or changing shared resources.
14
44
 
15
- - **Collection:** A group of API requests organized in folders. The primary unit of work in Postman. Contains requests, examples, tests, and documentation.
16
- - **Environment:** Key-value pairs (variables) scoped to a context (dev, staging, prod). Used to swap base URLs, auth tokens, and config without changing requests.
17
- - **Workspace:** Container for collections, environments, and specs. Can be personal, team, or public.
18
- - **Spec (Spec Hub):** An OpenAPI or AsyncAPI definition stored in Postman. Can generate collections and stay synced.
19
- - **Request:** A single API call definition (method, URL, headers, body, tests).
20
- - **Response:** A saved example response for a request. Used by mock servers and documentation.
21
- - **Folder:** A grouping within a collection, typically by resource (e.g., "Users", "Orders").
22
- - **Tags:** Labels on collections for categorization and search.
23
- - **Monitor:** A scheduled collection runner that checks API health.
24
- - **Mock Server:** A fake API that serves example responses from a collection.
45
+ Read the reference for the branch being used:
25
46
 
26
- ## Decision Guide
47
+ | Task | Reference and decision it supports |
48
+ | --- | --- |
49
+ | Locate an API | [Search](references/search.md): narrow candidates to the intended resource |
50
+ | Generate or synchronize artifacts | [Sync](references/sync.md): choose source and track completion |
51
+ | Serve saved examples | [Mock](references/mock.md): classic collection mocks; for CLI Code Mocks use **api-mocking** |
52
+ | Execute saved assertions | [Test](references/test.md): distinguish run completion from failures |
53
+ | Improve or publish docs | [Docs](references/docs.md): fill contract gaps and verify reader access |
54
+ | Requested security review | [Security](references/security.md): assess concrete API risks |
55
+ | Product how-to questions | [Learning Center](references/learn.md): product documentation search when exposed |
27
56
 
28
- | Goal | Approach |
29
- |------|----------|
30
- | Push code changes to Postman | Create/update spec in Spec Hub, then sync to collection |
31
- | Consume a Postman API | Read collection + generate client code |
32
- | Find an API | Use `searchPostmanElements`, then drill into details |
33
- | Test an API | Run collection with `runCollection` |
34
- | Create a fake API for frontend | Create mock server from collection with examples |
35
- | Document an API | Analyze collection completeness, fill gaps, optionally publish |
36
- | Audit API security | Run security checks against spec or collection |
37
- | Learn how to use a Postman feature | Search Postman docs with `searchLearningCenter` (Full mode) |
57
+ ## Verification
38
58
 
39
- ## MCP Tool Selection
59
+ State the active toolset as observed through `getEnabledTools`, or identify the
60
+ host discovery evidence used when that tool is unavailable. Report any operation
61
+ the connected surface could not perform instead of claiming it succeeded.
40
62
 
41
- **Workspace operations:** `getWorkspaces`, `getWorkspace`, `createWorkspace`
42
- **Collection CRUD:** `getCollections`, `getCollection`, `createCollection`, `putCollection`, `patchCollection`, `deleteCollection`
43
- **Request/Response:** `getCollectionRequest`, `createCollectionRequest`, `updateCollectionRequest`, `getCollectionResponse`, `createCollectionResponse`, `updateCollectionResponse`
44
- **Folder management:** `getCollectionFolder`, `createCollectionFolder`, `updateCollectionFolder`
45
- **Spec Hub:** `getAllSpecs`, `getSpec`, `createSpec`, `getSpecDefinition`, `updateSpecFile`, `getSpecFiles`
46
- **Sync:** `generateCollection`, `syncCollectionWithSpec`, `syncSpecWithCollection`
47
- **Environments:** `getEnvironments`, `getEnvironment`, `createEnvironment`, `putEnvironment`
48
- **Mocks:** `getMocks`, `getMock`, `createMock`, `publishMock`, `unpublishMock`
49
- **Tests:** `runCollection`
50
- **Docs:** `publishDocumentation`, `unpublishDocumentation`
51
- **Search:** `searchPostmanElements` , `getTaggedEntities`
52
- **Learning Center:** `searchLearningCenter` (Full mode only — searches Postman product docs for how-to guidance)
53
- **User:** `getAuthenticatedUser`
54
-
55
- See `references/mcp-limitations.md` for known limitations and workarounds.
56
-
57
- ## Workflows
58
-
59
- Each reference below is a full MCP-tool workflow for one goal — the tool
60
- call sequence, what to present at each step, and error handling. Reach for
61
- one once the Decision Guide above has picked a goal; they assume MCP tools
62
- only, no `postman` CLI.
63
-
64
- - `references/setup.md` — first-run auth (OAuth or API key) and workspace verification.
65
- - `references/search.md` — discover APIs across workspaces with `searchPostmanElements`.
66
- - `references/sync.md` — create/update collections from specs, or sync a spec from collection changes.
67
- - `references/mock.md` — create a mock server from a collection or spec.
68
- - `references/test.md` — run collection tests and diagnose failures.
69
- - `references/docs.md` — generate, improve, and publish API documentation.
70
- - `references/security.md` — audit a spec or collection against the OWASP API Top 10.
71
- - `references/learn.md` — search the Postman Learning Center for how-to guidance.
63
+ Report the resource and observed result: assertions for a run, completed sync
64
+ for a generated artifact, or the reachable URL and visibility for publication.
65
+ Tool success alone does not establish any of those outcomes.
@@ -1,6 +1,5 @@
1
1
  ---
2
2
  description: Generate, improve, and publish API documentation from Postman collections.
3
- allowed-tools: Read, Write, Glob, Grep, mcp__postman__getWorkspaces, mcp__postman__getAllSpecs, mcp__postman__getSpecDefinition, mcp__postman__getCollections, mcp__postman__getCollection, mcp__postman__updateCollectionRequest, mcp__postman__publishDocumentation, mcp__postman__unpublishDocumentation, mcp__postman__syncCollectionWithSpec, mcp__postman__syncSpecWithCollection, mcp__postman__getCollectionUpdatesTasks
4
3
  ---
5
4
 
6
5
  # API Documentation
@@ -1,6 +1,5 @@
1
1
  ---
2
2
  description: Search the Postman Learning Center for how-to guidance, feature explanations, and suggested workflows. Use for "how do I..." questions about the Postman product.
3
- allowed-tools: Read, mcp__postman__searchLearningCenter, mcp__postman__getEnabledTools
4
3
  ---
5
4
 
6
5
  # Learn Postman
@@ -11,14 +10,16 @@ Use this to learn *about Postman itself* — not to search the user's own collec
11
10
 
12
11
  ## Prerequisites
13
12
 
14
- This workflow uses `searchLearningCenter`, which the Postman MCP Server exposes only in **Full mode**.
13
+ Use `searchLearningCenter` when it is exposed by the connected server. Follow
14
+ **postman-mcp-server**'s toolset inspection guidance before diagnosing a missing
15
+ tool; a remembered mode-to-tool mapping is not evidence of current availability.
16
+ The route's MCP endpoint determines its configured surface. `POSTMAN_MCP_MODE`
17
+ is not read by this plugin's routes and cannot switch that surface.
15
18
 
16
- The mode is fixed by the endpoint in each route's MCP config, not by the environment. A route pinned to `https://mcp.postman.com/mcp` has the tool; a route pinned to `https://mcp.postman.com/minimal` does not. Read it off the route's own MCP config rather than inferring it from the agent's name — which endpoint an agent gets is a per-route product decision, and new routes are added. **`POSTMAN_MCP_MODE` is not read on any route** — never tell the user to set or unset it to change the tool set.
17
-
18
- - If MCP tools aren't available at all, follow `references/setup.md` to connect the Postman MCP Server.
19
- - If `searchLearningCenter` is missing, call `getEnabledTools` to confirm the active tool set, then split on which endpoint the route is pinned to. On a `/minimal` route it is absent by design and the user cannot change it from the client: say the Learning Center tool isn't part of that route's tool set and point them at https://learning.postman.com to search directly. On a `/mcp` route its absence is not a mode problem — the server isn't connected as configured: follow `references/setup.md` to reconnect it.
20
-
21
- Do not answer a "how do I..." question from memory when the tool is unavailable. Cite only URLs the tool returned, or send the user to the Learning Center.
19
+ If no MCP tools are available, follow `references/setup.md`. If only the learning
20
+ tool is absent, use an available web search/browser to read the official Learning
21
+ Center and cite the pages actually consulted. Without either capability, report
22
+ the limitation and link the Learning Center rather than inventing product steps.
22
23
 
23
24
  ## Workflow
24
25
 
@@ -68,6 +69,6 @@ To create a mock server in Postman:
68
69
  ## Error Handling
69
70
 
70
71
  - **MCP not configured:** Follow `references/setup.md` to connect the Postman MCP Server.
71
- - **`searchLearningCenter` unavailable:** Confirm with `getEnabledTools`. Expected on any route pinned to the `minimal` endpoint — say the tool isn't in that route's tool set and point the user at https://learning.postman.com. On a `/mcp` route: follow `references/setup.md` to reconnect it.
72
+ - **`searchLearningCenter` unavailable:** Use the toolset inspection and official-documentation fallback under Prerequisites.
72
73
  - **401 Unauthorized:** "Your Postman API key was rejected. Generate a new one at https://go.postman.co/settings/me/api-keys." Then re-authenticate with `references/setup.md`.
73
74
  - **No results:** "Nothing matched in the Learning Center. Try rephrasing with the Postman feature name, or ask about a more specific step."
@@ -1,6 +1,5 @@
1
1
  ---
2
2
  description: Create Postman mock servers for frontend development. Generates missing examples, provides integration config.
3
- allowed-tools: Bash, Read, Write, Glob, Grep, mcp__postman__getWorkspaces, mcp__postman__getCollections, mcp__postman__getCollection, mcp__postman__getCollectionRequest, mcp__postman__createCollectionResponse, mcp__postman__createSpec, mcp__postman__generateCollection, mcp__postman__getGeneratedCollectionSpecs, mcp__postman__getSpecCollections, mcp__postman__getAsyncSpecTaskStatus, mcp__postman__getMocks, mcp__postman__getMock, mcp__postman__createMock, mcp__postman__publishMock, mcp__postman__unpublishMock
4
3
  ---
5
4
 
6
5
  # Create Mock Servers
@@ -1,6 +1,5 @@
1
1
  ---
2
2
  description: Discover APIs across your Postman workspaces. Ask natural language questions about available endpoints and capabilities.
3
- allowed-tools: Read, Glob, Grep, mcp__postman__searchPostmanElements, mcp__postman__getWorkspaces, mcp__postman__getCollections, mcp__postman__getTaggedEntities, mcp__postman__getCollection, mcp__postman__getCollectionRequest, mcp__postman__getCollectionResponse, mcp__postman__getSpecDefinition
4
3
  ---
5
4
 
6
5
  # Discover APIs
@@ -1,6 +1,5 @@
1
1
  ---
2
2
  description: Security audit your APIs against OWASP API Top 10. Finds vulnerabilities and provides remediation guidance.
3
- allowed-tools: Read, Edit, Write, Glob, Grep, mcp__postman__getWorkspaces, mcp__postman__getAllSpecs, mcp__postman__getSpecDefinition, mcp__postman__getCollections, mcp__postman__getCollection, mcp__postman__getEnvironment, mcp__postman__putEnvironment, mcp__postman__updateCollectionRequest, mcp__postman__updateCollectionResponse
4
3
  ---
5
4
 
6
5
  # API Security Audit
@@ -1,6 +1,5 @@
1
1
  ---
2
2
  description: Set up Postman MCP Server. Authenticate via OAuth or API key, verify connection, select workspace.
3
- allowed-tools: mcp__postman__authenticate, mcp__postman__complete_authentication, mcp__postman__getAuthenticatedUser, mcp__postman__getWorkspaces, mcp__postman__getCollections, mcp__postman__getAllSpecs
4
3
  ---
5
4
 
6
5
  # First-Run Configuration
@@ -1,6 +1,5 @@
1
1
  ---
2
2
  description: Sync Postman collections with your API code. Create collections from specs, push updates, keep everything in sync.
3
- allowed-tools: Bash, Read, Write, Glob, Grep, mcp__postman__getWorkspaces, mcp__postman__getCollections, mcp__postman__getCollection, mcp__postman__createSpec, mcp__postman__updateSpecFile, mcp__postman__generateCollection, mcp__postman__getAsyncSpecTaskStatus, mcp__postman__getGeneratedCollectionSpecs, mcp__postman__syncCollectionWithSpec, mcp__postman__syncSpecWithCollection, mcp__postman__getCollectionUpdatesTasks, mcp__postman__createEnvironment, mcp__postman__createCollectionRequest, mcp__postman__updateCollectionRequest, mcp__postman__createCollectionFolder, mcp__postman__createCollectionResponse
4
3
  ---
5
4
 
6
5
  # Sync Collections
@@ -1,6 +1,5 @@
1
1
  ---
2
2
  description: Run Postman collection tests, analyze results, diagnose failures, and suggest fixes.
3
- allowed-tools: Bash, Read, Write, Glob, Grep, mcp__postman__getWorkspaces, mcp__postman__getCollections, mcp__postman__getCollection, mcp__postman__runCollection, mcp__postman__getEnvironments, mcp__postman__getCollectionRequest, mcp__postman__getCollectionResponse, mcp__postman__updateCollectionRequest, mcp__postman__updateCollectionResponse
4
3
  ---
5
4
 
6
5
  # Run Collection Tests
@@ -1,106 +1,63 @@
1
1
  ---
2
2
  name: variables
3
- description: How to parameterize a collection with variables and where each value belongs — a plain value goes in an environment or collection variable, a secret (token, password, API key) goes in the team's shared vault via `postman secret create` so its value never passes through the coding harness or lands in a committed file. Covers the variable scopes and their resolution order, reading and writing variables at runtime from pre-request and post-response scripts (`pm.environment`, `pm.collectionVariables`, `pm.variables`), and composing variables out of other variables. Use when the user asks where to put a base URL, token, or password, how to reference a secret without exposing it, how `{{variables}}` resolve, or how to set a value in a script. Covers `postman secret`.
3
+ description: Use when parameterizing requests across environments, choosing variable scopes, chaining values in scripts, or referencing credentials without committing or exposing them. Keeps one reusable collection while separating target configuration from secret values. Use for requests such as "where should I put this API key".
4
4
  ---
5
5
 
6
6
  # Variables
7
7
 
8
- A variable lets a request name a value — `{{base_url}}`, `{{authToken}}` —
9
- instead of hardcoding it, so one collection runs against staging and
10
- production and a secret never has to be typed into a request. The only real
11
- decision is **where the value lives**, and it turns on one question: is it a
12
- secret?
8
+ Variables let one maintained collection run against different targets without
9
+ forking its requests. Scope determines which value wins; secret references
10
+ allow the same files to be shared without sharing credential values.
11
+
12
+ 1. Put API defaults in collection variables and target-specific values, such
13
+ as `base_url`, in an environment. Parameterize values that actually vary;
14
+ a stable literal need not become another configuration choice. Reference
15
+ values as `{{key}}` in URLs, headers, parameters, or bodies.
16
+ 2. Resolve surprises through precedence: local script values override
17
+ iteration data, then environment, collection, and global values. A correct
18
+ environment file can still lose to a row or script override. Values can
19
+ reference other variables and resolve at send time, so inspect the chain
20
+ rather than just the final request field.
21
+ 3. Use runtime values for chaining responses into later requests. Choose
22
+ `pm.environment` or `pm.collectionVariables` when the scope is intentional;
23
+ `pm.variables.get` reads across scopes, and `pm.variables.set` holds a local
24
+ value for the current run. For transient sensitive values, avoid persisting
25
+ them to an environment or logging them.
26
+ 4. Store durable credentials in the shared vault and commit references.
27
+ `type: secret` alone masks the UI but still leaves a literal YAML value
28
+ readable. **collection-schema-v3**'s environment reference describes the
29
+ file schema; command-specific `-h` supplies supported vault operations.
30
+
31
+ For non-sensitive target configuration:
13
32
 
14
- ## Core foundations
15
- 1. One collection, many targets. Parameterize everything that changes between
16
- environments so the same requests run everywhere — a diff in values, not in
17
- requests.
18
- 2. Where a value lives is a security decision, not a convenience one. A plain
19
- value is a variable; a secret belongs in the vault, nowhere else.
20
- 3. A secret's value should never reach this harness, the terminal, or a
21
- committed file. `type: secret` only hides it in the UI — the value still
22
- sits in clear text in the YAML. The vault is the only place it stays out of
23
- the repo. (ref: postman secret command)
24
- 4. Resolution is narrowest-wins: `local (script) > data (iteration row) >
25
- environment > collection > global`. This is what lets a collection ship a
26
- default and an environment override just the few that differ.
27
- 5. Variables compose. A value can reference another (`usersUrl =
28
- {{base_url}}/users`), and a script can set one at runtime to chain requests
29
- (capture a token, use it on the next call). Resolution happens at send
30
- time, not at definition time.
31
-
32
- ## Non-secret variables
33
-
34
- A base URL, a non-sensitive id, a feature flag, a default page size — store it
35
- as a variable and commit it. Reference it as `{{key}}` in a URL, header, query
36
- param, or body. Scope picks the file:
37
-
38
- - **Collection variable** — travels with the collection; use it for a default
39
- that belongs to the API itself and rarely changes.
40
- - **Environment variable** — swapped per target; use it for anything that
41
- differs between staging and production. One file per environment, selected
42
- at run time.
43
-
44
-
45
- You can either directly edit into collection / environment file or use the cli commands to achieve the same.
46
33
  ```bash
47
34
  postman environment new "Staging"
48
35
  postman environment var set base_url https://staging.example.com \
49
36
  --environment "postman/environments/Staging.environment.yaml"
50
- postman environment lint postman/environments --fail-severity warning
51
37
  ```
52
38
 
53
- Set one at runtime from a script when you need to chain requests:
54
-
55
- ```javascript
56
- // post-response: capture for later requests
57
- pm.environment.set("authToken", pm.response.json().access_token);
58
- // pre-request: read it back (any scope, resolution order applies)
59
- const base = pm.variables.get("base_url");
60
- ```
61
-
62
- Use `pm.environment`/`pm.collectionVariables` to target a scope, `pm.variables`
63
- to read across all of them, and `pm.variables.set` for a local value that
64
- lives only for the current run.
65
-
66
- ## Secret keys
67
-
68
- Passport is how people, services, and agents call APIs without ever holding
69
- the secret. `postman secret` is the vault side of the same idea: it stores and
70
- links secrets without putting their values in agent context or repository
71
- files. Run `postman secret -h` for the supported vault operations and flags.
72
-
73
- A bearer token, password, API key, client secret, or signing key goes in the
74
- team's **shared vault**:
75
-
76
- ```bash
77
- # interactive masked prompt (default when stdin is a terminal)
78
- postman secret create STRIPE_API_KEY --workspace <workspaceId>
79
- ```
80
- By default only the creator of secret can view the secret. Others in workspace can resolve the secret in their runs but can not see the secret value.
81
-
82
- You then link the secret to an environment variable to use it in a request —
83
- the CLI writes the link for you from `secret create`'s output:
39
+ For a secret, have the user supply the value through the CLI's masked prompt,
40
+ not through agent context or a literal command argument:
84
41
 
85
42
  ```bash
43
+ postman secret create STRIPE_API_KEY --workspace <workspace-id>
86
44
  postman environment var set api_key --secret-id <secret-id> --vault-id <vault-id> \
87
45
  --environment "postman/environments/Staging.environment.yaml"
88
46
  ```
89
47
 
90
- The variable now points at the vault instead of holding a value; the file
91
- carries only the reference, never the secret:
92
-
93
- ```yaml
94
- values:
95
- - key: api_key
96
- enabled: true
97
- type: secret
98
- description: API key
99
- secret: true
100
- source:
101
- provider: postman
102
- postman:
103
- type: cloud
104
- secretId: <secret-id>
105
- vaultId: <vault-id>
106
- ```
48
+ The environment then carries the vault/secret IDs rather than the value.
49
+ Secret resolution and permission to view the secret are distinct; a teammate's
50
+ ability to run a request need not expose the credential to them. Use
51
+ **bootstrap** when the vault operation needs unresolved authentication.
52
+
53
+ ## Verification
54
+
55
+ Run `postman environment lint <path> --fail-severity warning` to fail on
56
+ warnings as well as errors in the saved environment. Lint checks the artifact;
57
+ it does not prove that the session can resolve a vault secret. Verify resolution
58
+ with an appropriate authenticated request and a contract-derived assertion,
59
+ keeping credentials out of output. An unresolved-reference or authorization
60
+ failure needs investigation, not a claim that the secret worked.
61
+ Report the selected environment and scope
62
+ or reference that supplies the value; a masked display alone does not prove
63
+ that the committed file contains no literal secret.