This repository contains a web search agent built with Google's Agent Development Kit (ADK) and Bright Data's Model Context Protocol (MCP). The agent can search the web and retrieve information based on user queries.
- Python 3.12 or later
- Node.js and npm (for Bright Data MCP)
- Google Gemini API key
- Bright Data account with active Web Unblocker API zone (For Browser capabilities, Scraping Browser zone is required as well)
git clone https://github.com/MeirKaD/MCP_ADK.git
cd MCP_ADK# For macOS/Linux
python -m venv .venv
source .venv/bin/activate
# For Windows
python -m venv .venv
.venv\Scripts\activatepip install google-adk google-generativeai python-dotenvnpm install -g @brightdata/mcpCreate a .env file in the root directory by copying the .env.template:
cp .env.template .envThen, edit the .env file and add your Google Gemini API key:
GOOGLE_GENAI_USE_VERTEXAI="False"
GOOGLE_API_KEY="YOUR_GEMINI_API_KEY"
Edit the web_search_agent/agent.py file and replace the placeholders with your Bright Data credentials:
"API_TOKEN": "YOUR_BRIGHT_DATA_API_TOKEN",
"WEB_UNLOCKER_ZONE": "unblocker",
"BROWSER_AUTH": "brd-customer-YOUR_CUSTOMER_ID-zone-scraping_browser:YOUR_PASSWORD"adk webThis will start a local web server, typically at http://localhost:8000.
Open your browser and navigate to http://localhost:8000 to interact with your agent through the ADK web interface.
The agent is built using Google's Agent Development Kit (ADK) and uses Gemini 2.0 Flash as the underlying model. It leverages Bright Data's Model Context Protocol (MCP) to perform web searches and retrieve information from websites.
The agent initializes the MCP toolset asynchronously when the first request is received, connecting to Bright Data's services to enable web search capabilities.
- Web search using Bright Data MCP
- Information retrieval from websites
- Answering questions based on web content
- Automatic cleanup of resources when the agent terminates
You can customize the agent's behavior by modifying the web_search_agent/agent.py file:
- Change the model by updating the
modelparameter - Modify the agent's description and instructions
- Add additional tools or capabilities
If you encounter issues:
- Ensure your Google Gemini API key is valid
- Check your Bright Data credentials
- Verify that Node.js and npm are correctly installed
- Make sure you have the correct version of Python and all required packages
MIT
- Google Agent Development Kit (ADK)
- Bright Data MCP