What is the Model Context Protocol (MCP) and how does it relate to OpenAPI? #
As AI agents and large language models (LLMs) have become capable of calling external tools, a new class of standard has emerged to describe how an AI client connects to those tools: the Model Context Protocol (MCP). Introduced by Anthropic in late 2024 and since adopted by multiple AI platforms and developer tools, MCP is frequently mentioned alongside OpenAPI — but the two standards solve different problems and are often used together rather than as alternatives.
What is the Model Context Protocol? #
MCP is an open, JSON-RPC-based protocol that standardizes how AI applications (called hosts or clients, such as an IDE, chat client, or agent framework) connect to external servers that expose:
- Tools — callable functions the model can invoke (analogous to an API operation).
- Resources — read-only data the model can pull into its context (files, database records, documents).
- Prompts — reusable prompt templates a host can surface to users.
An MCP server sits between an AI host and a real system (a database, a SaaS product, an internal service) and exposes a curated, model-friendly interface to it. Unlike a plugin format tied to one AI vendor, an MCP server can be connected to any MCP-compatible host — the same server works with multiple AI clients without redevelopment.
How MCP Differs from OpenAPI #
| Aspect | OpenAPI | MCP |
|---|---|---|
| Primary purpose | Describe an HTTP API’s shape (paths, schemas, auth) | Standardize the connection between an AI host and a tool/data server |
| Transport | HTTP/HTTPS | JSON-RPC over stdio, HTTP+SSE, or streamable HTTP |
| Consumer | Any HTTP client, human or machine | AI hosts/agents specifically |
| Discovery | A static document (openapi.yaml/.json) | Servers advertise tools/resources/prompts at runtime via protocol methods |
| Schema format | OpenAPI Schema Object (JSON Schema-aligned since 3.1) | JSON Schema for tool input/output |
| Typical output | A full API surface for building clients, docs, SDKs | A small, curated set of agent-facing capabilities |
In short: OpenAPI describes an API; MCP describes how an AI agent talks to a server that exposes capabilities, which may or may not be backed by an OpenAPI-described REST API underneath.
Where OpenAPI and MCP Overlap #
The two standards intersect most directly around tool definitions. Both an OpenAPI operation and an MCP tool need a name, a natural-language description, and a JSON Schema for their inputs — the same qualities that matter for AI-friendly OpenAPI descriptions apply directly to MCP tool definitions too.
Because of this overlap, it’s common to generate an MCP server from an existing OpenAPI document: several open-source generators exist that read an OpenAPI file and automatically expose its operations as MCP tools, letting teams reuse an API description they’ve already written rather than hand-writing a separate MCP server. Conversely, teams that want to expose a curated, agent-facing subset of a larger API (rather than the whole surface) often reach for the OpenAPI Overlay Specification to produce a scoped document before generating an MCP server from it.
Can You Use Both Together? #
Yes — and in practice this is the most common pattern:
- OpenAPI remains the source of truth for the REST API itself — used for human documentation, SDK generation, validation, and any non-AI client.
- MCP wraps a purpose-built, agent-facing subset of that API (or a set of related APIs) as tools/resources, exposed over a protocol every MCP-compatible AI host can already speak.
This mirrors how OpenAI’s Custom Actions and Microsoft Copilot Studio connectors consume OpenAPI documents directly — MCP simply standardizes that connection at the protocol level instead of leaving it to each AI vendor’s proprietary plugin format.
Should You Choose OpenAPI or MCP for Your AI Integration? #
They aren’t really competing choices:
- If you’re building or already maintain a REST API, OpenAPI is still the right way to describe it — MCP doesn’t replace that.
- If you’re building an AI agent integration that needs to work across multiple AI hosts without custom code for each one, MCP is the right connection layer — and it can be generated from your existing OpenAPI document rather than built from scratch.
Conclusion #
The Model Context Protocol and OpenAPI address different layers of the same problem: OpenAPI describes what an API can do, while MCP standardizes how an AI agent connects to and invokes curated capabilities. Rather than choosing one over the other, most teams building AI-integrated systems will keep OpenAPI as the API’s description and layer an MCP server on top for agent connectivity — reusing the tool descriptions, schemas, and design practices that make an OpenAPI document AI-friendly in the first place.
Last updated on August 13, 2026.