Explainer
MCP (Model Context Protocol)
The Problem
Why MCP?
AI agents need to interact with external tools and data sources. Before MCP, every integration was custom: different APIs, different auth methods, different error handling.
MCP (Model Context Protocol) standardizes this. Anthropic released it in November 2024, and it's now under the AAIF (Agentic AI Foundation) at the Linux Foundation. Thousands of MCP servers already exist for GitHub, Slack, Google Drive, Postgres, and more.
(Not to be confused with A2A, which handles agent-to-agent communication. MCP connects agents to tools.)
What MCP Solves
Three Core Problems
Think of MCP as a universal adapter. Build one integration, connect to any compatible tool.
How It Works
Architecture
The architecture is simple: clients (agents) talk to servers (tools) over a standard protocol.
Capabilities
MCP servers expose three types of capabilities:
Tools are where the action happens. The LLM sees tool schemas and decides when to call them:
Authentication
What the Spec Requires
MCP supports two transport mechanisms with different auth models:
For remote HTTP connections, the MCP spec (2025-11-25) mandates specific OAuth standards:
▶ What do these standards do?
The latest OAuth standard. Mandates PKCE for all clients, deprecates implicit flow and password grants.
Proof Key for Code Exchange. Prevents authorization code interception by requiring clients prove they initiated the request.
Binds tokens to specific audiences. Without this, leaked tokens can be replayed to any service. Resource indicators ensure a token issued for MCP Server A can't be used against Server B.
Enables auth server discovery. The MCP server tells clients which authorization server to use via /.well-known/oauth-protected-resource.
Best Practice: On-Behalf-Of
The agent exchanges the user's token for a new token scoped to the MCP server. The resulting token identifies both the user and the acting agent.
This is the On-Behalf-Of (OBO) pattern. It preserves user identity, enabling:
- Audit trails: MCP server knows Alice requested this via Agent X
- Fine-grained authorization: Policies consider both user and agent
- Least privilege: Tokens scoped to specific resources
With client_credentials, the MCP server only sees "Agent X is calling me". It can't enforce user-specific policies or audit who actually requested the action.
The demo below shows the OBO flow in practice. For a deep dive on the pattern, see my OBO Explainer.
See It In Action
MCP Flow with OBO
Security Risks
MCP Creates New Attack Surface
MCP solves integration. It also introduces new security risks.
- Standard protocol
- Capability discovery
- OAuth 2.1 authentication
- Scoped tokens
- Vetting which servers to trust
- Avoiding overprivileged tokens
- Validating tool behavior
Primary Attack Vectors
See Hou et al. for the full threat taxonomy.
Real-World Incidents
These aren't theoretical. MCP security incidents are already happening:
Who Benefits
Different Stakeholders, Same Protocol
For enterprise deployments, consider an MCP gateway:
What's Still Missing
The Trust Gap
MCP handles transport and auth to the server. It doesn't handle trust of the server.
✓ Server identity
TLS verifies domain ownership. An MCP server at tools.acme.com proves Acme controls it.
✓ Within your organization
You deploy your own MCP servers, you trust them. Standard auth works fine.
✗ Cross-organization discovery
No standard way to discover trustworthy MCP servers. No verification of capability claims. No delegation chain tracking.
✗ Non-repudiation
TLS encrypts the connection, but doesn't sign individual messages. If there's a dispute about what was sent, there's no cryptographic proof. Audit logs rely on trusting the logger.
✗ Trust durability
Trust is session-based and domain-centric. If a server migrates infrastructure, changes domains, or rotates certificates, previous trust relationships break. No persistent identity across these changes.
✗ Metadata privacy
TLS protects content, but network observers and intermediaries can still see who's talking to whom. For sensitive agent interactions, this traffic analysis is itself a privacy leak.
Third-Party MCP Servers
The problem: External MCP servers use external IdPs. Your enterprise IdP isn't in the loop.
- MCP gateways help inbound (user → gateway), but outbound (gateway → external IdP) is out of band
- Which users are allowed to connect to which external servers?
- How do you audit usage? On whose authority?
- Can you revoke access?
MCP gateways like AgentGateway are adding auth portals to manage these external connections from a single enforcement point.
Beyond Single Trust Domains?
The gap appears in open ecosystems where you can't pre-establish trust. DIDs and Verifiable Credentials offer a path forward:
- Discoverable identity without centralized registries
- Verifiable capability claims issued by trusted parties, not self-asserted
- Delegation chains that can be cryptographically verified across boundaries
Same gaps as A2A. Both protocols need this trust layer for open ecosystems. TSP (Trust Spanning Protocol) is the emerging answer from the Trust over IP Foundation.
MCP vs A2A
Different Problems
They're complementary. An agent might use MCP to query a database, then use A2A to delegate a subtask to a specialized agent. See the A2A explainer.
Learn More