How kumbham8888/hands-on-ai-building-ai-agents-with-model-context-protocol-mcp-and-agent2agent-a2a-6055298 works
This repository is a set of course examples demonstrating MCP resource and tool access, HR policy retrieval, time-off operations, and A2A multi-agent routing. The principal workflow is a user request routed to a policy or time-off agent, which uses an MCP server to retrieve policy context or perform time-off operations and returns a response. The earlier code-of-conduct example demonstrates a separate MCP resource-to-LLM workflow. Some chapter capabilities are documented by the tree and README but their wiring is not sampled; those links are omitted.
Main entry points: a2a_client_router_agent.py HR Router Agent · code_of_conduct_client.py Conduct Client · hr_policy_agent.py Policy Agent · hr_policy_server.py Policy Vector Store
Components 16
Conduct Resource Demo
- Conduct Client
chapter2/code_of_conduct_client.py - Conduct MCP Server
chapter2/code_of_conduct_server.py - Conduct PDF
chapter2/code_of_conduct.pdf - Language Model
Policy Assistant
- Policy Agent
chapter3/hr_policy_agent.py - Policy MCP Server
chapter3/hr_policy_server.py - Policy Document
chapter3/hr_policy_document.pdf - Policy Vector Store
chapter3/hr_policy_server.py
Time-Off Service
- Time-Off Agent
chapter4/timeoff_agent.py - Time-Off MCP Server
chapter4/timeoff_db_server.py - Time-Off Datastore
chapter4/timeoff_datastore.py
A2A Routing
- HR Router Agent
chapter6/a2a_client_router_agent.py - Policy A2A Wrapper
chapter6/a2a_wrapper_hr_policy_agent.py - Time-Off A2A Wrapper
chapter6/a2a_wrapper_timeoff_agent.py - Language Model
Other components
- User
Connections 20
- User → Conduct Client: asks query
- Conduct Client → Conduct MCP Server: starts MCP; fetches resource
- Conduct MCP Server → Conduct PDF: reads PDF
- Conduct Client → Language Model: supplies context and query
- Language Model → Conduct Client: returns answer
- User → Policy Agent: asks policy
- Policy Agent → Policy MCP Server: loads prompt and tools
- Policy Agent → Policy Vector Store: queries via MCP tool
- Policy MCP Server → Policy Vector Store: searches
- Policy Vector Store → Policy Document: indexes document
- User → Time-Off Agent: asks time-off
- Time-Off Agent → Time-Off MCP Server: loads prompt and tools
- Time-Off MCP Server → Time-Off Datastore: reads and updates
- Time-Off Datastore → Time-Off MCP Server: returns operation result
- User → HR Router Agent: sends request
- HR Router Agent → Language Model: classifies request
- HR Router Agent → Policy A2A Wrapper: routes A2A request
- HR Router Agent → Time-Off A2A Wrapper: routes A2A request
- Policy A2A Wrapper → Policy Agent: executes policy query
- Time-Off A2A Wrapper → Time-Off Agent: executes time-off query