REST 到 Postman MCP
一个模型上下文协议 (MCP) 服务器,用于将 REST API 代码(例如 NestJS 控制器、FastAPI/Flask 端点)转换为 Postman 集合和环境。此工具可帮助开发人员自动将其 REST API 端点和环境配置与 Postman 同步。
特征
- 将 REST API 端点转换为 Postman 集合
- 与 Postman 环境同步环境变量
- 支持各种身份验证方法(例如 Bearer token)
- 新端点与现有集合的智能合并
- 自动处理敏感环境变量
- 支持 stdio 和 SSE 传输模式
先决条件
- Bun v1.2.2 或更高版本
- Postman API 密钥
- Postman 工作区 ID
安装和使用
这是一个模型上下文协议 (MCP) stdio 服务器,需要访问您的 Postman 工作区来创建/更新集合和环境。
通过 Smithery 安装
要通过Smithery自动为 Claude Desktop 安装 REST-to-Postman MCP:
使用npx
运行 MCP 服务器
要将 MCP 服务器与npx
一起使用:
或者使用环境变量:
您可以将此命令与支持 MCP 的各种 AI 代码编辑器集成:
- 克劳德桌面
- 光标
- 风帆冲浪
- Roo Cline 编辑
重要提示:服务器需要 Postman API 凭证才能运行。在启动服务器之前,请确保已准备好 API 密钥和工作区 ID。
工具描述
该服务器提供两个主要工具:
1. REST 到 Postman 环境( rest_to_postman_env
)
使用应用程序的环境变量创建或更新 Postman 环境。
输入参数:
envName
(字符串):Postman 环境的名称envVars
(对象):环境变量的键值对
示例输入:
2. REST 到 Postman 集合( rest_to_postman_collection
)
使用您的 REST API 端点创建或更新 Postman 集合。
输入参数:
collectionRequest
(对象):Postman 收集配置包含:info
:集合元数据auth
:身份验证设置item
:API 端点数组
示例输入:
响应格式
两种工具都会返回一条成功消息,确认 Postman 资源的创建/更新:
在 Cursor 中使用此 MCP
您可以在 Cursor 中使用此 MCP 服务器。以下示例基于 Nest.js Typescript 控制器生成 Postman Collection。
迅速的:
这是自动生成的 Postman Collection:
请注意, Campaign
Controller 的所有端点都已生成,同时还生成了 Bear 令牌设置。
发展
本地设置
- 克隆存储库:
- 安装依赖项:
- 创建
.env
文件:
以开发模式运行
对于开发,您可以直接使用 Bun 运行服务器:
建筑
要构建项目:
这将在dist
目录中创建捆绑输出。
脚本
bun run build
构建项目bun run dev
以开发模式运行服务器bun run startSSE
以 SSE 模式启动服务器
贡献
欢迎贡献代码!欢迎提交 Pull 请求。
执照
该项目根据 MIT 许可证获得许可 - 有关详细信息,请参阅 LICENSE 文件。
You must be authenticated.
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
将 REST API 代码(如 NestJS 控制器或 FastAPI 端点)转换为 Postman 集合和环境,帮助开发人员自动将其 API 端点与 Postman 同步。
Related MCP Servers
- AsecurityAlicenseAqualityEnables running Postman collections using Newman for conducting API tests and obtaining detailed result analysis via a standardized interface.Last updated -12726TypeScriptMIT License
- AsecurityAlicenseAqualityAn MCP server that generates AI agent tools from Postman collections and requests. This server integrates with the Postman API to convert API endpoints into type-safe code that can be used with various AI frameworks.Last updated -17JavaScriptMIT License
- -securityAlicense-qualityA server that enables interaction with any API that has a Swagger/OpenAPI specification through Model Context Protocol (MCP), automatically generating tools from API endpoints and supporting multiple authentication methods.Last updated -61TypeScriptApache 2.0
- -securityFlicense-qualityA server based on Model Context Protocol that parses Swagger/OpenAPI documents and generates TypeScript types and API client code for different frameworks (Axios, Fetch, React Query).Last updated -1431TypeScript