PostMCP – Turn any OpenAPI spec into a context-optimized MCP server PostMCP, a tool from developer BraveRam, converts any OpenAPI or Swagger specification into a Model Context Protocol (MCP) server for AI coding assistants such as OpenCode, Cursor, Claude Desktop, and Windsurf. PostMCP claims its token-diet feature cuts token consumption by 70% to 95% by stripping boilerplate and converting large JSON arrays into Markdown tables, while adaptive JIT routing keeps tool definitions under 1,500 active tokens for large specs like Stripe and GitHub. The tool installs via a one-line shell script or npm package @postmcp/cli, and its dry-run protection intercepts POST, PUT, and DELETE mutations before they reach production systems. Turn any OpenAPI or Swagger specification into a fast, context-optimized, safe Model Context Protocol MCP server for your AI coding agents. AI coding assistants OpenCode, Cursor, Claude Desktop, Windsurf are great at writing code, but giving them direct access to external APIs usually means writing hundreds of lines of custom MCP server boilerplate by hand. Even if you auto-convert an OpenAPI spec naively, you hit immediate problems: - Context Bloat : A 200-endpoint API injects tens of thousands of tokens into every turn, exhausting context limits and causing hallucinations. - Token Drowning : Raw API responses return massive JSON payloads full of nulls, URLs, and internal metadata your LLM does not need. - Auth Confusion : Every API has different credential headers, query formats, and auth schemes. PostMCP solves this out of the box: 1. Inspect any API in seconds : Point to any OpenAPI URL, file, or preset to instantly see its endpoints, risk levels, and exact authentication requirements. 2. Zero-Code Execution : Run an in-memory MCP server over standard stdio or Streamable HTTP. 3. Token Diet : Automatically strips boilerplate and turns large JSON arrays into concise Markdown tables, cutting token consumption by 70% to 95%. 4. Adaptive JIT Routing : Scales to massive specs e.g. Stripe, GitHub by keeping tool definitions under 1,500 active tokens and loading endpoints on demand. 5. Dry-Run Protection : Intercepts destructive mutations POST, PUT, DELETE before they touch production systems. Install PostMCP in one command: macOS & Linux curl -fsSL https://raw.githubusercontent.com/BraveRam/postmcp/main/install.sh | bash Windows PowerShell irm https://raw.githubusercontent.com/BraveRam/postmcp/main/install.ps1 | iex Or via your favorite package manager: npm install -g @postmcp/cli or: pnpm add -g @postmcp/cli or: bun add -g @postmcp/cli Add any API directly to your coding assistant without installing anything locally: { "$schema": "https://opencode.ai/config.json", "mcp": { "firecrawl": { "type": "local", "enabled": true, "command": "bunx", "@postmcp/cli", "run", "https://raw.githubusercontent.com/firecrawl/firecrawl/refs/heads/main/apps/api/openapi.json" , "environment": { "BEARER TOKEN": "YOUR FIRECRAWL API KEY" } } } } Run directly in terminal: claude mcp add firecrawl -s project -e BEARER TOKEN=YOUR FIRECRAWL API KEY -- bunx @postmcp/cli run https://raw.githubusercontent.com/firecrawl/firecrawl/refs/heads/main/apps/api/openapi.json Or add to .mcp.json in your project root: { "mcpServers": { "firecrawl": { "command": "bunx", "args": "@postmcp/cli", "run", "https://raw.githubusercontent.com/firecrawl/firecrawl/refs/heads/main/apps/api/openapi.json" , "env": { "BEARER TOKEN": "YOUR FIRECRAWL API KEY" } } } } OpenAI Codex caches tools on initial startup and does not support mid-session dynamic tool reloading list changed . Always pass --no-jit to expose tools statically. Run directly in terminal: codex mcp add firecrawl --env BEARER TOKEN=YOUR FIRECRAWL API KEY -- bunx @postmcp/cli run https://raw.githubusercontent.com/firecrawl/firecrawl/refs/heads/main/apps/api/openapi.json --no-jit Or add to .codex/config.toml or ~/.codex/config.toml : mcp servers.firecrawl command = "bunx" args = "@postmcp/cli", "run", "https://raw.githubusercontent.com/firecrawl/firecrawl/refs/heads/main/apps/api/openapi.json", "--no-jit" env = { BEARER TOKEN = "YOUR FIRECRAWL API KEY" } { "mcpServers": { "firecrawl": { "command": "bunx", "args": "@postmcp/cli", "run", "https://raw.githubusercontent.com/firecrawl/firecrawl/refs/heads/main/apps/api/openapi.json" , "env": { "BEARER TOKEN": "YOUR FIRECRAWL API KEY" } } } } Note: Replace "bunx" with "npx", "-y" if running on Node.js instead of Bun . Launch the local interactive workbench to explore APIs, test endpoints in the AI sandbox, and curate Token Diet rules: postmcp studio Opens http://localhost:3000 in your default browser. From here, you can load any of the 60+ bundled presets, import custom OpenAPI specs, and access the built-in documentation at http://localhost:3000/docs . Before connecting an API to your agent, inspect it to verify its endpoints and authentication requirements: postmcp inspect https://raw.githubusercontent.com/firecrawl/firecrawl/refs/heads/main/apps/api/openapi.json Or inspect one of the 60+ built-in presets: npx @postmcp/cli inspect @stripe The output gives you an immediate summary: - Total operations and HTTP methods. - Base API URL. - Security schemes and exact credential requirements. - Estimated token savings with Token Diet. Every API authenticates differently. PostMCP makes it easy to know what to pass. When you run postmcp inspect , check the Security Schemes and Authentication Guide in the output. There are three common authentication patterns: Common services: Firecrawl, Stripe, GitHub, OpenAI, Supabase, Neon. - What it means : The API expects an HTTP Authorization: Bearer