AI Agents for Beginners - 11. Using Agentic Protocols (MCP, A2A and NLWeb)

MCP, A2A, and NLWeb — three agentic protocols for standardized tool access, agent-to-agent collaboration, and natural language interfaces on the web.
June 9, 2026

AI Agents for Beginners - 11. Using Agentic Protocols (MCP, A2A and NLWeb)

This article summarizes key takeaways based on Lesson 11 of Microsoft's AI Agents for Beginners course.
As the use of AI Agents grows, the need for protocols supporting standardization, security, and open innovation is becoming increasingly critical.
This lesson covers three protocols:
ProtocolRole
MCP (Model Context Protocol)Standardized access to external tools and data for AI Agents
A2A (Agent-to-Agent)Facilitates communication and collaboration between different AI Agents
NLWeb (Natural Language Web)Adds natural language interfaces to websites for AI Agents to explore and interact with content

Model Context Protocol

The Model Context Protocol (MCP) is an open standard that allows applications to provide context and tools to LLMs in a standardized way.
It acts as a "universal adapter" to connect consistently to diverse data sources and tools.

MCP Core Components

MCP operates on a client-server architecture, and its core components are as follows:
ComponentDescription
HostsLLM applications (e.g., VSCode) that initiate connections to MCP servers
ClientsComponents within the host application maintaining a 1
connection with servers
ServersLightweight programs exposing specific capabilities
The three core primitives of an MCP Server:
PrimitiveDescription
ToolsDiscrete actions and functions that agents can invoke (e.g., "get weather", "purchase product"). Advertises names, descriptions, and schemas
ResourcesRead-only data provided by the MCP server (file contents, database records, logs). Text or binary
PromptsPre-defined prompt templates designed for more complex workflows
MCP Client-Server Architecture
Mermaid
%%{init: {'look': 'handDrawn'}}%% flowchart LR subgraph Host["Host Application"] direction TB LLM["LLM"] Client["MCP Client"] LLM <--> Client end subgraph Server["MCP Server"] direction TB Tools["Tools\n(Actions)"] Resources["Resources\n(Data)"] Prompts["Prompts\n(Templates)"] end Client -->|"discover capabilities"| Server Server -->|"tool list + schemas"| Client Client -->|"call_tool(name, params)"| Server Server -->|"tool result"| Client

Benefits of MCP

BenefitDescription
Dynamic Tool DiscoveryAgents dynamically receive the list of available tools from the server. No static coding required unlike traditional APIs — an "integrate once" approach
Interoperability Across LLMsWorks across various LLMs, enabling flexible transitions to better-performing models
Standardized SecurityIncludes standard authentication methods — eliminates managing different keys and auth schemes when adding various MCP servers

MCP Example

A scenario where a user books a flight using an MCP-based AI assistant:
  1. Connection: The AI assistant (MCP client) connects to an MCP server provided by an airline.
  2. Tool Discovery: The client asks the airline's MCP server, "What tools do you have?" The server responds with a list of tools such as search_flights and book_flights.
  3. Tool Invocation: When requested to "Search for flights from Portland to Honolulu," the AI assistant uses the LLM to determine that it needs to call the search_flights tool and passes the relevant parameters (origin, destination) to the MCP server.
  4. Execution and Response: Acting as a wrapper, the MCP server calls the airline's internal booking API. It receives the flight information (JSON data) and returns it to the AI assistant.
  5. Further Interaction: The AI assistant presents flight options. Once a flight is selected, the assistant calls the book_flight tool on the same MCP server to complete the booking.
MCP Example: Flight Booking
Mermaid
%%{init: {'look': 'handDrawn'}}%% flowchart LR User(["User"]) Agent["AI\nAgent"] MCP["MCP\nServer"] API["Booking\nAPI"] User -->|"③ Request search_flights"| Agent Agent -->|"① Connection"| MCP Agent <-->|"② Tool Discovery\nsearch_flights, book_flights"| MCP MCP -->|"④ Execution\nCall internal API"| API API -->|"④ Response\nFlight JSON"| MCP MCP -->|"④ Returns\nFlight Options"| Agent Agent -->|"④ Shows\nFlight Options"| User User -->|"⑤ Selects Flight\n→ Call book_flight"| Agent

Code: MCP-Style Tool Discovery

In production, tools are dynamically discovered from an MCP server. The example below simulates an MCP-connected accommodation service:
setup.py
python
mcp_tools.py
python
mcp_agent.py
python
MCP Agent: Tool Discovery Flow
Mermaid
flowchart LR User["User Query\n'Tokyo 5 nights, culture & food'"] --> Agent["AccommodationAgent\n(MCP Client)"] Agent -->|"discover tools"| MCP["MCP Server\n(Simulated)"] MCP -->|"tool list + schemas"| Agent Agent --> T1["search_accommodations\n(Tokyo, April, 2 guests)"] Agent --> T2["get_local_experiences\n(Tokyo, culture + food)"] T1 & T2 --> LLM["LLM\nSynthesize & compare results"] LLM --> Response["Personalized accommodation\n& experience recommendations"] Response --> User

Agent-to-Agent Protocol (A2A)

While MCP focuses on connecting LLMs to tools, the Agent-to-Agent (A2A) protocol enables communication and collaboration between different AI Agents.
A2A connects agents across diverse organizations, environments, and technology stacks to accomplish joint tasks.

A2A Core Components

ComponentRole
Agent CardAdvertises the agent's name, description, skill list, endpoint URL, version, and capabilities. Helps other agents determine when and why to invoke it
Agent ExecutorPasses the user chat context to a remote agent. The remote agent parses the request with its own LLM and executes it using internal tools
ArtifactOutput generated after the remote agent completes a task. Includes task results, explanations, and textual context. The connection closes once delivered
Event QueueProcesses updates and delivers messages. Ensures connections remain intact until task completion. Crucial for long-running tasks
A2A Core Components
Mermaid
flowchart TD Orch["Orchestrator Agent\n(Travel Agent)"] Orch -->|"Look up Agent Card"| Registry["Agent Card Registry\nName · Skills · Endpoints"] Registry -->|"Discovered agents list"| Orch Orch -->|"Pass context"| AE["Agent Executor\nExecute remote agent"] AE -->|"Task complete"| Art["Artifact\nOutput · Explanations · Text"] Art --> Orch AE <-->|"Progress updates"| EQ["Event Queue\nMaintain connection · Message delivery"]

Benefits of A2A

BenefitDescription
Enhanced CollaborationEnables agents from different vendors and platforms to interact, share context, and collaborate
Model Selection FlexibilityEach A2A agent chooses its own LLM — enabling the use of models optimized or fine-tuned for specific agent roles
Built-in AuthenticationAuthentication is directly integrated into the A2A protocol, providing a robust security framework for agent interactions

A2A Example

The travel booking scenario expanded into A2A across 5 stages:
A2A Example: Full Trip Booking
Mermaid
flowchart TD User["User\n'Book round-trip flight + hotel + car rental for Honolulu'"] --> TA["Travel Agent\n(A2A Orchestrator)\nAnalyze task with LLM"] TA -->|"A2A Protocol"| AA["Airline Agent\n(Different company)\nSearch & book flights"] TA -->|"A2A Protocol"| HA["Hotel Agent\n(Different company)\nBook hotel"] TA -->|"A2A Protocol"| CA["Car Rental Agent\n(Different company)\nBook rental car"] AA & HA & CA -->|"Return Artifact"| TA TA -->|"Aggregate results"| Response["Consolidated Travel Confirmation\nIntegrated flight, hotel, and car rental"] Response --> User

Code: A2A Multi-Agent Workflow

Sequentially connecting three specialist agents using A2A message passing:
a2a_agents.py
python
a2a_workflow.py
python
A2A Workflow: 3-Agent Pipeline
Mermaid
flowchart LR User["User\n'1-week trip to Tokyo\nInterested in food, temples, technology'"] --> CE["CurrencyExchangeAgent\nExchange rates & currency guide\nBest timing & tips"] CE -->|"Pass context"| AP["ActivityPlannerAgent\nRecommend attractions, stays, dining\nTailored to traveler interests"] AP -->|"Pass context"| TM["TravelManagerAgent\nSynthesize full itinerary\nGenerate structured travel brief"] TM --> Response["Final Travel Plan\nExchange rates + Activities + Comprehensive brief"] Response --> User
Key capabilities in an A2A production environment:
CapabilityDescription
Cross-framework interopAgents built with different frameworks delegate tasks to A2A-compliant agents
Service boundariesAgents collaborate across distinct microservices, cloud regions, and external organizations
Dynamic discoveryOrchestrators discover the best specialist agents at runtime from an Agent Card registry
Streaming & push notificationsDelivers real-time progress updates via SSE (Server-Sent Events) and push notifications for long-running tasks

Natural Language Web (NLWeb)

Websites have long served as the primary means for users to access information across the internet.
NLWeb adds a natural language interface to every website, enabling AI Agents to explore and interact with content.

Components of NLWeb

ComponentRole
NLWeb ApplicationThe core service handling natural language questions. Connects various parts of the platform to generate responses — the "engine" of natural language capabilities
NLWeb ProtocolThe baseline set of rules for natural language interaction with websites. Provides JSON-formatted responses (leveraging Schema.org). The foundation for the "AI Web", just as HTML enabled document sharing
MCP ServerEach NLWeb setup also functions as an MCP server. Shares tools and data like the ask method with other AI systems — turning the website into a participant in the "agent ecosystem"
Embedding ModelsConverts website content into vectors (numerical representations). Stores semantic meaning in a form computers can compare and search
Vector DatabaseStores embeddings of website content. Rapidly retrieves relevant information upon receiving a query. Supports Qdrant, Snowflake, Milvus, Azure AI Search, Elasticsearch, etc.
NLWeb Architecture
Mermaid
flowchart TD Content["Website Content\n(Schema.org / RSS Feeds)"] --> Ingest["NLWeb Application\nData ingestion & processing"] --> Embed["Embedding Model\nConvert content → vectors"] --> VDB["Vector Database\n(Qdrant / Azure AI Search, etc.)"] Query["Natural Language Query\n(User or AI Agent)"] --> NLP["LLM\nQuery understanding & interpretation"] --> Search["Vector Search\nRetrieve relevant embeddings"] Search --> VDB VDB -->|"Return similar results"| NLP NLP --> Response["Natural Language Response\n(Grounded in real DB data)"] NLWeb_MCP["NLWeb as MCP Server\n'ask' method"] -->|"Called by AI Agent"| Search

NLWeb by Example

A scenario of a travel booking website powered by NLWeb:
  1. Data Ingestion: The travel website's existing product catalog (flight listings, hotel descriptions, tour packages, etc.) is formatted into Schema.org structures or ingested via RSS feeds. An NLWeb tool converts this structured data into embeddings and stores them in a local or remote vector database.
  2. Natural Language Query: Instead of navigating through menus, a user visiting the website types into a chat interface: "Find a family-friendly hotel in Honolulu with a pool for next week."
  3. NLWeb Processing: The NLWeb application receives the query. It sends the query to an LLM to comprehend its intent while simultaneously querying the vector database for relevant hotel listings.
  4. Accurate Results: The LLM interprets the database search results, selects optimal matches based on "family-friendly", "pool", and "Honolulu", and generates a natural language response. Because it references actual hotels from the website's catalog, hallucinations are avoided.
  5. AI Agent Interaction: Since NLWeb also functions as an MCP server, external AI travel agents can connect directly to the website's NLWeb instance. It queries directly via the ask MCP method: ask("Are there any hotel-recommended vegan restaurants in Honolulu?") → NLWeb processes this and returns a structured JSON response.
Five steps of applying NLWeb to a travel booking website:
NLWeb Example: Travel Booking Site
Mermaid
flowchart TD S1["1. Data Ingestion\nFormat flights, hotels, & tour packages\nusing Schema.org/RSS\nGenerate embeddings → Store in Vector DB"] --> S2["2. Natural Language Query\nUser: 'Family-friendly Hawaii hotel with pool'\nChat input without menu navigation"] --> S3["3. NLWeb Processing\nLLM: Understand query\nVector DB: Search relevant hotels"] --> S4["4. Accurate Results\nLLM interprets results & selects best matches\nResponse based on real catalog\n(No hallucinations)"] --> S5["5. AI Agent Interaction\nConnect external AI Agent via MCP 'ask' method\nask('Hawaii vegan restaurants?')\n→ Structured JSON response"]

Summary

Lesson 11 Summary: Three Agentic Protocols
Mermaid
flowchart LR Root["Agentic\nProtocols"] Root --> MCP["MCP\nModel Context Protocol"] Root --> A2A["A2A\nAgent-to-Agent"] Root --> NLW["NLWeb\nNatural Language Web"] MCP --> M1["Standardized Tool Access"] MCP --> M2["Dynamic Discovery"] MCP --> M3["Tools · Resources · Prompts"] A2A --> A1["Agent-to-Agent Collaboration"] A2A --> A2["Agent Card · Artifact"] A2A --> A3["Cross-framework Interop"] NLW --> N1["Websites + Natural Language Interface"] NLW --> N2["Vector DB-based Search"] NLW --> N3["Also Functions as an MCP Server"]
  • MCP serves as a "universal adapter" that grants AI Agents standardized access to external tools and data, allowing dynamic discovery of new capabilities without altering agent code.
  • A2A enables agents from different organizations and frameworks to discover one another via Agent Cards and collaborate to complete complex tasks.
  • NLWeb adds a natural language interface to websites and functions as an MCP server, empowering external AI Agents to query web content directly via the ask method.
  • The three protocols complement one another: MCP handles tool integration, A2A drives agent-to-agent collaboration, and NLWeb bridges web ecosystems with AI Agents.
Jooojub
System S/W engineer
Explore Tags
Series
    Recent Post
    © 2026. jooojub. All right reserved.