name: streamable-http-mcp-server
description: Creates and configures Streamable HTTP Model Context Protocol (MCP) server connections for OpenAI Agents SDK
Streamable HTTP MCP Server Skill
This skill helps create and configure Streamable HTTP Model Context Protocol (MCP) server connections for OpenAI Agents SDK.
Purpose
- Create MCPServerStreamableHttp configurations
- Configure HTTP connection parameters and authentication
- Set up caching and retry mechanisms
- Connect to HTTP-based MCP servers with direct connection management
MCPServerStreamableHttp Constructor Parameters
- params (MCPServerStreamableHttpParams): Connection parameters for the server
- url (str): The URL of the server
- headers (dict[str, str], optional): The headers to send to the server
- timeout (timedelta | float, optional): The timeout for the HTTP request (default: 5 seconds)
- sse_read_timeout (timedelta | float, optional): The timeout for the SSE connection (default: 5 minutes)
- terminate_on_close (bool, optional): Whether to terminate on close
- httpx_client_factory (HttpClientFactory, optional): Custom HTTP client factory for configuring httpx.AsyncClient behavior
- cache_tools_list (bool): Whether to cache the list of available tools (default: False)
- name (string | None): A readable name for the server (default: None, auto-generated from URL)
- client_session_timeout_seconds (float | None): Read timeout for the MCP ClientSession (default: 5)
- tool_filter (ToolFilter): The tool filter to use for filtering tools (default: None)
- use_structured_content (bool): Whether to use tool_result.structured_content when calling an MCP tool (default: False)
- max_retry_attempts (int): Number of times to retry failed list_tools/call_tool calls (default: 0)
- retry_backoff_seconds_base (float): The base delay, in seconds, for exponential backoff between retries (default: 1.0)
- message_handler (MessageHandlerFnT | None): Optional handler invoked for session messages (default: None)
Usage Context
Use this skill when:
- Managing HTTP connections yourself
- Running servers locally or remotely with direct connection management
- Needing to keep latency low with your own infrastructure
- Wanting to run the server inside your own infrastructure
Basic Example
import asyncio
import os
from agents import Agent, Runner
from agents.mcp import MCPServerStreamableHttp
from agents.model_settings import ModelSettings
async def main() -> None:
token = os.environ["MCP_SERVER_TOKEN"]
async with MCPServerStreamableHttp(
name="Streamable HTTP Python Server",
params={
"url": "http://localhost:8000/mcp",
"headers": {"Authorization": f"Bearer {token}"},
"timeout": 10,
},
cache_tools_list=True,
max_retry_attempts=3,
) as server:
agent = Agent(
name="Assistant",
instructions="Use the MCP tools to answer the questions.",
mcp_servers=[server],
model_settings=ModelSettings(tool_choice="required"),
)
result = await Runner.run(agent, "Add 7 and 22.")
print(result.final_output)
asyncio.run(main())
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: streamable-http-mcp-server3description: This skill helps create and configure Streamable HTTP Model Context Protocol (MCP) server connections for OpenAI Agents SDK. Use when this capability is needed.4---5---6name: streamable-http-mcp-server7description: Creates and configures Streamable HTTP Model Context Protocol (MCP) server connections for OpenAI Agents SDK8---910# Streamable HTTP MCP Server Skill1112This skill helps create and configure Streamable HTTP Model Context Protocol (MCP) server connections for OpenAI Agents SDK.1314## Purpose15- Create MCPServerStreamableHttp configurations16- Configure HTTP connection parameters and authentication17- Set up caching and retry mechanisms18- Connect to HTTP-based MCP servers with direct connection management1920## MCPServerStreamableHttp Constructor Parameters21- **params** (MCPServerStreamableHttpParams): Connection parameters for the server22 - **url** (str): The URL of the server23 - **headers** (dict[str, str], optional): The headers to send to the server24 - **timeout** (timedelta | float, optional): The timeout for the HTTP request (default: 5 seconds)25 - **sse_read_timeout** (timedelta | float, optional): The timeout for the SSE connection (default: 5 minutes)26 - **terminate_on_close** (bool, optional): Whether to terminate on close27 - **httpx_client_factory** (HttpClientFactory, optional): Custom HTTP client factory for configuring httpx.AsyncClient behavior28- **cache_tools_list** (bool): Whether to cache the list of available tools (default: False)29- **name** (string | None): A readable name for the server (default: None, auto-generated from URL)30- **client_session_timeout_seconds** (float | None): Read timeout for the MCP ClientSession (default: 5)31- **tool_filter** (ToolFilter): The tool filter to use for filtering tools (default: None)32- **use_structured_content** (bool): Whether to use tool_result.structured_content when calling an MCP tool (default: False)33- **max_retry_attempts** (int): Number of times to retry failed list_tools/call_tool calls (default: 0)34- **retry_backoff_seconds_base** (float): The base delay, in seconds, for exponential backoff between retries (default: 1.0)35- **message_handler** (MessageHandlerFnT | None): Optional handler invoked for session messages (default: None)3637## Usage Context38Use this skill when:39- Managing HTTP connections yourself40- Running servers locally or remotely with direct connection management41- Needing to keep latency low with your own infrastructure42- Wanting to run the server inside your own infrastructure4344## Basic Example45```python46import asyncio47import os4849from agents import Agent, Runner50from agents.mcp import MCPServerStreamableHttp51from agents.model_settings import ModelSettings5253async def main() -> None:54 token = os.environ["MCP_SERVER_TOKEN"]55 async with MCPServerStreamableHttp(56 name="Streamable HTTP Python Server",57 params={58 "url": "http://localhost:8000/mcp",59 "headers": {"Authorization": f"Bearer {token}"},60 "timeout": 10,61 },62 cache_tools_list=True,63 max_retry_attempts=3,64 ) as server:65 agent = Agent(66 name="Assistant",67 instructions="Use the MCP tools to answer the questions.",68 mcp_servers=[server],69 model_settings=ModelSettings(tool_choice="required"),70 )7172 result = await Runner.run(agent, "Add 7 and 22.")73 print(result.final_output)7475asyncio.run(main())76```7778---79> Converted and distributed by [TomeVault](https://tomevault.io/claim/syeda-hoorain-ali) — claim your Tome and manage your conversions.80<!-- tomevault:4.0:skill_md:2026-04-15 -->