AI & Agentic Systems

API vs MCP vs A2A: The Three Layers of the Modern AI Agent Stack

These three terms get thrown around interchangeably, and that is the source of most of the confusion. They are not three competing ways to do the same thing — they are three different layers of the same stack, each solving a problem the other two do not. This article breaks down what each one actually is, in plain language first, then at full technical depth — plus how industry is actually deploying MCP and A2A today.

Dr. Nabanita Sinha
August 2026
15 min read
API vs MCP vs A2A — the three layers of the AI agent stack

The Easy Explanation First

Start with an API. It is a fixed contract between two programs — call this exact endpoint, send these exact fields, and you get back an exact, predictable shape. That works beautifully when a human developer wrote the code on both ends. But hand that same job to a language model and a new problem appears: the model has to know precisely which endpoint to call, which fields to send, which credentials to use, and what to do when something breaks. It is like handing a talented new employee a wall of control panels with no labels — intelligence alone does not create an interface, and someone still has to write custom, brittle glue code for every single service the model might need to touch.

MCP (Model Context Protocol) is the fix for that wall of unlabeled panels. Think of it as a USB-C port for AI applications: one standard connector that any tool can plug into, instead of a different custom cable for every device. An MCP server sits in front of a service — Slack, a calendar, an internal database — and hands the model a short, readable menu of actions it can take: "search a channel," "read messages," "send a message." The model does not read API docs or construct a raw request; it picks an item off the menu, and the MCP server handles the authentication, the pagination, and the messy plumbing underneath. Like USB-C, standardizing the connector does not automatically make what is plugged into it safe — that part still has to be checked.

A2A (Agent-to-Agent Protocol) solves a different problem again: not a model calling a tool, but one agent calling another agent. A generalist agent planning a hiring campaign does not know how to score a resume the way a dedicated screening agent does, so it needs a way to find that specialist and hand off the work. Every A2A agent publishes an Agent Card — a short, structured profile listing what it claims to do, what formats it accepts, and how to reach it. Think of it as a service card, not a verified résumé: it tells a calling agent what to expect, but trusting it is a separate decision the system still has to make.

The One-Line Version

API

Software talks to software.

Built for developers

MCP

A model talks to tools.

Built for AI agents

A2A

An agent talks to another agent.

Built for multi-agent systems

Now, Technically: What Each One Actually Standardizes

API — the foundation everything else sits on

An API is a contract between two pieces of software: a fixed set of endpoints, request formats, and response shapes, documented for a human developer to read and code against. GET /users/123 returns a predictable JSON payload, and the developer who wrote the calling code decides what to do with it, handles authentication, retries, and error cases explicitly. Nothing about an API is dynamic from the caller's point of view — you write code once, against docs, and it either matches the contract or it does not.

This assumption — a human developer reads documentation and writes matching code — is exactly what breaks when the caller is a language model instead of a person. A model has no persistent code, cannot store a secret safely, and cannot be trusted to construct a raw HTTP request correctly and safely every time. APIs are not going away — MCP and A2A are both built on top of them, not instead of them — but a model calling a raw API directly is a security and reliability problem, not a solved one.

MCP — the tool-access layer for AI agents

MCP, introduced by Anthropic in late 2024, standardizes how an AI application connects to external tools, data sources, and workflows. It follows a client–server model: an MCP client (the agent runtime) connects to an MCP server, which exposes a set of tools with typed, self-describing schemas. The model asks "what tools do you have?", receives a structured list back, and calls one by name with typed parameters — it never sees a URL, a header, or an API key.

A minimal MCP tool definition

from mcp.server.fastmcp import FastMCP
import requests

mcp = FastMCP(name="hr-tools")

@mcp.tool()
def get_employee(employee_id: str):
    """Fetch an employee record from the HRIS"""
    url = f"https://api.internal-hr.com/employees/{employee_id}"
    return requests.get(url, headers=AUTH_HEADERS).json()

mcp.run()

The model never holds AUTH_HEADERS. It just says "call get_employee with employee_id=E4471" and the server does the rest — validating input, applying rate limits, logging the call, and returning only the data the model is allowed to see. This is the core insight: MCP separates reasoning from execution. The model decides what to do; the MCP server decides how it is safely done. That separation is what makes a single tool integration reusable across GPT, Claude, Gemini, or any other MCP-compatible model without rewriting it for each one.

What MCP deliberately does not standardize: human-approval workflows, multi-tenant isolation policy, or delegation between agents. It operates at one layer only — tool discovery and invocation.

A2A — the agent-coordination layer

A2A, introduced by Google and now under the Linux Foundation, standardizes something MCP does not touch at all: how one autonomous agent discovers, talks to, and delegates work to another autonomous agent — often built by a different team, on a different framework, sometimes in a different organization entirely.

Every agent publishes an Agent Card — a structured declaration of what it can do. Other agents read that card, construct a Task, hand it over, and track it through a defined lifecycle (created → in progress → completed, with structured artifacts as the output) rather than a single request/response.

A simplified Agent Card

{
  "name": "candidate-screening-agent",
  "description": "Screens resumes and ranks candidates",
  "capabilities": [
    {
      "action": "rank_candidates",
      "input_schema": {
        "job_description": "string",
        "candidate_profiles": "array"
      }
    }
  ]
}

A planning agent reads this card, decides the screening agent is the right specialist for the job, and sends it a task rather than trying to rank resumes itself. That is the fundamental shift: MCP connects an agent to systems; A2A connects an agent to other agents.

Side-by-Side: What Each Layer Owns

DimensionAPIMCPA2A
Who calls itA human developer's codeAn AI model / agent runtimeAnother AI agent
DiscoveryRead the docs, hardcode the callDynamic — ask the server for its tool listDynamic — read the other agent's Agent Card
Unit of workA request / responseA tool call with typed input/outputA task with a lifecycle and artifacts
SecretsHeld by the calling codeHeld by the MCP server, never the modelHeld by each agent's own identity
Failure looks likeHTTP error codes, timeoutsSchema mismatch, permission denialStalled task, orphaned delegation
Created byOpen web standard (decades old)Anthropic, 2024Google, 2025 — now Linux Foundation

None of this makes API "obsolete" — MCP servers and A2A agents both eventually bottom out in an API call to a real system. The layering is additive: API moves data between systems, MCP lets a model safely decide which API to call, and A2A lets one agent delegate an entire piece of reasoning — including its own MCP tool calls — to a specialist agent better suited for it.

How a Real Request Flows Through All Three Layers

1

A2A

Planning agent delegates “screen these resumes” to a specialist screening agent

2

MCP

Screening agent calls its get_candidates tool to pull applicant data

3

API

MCP server makes the actual authenticated REST call to the ATS backend

4

Result

Ranked shortlist flows back up as an A2A artifact to the planning agent

How Industry Is Actually Using MCP and A2A

This is not a future-tense technology. Enterprise teams are deploying both protocols today, and the pattern that keeps showing up is: MCP for reaching into systems, A2A for splitting work across specialists.

MCP + A2A

HR & Recruiting

MCP servers expose BambooHR, Workday, and applicant-tracking systems as callable tools so an HR assistant agent can create records or pull candidate data directly. A2A shows up when a planning agent delegates resume ranking to a dedicated screening agent, and compliance checks to a separate regulatory-review agent.

MCP + A2A

Customer Support & CRM

Support agents use MCP to retrieve and update tickets in Zendesk or Salesforce and pull order history from a CRM. A2A is used to hand off sentiment analysis or escalation decisions to a specialist agent when a ticket looks high-risk.

MCP + A2A

Finance & ERP Reporting

MCP connects an agent to ERP and accounting systems to pull structured financial data on demand. Forecasting and variance analysis is frequently delegated via A2A to an analytics-specialist agent trained specifically on that task.

MCP-heavy

Developer Tooling & DevOps

GitHub, CI pipelines, and internal deployment systems are exposed via MCP so an agent can query a PR or trigger a workflow. Code review itself is often delegated end-to-end via A2A to a specialist review agent with its own model and rules.

MCP-heavy

Document & Invoice Processing

MCP tools wrap PDF extraction, OCR, and validation systems so agents can process invoices, contracts, and compliance filings without direct file-system or network access.

Hybrid architecture

Multi-Agent Enterprise Copilots

The most sophisticated deployments run a planning or orchestrator agent that never touches a raw system itself — it only reasons and delegates. Every specialist agent underneath it uses MCP for its own system access, and A2A carries every handoff between them.

The consistent lesson across every one of these: teams that start with a single monolithic "do everything" agent hit a wall in complexity fairly fast. The ones that scale cleanly separate system access (MCP) from task delegation (A2A) early, so each layer can be secured, monitored, and scaled on its own terms.

The Shared Security Risk: Neither Was Built for Adversarial Input

This is where "technically strong" actually matters, and it is the part most explainer content skips. Neither MCP nor A2A was designed with adversarial input as a first-class concern, and OWASP ranks indirect prompt injection as the #1 risk for LLM applications. The attack surface differs between the two protocols, but the underlying vulnerability does not.

In MCP, the attack is static: a poisoned tool response contains hidden instructions that persist in the agent's context once delivered. A hidden display:none block in an email returned by a Gmail MCP tool can instruct the agent to forward sensitive data before a human ever sees the message. In A2A, the attack is stateful — multi-turn agent sessions give an attacker room to manipulate context gradually across a delegated task, a pattern security researchers call session smuggling.

Non-negotiables in a production deployment

  • Least-privilege tool scoping — an MCP server should expose the narrowest capability that gets the job done, never a raw database connection.
  • Human approval gates before any write action reaches a real system (send email, issue a refund, modify a record).
  • Full audit logging of every tool call and every A2A task handoff, with the reasoning trace kept, not just the result.
  • Tenant-scoped visibility so one customer's agent can never see another's tools, tasks, or data.

Decision Framework: Which One Do You Actually Need?

1
Choose API alone: You're building traditional software with a known set of callers and callees, and no AI model is deciding which call to make.
2
Add MCP: Your system's complexity is in connecting a model to external tools and data — a single agent needs to reach into CRMs, databases, or SaaS platforms safely and dynamically.
3
Add A2A: Your system's complexity is in coordination — multiple specialized agents need to discover each other's capabilities and hand off long-running work.
4
Use both, layered: You're building an enterprise-grade multi-agent system: A2A for delegation between specialists, MCP inside each specialist for its own tool access. This is where most serious production systems end up.

Rule of thumb: start with MCP. Add A2A only once you genuinely have more than one specialized agent that needs to hand work to another.

Key Takeaways

1

API is the foundation: a fixed contract for software calling software. MCP and A2A are both built on top of APIs, not replacements for them.

2

MCP standardizes how an AI model safely discovers and calls external tools — it separates what the model decides from how the action is actually executed, keeping secrets out of the model's hands entirely.

3

A2A standardizes how one autonomous agent delegates work to another via Agent Cards, structured tasks, and a defined lifecycle — a different problem from tool access.

4

In production, most enterprise systems converge on a hybrid: A2A for delegation between specialist agents, MCP inside each specialist for its own system access.

5

Both protocols share the same unsolved problem — neither was designed against adversarial input, so least-privilege scoping, human approval on writes, and full audit trails are not optional extras.

The question was never "which one wins." APIs, MCP, and A2A sit at three different altitudes of the same stack — data movement, tool access, and agent coordination. The systems that hold up in production are the ones that keep those three concerns cleanly separated instead of collapsing them into one oversized agent that tries to do everything itself.

More from this series

AI & Agentic Systems

LLM Caching Strategies: Faster Responses, Lower Costs—Without Stale AnswersLLM Caching

LLM Caching Strategies: Faster Responses, Lower Costs—Without Stale Answers

What caching means in AI, how prompt and semantic caching differ, where to use each, and how they reduce repeated computation, token costs and response time—with diagrams and trade-offs.

Read Article
Harness Engineering: Building the Test Infrastructure Your AI Agents Actually NeedEvaluation

Harness Engineering: Building the Test Infrastructure Your AI Agents Actually Need

The discipline of constructing rigorous, repeatable test infrastructure for AI systems — covering golden datasets, LLM-as-judge evaluation, regression suites, and CI/CD evaluation gates.

Read Article
Agentic AI Architecture: A Complete Layer-by-Layer Technical GuideArchitecture

Agentic AI Architecture: A Complete Layer-by-Layer Technical Guide

A comprehensive technical deep-dive into every layer of a production-grade agentic AI system — orchestration, specialised agents, memory, tools, observability, reliability, governance, and infrastructure.

Read Article
Vectorless RAG: When LLM Reasoning Replaces Vector SearchRAG & Retrieval

Vectorless RAG: When LLM Reasoning Replaces Vector Search

How the PageIndex architecture replaces vector similarity with LLM reasoning to plan retrieval — and why it outperforms traditional RAG for structured, multi-hop, and auditable enterprise queries.

Read Article
Memory in AI Agents: Architecture, Risks and Enterprise ManagementAgent Memory

Memory in AI Agents: Architecture, Risks and Enterprise Management

A practical guide to working, semantic, episodic and procedural memory—covering production architecture, poisoning, privacy, stale facts, lifecycle controls and enterprise governance.

Read Article
GraphRAG: Design, Advantages, Tradeoffs and When to Use ItRAG & Retrieval

GraphRAG: Design, Advantages, Tradeoffs and When to Use It

A practical guide to GraphRAG design, industry adoption and platform selection—comparing Neo4j, managed cloud graph services, distributed databases and semantic knowledge graph platforms.

Read Article
Advanced RAG: Building Retrieval Systems That Actually WorkRAG & Retrieval

Advanced RAG: Building Retrieval Systems That Actually Work

A practitioner's deep-dive into the full RAG pipeline — from chunking strategies and metadata design to query optimisation, reranking, and output validation.

Read Article
Prompt Engineering for Enterprise AI: From Vague Inputs to High-Impact OutputsPrompt Engineering

Prompt Engineering for Enterprise AI: From Vague Inputs to High-Impact Outputs

A practitioner's guide to the five types of prompting, the Role+Task+Context+Format+Constraints formula, and why prompt quality is governance in agentic AI systems.

Read Article
LLM Caching Strategies: Faster Responses, Lower Costs—Without Stale AnswersLLM Caching

LLM Caching Strategies: Faster Responses, Lower Costs—Without Stale Answers

What caching means in AI, how prompt and semantic caching differ, where to use each, and how they reduce repeated computation, token costs and response time—with diagrams and trade-offs.

Read Article
Harness Engineering: Building the Test Infrastructure Your AI Agents Actually NeedEvaluation

Harness Engineering: Building the Test Infrastructure Your AI Agents Actually Need

The discipline of constructing rigorous, repeatable test infrastructure for AI systems — covering golden datasets, LLM-as-judge evaluation, regression suites, and CI/CD evaluation gates.

Read Article
Agentic AI Architecture: A Complete Layer-by-Layer Technical GuideArchitecture

Agentic AI Architecture: A Complete Layer-by-Layer Technical Guide

A comprehensive technical deep-dive into every layer of a production-grade agentic AI system — orchestration, specialised agents, memory, tools, observability, reliability, governance, and infrastructure.

Read Article
Vectorless RAG: When LLM Reasoning Replaces Vector SearchRAG & Retrieval

Vectorless RAG: When LLM Reasoning Replaces Vector Search

How the PageIndex architecture replaces vector similarity with LLM reasoning to plan retrieval — and why it outperforms traditional RAG for structured, multi-hop, and auditable enterprise queries.

Read Article
Memory in AI Agents: Architecture, Risks and Enterprise ManagementAgent Memory

Memory in AI Agents: Architecture, Risks and Enterprise Management

A practical guide to working, semantic, episodic and procedural memory—covering production architecture, poisoning, privacy, stale facts, lifecycle controls and enterprise governance.

Read Article
GraphRAG: Design, Advantages, Tradeoffs and When to Use ItRAG & Retrieval

GraphRAG: Design, Advantages, Tradeoffs and When to Use It

A practical guide to GraphRAG design, industry adoption and platform selection—comparing Neo4j, managed cloud graph services, distributed databases and semantic knowledge graph platforms.

Read Article
Advanced RAG: Building Retrieval Systems That Actually WorkRAG & Retrieval

Advanced RAG: Building Retrieval Systems That Actually Work

A practitioner's deep-dive into the full RAG pipeline — from chunking strategies and metadata design to query optimisation, reranking, and output validation.

Read Article
Prompt Engineering for Enterprise AI: From Vague Inputs to High-Impact OutputsPrompt Engineering

Prompt Engineering for Enterprise AI: From Vague Inputs to High-Impact Outputs

A practitioner's guide to the five types of prompting, the Role+Task+Context+Format+Constraints formula, and why prompt quality is governance in agentic AI systems.

Read Article