Integrates Postman with Cursor IDE to manage collections and requests
Postman MCP Server
Model Context Protocol (MCP) server for integrating Postman API with Cursor IDE, enabling automatic migration of API endpoints from .NET controllers to Postman collections.
🎯 Features
- ✅ List Collections: List all Postman collections in workspace
- ✅ Get Collection: Get detailed collection information
- ✅ Create Collection: Create new Postman collections
- ✅ Create Folder: Create folders to organize requests (with auto-fix validation errors)
- ✅ Create Request: Create API requests manually
- ✅ Update Request: Update existing requests
- ✅ Delete Request: Delete requests by ID or name (with recursive search)
- ✅ Sync from Controller: Automatically parse .NET controller code and migrate endpoints to Postman
📋 Requirements
- Node.js >= 18.0.0
- Postman API Key (Get from Postman Account Settings)
- Cursor IDE with MCP support
🚀 Quick Start
Step 1: Install Dependencies
cd .cursor/mcp-servers/postman
npm install
Step 2: Build Project
npm run build
Or use the setup script:
./setup.sh
Step 3: Get Postman API Key
- Go to Postman Account Settings
- Create or copy your API Key (format:
PMAK-xxxxx-xxxxx)
Step 4: Configure Cursor MCP Settings
Add to Cursor MCP configuration (usually in ~/.cursor/mcp.json or Cursor Settings):
macOS - Get absolute path:
cd .cursor/mcp-servers/postman
./get-path.sh
# Script will copy path to clipboard
Configuration:
{
"mcpServers": {
"postman": {
"command": "node",
"args": ["/absolute/path/to/.cursor/mcp-servers/postman/dist/index.js"],
"env": {
"POSTMAN_API_KEY": "your-postman-api-key-here"
}
}
}
}
Example for macOS:
{
"mcpServers": {
"postman": {
"command": "node",
"args": ["/Users/dangvietson/Desktop/feec-phase1-pm/feec-phase1-pmsystem/.cursor/mcp-servers/postman/dist/index.js"],
"env": {
"POSTMAN_API_KEY": "PMAK-xxxxx-xxxxx-xxxxx"
}
}
}
}
Note: Replace /absolute/path/to/ with your actual absolute path.
Step 5: Restart Cursor IDE
- Quit Cursor completely (
Cmd + Qon macOS) - Reopen Cursor
- Test: Type "List all Postman collections" in Cursor chat
📖 Usage Examples
1. List Collections
List all Postman collections
2. Create Collection
Create a new Postman collection named "FEEC PM System APIs" with description "Project Management System API endpoints"
3. Create Folder
Create folder "API V1" with description "Version 1.0 endpoints" in Postman collection 97f3e1da-a4e9-44f6-8d1a-83766a827e54
4. Create Request Manually
Create a new GET request in collection 97f3e1da-a4e9-44f6-8d1a-83766a827e54:
- Name: "Get User by ID"
- Method: GET
- URL: {{baseUrl}}/api/v1/users/{userId}
- Headers: Content-Type: application/json
- Description: Retrieve user details by ID
5. Auto-Sync from Controller (Recommended)
Use the custom command /migrate-endpoint-to-postman or manually:
Sync API endpoints from this controller code to Postman collection 97f3e1da-a4e9-44f6-8d1a-83766a827e54:
[Paste full C# controller code here]
Base URL: http://localhost:5020
API Version: 1.0
Folder: PM System API V1
The server will automatically:
- Parse all HTTP endpoints (
[HttpGet],[HttpPost], etc.) - Extract routes from
[Route]attributes - Extract API version from
[ApiVersion]attributes - Extract XML comments for descriptions
- Extract API Code and Screen ID from comments
- Generate request names:
{API Code} - {API Name} - Generate request bodies for POST/PUT/PATCH
- Handle path parameters (
{id:guid}→:id) - Handle query parameters (
[FromQuery]) - Expand
PagedRequestintopageNumber,pageSize,searchTerm - Add Authorization header only if
[Authorize]attribute is present
6. Delete Request
Delete request "Test API Request" from Postman collection PMSystem
Or by ID:
Delete request with ID 8ea7c1f4-c9ba-4293-bbf4-b037f7962854 from collection 97f3e1da-a4e9-44f6-8d1a-83766a827e54
🔧 API Reference
Tool: `list_collections`
- Description: List all Postman collections
- Parameters: None
- Returns: Array of collections with
id,name,uid
Tool: `get_collection`
- Description: Get detailed collection information
- Parameters:
collectionId(string, required): Collection ID (UID)
- Returns: Full collection object with items, variables, etc.
Tool: `create_collection`
- Description: Create new Postman collection
- Parameters:
name(string, required): Collection namedescription(string, optional): Collection description
- Returns: Created collection object
Tool: `create_folder`
- Description: Create folder in collection to organize req
Tools (4)
list_collectionsList all Postman collections in workspaceget_collectionGet detailed collection information including items and variablescreate_collectionCreate a new Postman collectioncreate_folderCreate folder in collection to organize requestsEnvironment Variables
POSTMAN_API_KEYrequiredPostman API Key from Account Settings (format: PMAK-xxxxx)Configuration
{
"mcpServers": {
"postman": {
"command": "node",
"args": ["/absolute/path/to/.cursor/mcp-servers/postman/dist/index.js"],
"env": {
"POSTMAN_API_KEY": "your-postman-api-key-here"
}
}
}
}