Turn any REST API into an MCP server. No code required.
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.
Table of Contents:
Before running the installation command, make sure you have Node.js 20+, pnpm 9+, and Docker installed on your machine:
git clone https://github.com/Work90210/APIFold.git
cd APIFold
pnpm installAPIFold is designed to run in a containerized environment. Running your own instance is as easy as running one command from your terminal:
cp .env.example .env
docker compose -f infra/docker-compose.dev.yml up -d
pnpm devOpen http://localhost:3000 to access the dashboard.
cp .env.example .env
# Edit .env with your production values (database, Redis, vault secret)
docker compose -f infra/docker-compose.yml up -dThe production stack includes Nginx reverse proxy, Next.js web app, Express MCP runtime, Postgres 16, and Redis 7 — all behind a single command. For advanced configuration, check out the environment variables and self-hosting guide.
The core conversion logic is published as a standalone MIT-licensed npm package. You can use it in your own tools without any AGPL obligations:
npm install @apifold/transformerimport { transform } from "@apifold/transformer";
const tools = transform(myOpenAPISpec);
// Returns MCP-compatible tool definitionsOnce you've imported a spec and created an MCP server through the dashboard:
Claude Desktop — add to your claude_desktop_config.json:
{
"mcpServers": {
"my-api": {
"url": "http://localhost:3001/mcp/my-api/sse"
}
}
}Cursor — add the same endpoint URL in Cursor Settings > MCP Servers.
| Command | Description |
|---|---|
pnpm dev |
Start all services with hot-reload |
pnpm build |
Build all packages |
pnpm test |
Run tests |
pnpm lint |
Lint all packages |
pnpm typecheck |
Type-check all packages |
pnpm format |
Format all files with Prettier |
pnpm db:migrate |
Run database migrations |
pnpm db:seed |
Seed development data |
pnpm db:studio |
Open Drizzle Studio |
graph LR
Spec["OpenAPI / Swagger\nSpec"] --> Transformer
subgraph MT["APIFold"]
Transformer["Transformer\n(MIT lib)"]
Transformer --> Runtime["Runtime\nExpress + SSE"]
Web["Web App\nNext.js"] --> DB["Postgres 16\nRedis 7"]
Runtime --> DB
end
Runtime --> Upstream["Upstream API\n(Stripe, GitHub, etc.)"]
Agent["AI Agent\nClaude, Cursor,\nCopilot, etc."] -- "MCP / SSE" --> Runtime
APIFold uses a monorepo architecture built with Turborepo and pnpm workspaces:
| Component | Path | Description |
|---|---|---|
| Transformer | packages/transformer |
Core conversion library. Spec in, MCP tools out. Pure functions, no side effects. MIT licensed. |
| Runtime | apps/runtime |
Express server hosting live MCP endpoints over SSE. Handles credential decryption and upstream proxying. |
| Web App | apps/web |
Next.js 14 dashboard. Import specs, configure servers, manage credentials, test tools, inspect logs. |
| Types | packages/types |
Shared TypeScript type definitions. |
| UI | packages/ui |
Design system and component library. |
You can learn more about the architecture in the Architecture Decision Records.
All code contributions, including those of people having commit access, must go through a pull request and be approved before being merged. This is to ensure a proper review of all the code.
We truly ❤️ pull requests! If you wish to help, you can learn more about how you can contribute to this project in the contribution guide.
For security issues, please refer to our security policy for responsible disclosure guidelines. Do not post security vulnerabilities as public GitHub issues.
This repository uses a dual-license model:
@apifold/transformeris available under the MIT License. Use it anywhere, no strings attached.- Everything else is available under the GNU Affero General Public License v3.0.
This is the same model used by Grafana, Plausible, and PostHog.