@postman/postman-plugin 0.1.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.
Files changed (37) hide show
  1. package/README.md +13 -1
  2. package/dist/hosts/index.js +2 -1
  3. package/dist/hosts/pi.js +84 -0
  4. package/dist/pi-extension.js +27 -0
  5. package/dist/source.js +3 -1
  6. package/hooks/session-start-context.md +11 -0
  7. package/mcp.pi.json +14 -0
  8. package/package.json +21 -6
  9. package/skills/ai-readiness/SKILL.md +50 -0
  10. package/skills/api-discovery/SKILL.md +135 -0
  11. package/skills/api-discovery/reference/orbit.md +101 -0
  12. package/skills/api-documentation/SKILL.md +34 -0
  13. package/skills/api-documentation/reference/rest-api-best-practices.md +47 -0
  14. package/skills/api-engineer/SKILL.md +29 -0
  15. package/skills/api-mocking/SKILL.md +141 -0
  16. package/skills/api-monitoring/SKILL.md +137 -0
  17. package/skills/api-testing/SKILL.md +103 -0
  18. package/skills/bootstrap/SKILL.md +216 -0
  19. package/skills/bootstrap/reference/cli_installation.md +58 -0
  20. package/skills/ci-integration/SKILL.md +121 -0
  21. package/skills/collection-schema-v3/SKILL.md +210 -0
  22. package/skills/collection-schema-v3/reference/environment.md +63 -0
  23. package/skills/collection-schema-v3/reference/other_protocols.md +86 -0
  24. package/skills/datasets/SKILL.md +323 -0
  25. package/skills/flows/SKILL.md +212 -0
  26. package/skills/flows/reference/flow_cli_flags.md +111 -0
  27. package/skills/performance-testing/SKILL.md +71 -0
  28. package/skills/postman-mcp-server/SKILL.md +71 -0
  29. package/skills/postman-mcp-server/references/docs.md +88 -0
  30. package/skills/postman-mcp-server/references/learn.md +73 -0
  31. package/skills/postman-mcp-server/references/mcp-limitations.md +38 -0
  32. package/skills/postman-mcp-server/references/mock.md +101 -0
  33. package/skills/postman-mcp-server/references/search.md +83 -0
  34. package/skills/postman-mcp-server/references/security.md +129 -0
  35. package/skills/postman-mcp-server/references/setup.md +141 -0
  36. package/skills/postman-mcp-server/references/sync.md +85 -0
  37. package/skills/postman-mcp-server/references/test.md +84 -0
@@ -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.
@@ -0,0 +1,129 @@
1
+ ---
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
+ ---
5
+
6
+ # API Security Audit
7
+
8
+ Audit your API for security issues: missing auth, exposed sensitive data, insecure transport, weak validation, and OWASP API Security Top 10 alignment. Works with local OpenAPI specs and Postman collections.
9
+
10
+ ## Prerequisites
11
+
12
+ For collection auditing, the Postman MCP Server must be connected. Local spec auditing 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
+ **Local spec:**
21
+ - Search for `**/openapi.{json,yaml,yml}`, `**/swagger.{json,yaml,yml}`
22
+
23
+ **Postman spec (via MCP):**
24
+ - Call `getAllSpecs` with the workspace ID to find specs
25
+ - Call `getSpecDefinition` for the full spec content
26
+
27
+ **Postman collection (via MCP):**
28
+ - Call `getCollections` with the `workspace` parameter
29
+ - Call `getCollection` for full detail including auth config
30
+ - Call `getEnvironment` to check for exposed secrets
31
+
32
+ ### Step 2: Run Security Checks
33
+
34
+ **Authentication and Authorization:**
35
+ - Security schemes defined (OAuth2, API Key, Bearer, etc.)
36
+ - Security applied globally or per-endpoint
37
+ - No endpoints accidentally unprotected
38
+ - OAuth2 scopes defined and appropriate
39
+ - Admin endpoints have elevated auth requirements
40
+
41
+ **Transport Security:**
42
+ - All server URLs use HTTPS
43
+ - No mixed HTTP/HTTPS
44
+
45
+ **Sensitive Data Exposure:**
46
+ - No API keys, tokens, or passwords in example values
47
+ - No secrets in query parameters (should be headers/body)
48
+ - Password fields marked as `format: password`
49
+ - PII fields identified
50
+ - Postman environment variables checked for leaked secrets (via `getEnvironment`)
51
+
52
+ **Input Validation:**
53
+ - All parameters have defined types
54
+ - String parameters have `maxLength`
55
+ - Numeric parameters have `minimum`/`maximum`
56
+ - Array parameters have `maxItems`
57
+ - Enum values used where applicable
58
+ - Request body has required field validation
59
+
60
+ **Rate Limiting:**
61
+ - Rate limits documented
62
+ - Rate limit headers defined (X-RateLimit-Limit, X-RateLimit-Remaining)
63
+ - 429 Too Many Requests response defined
64
+
65
+ **Error Handling:**
66
+ - Error responses don't leak stack traces
67
+ - Error schemas don't expose internal field names
68
+ - 401 and 403 responses properly defined
69
+ - Error messages don't reveal implementation details
70
+
71
+ **OWASP API Top 10 Alignment:**
72
+ - API1: Broken Object Level Authorization
73
+ - API2: Broken Authentication
74
+ - API3: Broken Object Property Level Authorization
75
+ - API4: Unrestricted Resource Consumption
76
+ - API5: Broken Function Level Authorization
77
+ - API6: Unrestricted Access to Sensitive Business Flows
78
+ - API7: Server Side Request Forgery
79
+ - API8: Security Misconfiguration
80
+ - API9: Improper Inventory Management
81
+ - API10: Unsafe Consumption of APIs
82
+
83
+ ### Step 3: Present Results
84
+
85
+ ```
86
+ API Security Audit: pet-store-api.yaml
87
+
88
+ CRITICAL (2):
89
+ SEC-001: 3 endpoints have no security scheme applied
90
+ - GET /admin/users
91
+ - DELETE /admin/users/{id}
92
+ - PUT /admin/config
93
+ SEC-002: Server URL uses HTTP (http://api.example.com)
94
+
95
+ HIGH (3):
96
+ SEC-003: No rate limiting documentation or 429 response
97
+ SEC-004: API key sent as query parameter (use header instead)
98
+ SEC-005: No maxLength on 8 string inputs (injection risk)
99
+
100
+ MEDIUM (2):
101
+ SEC-006: Password field visible in GET /users/{id} response
102
+ SEC-007: Environment variable 'db_password' not marked secret
103
+
104
+ Score: 48/100 — Significant Issues
105
+ ```
106
+
107
+ ### Step 4: Fix
108
+
109
+ For each finding:
110
+ 1. Explain the security risk in plain terms
111
+ 2. Show the exact spec change needed
112
+ 3. Apply the fix with user approval
113
+
114
+ For Postman-specific issues:
115
+ - Call `putEnvironment` to mark secrets properly
116
+ - Call `updateCollectionRequest` to fix auth configuration
117
+ - Call `updateCollectionResponse` to remove sensitive data from examples
118
+
119
+ ### Step 5: Re-audit
120
+
121
+ After fixes, re-run the audit to show improvement.
122
+
123
+ ## Error Handling
124
+
125
+ - **MCP not configured:** Local spec auditing works without MCP. For Postman-specific checks: "Run `/postman:setup` to configure the Postman MCP Server."
126
+ - **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`."
127
+ - **No spec found:** Ask the user for the path. Offer to audit a Postman collection directly via MCP.
128
+ - **Spec too large:** For large specs (100+ endpoints), audit in batches by tag or path prefix.
129
+ - **Plan limitations:** "Some audit features may require a paid Postman plan. Check https://www.postman.com/pricing/"