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

  1. Fetch & parse/api/api-to-mcp/fetch downloads the OpenAPI JSON, validates it, extracts up to 15 endpoints with their parameters and bodies. Caps the context so the LLM call stays cheap.
  2. Generate — a generator prompt streams a complete src/index.ts using @modelcontextprotocol/sdk with stdio transport. One MCP tool per endpoint, JSON-Schema inputs derived from the OpenAPI parameter list, native fetch() with path interpolation + query + body.
  3. Ship — combine with npm create mcp-server@latest for 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.