@postman/postman-plugin 0.1.1-rc.0 → 0.1.2-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.
- package/README.md +14 -2
- package/dist/cli.js +7 -1
- package/dist/hosts/index.js +2 -1
- package/dist/hosts/kimi.js +5 -2
- package/dist/hosts/pi.js +84 -0
- package/dist/pi-extension.js +27 -0
- package/dist/run.js +16 -10
- package/dist/source.js +3 -1
- package/hooks/session-start-context.md +11 -0
- package/mcp.pi.json +14 -0
- package/package.json +21 -6
- package/skills/ai-readiness/SKILL.md +50 -0
- package/skills/api-discovery/SKILL.md +135 -0
- package/skills/api-discovery/reference/orbit.md +101 -0
- package/skills/api-documentation/SKILL.md +34 -0
- package/skills/api-documentation/reference/rest-api-best-practices.md +47 -0
- package/skills/api-engineer/SKILL.md +29 -0
- package/skills/api-mocking/SKILL.md +141 -0
- package/skills/api-monitoring/SKILL.md +137 -0
- package/skills/api-testing/SKILL.md +103 -0
- package/skills/bootstrap/SKILL.md +216 -0
- package/skills/bootstrap/reference/cli_installation.md +58 -0
- package/skills/ci-integration/SKILL.md +121 -0
- package/skills/collection-schema-v3/SKILL.md +210 -0
- package/skills/collection-schema-v3/reference/environment.md +63 -0
- package/skills/collection-schema-v3/reference/other_protocols.md +86 -0
- package/skills/datasets/SKILL.md +323 -0
- package/skills/flows/SKILL.md +212 -0
- package/skills/flows/reference/flow_cli_flags.md +111 -0
- package/skills/performance-testing/SKILL.md +71 -0
- package/skills/postman-mcp-server/SKILL.md +71 -0
- package/skills/postman-mcp-server/references/docs.md +88 -0
- package/skills/postman-mcp-server/references/learn.md +73 -0
- package/skills/postman-mcp-server/references/mcp-limitations.md +38 -0
- package/skills/postman-mcp-server/references/mock.md +101 -0
- package/skills/postman-mcp-server/references/search.md +83 -0
- package/skills/postman-mcp-server/references/security.md +129 -0
- package/skills/postman-mcp-server/references/setup.md +141 -0
- package/skills/postman-mcp-server/references/sync.md +85 -0
- package/skills/postman-mcp-server/references/test.md +84 -0
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
# Flows CLI Flags
|
|
2
|
+
|
|
3
|
+
Captured from `postman flows <subcommand> -h` and verified on CLI
|
|
4
|
+
**1.58.0**. Live `-h` output is authoritative over this file — re-run it if
|
|
5
|
+
the installed CLI is newer, since `flows` is an actively changing surface.
|
|
6
|
+
|
|
7
|
+
Every subcommand below also accepts `--verbose`, `--debug`, and `--json`.
|
|
8
|
+
|
|
9
|
+
**Short flags are not stable across subcommands.** `-f` is `--filter` on
|
|
10
|
+
`list`, `--input-file` on `trigger` and `run`, and `--flow` on `list-runs`;
|
|
11
|
+
`-r` is `--result` on `trigger`, `--range` on `list-runs`, and `--run-id` on
|
|
12
|
+
`get-run`; `-t` is `--timeout` on `deploy` but `--trigger` on `update`. Read
|
|
13
|
+
the table for the subcommand you are actually invoking, and prefer the long
|
|
14
|
+
form when composing a command from more than one table.
|
|
15
|
+
|
|
16
|
+
## `flows list`
|
|
17
|
+
|
|
18
|
+
| Flag | Notes |
|
|
19
|
+
| --- | --- |
|
|
20
|
+
| `-w, --workspace <workspaceId>` | **Required** — the CLI exits 1 with `required option '-w, --workspace <workspaceId>' not specified`. |
|
|
21
|
+
| `-f, --filter <pattern>` | Name prefix **or** regex, e.g. `--filter "^Test.*"`. |
|
|
22
|
+
| `-s, --sort <criteria>` | `name` or `updated`. Default `updated`. |
|
|
23
|
+
| `-p, --paginate` | Page through all flows. |
|
|
24
|
+
|
|
25
|
+
## `flows trigger <flowId>`
|
|
26
|
+
|
|
27
|
+
| Flag | Notes |
|
|
28
|
+
| --- | --- |
|
|
29
|
+
| `-i, --input <key=value>` | Repeatable. Trigger payload values. |
|
|
30
|
+
| `-f, --input-file <path.json>` | Repeatable. Payload from JSON files. Combines with `-i`, which overrides. |
|
|
31
|
+
| `-q, --query <key=value>` | Repeatable. Query parameters. |
|
|
32
|
+
| `--headers <key=value>` | Repeatable. Custom headers. |
|
|
33
|
+
| `-s, --scenario <name>` | Named scenario from the flow definition; builds payload, headers and query. **`--headers` and `--query` override it.** |
|
|
34
|
+
| `-n, --dry-run` | Print request URL + payload, send nothing. |
|
|
35
|
+
| `--show-secrets` | Unmask auth tokens in dry-run output. Masked by default. |
|
|
36
|
+
| `-r, --result` | Print only the response body. |
|
|
37
|
+
|
|
38
|
+
## `flows deploy <flowId>`
|
|
39
|
+
|
|
40
|
+
| Flag | Notes |
|
|
41
|
+
| --- | --- |
|
|
42
|
+
| `-p, --path <path>` | **Required** — `-h` carries no `(required)` annotation, but omitting it exits 1. A suffix appended to a generated base URL, e.g. `/my-trigger`. |
|
|
43
|
+
| `-t, --timeout <timeout>` | HTTP session timeout, **5000ms–60000ms**, default `"10000ms"`. Value carries units — `5000ms`, not `5000`. |
|
|
44
|
+
| `-a, --auth` | Boolean switch. Enables auth on the trigger. Default off. |
|
|
45
|
+
|
|
46
|
+
Note the asymmetry with `update`: here `--auth` is a bare flag; on `update` it
|
|
47
|
+
takes `on|off`.
|
|
48
|
+
|
|
49
|
+
## `flows update <flowId>`
|
|
50
|
+
|
|
51
|
+
| Flag | Notes |
|
|
52
|
+
| --- | --- |
|
|
53
|
+
| `-t, --trigger <on\|off>` | Enable/disable the trigger. Takes an explicit value. |
|
|
54
|
+
| `-a, --auth <on\|off>` | Enable/disable authentication on the trigger. Takes an explicit value. |
|
|
55
|
+
|
|
56
|
+
**At least one of the two is required**: a bare `flows update <flowId>` exits 1
|
|
57
|
+
with `Invalid command parameters: trigger: At least one option is required:
|
|
58
|
+
--trigger or --auth`.
|
|
59
|
+
|
|
60
|
+
Both are mutating and confirmation-gated. `--auth off` strips authentication
|
|
61
|
+
from a live trigger — never run it as a convenience.
|
|
62
|
+
|
|
63
|
+
## `flows run <path>`
|
|
64
|
+
|
|
65
|
+
Runs a flow **file** locally — documented as available on Postman **Enterprise**
|
|
66
|
+
plans, and requires `postman login`. Inputs work as on `trigger`; the rest is
|
|
67
|
+
execution and reporting. Takes the path positionally; a bad path fails with
|
|
68
|
+
`Error: Flow file not found: <path>` and exit 1.
|
|
69
|
+
|
|
70
|
+
| Flag | Notes |
|
|
71
|
+
| --- | --- |
|
|
72
|
+
| `-i, --input <key=value>` | Repeatable. |
|
|
73
|
+
| `-f, --input-file <path.json>` | Repeatable. |
|
|
74
|
+
| `-s, --scenario <name>` | Pre-built scenario as inputs; `-i`/`-f` override values. |
|
|
75
|
+
| `-e, --environment <path>` | Postman environment file, JSON or YAML. |
|
|
76
|
+
| `--working-dir <path>` | Working directory for the run. |
|
|
77
|
+
| `--workspace <workspaceId>` | **Required for flows containing connector blocks.** |
|
|
78
|
+
| `--output <format>` | Save execution result to file. `json` only. |
|
|
79
|
+
| `--reporters <format>` | Save a test results report. `html` only. |
|
|
80
|
+
| `-x, --suppress-exit-code` | Overrides the run's exit code. Defeats CI gating. |
|
|
81
|
+
| `--verbose` | Per-request detail: method, URL, assertions. |
|
|
82
|
+
| `--no-truncate` | Full output, no truncated long values. |
|
|
83
|
+
| `--no-report-events` | Don't send analytics. `--report-events` exists for compatibility; analytics are on by default. |
|
|
84
|
+
|
|
85
|
+
### BETA: dataset iteration
|
|
86
|
+
|
|
87
|
+
Runs the flow once per row of a dataset view. All three are marked `[BETA]` in
|
|
88
|
+
the CLI's own help — confirm against live `-h` before relying on them.
|
|
89
|
+
|
|
90
|
+
| Flag | Notes |
|
|
91
|
+
| --- | --- |
|
|
92
|
+
| `--iteration-data-dataset <pathOrId>` | Local `.dataset.yaml` path or a cloud dataset id (cloud requires login). **Requires `--iteration-data-view`.** |
|
|
93
|
+
| `--iteration-data-view <nameOrId>` | The view within that dataset whose rows drive the run. |
|
|
94
|
+
| `-m, --map-column <input=column>` | Repeatable. Binds a flow input to a dataset column. Inputs whose name already matches a column bind automatically, so only map the mismatches. |
|
|
95
|
+
| `--no-insecure-file-read` | Blocks reading dataset files outside the working directory. |
|
|
96
|
+
|
|
97
|
+
## `flows list-runs`
|
|
98
|
+
|
|
99
|
+
| Flag | Notes |
|
|
100
|
+
| --- | --- |
|
|
101
|
+
| `-w, --workspace <workspaceId>` | **Required**, same as on `list`. |
|
|
102
|
+
| `-f, --flow <flowId>` | Filter sessions to one flow. |
|
|
103
|
+
| `-r, --range <range>` | Time range, e.g. `30m`, `2h`, `3d`. **Default `1h`** — widen it before concluding a run is missing. |
|
|
104
|
+
|
|
105
|
+
## `flows get-run`
|
|
106
|
+
|
|
107
|
+
| Flag | Notes |
|
|
108
|
+
| --- | --- |
|
|
109
|
+
| `-r, --run-id <runId>` | **Required.** The id `trigger` or `list-runs` reported. Shapes vary across Postman's own material (`session-abc123`, `main/1a123ab1`) — pass it verbatim rather than reformatting. |
|
|
110
|
+
| `-l, --logs` | Detailed event log. Off by default. |
|
|
111
|
+
| `--filter <blockId>` | Repeatable. Matches a block ID **prefix**, not an exact id. |
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: performance-testing
|
|
3
|
+
description: Load-tests a collection with concurrent virtual users, a chosen load profile, and pass/fail thresholds on latency or error rate — run locally or on Postman's cloud runners. Use when the user asks to "load test this API," "run a performance test," "check how this holds up under load," or "benchmark this collection." Covers `postman performance run`. This generates real traffic against a real target — confirm the target and scale before running, the same way any action with effects outside this session gets confirmed.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Performance Testing
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
`performance run <collectionId>` is not `collection run` with more
|
|
11
|
+
iterations — it's a dedicated load-test mode: many virtual users hitting the
|
|
12
|
+
collection concurrently for a set duration, shaped by a load profile, scored
|
|
13
|
+
against thresholds you define, on infrastructure you choose. The collection
|
|
14
|
+
under test is authored the normal way — see the `collection-schema-v3` skill
|
|
15
|
+
if it needs edits before the load test is meaningful (e.g. an assertion
|
|
16
|
+
that would fail every VU's request identically).
|
|
17
|
+
|
|
18
|
+
## Core knowledge
|
|
19
|
+
|
|
20
|
+
- **Load profile is what you're actually testing.** `fixed` holds steady
|
|
21
|
+
concurrency (does this hold up at N users, sustained); `ramp-up` increases
|
|
22
|
+
gradually (where does it start to degrade); `spike` bursts suddenly (does
|
|
23
|
+
a sudden surge break it); `peak` sustains near-maximum load (does it
|
|
24
|
+
survive staying there). Pick based on the failure mode being probed, not
|
|
25
|
+
by default.
|
|
26
|
+
- **`--runner` chooses where load originates.** `local` runs from the
|
|
27
|
+
current machine/CI runner — bounded by its own resources, fine for
|
|
28
|
+
internal or low-scale targets. `postman-cloud` runs from Postman's
|
|
29
|
+
infrastructure — needed for realistic external-scale load, or once local
|
|
30
|
+
resources would cap the achievable VU count. `postman-cloud-static-ip`
|
|
31
|
+
is the same, from a static-IP range — needed when the target allowlists
|
|
32
|
+
by IP.
|
|
33
|
+
- **`--pass-if "less_than(p95, 500)"` turns a load test into a gate.**
|
|
34
|
+
Metrics: `avg`, `p90`, `p95`, `p99`, `error_rate`, `rps`. Checked after the
|
|
35
|
+
run completes, not enforced live — a bad configuration still generates its
|
|
36
|
+
full load before the gate fails.
|
|
37
|
+
- **`--use-mock` points the test at a mock instead of a real backend** — for
|
|
38
|
+
load-testing collection/script logic itself, or to baseline mock-only
|
|
39
|
+
latency and isolate app/network slowness from what the mock adds.
|
|
40
|
+
- **`--setup-collection`/`--teardown-collection`** (cloud runner only) run
|
|
41
|
+
once before/after the whole test — for provisioning or cleanup, not
|
|
42
|
+
per-iteration setup.
|
|
43
|
+
- **`--dataset-id`/`--dataset-view-id`** drive iteration data from a Postman
|
|
44
|
+
Dataset instead of a flat `--data-file`; `--dataset-distribution` controls
|
|
45
|
+
whether rows are spread round-robin, fixed, or randomly across VUs.
|
|
46
|
+
|
|
47
|
+
## Critical Rules
|
|
48
|
+
|
|
49
|
+
1. **Running this against a real, non-mock backend generates real load with
|
|
50
|
+
real consequences — confirm the target, VU count, and duration with the
|
|
51
|
+
user before running,** the same way any action with effects outside this
|
|
52
|
+
session gets confirmed. Default to a low `--vu-count` and short
|
|
53
|
+
`--duration` for a first run against anything live, or point it at a mock
|
|
54
|
+
(`--use-mock`) when the goal is testing the collection, not the backend.
|
|
55
|
+
2. **A `--pass-if` gate doesn't stop the load early.** The full VU count and
|
|
56
|
+
duration run regardless of whether the threshold will ultimately pass —
|
|
57
|
+
plan for that cost, don't assume a failing gate means less traffic was
|
|
58
|
+
sent.
|
|
59
|
+
3. **Cloud runners come from Postman's IP ranges.** Before assuming a
|
|
60
|
+
`postman-cloud` run will reach a target, check whether it's IP-allowlisted
|
|
61
|
+
— use `postman-cloud-static-ip` if so, rather than discovering the
|
|
62
|
+
mismatch as a wall of connection failures.
|
|
63
|
+
|
|
64
|
+
## Verification
|
|
65
|
+
|
|
66
|
+
State the actual metrics the run produced (p95, error rate, rps — whatever
|
|
67
|
+
the `--pass-if` checked, plus the ones it didn't) and whether the gate
|
|
68
|
+
passed, not just that the run completed. State which runner actually
|
|
69
|
+
executed it (`local`/`postman-cloud`/`postman-cloud-static-ip`) — that
|
|
70
|
+
determines whether the numbers reflect the target's real-world reachability
|
|
71
|
+
or only local-network conditions.
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
---
|
|
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
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Postman Knowledge
|
|
8
|
+
|
|
9
|
+
Reference for Postman concepts and MCP tool selection. Use this context when working with Postman MCP tools to make better decisions.
|
|
10
|
+
|
|
11
|
+
See `references/setup.md` for how to to setup postman mcp server and auth.
|
|
12
|
+
|
|
13
|
+
## Core Concepts
|
|
14
|
+
|
|
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.
|
|
25
|
+
|
|
26
|
+
## Decision Guide
|
|
27
|
+
|
|
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) |
|
|
38
|
+
|
|
39
|
+
## MCP Tool Selection
|
|
40
|
+
|
|
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.
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
---
|
|
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
|
+
---
|
|
5
|
+
|
|
6
|
+
# API Documentation
|
|
7
|
+
|
|
8
|
+
Analyze, improve, and publish API documentation from OpenAPI specs and Postman collections.
|
|
9
|
+
|
|
10
|
+
## Prerequisites
|
|
11
|
+
|
|
12
|
+
The Postman MCP Server must be connected for Postman operations. Local spec analysis works without MCP. If needed, tell the user: "Run `/postman:setup` to configure the Postman MCP Server."
|
|
13
|
+
|
|
14
|
+
## Workflow
|
|
15
|
+
|
|
16
|
+
### Step 1: Find the Source
|
|
17
|
+
|
|
18
|
+
Call `getWorkspaces` to get the user's workspace ID. If multiple workspaces exist, ask which to use.
|
|
19
|
+
|
|
20
|
+
Check for API definitions in this order:
|
|
21
|
+
|
|
22
|
+
**Local specs:**
|
|
23
|
+
- Search for `**/openapi.{json,yaml,yml}`, `**/swagger.{json,yaml,yml}`
|
|
24
|
+
|
|
25
|
+
**Postman specs:**
|
|
26
|
+
- Call `getAllSpecs` with the workspace ID to find specs in Postman
|
|
27
|
+
- Call `getSpecDefinition` to pull the full spec
|
|
28
|
+
|
|
29
|
+
**Postman collections:**
|
|
30
|
+
- Call `getCollections` with the `workspace` parameter
|
|
31
|
+
- Call `getCollection` for full detail
|
|
32
|
+
|
|
33
|
+
### Step 2: Analyze Documentation Completeness
|
|
34
|
+
|
|
35
|
+
Read the spec/collection and assess:
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
Documentation Coverage: 60%
|
|
39
|
+
Endpoints with descriptions: 8/15
|
|
40
|
+
Parameters with descriptions: 22/45
|
|
41
|
+
Endpoints with examples: 3/15
|
|
42
|
+
Error responses documented: 2/15
|
|
43
|
+
Authentication documented: Yes
|
|
44
|
+
Rate limits documented: No
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### Step 3: Generate or Improve
|
|
48
|
+
|
|
49
|
+
**Sparse spec:** Generate documentation for each endpoint:
|
|
50
|
+
- Operation summary and description
|
|
51
|
+
- Parameter table (name, type, required, description)
|
|
52
|
+
- Request body schema with examples
|
|
53
|
+
- Response schemas with examples for each status code
|
|
54
|
+
- Error response documentation
|
|
55
|
+
- Authentication requirements per endpoint
|
|
56
|
+
|
|
57
|
+
**Partial spec:** Fill the gaps:
|
|
58
|
+
- Add missing descriptions (infer from naming and schemas)
|
|
59
|
+
- Generate realistic examples from schemas
|
|
60
|
+
- Add error responses
|
|
61
|
+
- Document authentication and rate limits
|
|
62
|
+
|
|
63
|
+
### Step 4: Apply Changes
|
|
64
|
+
|
|
65
|
+
Ask the user which output they want:
|
|
66
|
+
|
|
67
|
+
1. **Update the spec file** - Write improved docs back into the OpenAPI spec
|
|
68
|
+
2. **Update in Postman** - Use `updateCollectionRequest` to add descriptions and examples to each request
|
|
69
|
+
3. **Publish public docs** - Call `publishDocumentation` with:
|
|
70
|
+
- `collectionId`: the collection's unique ID
|
|
71
|
+
- `customColor` and `customization` for branding
|
|
72
|
+
- Returns a public URL for the docs
|
|
73
|
+
- To unpublish later, call `unpublishDocumentation` with the collection ID
|
|
74
|
+
4. **Generate markdown** - Create a `docs/api-reference.md` file for the project
|
|
75
|
+
|
|
76
|
+
### Step 5: Sync Spec and Collection
|
|
77
|
+
|
|
78
|
+
If both a spec and collection exist, keep them in sync:
|
|
79
|
+
- Call `syncCollectionWithSpec` to update collection from spec. **Async (HTTP 202).** Poll `getCollectionUpdatesTasks` for completion with increasing waits between polls. Only supports OpenAPI 3.0.
|
|
80
|
+
- Or call `syncSpecWithCollection` to update spec from collection changes.
|
|
81
|
+
|
|
82
|
+
## Error Handling
|
|
83
|
+
|
|
84
|
+
- **MCP not configured:** Local markdown docs can be generated without MCP. For Postman publishing: "Run `/postman:setup` to configure the Postman MCP Server."
|
|
85
|
+
- **401 Unauthorized:** "Your Postman API key was rejected. Generate a new one at https://go.postman.co/settings/me/api-keys and run `/postman:setup`."
|
|
86
|
+
- **Invalid spec:** Report parse errors and offer to fix common YAML/JSON syntax issues.
|
|
87
|
+
- **Plan limitations:** "Publishing documentation may require a paid Postman plan. Check https://www.postman.com/pricing/"
|
|
88
|
+
- **Too many results:** Ask the user to specify a collection by name.
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
---
|
|
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
|
+
---
|
|
5
|
+
|
|
6
|
+
# Learn Postman
|
|
7
|
+
|
|
8
|
+
Answer "how do I..." questions about the Postman product by searching the official Postman Learning Center (https://learning.postman.com). Explain features, walk through workflows, and cite authoritative sources.
|
|
9
|
+
|
|
10
|
+
Use this to learn *about Postman itself* — not to search the user's own collections, workspaces, or specs (that's `/postman:search`).
|
|
11
|
+
|
|
12
|
+
## Prerequisites
|
|
13
|
+
|
|
14
|
+
This command uses `searchLearningCenter`, which the Postman MCP Server exposes only in **Full mode**.
|
|
15
|
+
|
|
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, tell the user: "Run `/postman:setup` to configure 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: "Run `/postman:setup` to configure the Postman MCP Server."
|
|
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.
|
|
22
|
+
|
|
23
|
+
## Workflow
|
|
24
|
+
|
|
25
|
+
### Step 1: Search
|
|
26
|
+
|
|
27
|
+
Call `searchLearningCenter` with a focused `query` derived from the user's question. Prefer the product vocabulary from `postman-mcp-server` (mock server, environment, monitor, collection variable, etc.) over the user's exact phrasing.
|
|
28
|
+
|
|
29
|
+
- Turn a broad request into a specific query — "how to create a mock server", "write a test script", "set a collection variable", "schedule a monitor".
|
|
30
|
+
- If results are thin or off-target, refine: try a different feature term, split a multi-part question into separate searches, or broaden a narrow query.
|
|
31
|
+
|
|
32
|
+
### Step 2: Synthesize
|
|
33
|
+
|
|
34
|
+
Read the returned passages and compose a direct answer to the user's question. Do not just dump raw results.
|
|
35
|
+
|
|
36
|
+
- Lead with the answer or the concrete steps.
|
|
37
|
+
- Keep steps in the order the user would perform them.
|
|
38
|
+
- If the docs reveal a better or officially recommended workflow than what the user asked, surface it.
|
|
39
|
+
- Always cite the source URLs the tool returns so the user can read more.
|
|
40
|
+
|
|
41
|
+
### Step 3: Connect to the Plugin
|
|
42
|
+
|
|
43
|
+
When a workflow maps to a plugin command, point the user there so they can act immediately:
|
|
44
|
+
|
|
45
|
+
- Creating/updating collections from a spec → `/postman:sync`
|
|
46
|
+
- Finding APIs in their org or the public network → `/postman:search`
|
|
47
|
+
- Running collection tests → `/postman:test`
|
|
48
|
+
- Creating mock servers → `/postman:mock`
|
|
49
|
+
- Generating or publishing docs → `/postman:docs`
|
|
50
|
+
- Security auditing → `/postman:security`
|
|
51
|
+
|
|
52
|
+
## Output
|
|
53
|
+
|
|
54
|
+
```
|
|
55
|
+
To create a mock server in Postman:
|
|
56
|
+
|
|
57
|
+
1. Open the collection you want to mock (it needs saved example responses).
|
|
58
|
+
2. Select the collection → "Mock collection".
|
|
59
|
+
3. Name the mock, pick an environment, and choose visibility.
|
|
60
|
+
4. Postman returns a mock URL that serves your examples.
|
|
61
|
+
|
|
62
|
+
Mock servers read from saved examples, so add examples first if you
|
|
63
|
+
have none — the plugin can do this for you via /postman:mock.
|
|
64
|
+
|
|
65
|
+
Source: https://learning.postman.com/docs/design-apis/mock-apis/set-up-mock-servers/
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Error Handling
|
|
69
|
+
|
|
70
|
+
- **MCP not configured:** "Run `/postman:setup` to configure 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: "Run `/postman:setup` to configure the Postman MCP Server."
|
|
72
|
+
- **401 Unauthorized:** "Your Postman API key was rejected. Generate a new one at https://go.postman.co/settings/me/api-keys and run `/postman:setup`."
|
|
73
|
+
- **No results:** "Nothing matched in the Learning Center. Try rephrasing with the Postman feature name, or ask about a more specific step."
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Known MCP Limitations
|
|
2
|
+
|
|
3
|
+
These limitations are documented so they are handled correctly in all commands and workflows.
|
|
4
|
+
|
|
5
|
+
## generateCollection is Async
|
|
6
|
+
|
|
7
|
+
`generateCollection` returns HTTP 202 (accepted), not the collection directly.
|
|
8
|
+
|
|
9
|
+
**Workaround:** Poll `getGeneratedCollectionSpecs` or `getSpecCollections` for completion. Note: `getAsyncSpecTaskStatus` may return 403 on some plans; use the alternatives.
|
|
10
|
+
|
|
11
|
+
## syncCollectionWithSpec is Async and OpenAPI 3.0 Only
|
|
12
|
+
|
|
13
|
+
`syncCollectionWithSpec` returns HTTP 202 and only supports OpenAPI 3.0 specifications.
|
|
14
|
+
|
|
15
|
+
**Workaround for async:** Poll `getCollectionUpdatesTasks` for completion.
|
|
16
|
+
|
|
17
|
+
**Workaround for non-3.0 specs:** For Swagger 2.0 or OpenAPI 3.1 specs, use `updateSpecFile` to update the spec and regenerate the collection with `generateCollection`.
|
|
18
|
+
|
|
19
|
+
## createCollection Cannot Nest Folders
|
|
20
|
+
|
|
21
|
+
`createCollection` creates a flat collection. You cannot nest folders in a single call.
|
|
22
|
+
|
|
23
|
+
**Workaround:** Decompose the operation:
|
|
24
|
+
1. `createCollection` to create the collection
|
|
25
|
+
2. `createCollectionFolder` to add folders
|
|
26
|
+
3. `createCollectionRequest` to add requests to folders
|
|
27
|
+
|
|
28
|
+
## putCollection Auth Enum Lacks "noauth"
|
|
29
|
+
|
|
30
|
+
The `putCollection` auth type enum does not include "noauth" as a valid value.
|
|
31
|
+
|
|
32
|
+
**Workaround:** Endpoints that need no auth should inherit from collection-level settings or use a different auth type as a placeholder.
|
|
33
|
+
|
|
34
|
+
## createSpec Impractical for Large Specs
|
|
35
|
+
|
|
36
|
+
`createSpec` struggles with specs larger than ~50KB due to request size limits.
|
|
37
|
+
|
|
38
|
+
**Workaround:** For large APIs, parse the spec locally and create collection items directly using `createCollection` + `createCollectionFolder` + `createCollectionRequest` + `createCollectionResponse`.
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
---
|
|
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
|
+
---
|
|
5
|
+
|
|
6
|
+
# Create Mock Servers
|
|
7
|
+
|
|
8
|
+
Spin up a Postman mock server from a collection or spec. Get a working mock URL for frontend development, integration testing, or demos.
|
|
9
|
+
|
|
10
|
+
## Prerequisites
|
|
11
|
+
|
|
12
|
+
The Postman MCP Server must be connected. If MCP tools aren't available, tell the user: "Run `/postman:setup` to configure the Postman MCP Server."
|
|
13
|
+
|
|
14
|
+
## Workflow
|
|
15
|
+
|
|
16
|
+
### Step 1: Find the Source
|
|
17
|
+
|
|
18
|
+
Call `getWorkspaces` to get the user's workspace ID. If multiple workspaces exist, ask which to use.
|
|
19
|
+
|
|
20
|
+
**From existing collection:**
|
|
21
|
+
- Call `getCollections` with the `workspace` parameter
|
|
22
|
+
- Select the target collection
|
|
23
|
+
|
|
24
|
+
**From local spec:**
|
|
25
|
+
- Find OpenAPI spec in the project
|
|
26
|
+
- Import it first:
|
|
27
|
+
1. Call `createSpec` with `workspaceId`, `name`, `type`, and `files`
|
|
28
|
+
2. Call `generateCollection`. **Async (HTTP 202).** Poll `getGeneratedCollectionSpecs` or `getSpecCollections` for completion, with increasing waits between polls (2s, 4s, 8s). Note: `getAsyncSpecTaskStatus` may return 403 on some plans.
|
|
29
|
+
|
|
30
|
+
### Step 2: Check for Examples
|
|
31
|
+
|
|
32
|
+
Mock servers serve example responses. Call `getCollection` and check if requests have saved responses.
|
|
33
|
+
|
|
34
|
+
If examples are missing:
|
|
35
|
+
```
|
|
36
|
+
Your collection doesn't have response examples. Mock servers need
|
|
37
|
+
these to know what to return.
|
|
38
|
+
|
|
39
|
+
Generating realistic examples from your schemas...
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
For each request without examples:
|
|
43
|
+
1. Call `getCollectionRequest` to get the schema
|
|
44
|
+
2. Generate a realistic example response from the schema
|
|
45
|
+
3. Call `createCollectionResponse` to save the example
|
|
46
|
+
|
|
47
|
+
### Step 3: Check for Existing Mocks
|
|
48
|
+
|
|
49
|
+
Before creating a new mock, call `getMocks` to check if one already exists for this collection. If found, call `getMock` to get its URL and present it. Only create a new mock if none exists or the user explicitly wants a new one.
|
|
50
|
+
|
|
51
|
+
### Step 4: Create Mock Server
|
|
52
|
+
|
|
53
|
+
Call `createMock` with:
|
|
54
|
+
- Workspace ID
|
|
55
|
+
- Collection UID in `ownerId-collectionId` format (from `getCollection` response's `uid` field)
|
|
56
|
+
- Environment ID (if applicable)
|
|
57
|
+
- Name: `<api-name> Mock`
|
|
58
|
+
- Private: false (or true if user prefers)
|
|
59
|
+
|
|
60
|
+
### Step 5: Present Mock URL
|
|
61
|
+
|
|
62
|
+
```
|
|
63
|
+
Mock server created: "Pet Store API Mock"
|
|
64
|
+
URL: https://<mock-id>.mock.pstmn.io
|
|
65
|
+
Status: Active
|
|
66
|
+
|
|
67
|
+
Try it:
|
|
68
|
+
curl https://<mock-id>.mock.pstmn.io/pets
|
|
69
|
+
curl https://<mock-id>.mock.pstmn.io/pets/1
|
|
70
|
+
curl -X POST https://<mock-id>.mock.pstmn.io/pets -d '{"name":"Buddy"}'
|
|
71
|
+
|
|
72
|
+
The mock serves example responses from your collection.
|
|
73
|
+
Update examples in Postman to change mock behavior.
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### Step 6: Integration
|
|
77
|
+
|
|
78
|
+
```
|
|
79
|
+
Quick integration:
|
|
80
|
+
|
|
81
|
+
# Add to your project .env
|
|
82
|
+
API_BASE_URL=https://<mock-id>.mock.pstmn.io
|
|
83
|
+
|
|
84
|
+
# Or in your frontend config
|
|
85
|
+
const API_URL = process.env.API_BASE_URL || 'https://<mock-id>.mock.pstmn.io';
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### Step 7: Publish (optional)
|
|
89
|
+
|
|
90
|
+
If the user wants the mock publicly accessible:
|
|
91
|
+
- Call `publishMock` to make it available without authentication
|
|
92
|
+
- Useful for demos, hackathons, or public documentation
|
|
93
|
+
- Call `unpublishMock` to make it private again
|
|
94
|
+
|
|
95
|
+
## Error Handling
|
|
96
|
+
|
|
97
|
+
- **MCP not configured:** "Run `/postman:setup` to configure the Postman MCP Server."
|
|
98
|
+
- **No examples in collection:** Auto-generate from schemas (Step 2). If no schemas either, ask the user to provide sample responses.
|
|
99
|
+
- **401 Unauthorized:** "Your Postman API key was rejected. Generate a new one at https://go.postman.co/settings/me/api-keys and run `/postman:setup`."
|
|
100
|
+
- **MCP timeout:** Retry once. If it still fails, check https://status.postman.com for outages.
|
|
101
|
+
- **Plan limitations:** "Mock server creation may require a Postman Basic plan or higher for increased usage limits."
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
---
|
|
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
|
+
---
|
|
5
|
+
|
|
6
|
+
# Discover APIs
|
|
7
|
+
|
|
8
|
+
Answer natural language questions about available APIs across Postman workspaces. Find endpoints, check response shapes, and understand what's available.
|
|
9
|
+
|
|
10
|
+
## Prerequisites
|
|
11
|
+
|
|
12
|
+
The Postman MCP Server must be connected. If MCP tools aren't available, tell the user: "Run `/postman:setup` to configure the Postman MCP Server."
|
|
13
|
+
|
|
14
|
+
## Workflow
|
|
15
|
+
|
|
16
|
+
### Step 1: Search
|
|
17
|
+
|
|
18
|
+
Use the unified `searchPostmanElements` tool. It can search across various entity types like requests, collections, workspaces, specs, flows, environments and mocks. Choose `entityType`, `ownership`, and `filters` based on the user's intent.
|
|
19
|
+
|
|
20
|
+
1. Call `searchPostmanElements` with the user's query. Pick the parameters from the user's intent:
|
|
21
|
+
- `entityType`: `requests` (default), `collections`, `workspaces`, `specs`, or `flows`.
|
|
22
|
+
- `ownership`: `organization` (default — your org's resources), `external` (public Postman network, third-party APIs), or `all` (both).
|
|
23
|
+
- `filters`: Optional structured `$and` expression to narrow results — e.g., restrict to the Private API Network, a workspace, or HTTP method.
|
|
24
|
+
2. If results are sparse, broaden the search — widen `ownership` to `all`, drop or relax filters, or try a different `entityType`. You can also fall back to `getWorkspaces` + `getCollections` for browsing, or `getTaggedEntities` to find collections by tag.
|
|
25
|
+
|
|
26
|
+
**Filter examples:**
|
|
27
|
+
|
|
28
|
+
- Search only the trusted Private API Network: `ownership: organization` with `filters: {"$and":[{"privateNetwork":{"$eq":true}}]}`
|
|
29
|
+
- Find a third-party public API (e.g. "Stripe API"): `ownership: external` with `filters: {"$and":[{"visibility":{"$eq":"public"}}]}`
|
|
30
|
+
- Restrict to a specific workspace: `filters: {"$and":[{"workspaceId":{"$eq":"ws-abc123"}}]}`
|
|
31
|
+
- GET requests only: `entityType: requests` with `filters: {"$and":[{"method":{"$eq":"GET"}}]}`
|
|
32
|
+
|
|
33
|
+
### Step 2: Drill Into Results
|
|
34
|
+
|
|
35
|
+
For each relevant hit:
|
|
36
|
+
1. Call `getCollection` to get the overview
|
|
37
|
+
2. Scan endpoint names and descriptions for relevance
|
|
38
|
+
3. Call `getCollectionRequest` for the most relevant endpoints
|
|
39
|
+
4. Call `getCollectionResponse` to show what data is available
|
|
40
|
+
5. Call `getSpecDefinition` if a linked spec exists for richer detail
|
|
41
|
+
|
|
42
|
+
### Step 3: Present
|
|
43
|
+
|
|
44
|
+
Format results as a clear answer to the user's question.
|
|
45
|
+
|
|
46
|
+
**When found:**
|
|
47
|
+
```
|
|
48
|
+
Yes, you can get a user's email via the API.
|
|
49
|
+
|
|
50
|
+
Endpoint: GET /users/{id}
|
|
51
|
+
Collection: "User Management API"
|
|
52
|
+
Auth: Bearer token required
|
|
53
|
+
|
|
54
|
+
Response includes:
|
|
55
|
+
{
|
|
56
|
+
"id": "usr_123",
|
|
57
|
+
"email": "jane@example.com",
|
|
58
|
+
"name": "Jane Smith",
|
|
59
|
+
"role": "admin"
|
|
60
|
+
}
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
**When not found:**
|
|
64
|
+
```
|
|
65
|
+
No endpoint returns user emails.
|
|
66
|
+
|
|
67
|
+
Closest matches:
|
|
68
|
+
- GET /users/{id}/profile — returns name, avatar (no email)
|
|
69
|
+
- GET /users — list view doesn't include email
|
|
70
|
+
|
|
71
|
+
The email field might require a different permission scope,
|
|
72
|
+
or it may not be exposed via API yet.
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
**When multiple results:**
|
|
76
|
+
List relevant collections with endpoint counts, then ask which to explore further.
|
|
77
|
+
|
|
78
|
+
## Error Handling
|
|
79
|
+
|
|
80
|
+
- **MCP not configured:** "Run `/postman:setup` to configure the Postman MCP Server."
|
|
81
|
+
- **No results:** "Nothing matched your query. Try different keywords, broaden `ownership` to `all`, or browse the user's workspaces with `getWorkspaces` + `getCollections`."
|
|
82
|
+
- **401 Unauthorized:** "Your Postman API key was rejected. Generate a new one at https://go.postman.co/settings/me/api-keys and run `/postman:setup`."
|
|
83
|
+
- **Too many results:** Ask the user to be more specific. Suggest filtering by workspace or using tags.
|