Haystack MCPTool with StreamableHttpServerInfo and Sume MCP

Connect Haystack to Sume's hosted MCP with MCPTool and StreamableHttpServerInfo: a url, an Authorization header, one tool per MCPTool, and what to call first.

5 min readSume
All posts

In Haystack, wrap one Sume tool in an MCPTool whose server_info is a StreamableHttpServerInfo with url="https://mcp.sume.com/mcp" and an Authorization header. Haystack's reference lists url, token, headers and timeout on that class. Each MCPTool names one tool on the server, so you create one per Sume tool you want the pipeline or agent to use.

Haystack's side comes from the MCP integration page and the integration reference; Sume's from OAuth and API keys and MCP tools and gates, all read on 2026-10-06. Sume has no official Haystack integration.

What is the minimal call?

Start with a read-only discovery tool. mcp_health takes no arguments and confirms the endpoint, the auth source and the safety posture. The example reads the key from the environment and has no top-level await, because Haystack's invoke is a plain call.

import os
from haystack_integrations.tools.mcp import MCPTool, StreamableHttpServerInfo

server_info = StreamableHttpServerInfo(
    url="https://mcp.sume.com/mcp",
    headers={"Authorization": f"Bearer {os.environ['SUME_API_KEY']}"},
)
health = MCPTool(name="mcp_health", server_info=server_info)
print(health.invoke())

API key or token field?

Haystack's reference shows both a token and a headers mapping on the server info. Use headers so the header is exactly Authorization: Bearer <key>, which is one of the two forms Sume accepts; the other is x-api-key. An OAuth token is not a Sume API key and the two are not interchangeable, so a pipeline run by your own backend should use a key.

What should the agent be allowed to call?

An API-key session sees the full hosted tool set, including paid tools. Wrap only the tools the pipeline needs, and read each one's contract with tools_schema first. Sume's docs say paid and write calls must send idempotency_key, that dry_run=true previews cost without submitting, and that max_spend_usd is enforced only when you send it.

Sources

Related posts

More in Integrations

All Integrations posts

Written by Sume