YouTube Search Assistant with ADK, MCP and Gemma 3
A practical implementation demonstrating YouTube search functionality using Google's Agent Development Kit (ADK), Model Context Protocol (MCP), and the Gemma 3 model via Ollama.
This project showcases how to leverage Google's ADK (Agent Development Kit) and MCP (Model Context Protocol) to build an agent powered by Gemma 3, Google's latest large language model. It demonstrates how to:
Connect to locally-hosted Gemma 3 via Ollama
Implement YouTube search functionality using MCP
Create a conversational agent that can format and present search results
🏗️ Architecture
🧩 Core Components
Google ADK - Provides the agent framework
Model Context Protocol (MCP) - Standardizes tool communication
Gemma 3 (12B) - Powers the language understanding and generation
ADK Agent Framework processes the query and determines intent
If a YouTube search is needed:
The request is routed to the MCP Tool Registry
The MCP YouTube Search tool receives the query
SERP API is called to fetch YouTube results
Results are returned through the MCP standardized format
Gemma 3 model (via Ollama and LiteLlm):
Receives the search results
Generates a natural language response
Formats the search results into readable bullet points
The formatted response is returned to the user interface
✨ Technology Highlights
Google ADK
Manages conversation flow and tool orchestration.
Model Context Protocol (MCP)
Enables standardized communication between models and tools.
Gemma 3 via Ollama
Delivers high-quality text generation with tool-calling capabilities.
LiteLlm Integration
Connects ADK to Ollama-hosted models seamlessly.
SERP API
Provides access to YouTube data through search API.
🚀 Features
🔍 Search for YouTube videos using natural language queries
🤖 Powered by Gemma 3 running on Ollama
📋 Formats search results in a clean, easy-to-read format
🛠️ Built with Google's Agent Development Kit (ADK)
🔄 Integrates MCP (Model Context Protocol) for seamless tool communication
🧠 Core Concepts
ADK - Agent Development Kit
Agent Development Kit (ADK) is an open-source, code-first Python toolkit for building intelligent AI agents.
MCP - Model Context Protocol
Model Context Protocol (MCP) is a standard for communication between models and tools. It allows for:
Consistent tool invocation patterns
Structured data exchange
Tool composition and chaining
Language-agnostic tool definitions
Agents in ADK
An Agent in ADK acts as the orchestrator for AI interactions. In this project, we use LlmAgent, which is a core component in ADK acting as the "thinking" part of your application that:
Leverages a Large Language Model (LLM) for reasoning and understanding
Manages conversation history and context
Coordinates tool usage based on user queries
Tools with MCP
Tools in this project are implemented using the MCP (Model Context Protocol) framework, which:
Defines a standard interface for tool interaction
Makes tools easily discoverable by the LLM
Structures input/output formats
Facilitates tool composition
The MCP YouTube Search tool provides a standardized way for the agent to interact with YouTube search functionality.
Ollama Integration
Ollama provides a way to run Gemma 3 and other large language models locally. Google ADK connects to Ollama through:
LiteLlm - A wrapper that standardizes communication with different LLM providers
Custom configurations to optimize model performance
Created by Arjun Prabhulal. For more articles on AI/ML and Generative AI, follow Arjun Prabhulal on Medium.
📄 License
This project is released under a free and open license. Anyone is free to use, modify, distribute, or build upon this code for any purpose, including commercial applications, without restriction.