Postman MCP Server

Postman MCP Server

用于通过Newman运行Postman集合的MCP Server。

smithery 徽章 Postman 服务器 MCP 服务器

简介

Postman MCP 服务器是一个允许大语言模型通过标准化接口执行 Postman 集合并获取详细测试结果的工具。

安装

自动安装 (推荐)

使用 Smithery 为 Claude 桌面安装:

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

手动安装

git clone <仓库URL>
cd mcp-postman
pnpm install
pnpm build

配置

编辑 Claude 桌面配置文件 ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "postman-runner": {
      "command": "node",
      "args": ["/绝对路径/to/mcp-postman/build/index.js"]
    }
  }
}

使用方法

运行集合

使用 run-collection 工具来执行 Postman 集合:

参数:

  • collection (必需): Postman 集合的路径或 URL
  • environment (可选): 环境文件的路径或 URL
  • globals (可选): 全局变量文件的路径或 URL
  • iterationCount (可选): 要运行的迭代次数

在 Claude 中使用

只需向 Claude 描述你的需求:

"运行位于 /path/to/collection.json 的 Postman 集合并告诉我所有测试是否通过"

响应示例

{
  "success": true,
  "summary": {
    "total": 5,
    "failed": 0,
    "passed": 5
  },
  "failures": [],
  "timings": {
    "started": "2024-03-14T10:00:00.000Z",
    "completed": "2024-03-14T10:00:01.000Z",
    "duration": 1000
  }
}

主要特性

  • 使用 Newman 运行 Postman 集合
  • 支持环境文件和全局变量
  • 提供详细的测试结果信息
  • 显示总体成功/失败状态和执行时间

更多信息

查看完整演示: MCP Postman 服务器演示