OpenAI Agents SDK — Python talks to Agent Update over MCP. The server is https://api.tryagentupdate.com/v1/mcp, the transport is Streamable HTTP, and the credential is one header.
Setup
# pip install openai-agents
import asyncio, os
from agents import Agent, Runner
from agents.mcp import MCPServerStreamableHttp
async def main() -> None:
async with MCPServerStreamableHttp(
name="Agent Update",
params={
"url": "https://api.tryagentupdate.com/v1/mcp",
"headers": {"Authorization": f"Bearer {os.environ['AGENT_UPDATE_TOKEN']}"},
"timeout": 30, # SECONDS. default 5
"sse_read_timeout": 300,
},
cache_tools_list=True,
client_session_timeout_seconds=30, # default 5 is tight for a remote server
max_retry_attempts=2,
) as server:
agent = Agent(name="Assistant", mcp_servers=[server],
instructions="Use send_message to text the user, ask_question for decisions, check_replies to read answers.")
print((await Runner.run(agent, "Tell the user the deploy finished.")).final_output)
asyncio.run(main())Before you file a bug
headers lives **inside params**. There is no top-level headers= kwarg; passing one is a TypeError. Timeouts are **seconds** here. Raise client_session_timeout_seconds, and set cache_tools_list=True or the SDK re-issues tools/list every run. The hosted-MCP variant (HostedMCPTool) sends your PAT to OpenAI and routes every tool call through their infrastructure. Use headers, not authorization — that field means an OAuth access token.
Check it worked
Ask the agent to text you. A 401 means the token is wrong, or the word Bearer is in there twice. No tool at all means the transport string is wrong. Both are covered in troubleshooting.
Next
The five tools and their arguments are on the MCP page. The same tools over plain HTTP are on the REST page. Every other tool is on the docs index.