Skip to content

openapi-mcp-generator vs FastMCP from_openapi

An honest comparison of openapi-mcp-generator and FastMCP's OpenAPI integration: model, transports, auth, curation, validation and when to pick each.

By Updated

Disclosure: I maintain openapi-mcp-generator. I have tried to describe FastMCP from its own docs and from running it, and to say where it is the better choice.

TL;DR#

Choose FastMCP if your team works in Python, wants tools that follow the spec automatically at startup, or needs inbound OAuth, tool search or code mode today. Choose openapi-mcp-generator if you want a TypeScript project you can read, edit and commit, with arguments validated before any request and a ready Cloudflare Workers target. Both convert OpenAPI 3.0 and 3.1, and neither accepted Swagger 2.0 or OpenAPI 3.2.0 in our tests.

What FastMCP does better#

  • A whole framework around the conversion. FastMCP is a full Python MCP framework. The OpenAPI tools sit next to hand-written tools, resources and prompts in the same server.
  • Inbound authentication. FastMCP documents token verification, remote OAuth, an OAuth proxy, an OIDC proxy, a full OAuth server and provider integrations (Auth0, WorkOS, Google, GitHub, Azure, Keycloak and others). openapi-mcp-generator 5.0.1 has bearer-token inbound auth only.
  • Large APIs. FastMCP has tool search transforms (since 3.1.0) that replace a big tool list with search and call tools, plus a code mode. openapi-mcp-generator generates one tool per operation and has no dynamic mode yet.
  • Mapping control. Route maps, a route_map_fn, mcp_names and mcp_component_fn let you turn routes into tools, resources or resource templates and rewrite components in code.
  • No regeneration step. The spec is read at startup, so tools follow API changes without a build.
  • Adoption. The PrefectHQ/fastmcp repository had 28,190 GitHub stars on 24 October 2026; openapi-mcp-generator had 640.

Comparison table#

Dimension FastMCP from_openapi openapi-mcp-generator
Language Python (3.10+) TypeScript output; generator needs Node 22.19+, generated servers Node 22+
Model Runtime: builds tools from the spec at startup Code generation: writes a project you own
OpenAPI versions 3.0 and 3.1 worked; 3.2.0 and Swagger 2.0 rejected (4.1.3, our test) 3.0.x and 3.1.x; 3.2.0 rejected; Swagger 2.0 refused with a conversion hint (5.0.1, our test)
Transports stdio, Streamable HTTP, legacy SSE stdio, Streamable HTTP, HTTP+SSE (web), Cloudflare Worker
Upstream auth Whatever you configure on the httpx2.AsyncClient (headers, timeouts) Per-operation from securitySchemes: API key, bearer, basic, OAuth2 client credentials and password grant, OIDC token; fails closed when missing
Inbound auth Extensive: token verification, OAuth proxy, remote OAuth, providers --inbound-auth bearer, --header-passthrough; no inbound OAuth 2.1 yet
Tool curation Route maps, route_map_fn, mcp_names, component functions, tool search, code mode x-mcp, --default-include, tag and operation include/exclude, programmatic filterFn
Input validation In our test an invalid petId: "abc" reached the API, which returned 400 Validated against JSON Schema before the request; readable isError result
Annotations / structured output No annotations set in our test; outputSchema declared by default; structured content returned Method-based annotations, overridable; structuredContent for object responses; outputSchema opt-in and enforced
Tool names operationId up to the first __, slugified, truncated to 56 chars operationId, abbreviated to 64 chars by default (configurable)
Hosting Anywhere Python runs; Prefect Horizon managed hosting (free personal tier per docs) Anywhere Node runs; deployable Cloudflare Workers project
License / price Apache-2.0, free MIT, free
Maintenance signals PyPI 4.1.3 released 20 October 2026; repo pushed 24 October 2026 npm 5.0.1 published 24 October 2026; 52,429 npm downloads in the last month

Model: runtime vs generated code#

FastMCP reads the spec and builds tools in memory each time the server starts. That is the right trade when the API changes often and you trust the library to interpret it. openapi-mcp-generator writes src/index.ts with every tool definition visible, so you can review it in a pull request and change anything. The cost is a regeneration step, and --force overwrites manual edits.

Spec support#

We fed the same documents to both tools. The OpenAPI 3.0.4 Petstore produced 19 tools in each. A small OpenAPI 3.1.0 spec with type: ["string", "null"] worked in both. A 3.2.0 document was rejected by both, and so was the Swagger 2.0 Petstore. openapi-mcp-generator prints the npx swagger2openapi command to convert it.

Transports and hosting#

Both serve stdio and Streamable HTTP. FastMCP keeps SSE as a legacy option; openapi-mcp-generator's web transport covers older SSE clients. FastMCP servers can be hosted on Prefect Horizon, built by the FastMCP team. openapi-mcp-generator can emit a Cloudflare Workers project with wrangler.jsonc and a deploy README.

Authentication#

Upstream, FastMCP sends whatever you put on the HTTP client, which is simple and flexible but is your code to get right per operation. openapi-mcp-generator reads the spec's security requirements per operation and refuses to call the API when required credentials are missing. That is safer by default, and it also means a spec that over-declares security will block calls until you fix it or set MCP_ALLOW_MISSING_CREDENTIALS=true. Inbound, FastMCP is far ahead.

Curation and large APIs#

FastMCP's route maps and transforms are more powerful, and its tool search is a real advantage for APIs with hundreds of operations. openapi-mcp-generator's filters are simpler: mark operations in the spec with x-mcp or filter by tag and operationId on the command line.

Validation, annotations and output#

In our Petstore runs, openapi-mcp-generator rejected a string petId locally with Expected "integer", while FastMCP forwarded it and surfaced the API's 400. openapi-mcp-generator also derived read-only and destructive hints from HTTP methods; FastMCP set none by default. FastMCP declared an outputSchema without extra flags, which openapi-mcp-generator only does with --output-schema. Our six-tool benchmark checks both against a recording mock API, including query arrays, cookies and multipart uploads, where FastMCP sent a valid upload and openapi-mcp-generator did not.

Who each is for#

  • FastMCP: Python teams, servers that mix generated and hand-written tools, and anyone who needs OAuth on the MCP endpoint or tool search now. FastMCP's docs also say curated servers outperform auto-converted ones for complex APIs, which is good advice for any tool.
  • openapi-mcp-generator: TypeScript or Node teams, teams that want generated code under review, and anyone deploying to Cloudflare Workers.

Switching#

  • FastMCP to openapi-mcp-generator: generate from the same spec, then move route-map exclusions into x-mcp: false or --exclude-operations. Move client headers into the environment variables listed in .env.example. Custom component logic must be rewritten in the generated TypeScript.
  • openapi-mcp-generator to FastMCP: pass the same spec to FastMCP.from_openapi, put credentials on the httpx2.AsyncClient, and translate x-mcp choices into RouteMap(..., mcp_type=MCPType.EXCLUDE) rules. Tool names may change because FastMCP truncates at 56 characters.

FAQ#

Is FastMCP's OpenAPI support free? Yes. FastMCP is Apache-2.0. Prefect Horizon hosting is separate and has a free personal tier per the FastMCP docs.

Can I use both? Yes. They read the same spec. Some teams prototype with one and ship with the other.

Which validates tool arguments? openapi-mcp-generator validates against the generated JSON Schema before calling the API. In our test FastMCP passed an invalid argument through to the API.

Which is better for an API with hundreds of operations? FastMCP today, because of tool search. With openapi-mcp-generator, curate with x-mcp and filters.

Last verified 24 October 2026.

Sources#