Postman MCP

Postman MCP

Sync your API code into Postman collections — body, params, auth, responses, tests, and examples — with zero manual fill, straight from Claude Code.

Category
访问服务器

README

<div align="center">

<img src="assets/logo/logo.svg" alt="Postman MCP" width="96" height="96">

Postman MCP

Sync your API code into Postman collections — body, params, auth, responses, tests, and examples — with zero manual fill, straight from Claude Code.

OpenAPI-first · code-parsing fallback · a diff before every write.

PyPI Python License: MIT CI codecov Docs

Documentation · Quickstart · Commands · Roadmap

</div>


Demo — an animated syncapi → diff → write recording goes here at launch (see assets/README.md).

/postman:syncapi createPayment --into payments

SYNC PREVIEW — POST /payments  →  collection / payments   [NEW] [openapi]

+ Request    POST {{base_url}}/payments
+ Auth       Bearer {{token}}              (from require_auth middleware)
+ Body       { "amount": 4200, "currency": "USD", "method": "card" }
+ Responses  201 Created, 400, 401, 422, 500
+ Tests      status(201) · schema(PaymentResponse) · business(amount > 0)
+ Examples   1 success, 4 error

Write? [y / n]

The problem

API code and Postman drift apart the moment you ship. Every new route, changed body shape, or added error response means going back into Postman by hand — re-typing fields, re-writing example data, re-doing test scripts. The work is mechanical, constant, and easy to skip, so collections rot. A rotten collection is worse than none: teammates trust it, then get burned by a stale endpoint.

The code already contains everything Postman needs — routes, types, middleware, comments. There's no reason a human should be the copy machine between them.

Why Postman MCP

  • Zero manual fill. Body, params, auth headers, every response, examples, and test scaffolds — all generated from your code.
  • OpenAPI-first. When your framework emits a spec, one mapper covers FastAPI, NestJS, and Django REST Framework. No spec? It falls back to parsing your code.
  • Diff before every write. Nothing reaches Postman until you've seen exactly what changes. There is no skip flag.
  • Never destroys your work. Test scripts, manual examples, and edited descriptions are read back and preserved on every sync.
  • Secrets never touch the repo. Your Postman API key is stored by reference — OS keychain, env var, or a gitignored file.
  • Low token cost. syncchanges parses only what you changed and reads just the collection's basic structure — never a full re-scan.

Features

Five sync commands from one route to the whole codebase
Frameworks FastAPI · Django REST Framework · Express · NestJS
Input OpenAPI 3.x spec (preferred) or framework code parsing, decided per route
Output complete Postman Collection v2.1 items — request, responses, scripts, examples, docs
Tests status + schema tiers (deterministic); business-logic tier gated/opt-in
Safety diff-before-write, soft deletes, preserved human work, secret masking

Architecture

Claude Code  ──slash commands──▶  Postman MCP Server (local)
             ◀──diffs/prompts───
                                      │
   ┌──────────┬──────────┬───────────┼──────────┬───────────┐
   ▼          ▼          ▼           ▼          ▼           ▼
Command    Input      Engine     Postman      Git        Config +
router     resolver  (builder)   client      reader      Secret store
         (OpenAPI/                (REST)    (diff since
          code)                              commit)

The five sync commands are one engine plus five selectors — the engine turns a normalized route model into a complete Postman request; the selectors decide which code goes in and where it lands. Full write-up in the architecture docs.

Installation

pip install postman-mcp

Requires Python ≥ 3.10, Claude Code, and a Postman personal API key. See Installation.

Quick start

# 1. install
pip install postman-mcp

# 2. set up this project (once)
cd my-api-project
postman-mcp init
#   → paste your Postman API key
#   → pick workspace + collection
#   → done: server registered, commands installed

# 3. open Claude Code in this project, then:
/postman:syncall        # first full sync
/postman:syncchanges    # from now on, after each change

# anytime something looks off:
postman-mcp doctor      # checks the whole setup chain

How it works

Step Where What
pip install postman-mcp terminal CLI + MCP server + slash commands + engine
postman-mcp init terminal key handshake, pick workspace + collection, write config, register MCP server, install slash commands
/postman:* Claude Code sync APIs into the collection

Three actions — install, init, then use inside Claude Code. After init, you never touch the terminal again for normal work.

Commands

Command What it does
/postman:syncapi <fn|"METHOD /route"|code> [--into path] Sync one API (the kernel).
/postman:syncchanges [--last N] [--since ref] Sync what changed since last sync (daily driver).
/postman:sync -<file|module|dir> [--into path] Sync everything in one file/module/dir.
/postman:syncall [--into path] Sync the whole codebase.
/postman:createenv [name] Generate a Postman environment from code.
/postman:status [--since ref] Read-only drift check. No writes.

Terminal-only: postman-mcp init, postman-mcp doctor, postman-mcp serve, postman-mcp version.

Examples

Runnable examples per framework live in examples/:

Example Framework Input path
fastapi-basic/ FastAPI code parsing
fastapi-openapi/ FastAPI OpenAPI spec
django-rest-framework/ Django REST Framework OpenAPI
express-api/ Express code parsing
nestjs-api/ NestJS OpenAPI

Configuration

All config lives in a small, committable, secret-free postman-mcp.json at your project root. See Configuration.

Framework support

OpenAPI-first for FastAPI, NestJS (@nestjs/swagger), and DRF (drf-spectacular); code-parsing fallback for all four, with Express as the primary code-path case. Details and known limits in the framework guides.

Roadmap

0.1.0 MVP → 0.2.0 hardening → 0.3.0 CI + Newman → 1.0.0 stable. See ROADMAP.md.

Contributing

Contributions welcome! See CONTRIBUTING.md, the Code of Conduct, and the development docs.

git clone https://github.com/logesh-works/postman-mcp
cd postman-mcp
python -m venv .venv && pip install -e ".[dev]"
pytest --cov

Security

The API key is stored by reference only and every write is gated behind a diff. Report vulnerabilities privately — see SECURITY.md.

License

MIT © Logesh Kumar (logeshkumar.in).


<div align="center"> <sub>Code is the source of truth for what an API <em>is</em>; Postman for what <em>exists</em>.</sub> </div>

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选