Serverdex · explainer
MCP vs OpenAPI
OpenAPI “defines a standard, language-agnostic interface description for HTTP APIs” (spec.openapis.org, v3.2.1, 10 Sep 2026) — a static document that executes nothing. Tools read it and emit an MCP server: Speakeasy “generate a fully functional MCP server from your existing OpenAPI document”; Stainless ships the same (experimental). The MCP server is what an agent calls at runtime via tools/list + tools/call (modelcontextprotocol.io). Read 26 Nov 2026.
Side by side
- What it is
- OpenAPI (the spec)A static, machine-readable description of an HTTP API
- MCPA live runtime protocol (JSON-RPC 2.0) for AI agents
- Primary consumer
- OpenAPI (the spec)Developers, doc generators, client/SDK codegen
- MCPAI agents at runtime
- Discovery
- OpenAPI (the spec)You read or parse the document
- MCPtools/list, negotiated at connection time
- Execution
- OpenAPI (the spec)Describes endpoints; executes nothing itself
- MCPtools/call invokes the tool and returns a result
- Schema
- OpenAPI (the spec)Params and schemas of REST endpoints
- MCPJSON Schema input/output per tool
- Relationship
- OpenAPI (the spec)Can be the source an MCP server is generated from
- MCPCan be generated from an OpenAPI document
1. OpenAPI is a description, not a runtime
OpenAPI is a document standard. The specification itself says it “defines a standard, programming language-agnostic interface description for HTTP APIs” — the current version is 3.2.1, dated 10 September 2026. It began as Swagger: the OpenAPI Initiative FAQ notes the spec “was based on the rebranded Swagger 2.0 specification,” and it is now “an open source collaboration project of the Linux Foundation.”
Crucially, an OpenAPI document does nothing on its own. It is a contract that humans read and tools consume — to render interactive docs, generate client SDKs or scaffold servers. It describes an API; it does not call one.
2. MCP is the runtime an agent speaks
MCP is the other half: not a description but a live protocol. It is “an open-source standard for connecting AI applications to external systems” — “a USB-C port for AI applications.” An agent connects to a server and uses two operations on tools: tools/list to “discover available tools” (it gets back “an array of tool definitions with schemas”), and tools/call to “execute a specific tool” and get a result. Tools are “schema-defined interfaces that LLMs can invoke,” validated with JSON Schema.
So where OpenAPI is a file you parse ahead of time, MCP is a connection you open at runtime, and the tool list is negotiated live.
3. Generate one from the other
Because an OpenAPI document already carries every endpoint, parameter and schema, it is a natural source for an MCP server. Speakeasy's guide is titled exactly that — “build MCP servers from your OpenAPI documents” — and Stainless offers the same (it flags MCP generation as experimental). The spec becomes the single source of truth: one document feeds your human API docs and the agent-facing server.
The caveat these tools state themselves: a good MCP server is “not a 1:1 mapping of your API.” Dumping every endpoint as a tool bloats the agent's context and its choices; the tools an agent should see are a curated subset. That is the same lesson as the Context-Cost Index — fewer, well-chosen tools beat a wall of them.
4. The decision rule
They are not either/or; they describe and run the same API at different stages.
- Documenting a REST API, generating SDKs or server stubs, giving human developers a contract: OpenAPI.
- Letting an AI agent discover and call tools at runtime, with the model choosing which to invoke: MCP.
- You have an OpenAPI-described API and want agents to use it: generate an MCP server from the spec, then prune it to the tools worth exposing.
Where this shows up on Serverdex
46,066 MCP servers from the official registry are listed here, each with a daily credential-free live check, the tool list it exposes and the estimated token cost of its definitions — the numbers this comparison turns on.
- server.json validator — check a server's own descriptor against the official registry schema
- MCP config generator — turn a server into the config your client needs, no hand-coding
- The Context-Cost Index — why a generated server should be pruned, not a 1:1 dump of every endpoint
- Remote MCP servers answering now — live servers exposing tools an agent calls at runtime
Questions
- Is MCP a replacement for OpenAPI?
- No — they are different kinds of thing. OpenAPI is a static document that describes an HTTP API; MCP is a live protocol an AI agent speaks to discover and call tools at runtime. They are complementary: an OpenAPI document can be the source from which an MCP server is generated, so one spec feeds both human API docs and the agent runtime.
- Can I generate an MCP server from an OpenAPI spec?
- Yes. Tools such as Speakeasy and Stainless read an OpenAPI document and emit an MCP server, mapping endpoints to tools (Stainless marks this experimental). Their own guidance is to curate rather than expose every endpoint: a good MCP server is not a 1:1 mapping of the API, because too many tools hurt the agent's accuracy and context budget.
- What's the difference between OpenAPI and MCP in one line?
- OpenAPI describes an API as a static document; MCP is the live protocol an agent uses to call tools. One is a contract you parse ahead of time; the other is a connection you open at runtime — and you can generate the second from the first.
Sources (read 26 November 2026)
- OpenAPI Specification (“standard, language-agnostic interface description for HTTP APIs”, v3.2.1)
- OpenAPI Initiative FAQ (Swagger lineage; Linux Foundation project)
- Model Context Protocol — Introduction (“USB-C for AI”)
- MCP server concepts — tools/list (discover) and tools/call (execute)
- Speakeasy — Build MCP servers from your OpenAPI documents
- Stainless — Generate an MCP server from an OpenAPI spec (experimental)
Not claimed here because it could not be read from a primary source on 26 November 2026: Stainless flags its OpenAPI→MCP generation as experimental; other generators sometimes cited (Postman, FastMCP, Azure API Center) were not verified here and are not claimed.; The OpenAPI Initiative FAQ says the spec was “based on” Swagger 2.0, not literally “formerly named Swagger”; the summary's “formerly Swagger” is the common shorthand..
More explainers: MCP vs CLI tools · MCP vs function calling · MCP vs RAG · MCP vs API · MCP vs A2A · MCP vs Agent Skills · MCP vs ACP · MCP vs connectors · MCP vs MCP gateways · MCP transports.