# Google Adk MCP Tool

> Integrate MCP (Model Context Protocol) tools into ADK agents. Use when connecting agents to MCP servers — stdio transport, SSE transport, MCPToolset configuration, and tool filtering.

- Skill: `eagleisbatman/google-adk-mcp-tool` (Agent Skill)
- Install (CLI): `npx skillmds@latest add eagleisbatman/google-adk-mcp-tool`
- Raw SKILL.md: https://api.skillmd.com/api/skills/eagleisbatman/google-adk-mcp-tool/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- Author: eagleisbatman (https://skillmd.com/u/eagleisbatman)
- Updated: 2026-09-22
- Page: https://skillmd.com/skills/eagleisbatman/google-adk-mcp-tool

---


# Google ADK — MCP Tool Integration

## Import

```python
from google.adk.tools.mcp_tool.mcp_toolset import MCPToolset
from mcp import StdioServerParameters
```

## Install MCP Extension

```bash
pip install google-adk[mcp]
# or
pip install google-adk[extensions]
```

## Stdio Transport (Local MCP Server)

```python
from google.adk.agents import Agent
from google.adk.tools.mcp_tool.mcp_toolset import MCPToolset
from mcp import StdioServerParameters

notion_toolset = MCPToolset(
    connection_params=StdioServerParameters(
        command="npx",
        args=["-y", "@notionhq/notion-mcp-server"],
        env={"NOTION_API_KEY": "your-key-here"},
    ),
)

root_agent = Agent(
    name="notion_agent",
    model="gemini-2.5-flash",
    instruction="Help users manage their Notion workspace.",
    tools=[notion_toolset],
)
```

## SSE Transport (Remote MCP Server)

```python
from google.adk.tools.mcp_tool.mcp_toolset import MCPToolset, SseServerParams

remote_toolset = MCPToolset(
    connection_params=SseServerParams(
        url="http://localhost:8080/sse",
        headers={"Authorization": "Bearer token"},
    ),
)

root_agent = Agent(
    name="remote_agent",
    model="gemini-2.5-flash",
    instruction="Use the remote tools to complete tasks.",
    tools=[remote_toolset],
)
```

## Tool Filtering

Only expose specific tools from the MCP server:

```python
toolset = MCPToolset(
    connection_params=StdioServerParameters(
        command="npx",
        args=["-y", "@modelcontextprotocol/server-filesystem"],
    ),
    tool_filter=["read_file", "write_file", "list_directory"],
)
```

## Tool Filter with Callable

```python
def my_filter(tool) -> bool:
    """Only allow read operations."""
    return tool.name.startswith("read_") or tool.name.startswith("list_")

toolset = MCPToolset(
    connection_params=StdioServerParameters(
        command="npx",
        args=["-y", "@modelcontextprotocol/server-filesystem"],
    ),
    tool_filter=my_filter,
)
```

## Multiple MCP Servers

```python
filesystem_tools = MCPToolset(
    connection_params=StdioServerParameters(
        command="npx",
        args=["-y", "@modelcontextprotocol/server-filesystem"],
    ),
)

github_tools = MCPToolset(
    connection_params=StdioServerParameters(
        command="npx",
        args=["-y", "@modelcontextprotocol/server-github"],
        env={"GITHUB_TOKEN": "your-token"},
    ),
)

root_agent = Agent(
    name="dev_agent",
    model="gemini-2.5-flash",
    instruction="Help with development tasks using filesystem and GitHub.",
    tools=[filesystem_tools, github_tools],
)
```

## MCP with Agent Instructions

Use `McpInstructionProvider` to fetch agent instructions from an MCP server's prompts:

```python
from google.adk.agents import Agent
from google.adk.agents.mcp_instruction_provider import McpInstructionProvider
from mcp import StdioServerParameters

# Fetches a named prompt from the MCP server as the agent instruction
mcp_instructions = McpInstructionProvider(
    connection_params=StdioServerParameters(
        command="npx",
        args=["-y", "@my-org/my-mcp-server"],
    ),
    prompt_name="agent_instructions",
)

root_agent = Agent(
    name="my_agent",
    model="gemini-2.5-flash",
    instruction=mcp_instructions,  # Callable that returns str
    tools=[notion_toolset],
)
```

## Common MCP Servers

| Server | Command | Use Case |
|--------|---------|----------|
| Filesystem | `@modelcontextprotocol/server-filesystem` | File read/write |
| GitHub | `@modelcontextprotocol/server-github` | Repos, PRs, issues |
| Notion | `@notionhq/notion-mcp-server` | Workspace management |
| Slack | `@anthropics/mcp-server-slack` | Channel messaging |
| PostgreSQL | `@modelcontextprotocol/server-postgres` | Database queries |
| Puppeteer | `@anthropics/mcp-server-puppeteer` | Browser automation |

## Key Rules

- MCP tools require `pip install google-adk[mcp]`
- Stdio transport starts a local process — ensure the binary/npx package exists
- SSE transport connects to a running remote server
- Tool filtering prevents agents from accessing dangerous tools
- MCPToolset is async — works with `adk web`, `adk run`, and `Runner.run_async()`
- Environment variables in `StdioServerParameters.env` are passed to the MCP process

## Related Skills

- `google-adk-function-tool` — Custom function tools
- `google-adk-openapi-tool` — REST API tools from OpenAPI specs

