Postman API Testing MCP Server
Connect Claude Code to your Postman workspace for API testing and exploration. Browse collections, run requests, inspect responses, and generate API client code directly from your Postman definitions.
MCP Server Configuration
Add to .claude/settings.json:
{ "mcpServers": { "postman": { "command": "npx", "args": ["-y", "@postman/mcp-server"], "env": { "POSTMAN_API_KEY": "${POSTMAN_API_KEY}" } } } }
Available Tools
| Tool | Description |
|---|---|
list-collections | List all Postman collections in your workspace |
get-collection | Get full details of a collection (requests, folders, variables) |
list-environments | List available environments (dev, staging, prod) |
get-environment | Get environment variables for a specific environment |
send-request | Execute a request from a collection and return the response |
list-apis | List API definitions in your workspace |
get-api-schema | Get the OpenAPI/Swagger schema for an API |
Common Workflows
API Exploration
1. list-collections β browse available API collections
2. get-collection β see all endpoints with request/response examples
3. get-api-schema β get the full OpenAPI spec for code generation
Testing & Debugging
1. list-environments β switch to the right environment (dev/staging)
2. send-request β execute an API call and inspect the response
3. Compare response with schema β validate correctness
4. Generate integration tests from the collection
Code Generation from Collection
1. Get collection with all request examples
2. Generate TypeScript API client with proper types
3. Include error handling for each endpoint's error responses
4. Add request/response interceptors for auth
Collection Structure Example
{ "info": { "name": "User Service API", "description": "REST API for user management" }, "item": [ { "name": "Authentication", "item": [ { "name": "Login", "request": { "method": "POST", "url": "{{baseUrl}}/auth/login", "header": [{"key": "Content-Type", "value": "application/json"}], "body": { "mode": "raw", "raw": "{\"email\": \"[email protected]\", \"password\": \"secret\"}" } }, "response": [ { "name": "Success", "status": "OK", "code": 200, "body": "{\"token\": \"eyJ...\", \"expiresIn\": 3600}" }, { "name": "Invalid Credentials", "status": "Unauthorized", "code": 401, "body": "{\"error\": \"Invalid email or password\"}" } ] } ] }, { "name": "Users", "item": [ { "name": "Get User", "request": { "method": "GET", "url": "{{baseUrl}}/users/{{userId}}", "header": [{"key": "Authorization", "value": "Bearer {{token}}"}] } } ] } ] }
Generated TypeScript Client (Example)
// Auto-generated from Postman collection: User Service API interface LoginRequest { email: string; password: string; } interface LoginResponse { token: string; expiresIn: number; } class UserServiceClient { constructor(private baseUrl: string, private token?: string) {} async login(data: LoginRequest): Promise<LoginResponse> { const res = await fetch(`${this.baseUrl}/auth/login`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(data), }); if (!res.ok) throw new ApiError(res.status, await res.json()); const result = await res.json(); this.token = result.token; return result; } async getUser(userId: string): Promise<User> { const res = await fetch(`${this.baseUrl}/users/${userId}`, { headers: { Authorization: `Bearer ${this.token}` }, }); if (!res.ok) throw new ApiError(res.status, await res.json()); return res.json(); } }
Setup
- Get a Postman API key at
https://web.postman.co/settings/me/api-keys - Set the environment variable:
export POSTMAN_API_KEY="PMAK-your-key-here" - Add the MCP configuration to
.claude/settings.json
Security Notes
- The Postman API key grants access to all collections and environments in your workspace
- Environment variables in Postman may contain API keys, passwords, and tokens -- review before sharing
- Use workspace-scoped tokens with minimal permissions when possible
- The
send-requesttool executes actual HTTP requests -- be careful with destructive operations (DELETE, PUT) - Never store the Postman API key in version control
Reviews
No reviews yet. Be the first to review this template!
Similar Templates
Database MCP Integration
MCP server configuration for connecting Claude Code to PostgreSQL, MySQL, and MongoDB databases. Enables schema inspection, query building, and migration generation.
Elevenlabs Server
Streamline your workflow with this official, elevenlabs, text, speech. Includes structured workflows, validation checks, and reusable patterns for audio.
Browser Use Portal
Powerful mcp for server, enables, agents, control. Includes structured workflows, validation checks, and reusable patterns for browser_automation.