MCP ExplorerExplorer

Mcp Adk

@MeirKaDon a year ago
21 MIT
FreeCommunity
AI Systems
A simple integration of Bright Data MCP with new Agent framework by google

Overview

What is Mcp Adk

MCP_ADK is an integration of Bright Data’s Model Context Protocol (MCP) with Google’s Agent Development Kit (ADK), designed to create a web search agent that retrieves information based on user queries.

Use cases

Use cases for MCP_ADK include building custom search agents for specific queries, automating data collection from the web, and enhancing research capabilities by retrieving relevant information efficiently.

How to use

To use MCP_ADK, clone the repository, set up a virtual environment, install the required packages, configure environment variables, and run the agent through the ADK web interface by starting the local web server.

Key features

Key features of MCP_ADK include seamless integration with Bright Data MCP, the ability to perform web searches, and a user-friendly web interface for interaction.

Where to use

MCP_ADK can be used in fields such as web scraping, data retrieval, and automated information gathering for research or business intelligence.

Content

Web Search Agent using Google ADK and Bright Data MCP

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.

Prerequisites

  • 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)

Installation

1. Clone the repository

git clone https://github.com/MeirKaD/MCP_ADK.git
cd MCP_ADK

2. Create and activate a virtual environment

# For macOS/Linux
python -m venv .venv
source .venv/bin/activate

# For Windows
python -m venv .venv
.venv\Scripts\activate

3. Install the required packages

pip install google-adk google-generativeai python-dotenv

4. Install Bright Data MCP package

npm install -g @brightdata/mcp

5. Set up environment variables

Create a .env file in the root directory by copying the .env.template:

cp .env.template .env

Then, edit the .env file and add your Google Gemini API key:

GOOGLE_GENAI_USE_VERTEXAI="False"
GOOGLE_API_KEY="YOUR_GEMINI_API_KEY"

6. Configure Bright Data MCP credentials

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"

Running the Agent with ADK Web Interface

1. Start the ADK Web Server

adk web

This will start a local web server, typically at http://localhost:8000.

2. Access the Web Interface

Open your browser and navigate to http://localhost:8000 to interact with your agent through the ADK web interface.

How the Agent Works

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.

Features

  • Web search using Bright Data MCP
  • Information retrieval from websites
  • Answering questions based on web content
  • Automatic cleanup of resources when the agent terminates

Customization

You can customize the agent’s behavior by modifying the web_search_agent/agent.py file:

  • Change the model by updating the model parameter
  • Modify the agent’s description and instructions
  • Add additional tools or capabilities

Troubleshooting

If you encounter issues:

  1. Ensure your Google Gemini API key is valid
  2. Check your Bright Data credentials
  3. Verify that Node.js and npm are correctly installed
  4. Make sure you have the correct version of Python and all required packages

License

MIT

Acknowledgements

  • Google Agent Development Kit (ADK)
  • Bright Data MCP

Tools

No tools

Comments

Recommend MCP Servers

View All MCP Servers