Google ADK

Give your Google ADK agent its own email inbox

Getting started

Google Agent Development Kit (ADK) is an open-source framework for building AI agents. By connecting AgentMail to your ADK agent via the AgentMail MCP server, your agent can create inboxes, send and receive emails, manage threads, and handle attachments using natural language.

Use cases

  • Give agents their own inboxes: Create dedicated email addresses for your agents so they can send and receive emails independently, just like a human team member.
  • Automate email workflows: Let your agent handle email conversations end to end, including sending initial outreach, reading replies, and following up on threads.
  • Manage conversations across inboxes: List and search across threads and messages, forward emails, and retrieve attachments to keep your agent informed and responsive.

Prerequisites

  1. An AgentMail account with an API key from the AgentMail Console
  2. Google ADK installed (pip install google-adk or npm install @google/adk)

Setup

ADK supports AgentMail through the MCP tool interface. Connect to the hosted AgentMail MCP server over HTTP:

1import os
2
3from google.adk.agents import Agent
4from google.adk.tools.mcp_tool import McpToolset
5from google.adk.tools.mcp_tool.mcp_session_manager import StreamableHTTPConnectionParams
6
7AGENTMAIL_API_KEY = os.environ["AGENTMAIL_API_KEY"]
8
9root_agent = Agent(
10 model="gemini-2.5-pro",
11 name="agentmail_agent",
12 instruction="Help users manage email inboxes and send messages",
13 tools=[
14 McpToolset(
15 connection_params=StreamableHTTPConnectionParams(
16 url="https://mcp.agentmail.to/mcp",
17 headers={"x-api-key": AGENTMAIL_API_KEY},
18 ),
19 )
20 ],
21)

Available tools

McpToolset discovers the hosted server’s current tools and schemas at connection time. Refer to the current MCP tool catalog instead of copying a fixed inventory into your application.