OpenAI Agents SDK — connect to an Agora Workbench server¶
A minimal walkthrough of just the connection plumbing between an
openai-agents SDK
agent and a running Agora Workbench MCP server. The focus is the wiring
between the SDK and the workbench; build the agent itself by following
the OpenAI Agents SDK docs.
What you'll do¶
- Start the chemistry MCP server locally on port 8020.
- Wrap it in an
MCPServerStreamableHttp. - Hand it to whatever
agents.Agentyou build.
┌────────────────────────────┐ Streamable HTTP ┌──────────────────────────┐
│ your agents.Agent │ ────────────────────► │ chemistry MCP server │
│ (MCPServerStreamableHttp) │ /mcp + Bearer │ 127.0.0.1:8020/mcp │
└────────────────────────────┘ └──────────────────────────┘
Prerequisites¶
uvinstalled.- Docker — the chemistry server runs as a local container.
openai-agentsinstalled:
Start the chemistry MCP server¶
Follow the steps in Start the chemistry MCP server
to build the base image and bring the server up at http://localhost:8020/mcp.
The OpenAI Agents SDK integration point¶
Wrap the running server in an MCPServerStreamableHttp and pass it to
whatever agent you build:
from agents import Agent, Runner
from agents.mcp import MCPServerStreamableHttp
server = MCPServerStreamableHttp(
name="chemistry",
params={
"url": "http://localhost:8020/mcp",
"headers": {"Authorization": "Bearer dev-token"},
},
cache_tools_list=True,
)
# Build your agent however the OpenAI Agents SDK docs describe.
agent = Agent(
name="my_agent",
model=model,
mcp_servers=[server],
instructions="...",
)
async with server:
result = await Runner.run(agent, "What does aspirin look like?")
Key options:
| Argument | What it does |
|---|---|
params["url"] |
Streamable-HTTP MCP endpoint — always ends in /mcp. |
params["headers"] |
Set the Authorization header here. |
cache_tools_list=True |
Skip re-listing tools on every turn — recommended once you've confirmed the server's tool set. |
async with server: opens the underlying MCP session. The Runner
re-uses it for the entire agent run and closes it on exit.
Where to go next¶
- Build the agent itself: follow the
OpenAI Agents SDK docs —
pick a model, write instructions, call
Agent(mcp_servers=[server]). Theserveris exactly theMCPServerStreamableHttpyou built here. - Inject the workbench skill: the
workbench runtime skill
is a portable system-prompt block that teaches any agent how to use
Workbench tools correctly. Append it to your agent's
instructions. - Authenticate against a real server: swap the dev bearer for a real token — see Authentication.
Cleanup¶
See Cleanup in the shared server guide.