Skip to content

Menu

OpenAPI to MCP Tools Converter

Turn each OpenAPI operation into an MCP tool definition with a JSON Schema input.

Runs entirely in your browserAIFree, no sign-up
Loading tool

01What is OpenAPI to MCP Tools Converter?

The Model Context Protocol lets a server expose tools that a language model can discover and call. Each tool is described by a name, an optional title, a description and an inputSchema, which is a JSON Schema object listing the arguments the tool accepts. If you already have a REST API documented with OpenAPI, most of that information exists in your spec. This converter reads the spec and writes one MCP tool definition per operation, so you do not have to copy parameter lists by hand. Paste an OpenAPI 3.x document in JSON form. Swagger 2.0 files are handled on a best-effort basis: body and formData parameters are mapped, but older edge cases may need manual cleanup. YAML is not parsed, so convert YAML specs to JSON first. For every path and HTTP method, the tool builds a name from the operationId. When an operation has no operationId, the name is made from the method and path instead, and a warning is shown. Names are cleaned to letters, digits, underscores and hyphens and cut to 64 characters, and duplicate names get a numeric suffix. The summary becomes the title, and the summary and description together become the tool description. The inputSchema merges path, query and header parameters with the request body. Path-level parameters are combined with operation-level ones, and path parameters are always marked as required. If the request body uses application/json, its schema is added under a body property. Local references such as #/components/schemas/Pet are resolved inline, and a reference that points back to itself is stopped and labelled rather than expanded forever. Cookie parameters and non-JSON bodies such as multipart/form-data are skipped and listed in the warnings panel. You get two outputs. The first is a JSON array of tool definitions that matches the shape returned by tools/list in the MCP specification. The second is a TypeScript starting point for the official TypeScript SDK (v1.x), which creates an McpServer, calls registerTool for each operation with a Zod input shape, and connects a stdio transport. The handlers are stubs, so you still write the code that calls your API. The conversion runs in your browser and the spec is not sent anywhere. Review the result before shipping it: large specs can produce many tools, and models tend to pick tools more accurately when the list is short and the descriptions are specific.

Backend and platform developers who want to make an existing REST API available to AI assistants through an MCP server. The tool runs entirely in your browser, so your data never leaves your device.

02How to use OpenAPI to MCP Tools Converter

  1. Paste your OpenAPI 3.x or Swagger 2.0 spec as JSON, or click Load sample to try the pet store example
  2. Read the counts and the warnings list for missing operationIds, skipped cookie parameters and unsupported content types
  3. Open the Tools JSON tab to review each generated name, description and inputSchema
  4. Switch to the TypeScript SDK tab to see the McpServer registerTool code for every operation
  5. Copy the output, remove tools you do not want to expose, and fill in the handler code that calls your API

03Worked examples

Input: openapi 3.0.0, GET /pets/{petId}, operationId getPetById, summary "Get a pet", params petId (path, integer) and fields (query, string)
Result: { "name": "getPetById", "title": "Get a pet", "description": "Get a pet", "inputSchema": { "type": "object", "properties": { "petId": {"type":"integer"}, "fields": {"type":"string"} }, "required": ["petId"] } }
Path parameters are always required, even when the spec doesn't mark them required.
Input: Same spec, TypeScript snippet
Result: server.registerTool( "getPetById", { title: "Get a pet", description: "Get a pet", inputSchema: { "petId": z.number().int(), "fields": z.string().optional(), }, }, …
integer becomes z.number().int() and parameters not listed as required get .optional().
Input: openapi 3.1.0, POST /orders, no operationId, required JSON requestBody $ref #/components/schemas/Order {sku: string (required), qty: integer}
Result: name: "post_orders", description: "POST /orders" properties.body: { type: object, required: ["sku"], properties: { sku: string, qty: integer } }, required: ["body"] Warning: POST /orders: no operationId; name built from method and path
The $ref is resolved inline and the request body becomes a single "body" argument.
Input: PUT /upload, operationId "upload file!", multipart/form-data body
Result: name: "upload_file", properties: {} Warnings: PUT /upload: operationId sanitized to "upload_file"; PUT /upload: unsupported request content type(s): multipart/form-data; body not included
Only JSON request bodies are converted; tool names are limited to letters, digits, _ and -.
Input: {"paths":{"/ping":{"get":{}}}} (no openapi field)
Result: name: "get_ping", description: "GET /ping" Warnings: No 'openapi: 3.x' or 'swagger: 2.0' field found; converting anyway. / GET /ping: no operationId; name built from method and path

04Common use cases

  • Draft an MCP server for an internal REST API that already has an OpenAPI spec
  • Check how many tools an API would expose before deciding which ones to keep
  • Find operations that lack an operationId or use request bodies MCP clients cannot send as JSON
  • Produce JSON Schema input definitions to paste into an existing MCP server
  • Generate a TypeScript SDK skeleton to start a stdio MCP server quickly

05Tips

  • Add a clear operationId to every operation in your spec; it gives much better tool names than method and path
  • Write summaries as short actions, such as 'Create a pet', because they become the tool title the client may display
  • Expose only the operations a model really needs; a smaller tool list is easier for the model to choose from
  • Check the generated Zod shapes for nested objects and unions, which the snippet simplifies

06Related concepts

Model Context Protocol, OpenAPI, JSON Schema, tool calling, MCP server.

Frequently Asked Questions

What is OpenAPI to MCP Tools Converter?

OpenAPI to MCP Tools Converter is a free, browser-based developer tool on AIDToolStack. Turn each OpenAPI operation into an MCP tool definition with a JSON Schema input. It requires no installation or sign-up and works entirely in your browser.

Is OpenAPI to MCP Tools Converter free to use?

Yes. No sign-up, no fees and no usage cap.

Does OpenAPI to MCP Tools Converter store my data?

No. It runs in your browser; nothing is uploaded.

Cheat sheet

Reviews and commentsShow

Reviews

Sign in to leave a review.

Loading reviews…

Comments

Sign in to leave a comment.

Loading comments…

What changed in AI dev tools, once a month

Renames, shutdowns, pricing changes and new MCP setups, each with a source.

Subscribe