# Postman MCP

> Postman MCP Server connects your entire API testing lifecycle directly into your AI agent. Stop exporting JSONs and switching tabs to understand APIs. This server lets you run against Collections, map Environments (Staging/Prod), query Mock Servers for simulated payloads, and check API health monitors—all conversationally. It brings the full scope of your Postman workspace into a pure LLM context.

## Overview
- **Category:** loved-by-devs
- **Price:** Free
- **Tags:** api-testing, api-documentation, mock-servers, rest-api, collection-management, endpoint-testing

## Description

You're done exporting JSON files just to talk to your AI agent. This server brings everything from your Postman workspace—your whole API testing setup—right into a conversational context for your client. You don't gotta switch tabs or deal with cURL formats anymore; you just ask, and the agent knows how to hit the endpoint.

It gives your agent access to run against full Collections, map out different environments like Staging or Production, query Mock Servers for fake responses, and even check API health monitors—all without leaving the chat window. It packs the entire scope of your Postman work into a pure LLM context.

**Understanding Your APIs (Collections):**
If you need to see what endpoints are available, run `list_collections` to get a list of every single API collection configured in your linked Postman account. When you find the right one, use `get_collection`. This tool downloads the entire JSON schema for that specific collection. It gives your agent deep visibility into everything: every endpoint path, what HTTP methods are allowed (GET, POST, etc.), all required headers, and the full structure of the request bodies. Your AI can instantly read this map so it knows exactly how to talk to your APIs.

**Defining Scope and Contexts (Workspaces & Environments):**
To know where you're testing, first run `list_workspaces` to pull up all the engineering team workspaces available in Postman. This lets your agent scope its actions correctly across teams. Next, use `list_environments`. This tool maps out every development environment—like Staging or Production—and lists all the variables defined for each one. Knowing these scoped variables is crucial because it tells your AI exactly which credentials and base URLs to use when building a request.

**Testing Readiness (Mocks & Monitors):**
When the backend isn't ready, you need simulated data. Run `list_mocks` to get a list of all active Mock Servers. This lets your agent pull those fake JSON responses needed for front-end development against an incomplete API. For reliability checks, use `list_monitors`. It retrieves scheduled health checks, showing the schedule details and giving you records of whether past test runs succeeded or failed for critical endpoints. All this information—the schemas, the environments, the mock data, and the failure history—is available conversationally.

## Tools

### get_collection
Downloads the complete JSON schema for a Postman Collection, exposing all endpoints, methods, headers, and request bodies.

### list_collections
Lists every API collection configured in your connected Postman account.

### list_environments
Lists available development environments (Staging, Prod) and their defined variables within Postman.

### list_mocks
Lists configured Mock Servers used in Postman to simulate API responses for front-end testing.

### list_monitors
Retrieves scheduled API health monitors, detailing their schedules and the success/failure status of the last run.

### list_workspaces
Lists all engineering team workspaces available in your connected Postman account.

## Prompt Examples

**Prompt:** 
```
Are there any Mock servers currently simulating our Auth API?
```

**Response:** 
```
I checked your Postman configurations and found 1 active mock server tied to 'User Onboarding Flows'. It exposes exactly 4 static JSON responses for `/login` and `/token` and operates at URL `https://c123.mock.pstmn.io`. Shall I pull its schema details?
```

**Prompt:** 
```
Download our core API Collection. Tell me exactly what parameters I need to submit to the Create User endpoint.
```

**Response:** 
```
I extracted Collection `col-x71...`, the 'Create User' endpoint (POST `/api/v2/users`) expects a JSON body containing `email` (string, required), `role` (string, defaults to 'viewer'), and `department_id` (number, required). Would you like me to write a Javascript snippet invoking it?
```

**Prompt:** 
```
Did any of our scheduled Postman monitors fail over the weekend?
```

**Response:** 
```
Looking at the `list_monitors` data, your 'Checkout Flow Monitor' failed consecutively on Saturday morning. The internal log indicates an assertion error mapping a `502 Bad Gateway` status on step 3 (`POST /cart`). All other monitors are currently healthy and passing.
```

## Capabilities

### Examine API Schemas
Use `get_collection` to download a collection's full JSON schema, allowing your AI agent to understand every endpoint, method, and required body parameter.

### Discover Available APIs
Run `list_collections` to list all API collections available under the connected Postman account ID.

### Manage Deployment Contexts
Use `list_environments` to map out development environments (like Staging or Prod) and see which variables are defined for each one.

### Simulate Backend Responses
Run `list_mocks` to list active Mock Servers, letting your AI pull the simulated JSON responses needed when developing front-ends against an incomplete API.

### Check API Reliability History
Use `list_monitors` to retrieve scheduled health checks, showing past test success or failure records for critical endpoints.

### Map Team Workspaces
Run `list_workspaces` to list all available engineering team workspaces within Postman.

## Use Cases

### Debugging Environment Drift
A backend engineer needs to know if Staging uses different base URLs than Production. Instead of navigating Postman and comparing settings, they ask their agent: 'What are the environment variables for staging vs. production?' The agent runs `list_environments` and instantly reports any discrepancies.

### Building UI Against Missing APIs
A frontend dev needs to build a user profile screen, but the actual `/user/details` API is broken. They ask their agent to check for mock data. The agent runs `list_mocks`, finds an active mock server URL, and provides the schema so the developer can proceed with building the UI bindings.

### Post-Deployment Health Check
The QA team just pushed a new feature. Before manually checking endpoints, they ask their agent to check health monitors. The agent runs `list_monitors` and reports that the 'Checkout Flow Monitor' failed on step 3 (`POST /cart`) due to a bad gateway status.

### Onboarding New Developers
A new hire needs to understand the company's core API. They ask their agent, 'Show me all our main APIs.' The agent runs `list_collections` and provides a list of available collections they can start learning from.

## Benefits

- **Deep Schema Access:** Instead of manually reviewing collection files, `get_collection` feeds the full JSON schema directly to your agent. Your AI knows exactly how every endpoint works.
- **Context Switching Stops:** You don't need to jump between Postman and Slack. The server handles environment variables (`list_environments`) and mock endpoints (`list_mocks`), keeping everything in one chat window.
- **Reliability Checks Made Easy:** QA teams can use `list_monitors` to pull failure histories instantly, letting the agent report if a critical path failed last night.
- **Simulated Testing Power:** When your backend is late, you run `list_mocks`. Your AI uses these mock endpoints to build and test UI components immediately against predictable JSON responses.
- **Full Visibility:** Easily map out your entire API landscape by running `list_collections` and `list_workspaces`, giving the agent a complete view of what APIs exist.

## How It Works

The bottom line is: You talk to your agent like a developer, and it talks directly to Postman's API tools for answers.

1. Subscribe to the server and enter your Postman Developer API Key.
2. Your AI client uses tools like `list_collections` or `list_environments` to fetch the required metadata (e.g., finding all available collections).
3. The AI then uses that data to answer specific questions, such as 'What payload does POST /users need?' using the retrieved collection schema.

## Frequently Asked Questions

**How do I find out what APIs are available with list_collections?**
It lists every API Collection tied to your connected account. This is the starting point; once you have the collection name, you can use `get_collection` to see its full schema details.

**Can Postman MCP Server help me test against a non-existent backend?**
Yes. You run `list_mocks` first. This shows active mock servers, and your agent can use those endpoints to generate simulated JSON responses for front-end testing.

**What is the difference between list_environments and get_collection?**
`get_collection` provides the technical structure (the 'what')—endpoints, methods, schemas. `list_environments` provides the context (the 'where')—it tells you if you should use Staging or Production variables.

**How do I check if my checkout flow is broken using list_monitors?**
Run `list_monitors`. This shows a history of scheduled checks. You can see the last run status (Success/Failure) and often get details about why it failed, like a 502 error.

**When I use list_environments, how does the server keep my development variables secure?**
The server enforces scope isolation. Your AI client only accesses variable sets defined for a specific environment (like Staging or Production). This prevents your agent from accidentally mixing up credentials or leaking sensitive production data into lower-level test runs.

**If I run get_collection, does it give me all the raw API documentation, or just what my AI client needs?**
It pulls the complete internal JSON schema for the collection. Your agent then analyzes this large dataset and pinpoints exactly which endpoints, methods, and required parameters you need, saving you from sifting through unnecessary details.

**Using list_workspaces, how do I ensure my AI client is only working within our team’s API scope?**
The tool lists all available engineering workspaces. Your agent uses this to identify the correct workspace name first, then scopes every subsequent action—like fetching collections—only within your designated team's context.

**When I check my active endpoints using list_mocks, can I trust that the simulated JSON responses are stable?**
Yes. The listed mock servers use static JSON payloads for testing. They maintain consistent data structures and behavior, which is crucial when front-end developers need to build UIs against predictable API responses.

**Can the AI automatically write code using my internal API documentation?**
Absolutely. If you use `get_collection` the AI unpacks the entire Postman hierarchy. Combine this by asking the AI to 'write a Python script to hit my Users Endpoint' and it will natively respect your headers, payload requirements, and auth settings without any context copy-pasting.

**How does the agent handle environments like production vs staging variables?**
The agent can call `list_environments` exposing active configurations inside your workspace. If a collection points to `{{base_url}}`, the AI reads your environments array to resolve exactly what URLs or access keys map to staging versus production natively.

**Can I query test success rates via AI instead of dashboards?**
Yes. The `list_monitors` connection unrolls the cron checks tied to your Postman collections. The AI inherently sees whether the latest automated integration tests succeeded or failed, making status reports conversational.