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
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?
What OpenAPI versions are supported?
Why does operationId matter for MCP?
What does this generator NOT handle?
How do I prepare my OpenAPI spec for MCP?
What is the TypeScript Skeleton output?
Are there any limits on spec size?
Is my OpenAPI spec uploaded anywhere?
Related Tools
MCP Tool Schema Validator
Validate MCP tool definitions โ names, descriptions, inputSchema, required fields, and common mistakes.
MCP Tool Definition Generator
Generate MCP tool definitions from a form โ name, description, typed input fields, and required arrays.
MCP Server Config Generator
Generate MCP server configuration snippets for Claude Desktop, Cursor, and other clients.