OpenAPI to MCP Generator

Paste an OpenAPI 3.x JSON or YAML spec and convert every operation into an MCP tool definition. Get MCP JSON, an endpoint summary table, a TypeScript server skeleton, and conversion warnings.

Paste OpenAPI JSON or YAML

Your spec is never uploaded or stored.0 chars

OpenAPI โ†’ MCP Conversion Guide

What this generator does

  • โ€บ Accepts OpenAPI 3.x JSON and YAML
  • โ€บ Extracts path, query, and body parameters
  • โ€บ Uses operationId as tool name (or generates one)
  • โ€บ Builds inputSchema from parameters and requestBody
  • โ€บ Flattens allOf request body schemas
  • โ€บ Generates TypeScript interface + server.tool() stub
  • โ€บ Reports warnings for missing descriptions, ids, enums

What it does NOT do

  • โ€บ Resolve $ref to external files (inline only)
  • โ€บ Handle anyOf/oneOf fully (first variant only)
  • โ€บ Convert authentication / security schemes
  • โ€บ Include response body in inputSchema
  • โ€บ Support Swagger 2.x fully (best-effort)
  • โ€บ Skip header/cookie params (not model-facing)

How to prepare your spec for best results

Add operationId to every operation

operationId becomes the stable tool name. Without it, names are generated from method + path and will change if paths change.

Write clear summaries

summary becomes the tool description the model uses to decide when to call your tool. One sentence that explains what the operation does and what it returns.

Describe every parameter

Parameter descriptions tell the model what value to pass. Without them, the model guesses โ€” and often guesses wrong for ambiguous field names.

Use enum for fixed options

status, category, type fields with a fixed set of values should use enum. This constrains what the model can pass and prevents invalid values like 'HIGH' when the valid value is 'high'.

Keep request bodies as flat objects

Deep nesting and anyOf/oneOf compositions are partially supported. Flat, typed property objects with descriptions produce the cleanest MCP schemas.

Keep auth out of parameters

API keys, auth tokens, and session cookies belong in the MCP server handler, not in the tool inputSchema. The model should never see or set authentication credentials.

OpenAPI โ†’ MCP field mapping

OpenAPI field Maps to MCP
operationId tool.name
summary tool.title + description
description tool.description
parameters[in=path] inputSchema.properties
parameters[in=query] inputSchema.properties
requestBody.content.application/json.schema inputSchema.properties
parameters[in=header/cookie] (skipped)
tags _meta.tags
responses tool.description suffix

Privacy: This tool runs entirely in your browser. Your OpenAPI spec is not uploaded, stored, or transmitted to any server.

Frequently Asked Questions

What does OpenAPI to MCP conversion mean?
OpenAPI is a standard format for describing REST APIs โ€” it defines endpoints, parameters, request bodies, and responses. MCP (Model Context Protocol) is a standard for exposing tools to AI assistants. Converting OpenAPI to MCP means taking each API operation (GET /users, POST /orders, etc.) and turning it into an MCP tool definition โ€” with a name, description, and inputSchema โ€” so an AI assistant like Claude can call your API as a tool.
What OpenAPI versions are supported?
This generator supports OpenAPI 3.x (3.0.x and 3.1.x). It also accepts Swagger 2.x documents but the conversion is best-effort โ€” some Swagger-specific fields may not map correctly. Both JSON and YAML input formats are accepted.
Why does operationId matter for MCP?
The operationId becomes the tool name โ€” the stable, machine-readable identifier that MCP clients and models use to call your tool. Without an operationId, a name is generated from the HTTP method and path (e.g. get_users_user_id), which is functional but fragile โ€” if your API paths change, the generated tool names change too, breaking any workflows that reference them by name. Always define operationIds in your OpenAPI spec.
What does this generator NOT handle?
$ref resolution across multiple files is not supported โ€” all schemas must be inline in the document. anyOf/oneOf compositions include only the first variant and emit a warning. Header and cookie parameters are skipped (they are usually authentication-related, not model-facing). Authentication/security schemes are not converted. Response body schemas are not included in inputSchema (they appear only in the description).
How do I prepare my OpenAPI spec for MCP?
Four things make a big difference: (1) Add operationId to every operation. (2) Write clear summaries โ€” this becomes the tool description the model reads to decide when to call the tool. (3) Add descriptions to every parameter and request body field โ€” models use these to know what value to pass. (4) Use enum on fixed-option fields (status, category, etc.) so the model picks valid values rather than guessing.
What is the TypeScript Skeleton output?
The TypeScript tab generates an MCP server file using the @modelcontextprotocol/sdk. Each tool gets a typed input interface and a server.tool() registration block with a TODO stub for the implementation. You can paste this directly into a new MCP server project and fill in the handler logic.
Are there any limits on spec size?
There are no server-side limits โ€” conversion happens entirely in your browser. Very large specs (1000+ operations) may take a moment to process but there is no hard cap. Performance depends on your device.
Is my OpenAPI spec uploaded anywhere?
No. The entire conversion runs in your browser using JavaScript. Your spec text is never sent to any server, logged, or stored anywhere. It exists only in your browser tab while the page is open.