连接器指南阅读约 7 分钟35 个 MCP 工具7 种语言

如何通过 MCP 将 Postman 连接到 Gemini

在 AI 智能体中使用 Postman:浏览工作区、集合、文件夹和请求、环境、Spec Hub 规范和 API、带调用日志的 Mock 服务器、监控和团队成员,跨资源搜索,并在你确认后创建或修改集合、请求、环境、Mock、监控和规范。

HC作者:HelpCode 团队更新于 7 分钟阅读 在 GitHub 开源

无需信用卡 · 7 天试用 · 提供自托管方案

Postman

Postman

Let your AI work with Postman: workspaces, collections and requests, environments, Spec Hub specs, APIs, mock servers and their call logs, monitors and team users, and create or change collections, requests, environments, mocks, monitors and specs after you confirm.

个工具

35

区域

INTL

类别

基础设施

身份验证

API Key

所需环境变量

POSTMAN_API_URLPOSTMAN_API_KEY
在 Cloud 上一键安装

7 天免费试用 · 无需信用卡

  • 7 天免费试用
    无需信用卡
  • 符合 GDPR,SOC 2 就绪
    数据驻留欧盟,审计日志
  • 在 GitHub 开源
    开源 · AGPL-3.0
  • 支持 ChatGPT、Claude、Gemini
    任何兼容 MCP 的客户端

跳过安装。2 分钟内即可运行。

在 cloud.anythingmcp.com 开始免费试用,一键添加 Postman,然后将你的 AI 客户端(Claude、ChatGPT、Copilot 或 Cursor)指向生成的 MCP 端点。无需 Docker,无需 git clone,无需任何工程经验。

开始免费试用

摘要

在 AI 智能体中使用 Postman:浏览工作区、集合、文件夹和请求、环境、Spec Hub 规范和 API、带调用日志的 Mock 服务器、监控和团队成员,跨资源搜索,并在你确认后创建或修改集合、请求、环境、Mock、监控和规范。

试试这样问

Postman 的示例提示

点击任意提示即可复制,然后粘贴到 Claude、ChatGPT、Cursor、Gemini、Copilot 或 OpenClaw 中,在该连接器上运行。

Postman · 通过 MCP 实时
分享
Opus 4.7

Claude 是 AI,可能会出错。请核对回答。

💡 无需安装? 直接使用 cloud.anythingmcp.com。 登录、点击 Connectors → Postman、粘贴凭证、生成 MCP API key,即可完成。无 Docker、无 git clone、无本地服务器。

Postman + Gemini

在 AI 智能体中使用 Postman:浏览工作区、集合、文件夹和请求、环境、Spec Hub 规范和 API、带调用日志的 Mock 服务器、监控和团队成员,跨资源搜索,并在你确认后创建或修改集合、请求、环境、Mock、监控和规范。

前提条件

完整的设置说明已内置在连接器中 (在 store 中选择连接器时可见)。所需环境变量:

POSTMAN_API_URL, POSTMAN_API_KEY

步骤 1 — 获取凭证

设置大约需要 2 分钟。你需要一个能访问相关工作区的 Postman 账户。

  1. 在 Postman 中打开头像、Settings、API keys(https://go.postman.co/settings/me/api-keys),点击 Generate API Key。命名后复制密钥;它以 PMAK- 开头。
  2. 把它粘贴到 POSTMAN_API_KEY。密钥通过 X-Api-Key 请求头发送,并以你的 Postman 用户身份操作:你在各个工作区能看到的,AI 都能看到。
  3. 将 POSTMAN_API_URL 设为 https://api.postman.com;如果你的团队使用 Postman 欧盟数据区域的 Enterprise 方案,则设为 https://api.eu.postman.com。
  4. 安装连接器并运行 postman_get_me:它会显示你的用户 id、团队和每月 API 用量,同时确认密钥可用。

id 和 uid:大多数对象都有 id 和 uid(<owner user id>-<id>)。Mock、监控和 postman_update_collection 使用集合的 uid;postman_create_collection_request、postman_update_collection_request 和 postman_create_collection_folder 使用普通 id。其他读取工具两者都接受。

可以读取:

  • 你和你的团队:postman_get_me、postman_list_workspaces(把 createdBy 设为你的用户 id 即可得到“我的工作区”)、postman_get_workspace(其中的集合、环境、Mock、监控和 API)、postman_list_team_users,以及按文本查找请求、集合、工作区、环境、文档、flow 或规范的 postman_search(默认只搜索你的团队,设置 ownership 可包含公开资源)。
  • Postman Collection Format v2.1 格式的集合:postman_list_collections、postman_get_collection(大型集合先用 model=minimal)、postman_get_collection_folder,以及包含方法、URL、请求头、请求体、认证和脚本的 postman_get_collection_request。
  • 环境:postman_list_environments 和 postman_get_environment,包含每个变量的键、值、类型和启用状态。
  • API 设计:Spec Hub 的 postman_list_specs、postman_get_spec、postman_list_spec_files、postman_get_spec_file 和 postman_get_spec_definition(完整解析后的 OpenAPI 或 AsyncAPI 定义);旧版 API Builder 的 API 用 postman_list_apis 和 postman_get_api。
  • Mock:postman_list_mocks、postman_get_mock 和 postman_get_mock_call_logs,即客户端发给 Mock 的内容和 Mock 的响应(每次最多 100 条或 6.5 MB;请求头和请求体需配合 include)。
  • 监控:postman_list_monitors 和 postman_get_monitor,其中 lastRun 显示最近一次的状态、时间以及通过和失败的断言数。

经你确认后可以写入:postman_create_collection、postman_update_collection(名称、描述、变量、认证;文件夹和请求保持不变)、postman_create_collection_folder、postman_create_collection_request、postman_update_collection_request(传入的字段替换旧值)、postman_create_environment、postman_update_environment、postman_create_mock、postman_create_monitor、postman_run_monitor、postman_create_spec(OpenAPI、AsyncAPI、protobuf、GraphQL、Smithy)和 postman_update_spec_file。AI 会说明要在哪个工作区创建或修改什么,得到你的同意后才调用。写入的内容对工作区所有成员可见。请注意:

  • postman_run_monitor 会把集合中的真实请求发送到对应的 API,并消耗你方案中的一次监控运行;postman_create_monitor 之后会按计划持续运行。
  • 新建的 Mock 默认公开,除非 private 为 true。
  • postman_update_environment 每次调用只接受一种 JSON Patch 操作;AI 会先读取环境以确定变量位置(values[0] 即 /values/0)。
  • Postman API 无法直接运行集合。请使用监控,或在你自己的 CI 中使用 Postman CLI。

安装后 35 个工具全部启用,没有被关闭的工具,也没有任何工具会删除工作区、集合、请求、环境、Mock、监控或规范。

机密信息:secret 类型的环境变量在共享时会连同值一起返回,集合变量或请求认证中也可能包含令牌。除非你要求,AI 不会复述这些值。

数据格式:集合和请求使用 Postman Collection Format v2.1(item 中包含文件夹和请求)。日期为 UTC 的 ISO 8601。

分页:postman_list_workspaces、postman_list_apis、postman_list_specs、postman_list_monitors、postman_get_mock_call_logs 和 postman_search 返回 meta.nextCursor;AI 会带上 cursor 继续调用,直到它为空。postman_list_collections 用 limit 和 offset 分页;它的 name 筛选按名称精确匹配,不能与二者同时使用。

限制:Postman 允许每个用户每分钟 300 个请求;postman_list_collections、postman_list_workspaces、postman_get_workspace 和监控相关端点则是 10 秒内最多 10 次。每个方案还有每月 API 调用配额,可在 postman_get_me 的 operations 中查看。带 rateLimited 的 429 表示需要等待(Retry-After 给出秒数);serviceLimitExhausted 表示方案配额已用完,需要团队管理员处理。

常见错误:401 表示密钥错误、已过期或已吊销,或属于另一个数据区域(检查 POSTMAN_API_URL)。403 表示你在该工作区的角色不允许此调用。404 表示 id 不存在或你无权查看。400 会指出错误的字段,例如在需要 uid 的地方传了集合 id。

连接器不会删除任何内容,也不涉及 fork 和 pull request、评论、标签、治理、API 目录、私有 API 网络、SCIM、审计日志、账单以及旧版 API Builder 的写入操作。

步骤 2 — 安装 adapter

curl -fsSL https://raw.githubusercontent.com/HelpCode-ai/anythingmcp/main/docker-compose.quickstart.yml -o docker-compose.yml
printf 'JWT_SECRET=%s\nENCRYPTION_KEY=%s\n' "$(openssl rand -hex 32)" "$(openssl rand -hex 32)" > .env
docker compose up -d

步骤 3 — 在 Gemini 中添加连接器

你的服务器 URL: 在 AnythingMCP 中打开 MCP Servers → 此连接器所在的服务器,复制它的 URL(https://cloud.anythingmcp.com/mcp/…)。本指南中出现 YOUR_SERVER_ID 的地方都用它替换。

Gemini CLI 从 ~/.gemini/settings.json(Windows 上为 %USERPROFILE%\.gemini\settings.json)读取 MCP 服务器。添加:

{
  "mcpServers": {
    "anythingmcp": {
      "httpUrl": "https://cloud.anythingmcp.com/mcp/YOUR_SERVER_ID",
      "headers": { "X-API-Key": "YOUR_MCP_API_KEY" }
    }
  }
}
  1. 在 AnythingMCP 的 MCP Servers → 你的服务器 → API keys 中创建 MCP API 密钥,并用它替换 YOUR_MCP_API_KEY。
  2. 保存文件并重启 gemini。
  3. 在 Gemini CLI 中运行 /mcp(或在终端运行 gemini mcp list),anythingmcp 应显示为已连接。
  4. 开始输入提示,Gemini CLI 现在可以调用 Postman 的工具。

可用工具

ToolWhat it does
postman_get_meRead the Postman user the API key belongs to: user id, username, email, team id and name, and the monthly usage of API calls and other plan…
postman_list_workspacesList the workspaces the key can see: id, name, type and visibility (personal, team, private, public, partner)
postman_get_workspaceRead one workspace with the collections, environments, mocks, monitors and APIs it contains (ids, uids and names), its visibility and who…
postman_list_collectionsList collections, optionally of one workspace: id, uid, name, owner and dates
postman_get_collectionRead a whole collection in Postman Collection Format v2.1: info, folders and requests (item), variables, auth and scripts
postman_get_collection_requestRead one request of a collection: method, url, headers, query parameters, body, auth and scripts
postman_get_collection_folderRead one folder of a collection with the ids of its requests and subfolders (or their full contents with populate)
postman_list_environmentsList environments, optionally of one workspace: id, uid, name, owner and dates
postman_get_environmentRead an environment with its variables (key, value, type, enabled)
postman_list_apisList the APIs (API Builder) of a workspace: id, name, summary and dates
postman_get_apiRead one API with, on request, its linked collections, versions, schemas or Git repository details
postman_list_mocksList the active mock servers: id, uid, name, mockUrl, the collection and environment they serve, and whether they are private
postman_get_mockRead a mock server: mockUrl, collection, environment, private flag, delay and server responses
postman_get_mock_call_logsRead the requests a mock server received and what it answered, newest first with sort=servedAt and direction=desc
postman_list_monitorsList monitors (scheduled collection runs): id, uid, name, owner and whether they are active
postman_get_monitorRead a monitor: collection, environment, schedule (cron and time zone), regions, notifications, and lastRun with status, start and finish…
postman_list_specsList the API specifications in Spec Hub for a workspace: id, name, type (OPENAPI:3.0, ASYNCAPI:2.0 ...) and dates
postman_get_specRead a spec's metadata: name, type, dates and who created and changed it
postman_list_spec_filesList the files of a spec with their path and type (ROOT is the entry file, DEFAULT a referenced file)
postman_get_spec_fileRead one file of a spec, including its content as text
postman_get_spec_definitionRead the complete, resolved definition of an OpenAPI or AsyncAPI spec, with all files combined
postman_list_team_usersList the users of the Postman team: id, name, username, email, roles and join date
postman_searchSearch Postman for requests, collections, workspaces, environments, documents, flows or specs by text
postman_create_collectionCreate a collection in a workspace, empty or with folders and requests in Postman Collection Format v2.1
postman_update_collectionChange a collection's name or description, its variables or its auth, leaving folders and requests as they are
postman_create_collection_folderCreate a folder in a collection, at the top level or inside another folder
postman_create_collection_requestAdd a request to a collection, at the top level or in a folder: method, URL, headers, query parameters, body and scripts
postman_update_collection_requestChange a request in a collection: name, method, URL, headers, query parameters, body, auth or scripts
postman_create_environmentCreate an environment in a workspace with its variables
postman_update_environmentChange an environment with JSON Patch operations of one kind per call: add variables, replace the name or a variable property, or remove…
postman_create_mockCreate a mock server that answers with the saved example responses of a collection
postman_create_monitorCreate a monitor that runs a collection on a schedule from Postman's cloud
postman_run_monitorRun a monitor now, which sends the collection's real requests to their APIs and uses a monitoring run of the plan
postman_create_specCreate an API specification in Spec Hub from one or more files (OpenAPI, AsyncAPI, protobuf, GraphQL, Smithy)
postman_update_spec_fileChange one file of an OpenAPI or protobuf spec: its content, its name, or its type (ROOT or DEFAULT)

示例提示

  • “我们的‘Payments’工作区里有哪些集合?Checkout 集合包含哪些请求?”
  • “订单 API 的夜间监控最近一次运行通过了吗?有多少个断言失败?”
  • “给我看我们的结账 Mock 服务器最近 20 次返回 404 的调用。”
  • “在 Payments 集合中添加一个 POST 请求‘Create refund’,带 orderId 和 amount 的 JSON 请求体。”
  • “给我 Orders 规范解析后的 OpenAPI 定义,并列出它的端点。”

FAQ

Gemini CLI 从哪里读取 MCP 服务器? 用户级配置位于 ~/.gemini/settings.json,项目级配置位于项目内的 .gemini/settings.json。gemini mcp list 会列出每个服务器及其连接状态。

下一步

这份指南对你有帮助吗?

你的 Postman 智能体只差一次点击。

安装连接器,粘贴密钥,向 Gemini 提问。免费试用 7 天,无需信用卡。

相关指南

连接器

如何通过 MCP 将 Postman 连接到 ChatGPT

在 AI 智能体中使用 Postman:浏览工作区、集合、文件夹和请求、环境、Spec Hub 规范和 API、带调用日志的 Mock 服务器、监控和团队成员,跨资源搜索,并在你确认后创建或修改集合、请求、环境、Mock、监控和规范。

连接器

如何通过 MCP 将 Postman 连接到 Claude

在 AI 智能体中使用 Postman:浏览工作区、集合、文件夹和请求、环境、Spec Hub 规范和 API、带调用日志的 Mock 服务器、监控和团队成员,跨资源搜索,并在你确认后创建或修改集合、请求、环境、Mock、监控和规范。

连接器

如何通过 MCP 将 Postman 连接到 Cursor

在 AI 智能体中使用 Postman:浏览工作区、集合、文件夹和请求、环境、Spec Hub 规范和 API、带调用日志的 Mock 服务器、监控和团队成员,跨资源搜索,并在你确认后创建或修改集合、请求、环境、Mock、监控和规范。

连接器

如何通过 MCP 将 Postman 连接到 Meta Muse

在 AI 智能体中使用 Postman:浏览工作区、集合、文件夹和请求、环境、Spec Hub 规范和 API、带调用日志的 Mock 服务器、监控和团队成员,跨资源搜索,并在你确认后创建或修改集合、请求、环境、Mock、监控和规范。

连接器

Postman 接入 MCP:在任意 AI 智能体中使用工作区、集合、请求、环境、规范、Mock 和监控

在 AI 智能体中使用 Postman:浏览工作区、集合、文件夹和请求、环境、Spec Hub 规范和 API、带调用日志的 Mock 服务器、监控和团队成员,跨资源搜索,并在你确认后创建或修改集合、请求、环境、Mock、监控和规范。

连接器

如何通过 MCP 将 Postman 连接到 Microsoft Copilot

在 AI 智能体中使用 Postman:浏览工作区、集合、文件夹和请求、环境、Spec Hub 规范和 API、带调用日志的 Mock 服务器、监控和团队成员,跨资源搜索,并在你确认后创建或修改集合、请求、环境、Mock、监控和规范。