
REST-to-Postman MCP

2025.04.13
0
JavaScriptAPI转换工具Postman集成开发效率
REST-to-Postman MCP 是一个模型上下文协议(MCP)服务器,能够将REST API代码(如NestJS控制器、FastAPI/Flask端点)转换为Postman集合和环境配置。该工具帮助开发者自动同步其REST API端点和环境配置到Postman中,提升开发效率。
View on GitHub
Overview
基本能力
产品定位
REST-to-Postman MCP 是一个开发工具,旨在帮助开发者将REST API代码自动转换为Postman集合和环境配置,简化API测试和文档生成流程。
核心功能
- 将REST API端点转换为Postman集合
- 同步环境变量到Postman环境
- 支持多种认证方法(如Bearer token)
- 智能合并新端点到现有集合
- 自动处理敏感环境变量
- 支持stdio和SSE传输模式
适用场景
- 开发者需要快速将REST API代码转换为Postman集合
- 团队需要同步API环境配置
- 自动化API测试和文档生成
工具列表
- REST to Postman Environment (
rest_to_postman_env
): 创建或更新Postman环境,包含应用程序的环境变量。 - REST to Postman Collection (
rest_to_postman_collection
): 创建或更新Postman集合,包含REST API端点。
常见问题解答
- 如何获取Postman API Key和Workspace ID? 需要在Postman账户中生成API Key并获取Workspace ID。
- 支持哪些传输模式? 支持stdio和SSE模式。
使用教程
使用依赖
- Bun v1.2.2或更高版本
- Postman API Key
- Postman Workspace ID
安装教程
通过Smithery安装
npx -y @smithery/cli install @runninghare/rest-to-postman-mcp --client claude
使用npx运行MCP服务器
npx -y rest-to-postman@latest --postman-api-key your_api_key --postman-workspace-id your_workspace_id
或使用环境变量:
export POSTMAN_API_KEY=your_api_key
export POSTMAN_ACTIVE_WORKSPACE_ID=your_workspace_id
npx -y rest-to-postman@latest
调试方式
本地开发模式
# 以stdio模式运行(默认)
bun run src/mcp.ts
# 以SSE模式运行
bun run src/mcp.ts --sse