Agno MCP server: give an Agno agent Sume's hosted tools

Connect an Agno agent to Sume's hosted MCP server with MCPTools, an API-key header, a tool allowlist, and timeout_seconds raised from 10.

5 min readSume
All posts

To connect an Agno agent to a remote MCP server, create MCPTools with the server's url, pass auth in headers, and give it to the agent's tools; a URL makes Agno use the Streamable HTTP transport. For Sume's hosted MCP server that is url="https://mcp.sume.com/mcp" with your Sume API key in an Authorization: Bearer header, an include_tools allowlist, and timeout_seconds raised from its default of 10, because one Sume jobs_wait call can hold for 55 seconds.

Agno's side comes from its MCP overview, its Stripe MCP agent and Confirmation Required MCP Toolkit examples, and its server parameters page; Sume's side comes from MCP OAuth and API keys, MCP tools and gates, and Jobs and results, all read on 2026-09-28. Sume has no Agno package or plugin: this is Agno's own MCP client talking to Sume's remote server, and Sume's basics page says hosted MCP still works but is not part of the primary path today.

How do I connect an Agno agent to Sume's MCP server?

Install agno[mcp,openai], as Agno's Stripe example does for its OpenAI model, and use one MCPTools instance per server. That example, for Stripe's hosted server, passes a bearer key in headers and opens the connection with async with, which cleans up for you. Sume takes the same shape; leave transport to Agno's inference from the URL. Read the key from the environment, never from a prompt:

import asyncio
import os

from agno.agent import Agent
from agno.models.openai import OpenAIResponses
from agno.tools.mcp import MCPTools


async def main() -> None:
    async with MCPTools(
        url="https://mcp.sume.com/mcp",
        headers={"Authorization": f"Bearer {os.environ['SUME_API_KEY']}"},
        include_tools=["tools_schema", "generate_image", "jobs_wait", "jobs_result"],
        timeout_seconds=60,
    ) as sume:
        agent = Agent(
            model=OpenAIResponses(id="gpt-5.2"),
            tools=[sume],
            instructions="Call generate_image with dry_run=true before any real submit.",
        )
        await agent.aprint_response("Make a photo of a blue ceramic mug.", stream=True)


asyncio.run(main())

Why raise timeout_seconds for Sume?

timeout_seconds is the MCP client read timeout in seconds, and it defaults to 10. Sume's jobs_wait holds one call open for at most 55 seconds, or 50 when its own timeout_seconds argument is omitted, so with Agno's default the client stops reading while Sume is still holding the wait. Set 60. A client-side timeout does not cancel a Sume job: it keeps running and billing, so raise the client timeout rather than submitting again. OpenAI Agents SDK MCP server covers the same trap with a 5-second default.

  • Two settings share the name: Agno's timeout_seconds on MCPTools, and the timeout_seconds argument of Sume's jobs_wait tool.
  • If you connect with server_params=StreamableHTTPClientParams(...) instead of url, its timeout for HTTP operations defaults to 30 seconds and sse_read_timeout to 5 minutes. Raise timeout above 55 as well.
  • On wait_slice_expired, the agent should call jobs_wait again with the same ids and never resubmit the paid create. MCP tool call timeouts on long-running video jobs has the pattern.

Which Sume tools should the agent get?

include_tools and exclude_tools select from the tools Agno discovers. An API-key session sees Sume's full hosted tool set, write and paid tools included, so the allowlist is the narrowing you control. Sume's live tool ids use underscores; Sume MCP tools list groups them by read, write, and paid.

Parameters from Agno's MCP overview; Sume values from MCP OAuth and API keys and Jobs and results, read 2026-09-28.
`MCPTools` parameterAgno default and purposeFor Sume
urlNone; the remote server endpointhttps://mcp.sume.com/mcp
transportInferred: streamable-http when a URL is providedLeave it inferred; never sse
headersNone; static HTTP headersAuthorization: Bearer <key> or x-api-key
include_toolsNone; selects discovered toolsOnly the Sume tools the task needs
timeout_seconds10; the MCP client read timeout in seconds60, above the 55-second jobs_wait hold
protocol_mode"legacy", the session-based protocolKeep the default: Sume's current server negotiates through initialize

How do I make the agent ask before a paid Sume call?

Name the paid tools in requires_confirmation_tools on MCPTools; tool names are case-sensitive. In Agno's example the run pauses when the agent calls such a tool, and it continues only after your code answers each pending confirmation with requirement.confirm() or requirement.reject() and calls agent.acontinue_run(...). The example's agent also has a db.

  • Sume's paid tools need an idempotency_key on every call. dry_run=true returns an admission and cost preview without submitting the job, and max_spend_usd caps a call only when it is sent.
  • The agent writes those arguments itself, so they are not a limit your code enforces. The allowlist and the confirmation step are.
  • Hosted MCP cannot read files from your laptop.

Sources

Related posts

More in Integrations

All Integrations posts

Written by Sume