Blog · · 6 min read
MCP vs A2A vs Direct API: Choosing the Right Agent Boundary

A team adding AI features to an existing product has internal APIs it wants language models to use, and has to decide what stays internal, what becomes a Model Context Protocol (MCP) tool, and what crosses an Agent-to-Agent (A2A) boundary. Wrapping every endpoint in a direct API function call is the easy start, and it ends in a tightly coupled, brittle integration.
The boundary you pick determines how much custom orchestration you build, how well you isolate tenant data, and how easily you can swap models or agents later. The worked architecture below covers the failure modes of each approach and when each one fits.
The problem with defaulting to direct function calling
Direct API function calling remains the baseline integration method. A platform engineer exposes an existing REST or GraphQL endpoint, provides a JSON Schema description, and passes it directly to the model.
This forces the application tier to handle all of tool coordination. When a product team exposes dozens of endpoints, the model prompt becomes bloated with schemas. The application code must intercept every call, enforce domain invariants, manage authorization, handle retries, and translate product-specific errors into model-friendly feedback. Anthropic's engineering team notes that unnecessary abstraction or poorly scoped tools can degrade performance.
If you use direct function calling for everything, you end up rebuilding protocol-level concerns like discovery and session management from scratch.
Defining the three integration boundaries
Separate internal domain logic from reusable context and from autonomous delegation.
Direct API function calling: internal domain invariants
Direct APIs suit narrow, product-specific actions where the application must tightly control the execution context. These are operations that require synchronous validation, immediate product-state updates, or strict transactional integrity.
When you use direct function calling, the integration boundary is the model itself. The application maintains full control over the execution loop. It decides when to invoke the model, what schemas to provide, and how to handle the response.
Use direct APIs when:
- The tool interacts deeply with internal product state.
- The action requires synchronous, transaction-safe execution.
- The application needs to enforce strict domain invariants before the model sees the result.
Model Context Protocol (MCP): reusable tools and context
Model Context Protocol (MCP) defines an open standard connecting AI applications to external data, tools, and workflows. It creates a standard client-server boundary. Instead of hardcoding schemas into the application, the application acts as an MCP client and connects to one or more MCP servers.
MCP is the right boundary when you need to decouple the tool implementation from the agent application. An MCP server handles discovery, resource exposure, and tool execution. It allows you to expose reusable capabilities like reading a filesystem, querying a database, or accessing a third-party SaaS without rebuilding the integration for every new agent.
Use MCP when:
- You want to expose a reusable tool or context source to multiple agents.
- You need to isolate the tool execution environment from the core application for security or dependency reasons.
- You want to use community-built servers for standard resources.
Agent-to-Agent (A2A) Protocol: autonomous cross-system delegation
The Agent-to-Agent (A2A) Protocol defines discovery, long-running task state, authentication, authorization, idempotency, and approval states for agent-to-agent work.
Unlike MCP, which exposes tools to an agent, A2A coordinates independent, long-running agents. It provides a standard for asynchronous delegation. When Agent A delegates a task to Agent B, Agent A does not need to know how Agent B accomplishes the task. It only needs to know how to track progress, handle approval requests, and receive the final result.
Use A2A when:
- An agent needs to delegate an autonomous, long-running task to another agent.
- The delegated task crosses trust boundaries or organizational domains.
- The interaction requires standardized pause, resume, and approval states.
A worked product architecture
Consider an existing customer support platform. The platform wants to deploy an AI agent that can read support tickets, query a customer database, and issue refunds.
If the team uses direct function calling for everything, the agent application must securely hold database credentials, manage the refund transaction, and handle pagination for the ticketing system. This mixes infrastructure, product logic, and AI orchestration in a single monolith.
Instead, apply boundaries by capability and risk.
Step 1: Wrap internal data with MCP
The ticketing system and customer database should be exposed via an MCP server. The agent acts as an MCP client. The MCP server handles connection pooling, data retrieval, and pagination.
This boundary allows the team to swap the agent framework without rewriting the data integrations. It also gives a clean security boundary: the MCP server can run in a restricted environment, and the agent only sees the standardized MCP protocol.
Step 2: Enforce domain invariants with direct APIs
Issuing a refund is a high-risk, transaction-safe operation. It should not be a generic MCP tool. Instead, the application should expose a narrow, direct API function call specifically for initiating a refund.
The refund also stays direct because an MCP server sees only the context the client passes it, while the application already holds the user, tenant, and limits. When the model calls the refund tool, the application code intercepts the call and enforces domain invariants: checking the user's authorization, verifying the refund limit, and recording the audit trail. The application manages the transaction and returns a strict success or failure schema to the model.
Step 3: Delegate specialized tasks via A2A
Suppose the support agent needs to escalate a complex bug to the engineering team's specialized triage agent. This is an asynchronous, cross-system delegation.
The support agent uses the A2A protocol to send the task to the engineering agent. The support agent monitors the task state using A2A's standardized tracking. If the engineering agent requires human approval to proceed, it pauses its execution and surfaces the request through the A2A protocol. The support agent does not need to understand the engineering agent's internal tools; it only needs to understand the A2A state machine.
Managing authentication, state, and tenancy
Each boundary handles authentication and state differently.
For direct APIs, authentication is usually handled implicitly by the application context. The application knows the current tenant and user, and it scopes the function execution accordingly.
For MCP, the protocol supports connection-level authentication, but the server must still enforce tenant isolation. If a multi-tenant SaaS uses MCP, the client must pass the tenant context, and the server must apply row-level security or tenant-scoped credentials before retrieving data.
For A2A, authentication and authorization are built into the protocol. A2A defines how agents verify each other's identity and prove authorization to perform a delegated task. Task state is managed explicitly by the protocol, allowing long-running operations to survive process restarts.
When not to introduce a protocol
If the tool is used by one agent, tied to internal application state, and executes synchronously, a plain function call is enough, and wrapping it in MCP adds a network hop and latency.
Similarly, do not use A2A for simple data retrieval. A2A is designed for autonomous delegation and long-running state. Do not use it to fetch a user profile. Use MCP or a direct API for synchronous data access.
Verification and next steps
To implement these boundaries in your existing product:
- Audit your existing endpoints and categorize them as data retrieval, generic tools, or product-specific transactions.
- Implement an MCP server for your generic data retrieval and isolated tools.
- Keep high-risk transactions as direct API function calls within your application orchestration loop.
- If you have independent agents that need to coordinate asynchronously, evaluate the A2A protocol for standardization.