MCP toolkit · Generator
API → MCP Server Generator
Paste any OpenAPI spec. The server parses it, an LLM writes a complete TypeScript MCP server that exposes each endpoint as an MCP tool. Copy, drop into a fresh create-mcp-server blank template, build, ship. The third piece of an MCP toolkit alongside portfolio-mcp (reference impl) and MCP Inspector (visualization).
Generate an MCP server from any OpenAPI spec
Paste an OpenAPI URL. The server fetches and parses it, then an LLM writes a complete TypeScript MCP server that exposes each endpoint as an MCP tool. Copy, drop into src/index.ts of a fresh create-mcp-server blank template, build, ship.
Examples:
How it works
- Fetch & parse —
/api/api-to-mcp/fetchdownloads the OpenAPI JSON, validates it, extracts up to 15 endpoints with their parameters and bodies. Caps the context so the LLM call stays cheap. - Generate — a generator prompt streams a complete
src/index.tsusing@modelcontextprotocol/sdkwith stdio transport. One MCP tool per endpoint, JSON-Schema inputs derived from the OpenAPI parameter list, nativefetch()with path interpolation + query + body. - Ship — combine with
npm create mcp-server@latestfor the package boilerplate (tsconfig, build script, README, Claude Desktop snippet) and you have a working MCP server in under five minutes.
Limits: only OpenAPI 3.x JSON (YAML soon), ≤15 endpoints per spec, generated code capped at 800 tokens. For large APIs, split the spec or generate in chunks.