游标邮递员插件
Cursor内部的完整API生命周期管理。同步集合、生成类型化客户端代码、发现API、运行测试、创建模拟、改进文档和审计安全性。由 邮递员MCP服务器.
注: 此插件反映了 克劳德代码的邮递员插件,这是Postman的AI编码代理插件的真实来源。
此插件的功能
该插件通过Postman MCP服务器将Cursor连接到您的Postman帐户,并捆绑了专门构建的命令、技能和API就绪度分析器。一次安装即可获得:
- 8个命令 涵盖整个API生命周期
- 3种自动加载技能 教代理如何有效地使用Postman
- 1名次级代理人 用于深入的API准备情况分析(在8个支柱上进行48次检查)
- API设计规则 注射到每个疗程中
- 零配置MCP设置 (只需带上API密钥)
先决条件
安装
来自Cursor市场
马上就来: Cursor Marketplace列表和 /add-plugin 支持尚未提供。现在使用下面的GitHub或本地安装方法。- 打开的游标
- 跑
/add-plugin postman或浏览 市场 - 设置API密钥(请参阅下面的设置)
来自GitHub
/add-plugin Postman-Devrel/cursor-postman-plugin本地开发
/add-plugin /path/to/cursor-postman-plugin设置
1.获取Postman API密钥
- 首选 邮差API钥匙
- 点击 生成API密钥
- 将其命名为“游标插件”并复制密钥(以开头
PMAK-)
2.设置环境变量
添加到您的shell配置文件(~/.zshrc, ~/.bashrc,或 ~/.bash_profile):
export POSTMAN_API_KEY=PMAK-your-key-here重新启动终端(或运行 source ~/.zshrc).
3.验证连接
在Cursor中,运行:
/postman:setup这将验证您的API密钥,列出您的工作区,并确认所有内容都已连接。
命令
/postman:setup --首次运行配置
指导您完成API密钥设置,验证MCP连接,并列出您的工作空间。
/postman:sync --同步收藏
根据您当地的OpenAPI规范创建或更新Postman集合。使您的Postman工作区与您的代码保持同步。
> /postman:sync
Found openapi.yaml in ./api/openapi.yaml
Creating collection "Pet Store API" with 15 endpoints...
Collection synced. Environment "Pet Store - Dev" created./postman:codegen --生成客户端代码
从任何Postman集合生成键入的客户端代码。检测您的项目语言并匹配现有约定。
> /postman:codegen
Which collection? "User Management API"
Detected: TypeScript project
Generated: src/clients/user-management-api.ts (5 endpoints, 8 types)/postman:search --发现API
使用自然语言问题在组织的专用网络、工作区和公共Postman网络中查找API。
> /postman:search
"Is there an endpoint that returns user email addresses?"
Yes -- GET /users/{id} in the "User Management API" collection returns email./postman:test --运行收集测试
执行Postman收集测试,分析故障,并获取修复建议。
> /postman:test
Running "Pet Store API" tests...
Passed: 12/15 (80%)
Failed: 3 -- diagnosing.../postman:mock --创建模拟服务器
从您的集合中创建模拟服务器,用于前端开发和测试。
> /postman:mock
Created mock: https://abc123.mock.pstmn.io
Add to .env: API_BASE_URL=https://abc123.mock.pstmn.io/postman:docs --API文件
分析文档的完整性,并生成缺失的描述、示例和错误文档。
> /postman:docs
Documentation coverage: 60%
Missing: 12 error responses, 23 parameter descriptions
Want me to fill the gaps?/postman:security --安全审计
根据OWASP API安全性前10项审核您的API。查找漏洞并提供特定的补救措施。
> /postman:security
Score: 48/100
CRITICAL: 3 endpoints have no auth
HIGH: No rate limiting defined
Providing fixes...自动布线
你不必记住命令名。该插件包括一个将自然语言映射到正确命令的路由技能:
| 你说 | 插件运行 |
|---|---|
| “将我的API与Postman同步” | /postman:sync |
| “为支付生成Python客户端API” | /postman:codegen |
| “我们有什么订单端点?” | /postman:search |
| “运行我的API测试” | /postman:test |
| “我需要一个前端开发模拟” | /postman:mock |
| “我的API代理准备好了吗?” | Readiness Analyzer代理 |
API准备度分析器
该插件包含一个子代理,用于评估API的AI代理兼容性。它在8个支柱上运行48次检查,并在0-100分制上为您的API打分。
用以下方式触发它:
- “我的API代理准备好了吗?”
- “扫描我的API以了解AI兼容性”
- “我的代理API有什么问题?”
它分析您的OpenAPI规范,识别问题,并引导您完成修复。它可以将改进后的规格推回给Postman。
看 examples/sample-readiness-report.md 用于示例输出。
配置
MCP服务器模式
此插件默认为 代码模式 (~45-50个工具),完全涵盖了8个命令中的7个。唯一的差距是文档发布(仅在完整模式下可用)。
代码模式(默认):
{
"mcpServers": {
"postman": {
"type": "http",
"url": "https://mcp.postman.com/mcp",
"headers": {
"Authorization": "Bearer ${POSTMAN_API_KEY}"
}
}
}
}全模式(高级用户,100多种工具):
编辑 .mcp.json 在插件目录中:
{
"mcpServers": {
"postman": {
"type": "http",
"url": "https://mcp.postman.com",
"headers": {
"Authorization": "Bearer ${POSTMAN_API_KEY}"
}
}
}
}完整模式包括 publishDocumentation / unpublishDocumentation 但超过了Cursor的80刀具限制。您可能需要在光标设置>MCP中禁用未使用的工具。
环境变量
| 变量 | 必填 | 描述 |
|---|---|---|
POSTMAN_API_KEY | 是 | 您的邮差API密钥(以 PMAK-) |
插件结构
cursor-postman-plugin/
├── .cursor-plugin/
│ └── plugin.json # Plugin manifest
├── .mcp.json # Postman MCP server config (Code mode)
├── commands/
│ ├── setup.md # /postman:setup
│ ├── sync.md # /postman:sync
│ ├── codegen.md # /postman:codegen
│ ├── search.md # /postman:search
│ ├── test.md # /postman:test
│ ├── mock.md # /postman:mock
│ ├── docs.md # /postman:docs
│ └── security.md # /postman:security
├── skills/
│ ├── postman-routing/ # Auto-routes intent to commands
│ ├── postman-knowledge/ # Postman concepts + MCP guidance
│ └── agent-ready-apis/ # API readiness knowledge
├── agents/
│ └── readiness-analyzer.md # 48-check API readiness analyzer
├── rules/
│ └── postman-best-practices.mdc # API design rules
├── assets/ # Logo and branding
├── examples/
│ └── sample-readiness-report.md
├── LICENSE # Apache-2.0
└── README.md贡献
- 分叉此存储库
- 创建要素分支:
git checkout -b feature/my-improvement - 进行更改
- 本地测试:
/add-plugin /path/to/your/fork - 提交拉取请求
添加新命令
- 创建
commands/your-command.md使用YAML frontmatter - 将路由模式添加到
skills/postman-routing/SKILL.md - 测试用
/postman:your-command在游标中 - 更新此自述文件
本地测试
# Clone the repo
git clone https://github.com/Postman-Devrel/cursor-postman-plugin.git
# Install in Cursor
# In Cursor agent, run:
/add-plugin /path/to/cursor-postman-plugin
# Verify
/postman:setup许可证
另见
- 克劳德代码的邮递员插件 -所有Postman AI编码插件的真相来源
- 邮递员代理技能 -适用于任何技能的便携式技能.sh兼容代理
- 邮递员光标规则 -游标的轻量级MCP配置+规则
