APIs have made it possible for one application to query data or execute operations in another for decades. Thanks to them, an online store can process payments through a payment gateway, an ERP can synchronize orders with a CRM, and a mobile application can check the weather forecast.
The arrival of artificial intelligence agents introduces an additional challenge. A developer no longer always programs every call and every transition in advance: a model can decide which tool it needs, select an operation, build its arguments, and interpret the result during a conversation.
This is where MCP, which stands for Model Context Protocol, comes into play. MCP is an open standard for connecting AI applications to external systems, whether they are local files, databases, remote services, or workflows. Its purpose is to create a common interface between agents and the capabilities they can use.
The question seems inevitable: if we already have APIs, why do we need MCP? The short answer is that they do not solve exactly the same problem.
Before comparing them: an API is not a specific protocol
Although we often use “API” as a synonym for a REST API over HTTP, an API is actually an interface through which one software component provides data or functions to another. It can be implemented using REST, GraphQL, gRPC, SOAP, a local library, or many other approaches.
OpenAPI, for example, does not define the behavior of all APIs: it provides a standard, language-independent description for HTTP APIs. This description allows people and tools to understand routes, operations, parameters, responses, and security mechanisms without inspecting the source code. This is established in the OpenAPI Specification itself.
MCP, on the other hand, is a specific protocol. It defines a client-server architecture, messages based on JSON-RPC 2.0, discovery mechanisms, and a set of primitives designed for AI applications. Therefore, “MCP vs. API” is a useful comparison for decision-making, but not a strict opposition between equivalent concepts.
A simple way to look at it is:
The API exposes what a system can do. MCP translates and organizes those capabilities so that an agent can discover and use them in a consistent way.
What does a traditional API provide?
A conventional API offers a contract that allows a program to invoke known operations. In a REST API, for example, the client knows that it must send a GET /customers/123 request to retrieve a customer or a POST /orders/ request to create an order.
The consuming application is programmed around that contract. The development team decides which endpoint to call, when to call it, which parameters to use, and how to process the response. This provides control, predictability, and efficiency.
APIs are particularly well suited to:
- Deterministic integrations between services.
- Mobile and web applications with known flows.
- High-volume or low-latency processing.
- Public interfaces for developers and partners.
- Automations in which every step is defined in advance.
In addition, the API ecosystem is highly mature. There are established tools for documentation, client generation, testing, observability, version control, quotas, and security. OpenAPI can describe schemes using API keys, HTTP authentication, OAuth 2.0, OpenID Connect, or mTLS, among others.
Their limitation in the context of agents is not that an API is incapable of serving them. An agent can use an API directly if its platform allows functions or tools to be registered. The problem appears at scale: every AI application needs to adapt the contract of each service, select which operations to expose to the model, and transform their responses into useful context.
What does MCP provide?
MCP standardizes communication between an AI application (the host) and one or more MCP servers. The host creates a client for each server and aggregates the available capabilities so that the model can use them. The official MCP architecture also separates the data layer, which is based on JSON-RPC 2.0, from the transport layer.
An MCP server can expose three main primitives:
- Tools: executable functions used to query a service or perform actions, such as searching for orders, creating a ticket, or updating a task.
- Resources: information sources that can be added to the context, such as a document, a database schema, or the contents of a record.
- Prompts: reusable templates that structure an interaction or workflow.
The client can discover these capabilities at runtime. For example, it requests the list of tools, receives their names, descriptions, and input schemas, and then invokes one using tools/call. The schemas make it possible to validate arguments, while the results can combine text, structured content, and references to resources. The MCP tools specification defines this contract in detail.
MCP supports local connections through standard input and output (stdio) and remote connections through Streamable HTTP. This makes it possible to use the same conceptual model both for a local tool that works with files and for a cloud-hosted service.
Its main advantage is interoperability at the agent layer. A well-designed MCP server can connect to different compatible clients without requiring a specific integration for each one. On the other side, a host can incorporate different servers under a common discovery and invocation pattern.
MCP vs. API: they do not replace each other; they support each other
In a real-world architecture, the MCP server usually acts as an adaptation layer. It receives a standard request from the AI client, validates the arguments, applies permissions, and calls the internal or public API that already contains the business logic.
For example, a support platform can keep its REST API as the canonical interface:
- The API provides operations for querying customers, reading tickets, and publishing replies.
- The MCP server groups those operations into tools that an agent can understand, such as
search_ticketsorreply_to_ticket. - The agent discovers the tools and decides which one to propose based on the user's request.
- The host applies policies and, if the action is sensitive, requests confirmation.
- The MCP server calls the API with the appropriate credentials and permissions.
This separation is useful because the business logic remains behind the API, where it can also serve the web application, mobile application, and other integrations. MCP provides a purpose-built facade for AI clients without turning the model into a direct consumer of the system's entire technical surface.
Nor is it necessary to expose every endpoint as a tool. In fact, it is usually better to design higher-level tools that are scoped and intent-oriented. Instead of transferring twenty low-level endpoints, a server could provide prepare_refund, which checks the order, verifies the rules, and returns a proposal before executing the final operation.
Advantages of APIs
- They provide precise control over every request and response.
- They are a stable foundation for multiple channels and consumers.
- They are well suited to high-volume operations, deterministic flows, and strict latency requirements.
- They have a mature ecosystem of gateways, SDKs, testing, monitoring, and governance.
Limitations of APIs for agents
- Each AI client may require a different adaptation.
- A technical specification does not always contain the semantic descriptions that help the model choose an operation correctly.
- Responses may be too extensive or poorly suited to a context window.
- Exposing an entire API increases the number of tools and makes it harder for the model to select the right one.
Advantages of MCP
- It provides a common interface for different AI clients.
- It allows capabilities and their schemas to be discovered dynamically.
- It distinguishes between actions, context sources, and interaction templates.
- It makes the same integration available across multiple compatible hosts.
- It can encapsulate several API calls in task-oriented tools.
Limitations of MCP
- It introduces another layer that must be deployed, versioned, monitored, and protected.
- Actual compatibility may vary depending on the MCP features implemented by each client.
- It does not eliminate the need for an API or data-access layer behind the server.
- It does not make a poorly designed tool safe or easy to use.
- It may be unnecessary when there is only one consumer and the flow is completely deterministic.
Security changes when the consumer can reason and act
In a traditional integration, the sequence of calls is written in code. In an agent, part of the decision may depend on the model and on untrusted external content. Therefore, connecting a tool is not the same as authorizing every possible use of that tool.
For remote MCP servers, the specification provides for authorization over the HTTP transport and is based on OAuth standards. However, authorization is optional in MCP, and an implementation must design it correctly. When applied, the authorization specification requires validating that tokens are intended for the correct server and recommends selecting permissions according to the principle of least privilege.
There are also specific risks: local servers with access to the device, tools with untrusted descriptions, incorrect credential delegation, SSRF during OAuth discovery, or destructive actions proposed by the model. The official MCP security best practices guide addresses threats such as the confused deputy problem, improper token passthrough, state handle hijacking, and compromised local servers.
At a minimum, an implementation should:
- Grant each server and tool only the permissions it needs.
- Separate read and write operations.
- Validate inputs, outputs, paths, and URIs on the server.
- Treat external descriptions, annotations, and responses as untrusted data.
- Show which tool is about to run and request confirmation for sensitive or irreversible actions.
- Apply usage limits, audit logs, timeouts, and idempotency where appropriate.
- Run local servers in an isolated environment with restricted system access.
- Prevent the MCP server from accepting or forwarding tokens intended for other services.
The tools specification itself recommends keeping a person in the loop, with the ability to deny invocations. MCP standardizes the connection, not trust.
When should you use an API?
Use an API directly when:
- The consumer is a traditional application rather than an agent.
- The flow is defined from beginning to end and does not require dynamic discovery.
- You need maximum control over latency, retries, caching, or volume.
- You are publishing a general interface for developers and multiple types of clients.
- You have only one agent and a few stable operations that you can register as functions without adding another layer.
An API should also remain the foundation when the organization already centralizes its business logic, permissions, and auditing there. There is no need to duplicate that logic inside the MCP server.
When should you use MCP?
MCP is particularly useful when:
- You want an integration to work with multiple compatible agent clients or environments.
- The agent needs to combine tools and context sources from different systems.
- The available capabilities change and should be discovered at runtime.
- You need to expose files, documents, or schemas as resources in addition to executing actions.
- You want to offer an official integration of your product for the AI assistant ecosystem.
- You want to encapsulate complex APIs in business tasks that are clearer and safer for a model.
The benefit increases with the number of combinations. If a company must connect several agents to many services, a shared interface reduces the work required to build point-to-point adapters.
When should you use both?
For most established products, this will be the most sensible option:
- API as the core: it maintains the business logic, data, authorization, and contracts for any consumer.
- MCP as the agent layer: it selects the appropriate capabilities, describes them clearly, limits their scope, and transforms the results into useful context.
This pattern makes it possible to evolve the agent experience without breaking applications that already consume the API. It also prevents the MCP layer from becoming a second implementation of the business logic.
A practical rule for deciding
You can make the decision by asking three questions:
- Who will consume the interface? If it is deterministic code, start with an API. If there are several AI clients, consider MCP.
- Does the capability already exist behind an API? Keep it there and create an MCP layer only if it adds interoperability or better semantics for the agent.
- Does the model need to choose between tools or access heterogeneous context? The greater this need, the greater the value of MCP.
In summary:
Use an API to expose software capabilities; use MCP to present capabilities and context to agents. In real-world systems, the usual approach will not be to choose one or the other, but to use MCP on top of well-designed APIs.
Conclusion and use at Gescon
MCP addresses a need that traditional APIs did not handle consistently: connecting models and agents to tools, resources, and workflows through a common contract. Its dynamic discovery and primitives reduce the cost of integrating the same service into different AI applications.
But MCP does not replace the existing architecture. APIs remain the appropriate mechanism for exposing services, centralizing business rules, and serving deterministic integrations. An MCP server can build on them and provide the agent with a smaller, semantic, and controlled surface.
Therefore, the decision should not be based on which technology is newer. It should be based on the consumer and the problem: use an API when you need a general and predictable interface; use MCP when you need compatible agents to discover and use capabilities in a consistent way; use both when you want to combine a mature foundation with an experience designed specifically for AI.
MCP and API at Gescon
On our platform, artificial intelligence agents can connect to traditional REST APIs as well as MCP servers. In the Integrations section, you can find information about some connectors developed by NurIA Labs for Gescon. Depending on the provider, we use the connection to its MCP server, while in other cases we choose to adapt agent integrations natively to the APIs.
Marc Seguí Coll