This document describes three standardized communication protocols for AI agent systems: Model Context Protocol (MCP), Agent-to-Agent Protocol (A2A), and Natural Language Web (NLWeb). These protocols enable agents to discover tools, communicate with other agents, and interact with web content in standardized ways.
MCP provides universal tool discovery and invocation. A2A enables multi-agent collaboration across different organizations and platforms. NLWeb makes website content accessible to AI agents through natural language interfaces.
For information about implementing agent memory and context management strategies that complement these protocols, see Context Engineering and Agent Memory Systems. For details on specific agent frameworks that implement these protocols, see Microsoft Agent Framework.
Sources: 11-agentic-protocols/README.md1-175
The Model Context Protocol provides a standardized client-server architecture for exposing tools and data sources to Large Language Models. MCP acts as a "universal adaptor" enabling dynamic tool discovery, eliminating the need for hardcoded API integrations. 11-agentic-protocols/README.md27-31
Unlike traditional API calls that require static integration code, MCP allows agents to query available tools at runtime and invoke them through a consistent interface. This supports the "integrate once, use everywhere" pattern across different LLMs and frameworks. 11-agentic-protocols/README.md55-56
Sources: 11-agentic-protocols/README.md27-60 11-agentic-protocols/code_samples/11-mcp-agent-framework.ipynb81-90
Core Components:
| Component | Description | Role |
|---|---|---|
| Host | LLM application (VSCode, Agent) | Initiates server connections 11-agentic-protocols/README.md37-38 |
| Client | Connection manager within host | Maintains 1:1 server connection 11-agentic-protocols/README.md39-40 |
| Server | Lightweight service process | Exposes tools, resources, prompts 11-agentic-protocols/README.md41-42 |
| Tools | Callable functions with schemas | Execute actions (e.g., API calls) 11-agentic-protocols/README.md45-46 |
| Resources | Read-only data items | Provide text/binary content 11-agentic-protocols/README.md47-48 |
| Prompts | Predefined templates | Enable complex workflows 11-agentic-protocols/README.md49-50 |
Sources: 11-agentic-protocols/README.md33-50 11-agentic-protocols/code_samples/11-mcp-agent-framework.ipynb96-113
In the Microsoft Agent Framework, MCP-style patterns are implemented using the @tool decorator to simulate discovery, or via direct integration with MCP servers. 11-agentic-protocols/code_samples/11-mcp-agent-framework.ipynb119-125
Key Implementation Entities:
FoundryChatClient - Connects to Azure AI Foundry models to power the agent. 11-agentic-protocols/code_samples/11-mcp-agent-framework.ipynb69-74@tool - Decorator used to define functions that can be dynamically discovered by agents. 11-agentic-protocols/code_samples/11-mcp-agent-framework.ipynb132-140SimpleEventStore / PersistentEventStore - Classes that enable MCP session resumption by storing and replaying JSONRPC events. 11-agentic-protocols/code_samples/mcp-agents/server/event_store.py28-100Simulated Discovery Pattern:
Sources: 11-agentic-protocols/code_samples/11-mcp-agent-framework.ipynb132-162 11-agentic-protocols/code_samples/mcp-agents/server/event_store.py1-145
The Agent-to-Agent Protocol enables AI agents from different organizations and platforms to communicate, share context, and collaborate on tasks. 11-agentic-protocols/README.md78-79 Unlike MCP which connects agents to tools, A2A connects agents to other agents, creating distributed multi-agent systems. 11-agentic-protocols/code_samples/11-a2a-agent-framework.ipynb75-78
Each A2A agent runs its own LLM, uses its own tools, and publishes an Agent Card describing its capabilities. Agents discover each other through these cards and delegate subtasks via standardized message passing. 11-agentic-protocols/README.md87-94
Sources: 11-agentic-protocols/README.md78-82 11-agentic-protocols/code_samples/11-a2a-agent-framework.ipynb73-90
Core Components:
| Component | Description |
|---|---|
| Agent Card | Metadata including name, description, skills, and endpoint URL. 11-agentic-protocols/README.md87-94 |
| Agent Executor | Responsible for passing user chat context to remote agents. 11-agentic-protocols/README.md96-98 |
| Artifact | Work product containing results and descriptions sent through the protocol. 11-agentic-protocols/README.md100-102 |
| Event Queue | Handles updates and message passing to prevent premature connection closure. 11-agentic-protocols/README.md104-106 |
Sources: 11-agentic-protocols/README.md83-107 11-agentic-protocols/code_samples/11-a2a-agent-framework.ipynb79-88
In production, A2A agents are instantiated using the A2AAgent class, which takes an agent_card and a url. 14-microsoft-agent-framework/README.md90-94
Agent Creation Pattern:
Workflow Integration:
The framework uses WorkflowBuilder to connect specialized agents into a sequential or concurrent pipeline that mirrors A2A message passing. 11-agentic-protocols/code_samples/11-a2a-agent-framework.ipynb154-157
Sources: 14-microsoft-agent-framework/README.md90-94 11-agentic-protocols/code_samples/11-a2a-agent-framework.ipynb106-157
NLWeb makes website content accessible to AI agents through natural language interfaces. It acts as both a user-facing chat interface and an MCP server, allowing agents to query website data using the ask() method. 11-agentic-protocols/README.md143-145
NLWeb ingests structured content (Schema.org, RSS), creates embeddings, stores them in vector databases, and exposes them through natural language queries. 11-agentic-protocols/README.md156 This enables accurate, grounded responses without hallucinations since results come from actual website data. 11-agentic-protocols/README.md162
Sources: 11-agentic-protocols/README.md132-136 11-agentic-protocols/README.md154-165
Core Components:
| Component | Description |
|---|---|
| NLWeb Application | The engine driving natural language capabilities. 11-agentic-protocols/README.md140 |
| NLWeb Protocol | Ruleset for interaction, returning JSON/Schema.org responses. 11-agentic-protocols/README.md142 |
| MCP Server | Allows other AI systems to share tools (e.g., ask) and data. 11-agentic-protocols/README.md143-145 |
| Embedding Models | Converts content into vector representations. 11-agentic-protocols/README.md146-147 |
| Vector Database | Stores embeddings (e.g., Azure AI Search, Qdrant, Milvus). 11-agentic-protocols/README.md148-149 |
Sources: 11-agentic-protocols/README.md138-149
| Protocol | Connects | Discovery | Primary Data Format |
|---|---|---|---|
| MCP | Agent to Tools/Data | Tool Listing/Schemas | JSON-RPC |
| A2A | Agent to Agent | Agent Cards | Structured Artifacts |
| NLWeb | Agent to Website | ask() MCP Method | JSON (Schema.org) |
Sources: 11-agentic-protocols/README.md27-165
For production MCP servers, the PersistentEventStore class uses SQLite to ensure that communication events are not lost during client reconnections. 11-agentic-protocols/code_samples/mcp-agents/server/event_store.py88-100
store_event(stream_id, message): Persists JSONRPC messages to the events table. 11-agentic-protocols/code_samples/mcp-agents/server/event_store.py127-134replay_events_after(last_event_id, send_callback): Replays subsequent events for a specific stream to resume state. 11-agentic-protocols/code_samples/mcp-agents/server/event_store.py147-156The A2A protocol allows for Cross-framework interop, where an agent built in the Microsoft Agent Framework can delegate tasks to agents built in different frameworks, provided they are A2A-compliant. 11-agentic-protocols/code_samples/11-a2a-agent-framework.ipynb188
Sources: 11-agentic-protocols/code_samples/mcp-agents/server/event_store.py88-177 11-agentic-protocols/code_samples/11-a2a-agent-framework.ipynb182-192
Refresh this wiki