packages/kilo-docs/pages/automate/mcp/mcp-vs-api.md
Comparing REST APIs to the Model Context Protocol (MCP) is a category error. They operate at different layers of abstraction and serve fundamentally different purposes in AI systems.
| Feature | MCP | REST APIs |
|---|---|---|
| State Management | Stateful - maintains context across interactions | Stateless - each request is independent |
| Connection Type | Persistent, bidirectional connections | One-way request/response |
| Communication Style | JSON-RPC based with ongoing sessions | HTTP-based with discrete requests |
| Context Handling | Context is intrinsic to the protocol | Context must be manually managed |
| Tool Discovery | Runtime discovery of available tools | Design-time integration requiring prior knowledge |
| Integration Approach | Runtime integration with dynamic capabilities | Design-time integration requiring code changes |
REST APIs and MCP serve different tiers in the technology stack:
MCP often uses REST APIs internally, but abstracts them away for the AI. Think of MCP as middleware that turns discrete web services into a cohesive environment the AI can operate within.
MCP's stateful design solves a key limitation of REST in AI applications:
For example, an AI debugging a codebase can open a file, run tests, and identify errors without losing context between steps. The MCP session maintains awareness of previous actions and results.
MCP enables an AI to discover and use tools at runtime:
// AI discovers available tools
{
"tools": [
{
"name": "readFile",
"description": "Reads content from a file",
"parameters": {
"path": { "type": "string", "description": "File path" }
}
},
{
"name": "createTicket",
"description": "Creates a ticket in issue tracker",
"parameters": {
"title": { "type": "string" },
"description": { "type": "string" }
}
}
]
}
This "plug-and-play" capability allows new tools to be added without redeploying or modifying the AI itself.
Consider a task requiring multiple services: "Check recent commits, create a JIRA ticket for the bug fix, and post to Slack."
REST-based approach:
MCP-based approach:
Kilo Code leverages MCP to provide:
MCP creates a universal connector between Kilo Code and external services, with REST APIs often powering those services behind the scenes.
MCP doesn't replace REST APIs - it builds upon them. REST excels at providing discrete services, while MCP excels at orchestrating those services for AI agents.
The critical distinction is that MCP is AI-native: it treats the model as a first-class user, providing the contextual, stateful interaction layer that AI agents need to function effectively in complex environments.