
adk mcp a2a langgraph example
演示通过 A2A 协议在 ADK 和 LangGraph 代理之间进行通信,实现视频检索与总结。
Repository Info
About This Server
演示通过 A2A 协议在 ADK 和 LangGraph 代理之间进行通信,实现视频检索与总结。
Model Context Protocol (MCP) - This server can be integrated with AI applications to provide additional context and capabilities, enabling enhanced AI interactions and functionality.
Documentation
ADK/LangGraph MCP A2A YouTube Summarizer
This project demonstrates inter-agent communication using the A2A protocol between an agent built with Google's Agent Development Kit (ADK) and another built with LangGraph. It uses real MCP tool endpoints and Google Cloud Secret Manager for API key handling.
- LangGraph YouTube Agent: Finds YouTube video IDs based on channel/date or playlist ID using specific MCP tool URLs. Runs an A2A server.
- ADK Summary Agent: Coordinates the summarization process. It receives a user request, delegates video finding to the YouTube Agent via A2A, receives the video IDs, calls specific MCP tool URLs to summarize each video, combines the summaries using another MCP tool URL, and returns the final result (streaming updates). Runs an A2A server.
Prerequisites
- Python 3.11+
- uv (recommended Python package manager)
- Google Cloud Project with Secret Manager API enabled.
- A secret stored in Google Cloud Secret Manager containing your Google AI (Gemini) API Key.
- URLs for four running MCP servers (or fewer if tools are hosted together):
get_playlist_videostool endpoint.get_youtube_videos_for_channel_datetool endpoint.get_youtube_video_summarytool endpoint.generate_final_summarytool endpoint.
- (Optional) Service account JSON files if your MCP servers require authentication.
a2a-sampleslibrary installed orcommondirectory copied from thegoogle-a2arepository.
Setup
-
Clone the repository (or run the creation script):
cd adk-langgraph-a2a-youtube-summarizer -
Install Dependencies:
uv venv source .venv/bin/activate # Ensure a2a-samples is installed or common dir setup in pyproject.toml uv pip install -e . # Install root package and workspace members -
Configure Environment Variables:
- Fill in the placeholders in
langgraph_youtube_agent/.env. RemoveGOOGLE_API_KEY. AddSECRET_PROJECT_IDandGOOGLE_API_KEY_SECRET_ID. AddMCP_URL_GET_PLAYLISTandMCP_URL_GET_CHANNEL. - Fill in the placeholders in
adk_summary_agent/.env. RemoveGOOGLE_API_KEY. AddSECRET_PROJECT_IDandGOOGLE_API_KEY_SECRET_ID. AddMCP_URL_SUMMARIZEandMCP_URL_COMBINE. EnsureYOUTUBE_AGENT_A2A_URLis correct. Replace placeholders.
- Fill in the placeholders in
-
Authentication: Ensure your environment is authenticated to Google Cloud with permissions to access the specified secret in Secret Manager (e.g., run
gcloud auth application-default login).
Running
-
Start the MCP Servers: Ensure your MCP servers are running and accessible at the URLs specified in the
.envfiles. -
Start the LangGraph YouTube Agent A2A Server: (Terminal 1)
# From the root directory, activate venv uv run langgraph_youtube_agent --port 10003 -
Start the ADK Summary Agent A2A Server: (Terminal 2)
# From the root directory, activate venv uv run adk_summary_agent --port 10004 -
Interact using an A2A Client: (Terminal 3) Use an A2A client pointed at the ADK Summary Agent's URL (
http://localhost:10004).# Example using the sample CLI # cd <path_to_google_a2a>/samples/python/hosts/cli # Activate venv if needed # uv run . --agent http://localhost:10004 --streamEnter prompts like:
Summarize videos from channel <channel_id> on <YYYY-MM-DD>Give me a summary for playlist <playlist_id>
Observe logs and streaming output.
Quick Start
Clone the repository
git clone https://github.com/iamulya/adk-mcp-a2a-langgraph-exampleInstall dependencies
cd adk-mcp-a2a-langgraph-example
npm installFollow the documentation
Check the repository's README.md file for specific installation and usage instructions.
Repository Details
Recommended MCP Servers
Discord MCP
Enable AI assistants to seamlessly interact with Discord servers, channels, and messages.
Knit MCP
Connect AI agents to 200+ SaaS applications and automate workflows.
Apify MCP Server
Deploy and interact with Apify actors for web scraping and data extraction.
BrowserStack MCP
BrowserStack MCP Server for automated testing across multiple browsers.
Zapier MCP
A Zapier server that provides automation capabilities for various apps.