Turn any REST API into an MCP server. No code required.
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
APIFold reads an OpenAPI 3.x or Swagger 2.x specification and generates a live, production-ready MCP server endpoint. AI agents — Claude, Cursor, Copilot, or any MCP-compatible client — can connect immediately. Tool calls execute real HTTP requests to real upstream APIs with securely stored credentials. No stubs, no mocks, no glue code.
Quick Start
CLI (fastest)
One command. Your spec becomes a running MCP server with SSE transport on localhost:3000. Connect Claude or Cursor immediately.
From the API Registry
Ships with 8 pre-configured API specs: Stripe, GitHub, Slack, HubSpot, Twilio, OpenAI, Notion, and Petstore.
Hosted Platform
1. Sign up at apifold.dev
2. Import a spec (URL, file upload, or browse the registry)
3. Copy the connection snippet into Claude Desktop or Cursor
4. Your MCP server is live with a unique endpoint URL
Features
- **OpenAPI 3.x + Swagger 2.0** — auto-converts Swagger 2.0 specs transparently
- **CLI tool** — npx apifold serve for zero-config local MCP servers
- **API registry** — one-click deploy from 8 curated API specs
- **OAuth 2.0** — Authorization Code (PKCE), Client Credentials, 8 provider presets, auto token refresh
- **Access profiles** — tool-level permissions (Read Only / Read-Write / Full Access)
- **Analytics** — call volume, latency percentiles, error breakdown, usage quotas
- **Custom domains** — use mcp.yourcompany.com with DNS verification
- **Unique endpoint IDs** — cryptographic, unguessable URLs per server
- **SSE + Streamable HTTP** — both MCP transport modes supported
- **Vault encryption** — AES-256-GCM for all stored credentials
- **SSRF protection** — DNS pinning, redirect blocking, private IP rejection
CLI
| Command | Description |
|---------|-------------|
| apifold serve | Start an MCP server from an OpenAPI spec |
| apifold serve --registry stripe | Start from a registry spec |
| apifold transform | Output MCP tool definitions as JSON |
| apifold validate | Parse-only validation with warnings |
| apifold init [spec] | Generate an apifold.config.yaml template |
Config file
Self-Hosting
Development
Open http://localhost:3000 to access the dashboard.
Production
Using the Transformer Library
The core conversion logic is a standalone **MIT-licensed** npm package:
Architecture
| Component | Path | Description |
|-----------|------|-------------|
| **Transformer** | packages/transformer | OpenAPI to MCP conversion. Pure functions. **MIT licensed.** |
| **Runtime** | apps/runtime | Express MCP server with SSE/HTTP, OAuth token refresh, access profiles. |
| **Web App** | apps/web | Next.js dashboard. Import specs, manage credentials, analytics, custom domains. |
| **CLI** | apps/cli | Standalone CLI tool. npx apifold serve for local MCP servers. |
| **Registry** | packages/registry | Curated catalog of 8 validated API specs with one-click deploy. |