Content
# A2A MCP Demo
A multi-agent system demo that uses the [A2A protocol](https://a2aproject.github.io/A2A/latest/) and an A2A [MCP](https://modelcontextprotocol.io/introduction) server.
## What's Included
- **MCP Server** (`mcp_server.py`): A FastMCP server that provides tools for agent discovery, communication, and session management via A2A.
- **Orchestrator Agent** (`orchestrator_agent.py`): A [LangGraph](https://langchain-ai.github.io/langgraph/) agent uses [A2ANet](https://github.com/A2ANet/A2ANetPython) to easily implement A2A. Coordinates multiple AI agents using MCP tools.
- **Tavily Agent** (`tavily_agent.py`): A [LangGraph](https://langchain-ai.github.io/langgraph/) agent uses [A2ANet](https://github.com/A2ANet/A2ANetPython) to easily implement A2A. Web search agent.
## Quick Start
1. Clone the repository: `git clone https://github.com/A2ANet/A2AMCPDemo.git`
2. Create an `.env` file from `.env.example`
3. Set `ANTHROPIC_API_KEY` and `TAVILY_API_KEY`
4. Optionally, set `LANGSMITH_*` for LangSmith tracing
5. Install [uv](https://docs.astral.sh/uv/)
6. Run the Orchestrator agent: `uv run --env-file .env orchestrator_agent.py`
7. Run the Tavily agent: `uv run --env-file .env tavily_agent.py`
That's it! The Orchestrator agent will be running on `http://localhost:8000` and the Tavily agent on `http://localhost:8001`.
Test the Orchestrator Agent with the [Agent2Agent (A2A) UI](https://github.com/A2ANet/A2AUI) or [A2A Protocol Inspector](https://github.com/a2aproject/a2a-inspector).
Ask it to "discover an agent at http://localhost:8001", then ask it "what's the weather in London?".
It will use the A2A MCP server to fetch the Tavily Agent's agent card, then to send it a message.
The Tavily Agent will then use the [Tavily Search API](https://www.tavily.com/) to search for the weather in London, and send an `Artifact` back for the Orchestrator agent to display.
## License
Distributed under the terms of the [Apache-2.0](https://spdx.org/licenses/Apache-2.0.html) license.