MCP vs REST APIs for AI agents: when to use which
Short answer: they are not competitors. REST (or SOAP) is how services expose functionality to developers. MCP is how an AI agent discovers and calls tools. In practice an MCP server usually wraps one or more existing APIs.
Side by side
| REST API | MCP server | |
|---|---|---|
| Primary audience | Developers writing client code | AI agents and AI applications |
| Discovery | Docs or OpenAPI, read by a human | Built-in tool listing the agent reads at runtime |
| Input contract | OpenAPI / custom | JSON Schema per tool |
| Integration effort per client | Custom code for each consumer | One protocol for all MCP clients |
| Typical role | System interface | Agent-facing layer over system interfaces |
When to use which
- Build or keep REST for service-to-service integration and traditional applications.
- Add MCP when you want agents to use a capability without hand-written glue for each agent framework.
- Wrap legacy systems (SOAP, databases, queues) in MCP when they have no agent-friendly interface at all. That is what legacy2mcp automates.
Design tip
Do not expose every endpoint as a tool. Agents work better with a smaller set of well-named, well-described tools. Curate, and apply safe defaults.
FAQ
Can an MCP server call a REST API?
Yes. That is a very common pattern.
Does MCP replace OpenAPI?
No. OpenAPI describes HTTP APIs; MCP describes tools for agents. Some tools generate MCP tools from OpenAPI specs.