A2A-MCP-ADK-Integration
A2A-MCP-ADK-Integrationは、異なるアプリケーション間のデータ統合を容易にするPythonライブラリです。自動化されたワークフローを構築し、APIを介してデータを効率的にやり取りできます。使いやすいインターフェースと高い柔軟性を持ち、開発者にとって強力なツールです。
GitHubスター
6
ユーザー評価
未評価
お気に入り
0
閲覧数
16
フォーク
3
イシュー
0
🔍 Search Agent – A2A with Google ADK
This repository contains a demo of a Search Agent built with Google's Agent Development Kit (ADK), showcasing Agent2Agent (A2A) and Multi-Component Protocol (MCP) integration. The Search Agent is capable of scraping content from specified URLs. Additionally, it includes an orchestrator agent that demonstrates agent-to-agent communication.
This example demonstrates how to build, serve, and interact with a Search Agent capable of scraping content from specified URLs, as well as how to create orchestrator agents that can call other agents via the A2A protocol.
📦 Project Structure
This agent is located within the agents/search_agent/
directory.
agents/
└── search_agent/
├── __main__.py # Starts the Search Agent server
├── agent.py # Gemini-based search agent logic
├── client.py # Test client to interact with the agent
└── task_manager.py # In-memory task handler for the Search Agent
scrap_translate/
├── __init__.py # Package initialization
└── agent.py # Orchestrator agent that calls other agents via A2A
🛠️ Setup
Prerequisites
- Python 3.8 or higher
- pip (Python package manager)
1. Create Virtual Environment
Create and activate a Python virtual environment to isolate project dependencies:
# Create virtual environment
python3 -m venv venv
# Activate virtual environment
# On macOS/Linux:
source venv/bin/activate
# On Windows:
venv\Scripts\activate
2. Install Dependencies
Install the required Python packages:
pip install -r requirements.txt
3. Environment Configuration
Create your environment file by copying the provided template:
cp env.example .env
Edit the
.env
file and fill in your actual API keys:GOOGLE_API_KEY
- Get this from Google AI StudioFIRECRAWL_API_KEY
- Get this from FireCrawl
Optional configurations (already have sensible defaults):
GOOGLE_MODEL_NAME
- Gemini model to use (default:gemini-2.5-pro-preview-03-25
)AGENT_REGISTRY_BASE_URL
- URL for agent discovery (default:http://localhost:10000
)
⚠️ Important: Never commit your .env
file to version control. It's already included in .gitignore
.
🎬 Demo Walkthrough
Follow these steps to run and test the Search Agent:
Start the Search Agent Server
Open a terminal and run the following command from the project root directory:
python3 -m agents.search_agent --host localhost --port 10000
This will start the agent server, listening on
localhost
at port10000
(the default port).Test using the Test Client
Open a new terminal window (keep the server running in the first one) and run the client script:
python3 agents/search_agent/client.py
This script is configured to connect to
http://localhost:10000
by default and send a predefined query to the agent. You should see output in both the server terminal (indicating it received a request) and the client terminal (showing the agent's response).Agent-to-Agent Communication via ADK Web Interface
Now let's demonstrate how agents can call other agents using the A2A protocol. We'll use the ADK web interface to interact with the orchestrator agent (
scrap_translate
) which can then call our search agent.Run the ADK Web Interface:
adk web
This will open a web interface where you can select the
scrap_translate
agent from the available agents list and interact with it.This orchestrator agent can discover and call other A2A agents, including our search agent. It demonstrates:
- Agent discovery: Finding available agents on the network
- Agent-to-agent communication: Calling specialized agents as tools
- Collaborative workflows: Breaking complex tasks into agent-specific subtasks
The orchestrator will automatically discover your running search agent and can delegate web scraping tasks to it, showcasing the power of the A2A framework for building collaborative AI systems.
Refer to the official Google ADK documentation for detailed instructions on setting up and using the ADK web interface.
📖 Learn More
- A2A GitHub: https://github.com/google/A2A
- Google ADK: https://github.com/google/agent-development-kit