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.

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_providertakes a callable that receives aReadonlyContextand 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_filterto 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
DatabaseSessionServiceorVertexAiSessionService. - The boolean covers every tool in the toolset, so a
dry_run=truepreview asks too. ADK's API reference saysrequire_confirmationcan 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 freshidempotency_key, which every write and paid tool needs.max_spend_usdcaps 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, calljobs_waitagain with the same ids and never resubmit the paid create. A524,522,523, or525onjobs_waitis a transport failure, not a job outcome. - Outside
adk web, callawait 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.
| Setting | ADK default | What it bounds | For Sume |
|---|---|---|---|
timeout | 5.0 seconds | Establishing the connection | Keep the default. |
sse_read_timeout | 300.0 seconds | Reading data from the server | Already above the 55-second jobs_wait cap. |
tool_filter | None | Which tools the agent gets | Always a list of Sume tool names. |
require_confirmation | False | A yes or no before each call | True on the paid toolset. |
Sources
Related posts
More in Integrations
- Google Sheets to video automation with Apps Script and Sume
Turn up to 100 sheet rows into Sume video runs with one Apps Script request, then poll the queue from a time-driven trigger and write URLs back.
- Gradio video generation app: Sume API key in a Space secret
Build a Gradio video generation app on the Sume API: the key stays in a Hugging Face Space secret, a generator polls the job, and gr.Video plays it.
- Inngest wait for event: resume when a Sume video run ends
Start a Sume run in step.run, turn its webhook into an Inngest event with a transform, then step.waitForEvent on the run id with a 2h timeout.
- LangChain video generation tool that runs a Sume Format
A LangChain @tool can start a Sume Format run, cap its spend, key it for safe retries, and return a run id the agent checks until the video is ready.
Written by Sume