postman-mcp
Provides tools for managing Postman collections, environments, mock servers, API specifications, and workspaces through the Postman API.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@postman-mcplist my workspaces"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Postman MCP Server
A production-ready Model Context Protocol (MCP) server that provides 41 Postman API tools for managing collections, environments, mocks, API specifications, and workspaces. Supports Streamable HTTP, SSE, and stdio transports.
Features
📦 41 Postman API Tools - Complete Postman API automation
🔄 Multiple Transports - Streamable HTTP, SSE, and stdio support
🚀 Production Ready - Docker support with proper error handling
📚 Collections - Create, read, update, duplicate collections
🔐 Environments - Manage environment variables
🎭 Mocks - Create and manage mock servers
📝 API Specs - OpenAPI, AsyncAPI, protobuf, GraphQL support
🏢 Workspaces - Manage team and personal workspaces
🔗 Integration - Sync specs with collections
Available Tools (41)
Collections (7 tools)
createCollection- Create a collection (v2.1.0 format)getCollection- Get collection info (map/minimal/full)getCollections- List workspace collectionsputCollection- Replace collection contentsduplicateCollection- Duplicate to another workspacegetDuplicateCollectionTaskStatus- Check duplication status
Requests & Responses (3 tools)
createCollectionRequest- Create request in collectionupdateCollectionRequest- Update existing requestcreateCollectionResponse- Create request response
Environments (4 tools)
createEnvironment- Create environmentgetEnvironment- Get environment detailsgetEnvironments- List all environmentsputEnvironment- Replace environment contents
Mock Servers (5 tools)
createMock- Create mock servergetMock- Get mock server detailsgetMocks- List all mock serversupdateMock- Update mock serverpublishMock- Publish mock server (set public)
API Specifications (9 tools)
createSpec- Create API spec (OpenAPI/AsyncAPI/protobuf/GraphQL)getSpec- Get spec detailsgetAllSpecs- List workspace specsupdateSpecProperties- Update spec propertiesgetSpecDefinition- Get complete spec definitioncreateSpecFile- Create spec filegetSpecFiles- List all spec filesgetSpecFile- Get file contentsupdateSpecFile- Update spec file
Spec-Collection Integration (4 tools)
generateCollection- Generate collection from specgetSpecCollections- List spec's generated collectionsgenerateSpecFromCollection- Generate spec from collectiongetGeneratedCollectionSpecs- Get collection's generated specssyncCollectionWithSpec- Sync collection with specsyncSpecWithCollection- Sync spec with collection
Workspaces (4 tools)
createWorkspace- Create workspacegetWorkspace- Get workspace detailsgetWorkspaces- List all workspacesupdateWorkspace- Update workspace properties
Other (4 tools)
getAuthenticatedUser- Get current user infogetTaggedEntities- Get entities by tag (Enterprise)runCollection- Run collection with NewmangetEnabledTools- List enabled tools
Quick Start
Prerequisites
Required:
Postman API Key - Get from https://postman.com/settings/me/api-keys
Python 3.10+
Installation
cd postman-tool
# Install in editable mode
pip install -e .
# Verify installation
postman-mcp --helpEnvironment Variables
Required:
export POSTMAN_API_KEY="your_postman_api_key"Windows PowerShell:
$env:POSTMAN_API_KEY = "your_postman_api_key"Run Server
Streamable HTTP (Recommended):
postman-mcp --mode streamable-http --port 8010SSE:
postman-mcp --mode sse --port 8010Stdio (for MCP clients):
postman-mcp --mode stdioDocker
# Build image
docker build -t postman-mcp .
# Run container
docker run -e POSTMAN_API_KEY=your_key -p 8010:8010 postman-mcpMCP Client Configuration
Streamable HTTP
{
"mcpServers": {
"postman": {
"type": "streamable-http",
"url": "http://localhost:8010/mcp"
}
}
}Stdio
{
"mcpServers": {
"postman": {
"command": "postman-mcp",
"args": ["--mode", "stdio"],
"env": {
"POSTMAN_API_KEY": "your_postman_api_key"
}
}
}
}Usage Examples
Get Current User
await call_tool("getAuthenticatedUser", {})List Workspaces
# List my personal workspaces
user = await call_tool("getAuthenticatedUser", {})
workspaces = await call_tool("getWorkspaces", {
"createdBy": user["user"]["id"],
"type": "personal",
"limit": 100
})Create Collection
await call_tool("createCollection", {
"workspace": "workspace-id",
"collection": {
"info": {
"name": "My API Collection",
"description": "Collection for testing",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": []
}
})Get Collection
# Get lightweight map (default)
await call_tool("getCollection", {
"collectionId": "12345-abc123def456"
})
# Get full payload
await call_tool("getCollection", {
"collectionId": "12345-abc123def456",
"model": "full"
})Create Mock Server
await call_tool("createMock", {
"workspace": "workspace-id",
"mock": {
"name": "My Mock Server",
"collection": "12345-abc123def456", # Collection UID
"environment": "env-id",
"private": false
}
})Create API Specification
await call_tool("createSpec", {
"workspaceId": "workspace-id",
"name": "My API",
"type": "openapi",
"files": [
{
"path": "openapi.yaml",
"content": "openapi: 3.0.0\ninfo:\n title: My API\n version: 1.0.0"
}
]
})Generate Collection from Spec
await call_tool("generateCollection", {
"specId": "spec-id",
"name": "Generated Collection",
"elementType": "collection",
"options": {
"requestParametersResolution": "example",
"exampleParametersResolution": "example"
}
})Create Environment
await call_tool("createEnvironment", {
"workspace": "workspace-id",
"environment": {
"name": "Production",
"values": [
{"key": "base_url", "value": "https://api.example.com", "enabled": true},
{"key": "api_key", "value": "secret", "enabled": true, "type": "secret"}
]
}
})Run Collection
await call_tool("runCollection", {
"collectionId": "12345-abc123def456",
"environmentId": "env-id",
"iterationCount": 1,
"requestTimeout": 30000
})API Endpoints
When running with HTTP transports:
GET /- Server infoGET /health- Health check/mcp/*- MCP protocol endpoints (streamable-http)/sse- SSE endpoint/messages- SSE messages endpoint
Development
Run Tests
pytestProject Structure
postman-tool/
├── postman_server.py # Main MCP server
├── tools/
│ ├── toolhandler.py # Base class
│ └── postman_tools.py # All 41 tool implementations
├── tests/
│ └── test_postman.py
├── pyproject.toml
├── Dockerfile
└── README.mdPostman API Details
Authentication
Uses X-Api-Key header with your Postman API key. Get yours at: https://postman.com/settings/me/api-keys
Base URL
https://api.getpostman.comCollection UID Format
Many endpoints require collection UID in format: <OWNER_ID>-<COLLECTION_ID>
To get the UID:
Use
getCollectionand read theuidfieldConstruct from
{ownerId}-{collectionId}where:For team collections:
ownerId = me.teamId(fromgetAuthenticatedUser)For personal collections:
ownerId = me.user.id(fromgetAuthenticatedUser)
Rate Limits
Postman API has rate limits. See: https://learning.postman.com/docs/developer/postman-api/postman-api-rate-limits/
Common Issues
Authentication Error
Error: Postman API error (401)
Solution:
Verify
POSTMAN_API_KEYis set correctlyCheck key is valid at https://postman.com/settings/me/api-keys
Ensure key has required permissions
Collection UID Format
Error: Collection not found
Solution:
Use full UID format:
12345-abc123def456Get UID from
getCollectionresponseFor createMock, pass collection UID, not bare ID
Workspace Required
Error: Workspace is required
Solution:
Call
getWorkspacesto list available workspacesPass
workspacequery parameterFor "my workspaces", call
getAuthenticatedUserfirst
Newman Integration
The runCollection tool requires Newman (Postman's CLI runner) to be integrated programmatically. This is a placeholder that returns instructions.
Requirements
Python 3.10+
Postman API Key
MCP 1.12.0+
httpx, Starlette, Uvicorn
License
MIT License - See LICENSE file for details
Support
For issues, questions, or contributions, please visit the project repository.
Additional Resources
Postman API Documentation: https://learning.postman.com/docs/developer/postman-api/intro-api/
Postman Collection Format: https://schema.postman.com/collection/json/v2.1.0/draft-07/docs/index.html
MCP Protocol: https://modelcontextprotocol.io
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Sourav4670/postman-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server