Token导航 LogoToken导航TokenDH.com
REST-to-Postman MCP logo
开发工具stdio官方级别未说明来源级核验

REST-to-Postman MCP

MCP Server

@smithery/cli

Rest To Postman Collection MCP Server

工具数

2

提示词数

0

GitHub Stars

0

资源数

0
API开发JavaScriptClaudeAPI集成ClaudeCursorCline

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

runninghare

提供方

runninghare

最后核验

2026/5/18 03:27

运行时

Node.js

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

npx -y @smithery/cli install @runninghare/rest-to-postman-mcp --client claude

详细介绍

REST到邮递员MCP

](https://smithery.ai/server/@runninghare/rest-to-postman-mcp)

模型上下文协议(MCP)服务器,用于将REST API代码(例如,NestJS控制器、FastAPI/Flask端点)转换为Postman集合和环境。该工具帮助开发人员自动将他们的REST API端点和环境配置与Postman同步。

特性

  • 将REST API端点转换为Postman集合
  • 将环境变量与Postman环境同步
  • 支持各种身份验证方法(例如,承载令牌)
  • 新端点与现有集合的智能合并
  • 敏感环境变量的自动处理
  • 支持stdio和SSE传输模式

先决条件

  • 包子 v1.2.2或更高版本
  • 邮差API密钥
  • 邮递员工作区ID

安装与使用

这是一个模型上下文协议(MCP)stdio服务器,需要访问Postman工作区来创建/更新集合和环境。

通过Smithery安装

通过以下方式自动将REST安装到克劳德桌面版的Postman MCP 史密瑟里:

npx -y @smithery/cli install @runninghare/rest-to-postman-mcp --client claude

使用以下命令运行MCP服务器 npx

使用MCP服务器 npx:

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 

您可以将此命令与支持MCP的各种AI代码编辑器集成:

  • 克劳德桌面
  • 光标
  • 帆板运动
  • Roo Cline编辑
重要提示:服务器需要Postman API凭据才能运行。在启动服务器之前,请确保已准备好API密钥和工作区ID。

工具说明

服务器提供两个主要工具:

1.REST到Postman环境(rest_to_postman_env)

使用应用程序的环境变量创建或更新Postman环境。

输入参数:

  • envName (string):Postman环境的名称
  • envVars (object):环境变量的键值对

输入示例:

{
    "envName": "REST Environment",
    "envVars": {
        "API_URL": "https://api.example.com",
        "API_TOKEN": "secret-token-1"
    }
}

2.休息至邮差收藏(rest_to_postman_collection)

使用REST API终结点创建或更新Postman集合。

输入参数:

  • collectionRequest (对象):邮差集合配置,包含:

- info:集合元数据 - auth:身份验证设置 - item:API终结点数组

输入示例:

{
    "info": {
        "name": "REST Collection",
        "description": "REST Collection", 
        "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
    },
    "auth": {
        "type": "bearer",
        "bearer": [
            {   
                "key": "Authorization",
                "value": "Bearer {{API_TOKEN}}",
                "type": "string"
            }
        ]
    },  
    "item": [
        {
            "name": "Get Users",
            "request": {
                "method": "GET",    
                "url": {
                    "raw": "{{API_URL}}/users",
                    "protocol": "https",
                    "host": ["api", "example", "com"],
                    "path": ["users"]
                }   
            }
        }
    ]
}

响应格式

这两个工具都会返回一条成功消息,确认Postman资源的创建/更新:

{
    "content": [{
        "type": "text",
        "text": "Successfully created/updated Postman environment: REST Environment"
    }]
}

在游标中使用此MCP

您可以在Cursor中使用此MCP服务器。下面是一个基于Nest.js Typescript控制器生成Postman Collection的示例。

__提示__:

Create a postman collection named "Campaign Endpoints" based on this next.js controller. The baseUrl is `http://localhost:7022`. The collection should have a Bear token which applies to all the endpoints

以下是自动生成的邮差收藏:

注意来自的所有端点 Campaign 控制器与熊令牌设置一起生成。

发展

本地设置

  1. 克隆存储库:
git clone https://github.com/runninghare/rest-to-postman.git
cd rest-to-postman
  1. 安装依赖项:
bun install
  1. 创建一个 .env 文件:
POSTMAN_API_KEY=your_api_key_here
POSTMAN_ACTIVE_WORKSPACE_ID=your_workspace_id_here

以开发模式运行

对于开发,您可以直接使用Bun运行服务器:

# Start in stdio mode (default)
bun run src/mcp.ts

# Start in SSE mode
bun run src/mcp.ts --sse

建筑

要构建项目,请执行以下操作:

bun run build

这将在 dist 目录。

脚本

  • bun run build -构建项目
  • bun run dev -在开发模式下运行服务器
  • bun run startSSE -以SSE模式启动服务器

贡献

欢迎投稿!请随时提交拉取请求。

许可证

此项目根据MIT许可证获得许可-有关详细信息,请参阅许可证文件。

目录标签

目录标签

API开发JavaScriptClaudeAPI集成developer-tools本地部署Postman集成自动化工具RESTAPI环境管理

支持客户端

ClaudeCursorCline

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

none

运行时(runtime,运行环境)

Node.js

部署方式(deploymentType,部署类型)

remote-capable

来源包(packageName,安装包名)

@smithery/cli

工具数量(toolCount,工具数)

2

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdiononeremote-capable

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP