

In this article, I will build an ADK agent using version 1.2.0 or later, which introduces numerous new features since version 0.5.0, particularly in MCP tool integration, making it a simpler and cleaner tool registration process, and enabling more intuitive agent building.
In my previous article , Agent Development Kit (ADK) as MCP Client — A Deep Dive (Full Code), we built an ADK agent using the MCP client in a fully programmatic way. Now, with ADK v1.2.0+, we will use same MCPToolset in ADK Web, CLI, and programmatic agent development with only few lines of code.
Agent Development Kit (ADK) is a flexible and modular framework for developing and deploying AI agents.
- ADK is model-agnostic, deployment-agnostic, and is built for compatibility with other frameworks.
- ADK was designed to make agent development feel more like software development, to make it easier for developers to create, deploy, and orchestrate agentic architectures that range from simple tasks to complex workflows.
Model Context Protocol (MCP) is a standardized, open protocol developed by Anthropic that enables AI models to seamlessly interact with external data sources and tools, acting as a universal connector for AI integrations.
MCP follows a client-server architecture, defining how data (resources), interactive templates (prompts), and actionable functions (tools) are exposed by an MCP server and consumed by an MCP client (which could be an LLM host application or an AI agent).
Let’s dive into building this ADK, MCP, and Gemini AI agent by breaking it down into key implementation steps. We will be using Brightdata MCP as a search assistant to access, discover, and extract web data in real-time.
- Python 3.10+ installed
- GOOGLE_API_KEY https://aistudio.google.com/app/apikey
- Brightdata API key https://brightdata.com/ for the MCP server
- Node.js 16+ — Required `npx` command to run Bright Data MCP server
adk-mcp-brightdata
└── search
├── __init__.py
├── agent.py
└── prompt.py
# Setup virtual environment (Mac or Unix )
python -m venv venv && source venv/bin/active # Install agent development kit
pip install google-adk
#Install Brightdata MCP Server
npm install @brightdata/mcp
- google-adk: Installs the Agent Development Kit from Google
- brightdata/mcp: Installs Brightdata MCP server
#Copy keys from https://aistudio.google.com/app/apikey
export GOOGLE_API_KEY="xxxx"#Copy keys from https://brightdata.com/cp/zones
export API_TOKEN="xxxx"
export WEB_UNLOCKER_ZONE="xxxx"
Below is the change between ADK v0.5.0 vs v1.0.0
Only two packages need to be imported for the MCP Tool integration
from google.adk.agents import Agent
from google.adk.tools.mcp_tool.mcp_toolset import MCPToolset, StdioServerParameters
ADK — v0.5.0 (old way)
- async executor that fetched MCP tools dynamically using MCPToolset.from_server(), then ran them sequentially
- Tool registration was indirect and more boilerplate-heavy
def create_mcp_tool_executor():
async def mcp_tool_executor(**kwargs):
tools, exit_stack = await MCPToolset.from_server(
connection_params=StdioServerParameters(
command="npx",
args=["-y", "@brightdata/mcp"],
env={"API_TOKEN": os.getenv("API_TOKEN"),
"WEB_UNLOCKER_ZONE": os.getenv("WEB_UNLOCKER_ZONE")}
)
)try:
return await try_tools_sequentially(tools, kwargs, exit_stack)
finally:
await exit_stack.aclose()
return mcp_tool_executor
root_agent = Agent(
model="gemini-2.0-flash",
name="search_assistant",
description="Google ADK Agent integrated with MCP for intelligent web search assistance.",
instruction=PROMPT,
tools=create_mcp_tool_executor
)
ADK — v1.2.1 (New way tool declaration)
- No more async tool executor — tool setup is now synchronous and simpler.
- Tools registered directly with the agent make the code cleaner and more readable.
- MCPToolset is now fully supported as a first-class citizen in ADK, making integrations easier.
tools = MCPToolset(
connection_params=StdioServerParameters(
command='npx',
args=["-y", "@brightdata/mcp"],
env={
"API_TOKEN": os.getenv("API_TOKEN"),
"WEB_UNLOCKER_ZONE": os.getenv("WEB_UNLOCKER_ZONE")
}
)
)root_agent = Agent(
model="gemini-2.0-flash",
name="search_assistant",
description= "Google ADK Agent integrated with MCP for intelligent web search assistance.",
instruction=PROMPT,
tools=[tools],
)
adk web
adk run search
Event Trace
The default timeout in the mcp_session_manager is 5 seconds
Timeout Exception
Any MCP search exceeding 5.0 seconds will throw a timeout exception.
Temporary Workaround
Update the timeout from 5 to 60 seconds in the mcp_session_manager.py inside your virtual environment.
.venv/lib/python3.12/site-packages/google/adk/tools/mcp_tool/mcp_session_manager.py
session = await self._exit_stack.enter_async_context(
ClientSession(
*transports[:2],
read_timeout_seconds=timedelta(seconds=60),
)
)
With ADK v1.2.0+, building agents using MCP tools has become a more developer-friendly and efficient way to integrate with the Agent tool, into cleaner, more maintainable code.
Source Credit: https://medium.com/google-cloud/building-adk-v1-2-0-agents-using-mcp-tools-e97fb5e47961?source=rss—-e52cf94d98af—4