Google ADK MCP tools: connect McpToolset to Sume's server

Add Sume's hosted MCP server to a Google ADK agent with McpToolset, an API-key header, and tool_filter, and make paid tools ask for confirmation.

5 min readSume
All posts

To connect a Google ADK agent to Sume's MCP tools, add an McpToolset to the agent's tools with StreamableHTTPConnectionParams(url="https://mcp.sume.com/mcp"), your Sume API key in an Authorization: Bearer header, and a tool_filter naming only the Sume tools the agent may call. Put paid tools in a second McpToolset with require_confirmation=True.

The ADK facts come from its MCP tools, Python API reference, and action confirmations pages; the Sume facts come from OAuth and API keys, MCP tools and gates, and Jobs and results, all read on 2026-09-27. Sume has no ADK package or plugin; McpToolset is ADK's own MCP client. Sume's basics page says hosted MCP still works but is not part of the primary path today. For the same setup in Anthropic's SDK, see Claude Agent SDK MCP server.

How do I add Sume's MCP server to an ADK agent?

Install ADK with its MCP extra, pip install "google-adk[mcp]", on Python 3.10 or later. ADK's docs say agents deployed to production must define McpToolset synchronously in agent.py, so build both toolsets at import time:

import os
from google.adk.agents import LlmAgent
from google.adk.tools.mcp_tool import McpToolset
from google.adk.tools.mcp_tool.mcp_session_manager import StreamableHTTPConnectionParams

def sume(tools, confirm=False):
    return McpToolset(
        connection_params=StreamableHTTPConnectionParams(
            url="https://mcp.sume.com/mcp",
            headers={"Authorization": f"Bearer {os.getenv('SUME_API_KEY')}"},
        ),
        tool_filter=tools,
        require_confirmation=confirm,
    )

root_agent = LlmAgent(
    model="gemini-flash-latest",
    name="video_producer",
    instruction="Preview paid calls with dry_run=true. Wait with jobs_wait; never resubmit.",
    tools=[
        sume(["tools_schema", "balance_get", "jobs_wait", "jobs_result"]),
        sume(["generate_video"], confirm=True),
    ],
)

Where does the Sume API key go?

ADK's MCP page passes a bearer token in headers, read with os.getenv, and the example does the same. The page also recommends its native auth_scheme and auth_credential parameters over hand-built headers; with those, ADK constructs the Authorization header itself. For API-key auth on MCP tools, ADK supports only header-based keys, which is what Sume takes: Authorization: Bearer or x-api-key.

  • For a key that differs per user, header_provider takes a callable that receives a ReadonlyContext and returns the session's headers.
  • An API-key session on Sume sees the full hosted tool set, paid tools included; the Sume MCP tools list shows which tools read, write, or spend. ADK's checklist says to always supply tool_filter to expose only necessary actions, and its docs note that every tool definition from a directly attached toolset enters the agent's history.
  • Don't paste the key into chat, and rotate it if it appears in logs or chat history.

How does confirmation stop a paid Sume call?

With require_confirmation=True, every tool in that toolset pauses for a yes or no before it runs. In the adk web interface the user gets a dialog. Without a UI, send a FunctionResponse named adk_request_confirmation to the ADK API server's /run or /run_sse endpoint, with the id of the confirmation request and confirmed in the response.

  • ADK marks Tool Confirmation as experimental, and it does not support DatabaseSessionService or VertexAiSessionService.
  • The boolean covers every tool in the toolset, so a dry_run=true preview asks too. ADK's API reference says require_confirmation can also be a callable that takes the tool's arguments and returns a boolean; its confirmation guide shows that form only for function tools.
  • Sume's playbook before paying is to call the paid tool with dry_run=true, confirm the estimate, balance, and queue behavior, then submit with a fresh idempotency_key, which every write and paid tool needs. max_spend_usd caps a call only when you pass it. Spend caps for unattended AI agents covers the other limits.

Do Sume's long waits fit ADK's timeouts?

Yes. For Streamable HTTP, timeout bounds establishing the connection and sse_read_timeout bounds reading data. Sume's jobs_wait holds one call for at most 55 seconds, or 50 when timeout_seconds is omitted, well inside the read timeout.

  • On wait_slice_expired, call jobs_wait again with the same ids and never resubmit the paid create. A 524, 522, 523, or 525 on jobs_wait is a transport failure, not a job outcome.
  • Outside adk web, call await toolset.close() or use an async context manager; close() closes the MCP session and releases its resources. MCP tool call timeouts on long-running video jobs covers batch waits.
From ADK's Python API reference and Sume's Jobs and results, read 2026-09-27.
SettingADK defaultWhat it boundsFor Sume
timeout5.0 secondsEstablishing the connectionKeep the default.
sse_read_timeout300.0 secondsReading data from the serverAlready above the 55-second jobs_wait cap.
tool_filterNoneWhich tools the agent getsAlways a list of Sume tool names.
require_confirmationFalseA yes or no before each callTrue on the paid toolset.

Sources

Related posts

More in Integrations

All Integrations posts

Written by Sume