Postman Cursor Rules
March 9, 2026 · View on GitHub
Looking for the full Cursor plugin? Check out the Postman Plugin for Cursor for the complete experience with 8 commands, 3 skills, and an API readiness analyzer. This repo provides a lightweight alternative with just the MCP config and a single rule file.
Cursor Rules and MCP configuration for working with the Postman MCP Server.
Drop these files into any project to give Cursor persistent context about your Postman workspace and API sync workflows.
What's Included
.cursor/
├── mcp.json # Postman MCP server config
└── rules/
└── postman-mcp.mdc # API sync rules and workflow prompts
mcp.json connects Cursor to the Postman MCP server, giving your AI assistant direct access to your Postman collections, APIs, and workspaces.
postman-mcp.mdc teaches Cursor when and how to sync code changes with Postman. It activates automatically when you're working on API files (routes, controllers, OpenAPI specs).
Setup
1. Get a Postman API Key
Go to your Postman account settings and generate an API key.
2. Set the Environment Variable
Add to your shell profile (.zshrc, .bashrc, etc.):
export POSTMAN_API_KEY="PMAK-your-key-here"
Or create a .env file in your project root:
POSTMAN_API_KEY=PMAK-your-key-here
3. Copy Files Into Your Project
# From your project root
cp -r path/to/postman-cursor-rules/.cursor .cursor/
Or clone this repo and copy the .cursor/ directory.
4. Customize the Rules
Open .cursor/rules/postman-mcp.mdc and fill in your workspace details:
## Workspace
- Workspace: My API Project
- Workspace ID: 29b66d3d-be33-4dab-b740-2b00f7b5d0b2
Get your workspace ID from the URL when you open your workspace in Postman: https://go.postman.co/workspace/<workspace-id>
5. Restart Cursor
Restart Cursor to pick up the new MCP server and rules. You should see "postman" listed under MCP servers in Cursor settings.
MCP Server Modes
The default config uses /code mode. You can change the URL in mcp.json depending on your needs:
| Mode | URL | Use Case |
|---|---|---|
| Minimal | https://mcp.postman.com/minimal | Basic collection operations |
| Code | https://mcp.postman.com/code | API search + client code generation |
| Full | https://mcp.postman.com/mcp | Everything (100+ Postman API tools) |
How It Works
The rule file uses Cursor's Apply to Specific Files mode. It activates automatically when you open files matching API patterns:
**/api/**/***/routes/**/*,**/routers/**/***/endpoints/**/*,**/controllers/**/*openapi.yaml,openapi.json,swagger.yaml,swagger.json
Once active, Cursor knows how to sync your code changes with Postman. Ask it to add endpoints, check for drift between code and spec, or generate client code from your APIs.
Example Prompts
Once set up, try these in Cursor:
"Add the new GET /users/{id}/orders endpoint to my Postman collection with example responses."
"Fetch the API spec from my Postman workspace and compare it to my local schemas. What's out of sync?"
"I just added 3 new endpoints. Sync all of them to Postman with proper documentation."
"Generate a TypeScript client from the Users API in my Postman workspace."
Resources
- Cursor Rules Documentation
- Cursor MCP Documentation
- Postman MCP Server Guide
- Postman MCP Server (GitHub)
- Get a Postman API Key
See Also
- Postman Plugin for Cursor - Full plugin with commands, skills, and agents
- Postman Plugin for Claude Code - Source of truth for all Postman AI coding plugins
- Postman Agent Skills - Portable skills for any skills.sh-compatible agent