Guide

OpenAPI to MCP server: how to convert your spec

If your API has an OpenAPI (Swagger) spec, you already have most of an MCP server. The spec lists every endpoint, its inputs and how to call it. An MCP server needs the same things, written as tools an AI agent can pick from. This guide shows how one maps to the other, what to leave out, and how to get a working server without writing one by hand.

What each part of the spec becomes

In your OpenAPI specIn the MCP serverWhy it matters
An operation (GET /orders/{id})A toolEach endpoint an agent should use becomes one tool.
operationId or summaryThe tool nameAgents choose tools by name, so get_order beats op_17.
descriptionThe tool descriptionThis is what the agent reads to decide when to call it.
Path, query and body parametersThe tool's input schemaTypes, required fields and enums carry over.
securitySchemesHow the server calls your APIYour key stays on the server; the agent never sees it.
serversWhere calls are sentThe base URL of your API.

Don't turn every endpoint into a tool

A converter can turn all 200 endpoints into 200 tools. That usually makes the agent worse, not better. Every tool's name and description takes up room in the model's context, and the more similar tools there are, the more often the agent picks the wrong one.

Start with the few actions people will actually ask an assistant to do, such as looking up an order, checking availability or creating a booking. Leave out health checks, internal admin routes and anything you would not want an assistant to do on its own.

  • Keep the endpoints that answer real questions from users.
  • Rename tools so the name says what they do.
  • Rewrite descriptions in plain words, including when not to use the tool.
  • Hide parameters the agent should never set, like internal IDs or flags.
  • Mark which tools change data, and start with read-only ones.

How to convert an OpenAPI spec to an MCP server with MCPEasy

  1. 1

    Get your spec

    Many APIs already publish one at /openapi.json, /swagger.json or /v3/api-docs. If yours doesn't, the framework guides show how to export one from Express, FastAPI, Django, Spring Boot, Laravel, Rails and more. Swagger 2.0 and OpenAPI 3 both work, as does a Postman collection. See the framework guides.

  2. 2

    Import it into MCPEasy

    Create a server and paste the spec's URL, or upload the .json or .yaml file (up to 5 MB). With a URL, later changes to your API can be picked up with a sync. No spec at all? Choose From code (GitHub) and MCPEasy reads your routes from the repository, read-only. Every way to start without a spec.

  3. 3

    Review the tools

    MCPEasy groups endpoints into a small set of clear tools, writes descriptions agents understand and skips internal and health endpoints. You can rename any tool, rewrite its description, hide parameters or switch it off. Every tool is labelled read only, write or destructive.

  4. 4

    Test it before anyone else does

    Chat with your tools in the Playground. You see every call, the arguments the agent chose and what your API sent back, so you can fix a confusing description before it reaches a customer.

  5. 5

    Deploy and connect

    You get a hosted MCP endpoint, for example your-api.mcp.mcpeasy.net/mcp, with API keys and rate limits. Paste it into Claude, ChatGPT, Cursor, VS Code or your own agent. MCPEasy generates the config snippet for your exact server.

How authentication works

There are two keys involved, and they never mix. The agent connects to your MCP server with an MCPEasy API key, one per team, app or agent, so you can switch off one without touching the others.

The server then calls your API with your API's own credentials. Those are encrypted at rest, only decrypted inside the gateway when a call is made, and never sent to the AI client.

Build it yourself, or use a hosted converter?

You can generate an MCP server from an OpenAPI spec yourself with an open-source generator or one of the official MCP SDKs. That's a good choice if you want full control and are happy to run it.

Then the work after the first version is yours too: hosting it, keeping it in step with your API, issuing and revoking keys, rate limits, and logs that show what each agent did. A hosted converter like MCPEasy does those parts for you, so the work left is deciding which tools agents should have.

Questions about OpenAPI to MCP

What does converting OpenAPI to MCP mean?
It means turning the endpoints in your OpenAPI spec into MCP tools. Each tool gets a name, a description and an input schema taken from the spec, and the MCP server calls your API when an AI agent uses the tool.
Does it work with Swagger 2.0?
Yes. MCPEasy reads OpenAPI 3 and the older Swagger 2.0 format, in JSON or YAML. It also accepts Postman collections.
Do I need to change my API?
No. The MCP server sits in front of your existing HTTP API and calls it the same way any other client would.
How many endpoints should become tools?
Only the ones an agent needs for real tasks. Fewer, clearer tools mean fewer wrong calls and less of the model's context spent reading tool descriptions. You can switch more on later.
Can an AI agent change or delete data through it?
Only through tools you leave switched on. Every tool is labelled read only, write or destructive, you can disable any of them, and descriptions tell agents to confirm with the user before making changes.
Which AI clients can use the server?
Any client that supports remote MCP servers, including Claude, ChatGPT, Cursor, VS Code and custom agents built with an MCP SDK.
Is there a free plan?
Yes. The free plan includes 500 tool calls a month, with hosting, AI-written tools and the Playground. Paid plans start at $19 a month.

Turn your spec into an MCP server

Paste your OpenAPI URL, review the tools and get a hosted endpoint. The free plan includes 500 tool calls a month.