Postman MCP Server
Integrates Postman with Cursor IDE to manage collections and requests through natural language. It features specialized tools for automatically migrating API endpoints and metadata directly from .NET controller code into Postman collections.
README
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 requests
- Parameters:
collectionId(string, required): Collection IDname(string, required): Folder namedescription(string, optional): Folder description
- Returns: Updated collection object
- Features:
- Auto-fixes invalid collection variables (type validation)
- Creates folder with placeholder request (avoids empty folder validation error)
- Preserves entire collection structure
Tool: create_request
- Description: Create API request in collection
- Parameters:
collectionId(string, required): Collection IDname(string, required): Request namemethod(string, required): HTTP method (GET, POST, PUT, DELETE, PATCH, HEAD, OPTIONS)url(string, required): Full URL or pathheaders(object, optional): HTTP headers as key-value pairsbody(object, optional): Request body for POST/PUT/PATCHmode: "raw", "urlencoded", "formdata"raw: JSON string for raw body
description(string, optional): Request descriptionfolderId(string, optional): Folder ID to organize requests
- Returns: Updated collection object
Tool: update_request
- Description: Update existing request
- Parameters:
collectionId(string, required): Collection IDrequestId(string, required): Request ID (UID) to updatename,method,url,headers,body,description(optional): Fields to update
- Returns: Updated collection object
Tool: delete_request
- Description: Delete API request from collection
- Parameters:
collectionId(string, required): Collection IDrequestId(string, optional): Request ID (UID) to deleterequestName(string, optional): Request name to find and delete
- Returns: Updated collection object
- Features:
- Delete by ID or name
- Recursive search in folders
- Auto-fixes collection variables
- Preserves collection structure
Tool: sync_from_controller
- Description: Automatically migrate endpoints from .NET controller code
- Parameters:
collectionId(string, required): Postman collection IDcontrollerCode(string, required): Full C# controller code with XML commentsbaseUrl(string, required): Base URL (e.g.,http://localhost:5020)apiVersion(string, optional): API version (default: "1.0")folderName(string, optional): Folder name to organize requests (will be created if not exists)
- Returns: Summary of created requests with endpoint details
- Features:
- Parses
[Route],[HttpGet],[HttpPost],[HttpPut],[HttpDelete],[HttpPatch]attributes - Extracts XML comments (
/// <summary>,API Code:,Screen ID:) - Generates request names:
{API Code} - {API Name}(from summary) - Generates request bodies from DTO properties
- Handles path parameters (
{id:guid}β:idPostman format) - Handles query parameters (
[FromQuery]) - Expands
PagedRequestinto individual query parameters - Adds Authorization header only if
[Authorize]attribute is present - Replaces
[controller]placeholder with actual controller name - Extracts major version from API version (e.g., "1.0" β "v1")
- Uses
{{baseUrl}}Postman variable for URLs
- Parses
π¨ Controller Code Requirements
For sync_from_controller to work optimally:
- β
Controller must have
[ApiController]attribute - β
Methods must have HTTP method attributes (
[HttpGet],[HttpPost], etc.) - β
XML comments with
/// <summary>for descriptions - β
API Code: XXXXin comments for request naming - β
Screen ID: XXXXin comments (optional)
Example:
/// <summary>
/// Get vendor quotation history for specified vendors within a specific ES Version (v1.0)
/// API Code: QS0041
/// Screen ID: QS-L0004-2 (Estimation quotation vendor history)
/// </summary>
[HttpGet("quotation-history")]
public async Task<IActionResult> GetVendorQuotationHistory(
[FromQuery] Guid versionId,
[FromQuery(Name = "vendorId")] List<Guid> vendorIds,
CancellationToken cancellationToken)
{
// Implementation...
}
Generated Request:
- Name:
QS0041 - Get vendor quotation history for specified vendors within a specific ES Version - URL:
{{baseUrl}}/api/v1/Vendors/quotation-history?versionId=...&vendorId=... - Method: GET
- Headers: Only Authorization if
[Authorize]is present
π Development Workflow
Workflow 1: Manual Migration (Step-by-step)
- Create Collection for each system (PM, DC, ES, QS, Master)
- Develop API in .NET controller
- Create Request in Postman via Cursor prompt
- Test in Postman
Workflow 2: Auto-Sync (Bulk Migration) β Recommended
- Develop API in .NET controller with complete XML comments
- Use
/migrate-endpoint-to-postmancommand or sync manually - Verify in Postman
- Update if needed
Workflow 3: GitHub Actions Integration (Future)
Create GitHub Action workflow to auto-sync when PR is merged:
name: Sync APIs to Postman
on:
pull_request:
types: [closed]
jobs:
sync-postman:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- run: |
# Parse changed controllers
# Call Postman MCP Server
# Create/update requests
π Security Notes
- API Key: Do not commit
POSTMAN_API_KEYto git (already in.gitignore) - Local Only: Server runs locally, not exposed externally
- Environment Variables: Use
.envfile if needed (do not commit)
π Troubleshooting
Server Not Starting
- Check Node.js version:
node --version(requires >= 18) - Check build:
npm run build - Check absolute path in MCP config (must be absolute path)
- After code changes: Quit Cursor completely and rebuild with
npm run build
Postman API Errors
- Verify API Key: Check key format (
PMAK-...) - Check API limits: Postman has rate limits
- Verify Collection ID: Collection ID must be UID (not name)
- Check workspace permissions: Need Editor or Admin role
Endpoints Not Parsed
- Ensure controller code has complete attributes
- Check XML comments format (must use
///) - Verify route patterns
- Check for
[ApiController]attribute
Request Names Not Correct
- Ensure
API Code: XXXXis present in XML comments - Check summary format in
<summary>tags - Rebuild MCP server after code changes:
npm run build
Headers Not Added
- Authorization header is only added when
[Authorize]attribute is explicitly present - No default headers (X-API-Version, Accept, Content-Type) are added automatically
- Headers are only added when explicitly defined in code (e.g.,
[FromHeader]parameters)
π Project Structure
.cursor/mcp-servers/postman/
βββ src/
β βββ index.ts # Main MCP server implementation
β βββ controller-parser.ts # .NET controller parser
βββ dist/ # Compiled JavaScript (after build)
βββ package.json
βββ tsconfig.json
βββ .gitignore
βββ README.md # This file
βββ get-path.sh # Helper script to get absolute path
βββ setup.sh # Setup script
βββ rebuild-after-quit.sh # Rebuild script after quitting Cursor
π οΈ Development
Run in Development Mode
npm run dev
Type Check
npm run type-check
Build
npm run build
Important: After making code changes, you must:
- Quit Cursor completely
- Run
npm run build - Reopen Cursor
Or use the helper script:
./rebuild-after-quit.sh
π References
πΊοΈ Roadmap
β Completed Features
- [x] List collections
- [x] Get collection details
- [x] Create collection
- [x] Create folder (with auto-fix validation errors)
- [x] Create request
- [x] Update request
- [x] Delete request (by ID or name, recursive search)
- [x] Sync from .NET controller (parse routes, methods, parameters)
- [x] Extract XML comments (summary, API Code, Screen ID)
- [x] Generate request names:
{API Code} - {API Name} - [x] Handle path/query parameters
- [x] Expand
PagedRequestinto individual parameters - [x] Authorization header based on
[Authorize]attribute - [x] No default headers (only explicit headers from code)
π Planned Enhancements
Phase 1: Enhanced Parsing
- [ ] Support for
[FromForm]parameters (multipart/form-data) - [ ] Support for
[FromHeader]parameters (already parsed, need to add to headers) - [ ] Better DTO property type detection
- [ ] Support for nested DTOs
- [ ] Extract validation rules from FluentValidation
Phase 2: Advanced Features
- [ ] Update existing requests (detect changes and update)
- [ ] Delete deprecated endpoints
- [ ] Support for multiple API versions in same collection
- [ ] Generate Postman tests from controller code
- [ ] Support for authentication (JWT, API Key, etc.)
Phase 3: Integration
- [ ] GitHub Actions integration (auto-sync on PR merge)
- [ ] Support for other frameworks (FastAPI, Express.js, etc.)
- [ ] Export collection to OpenAPI/Swagger
- [ ] Import from OpenAPI/Swagger
π Best Practices
- Naming: Use API Code in XML comments for consistent naming
- Organization: Create folders by system/version for easy management
- Documentation: Add descriptions for requests for better understanding
- Testing: Test requests after migration to ensure correctness
- Authorization: Use
[Authorize]attribute explicitly when authentication is required - Headers: Only add headers when explicitly defined in code
π€ Contributing
When adding new features:
- Update this README with new features
- Test thoroughly
- Update roadmap section
- Rebuild and test in Cursor
Last Updated: 2026-01-23
Version: 1.0.0
Status: β
Production Ready
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
E2B
Using MCP to run code via e2b.