Skip to content

examples: add openai_agents_streamable_http.py (MCP-transport variant)#1

Open
ejentum wants to merge 1 commit into
mainfrom
add-openai-agents-streamable-http
Open

examples: add openai_agents_streamable_http.py (MCP-transport variant)#1
ejentum wants to merge 1 commit into
mainfrom
add-openai-agents-streamable-http

Conversation

@ejentum
Copy link
Copy Markdown
Owner

@ejentum ejentum commented May 23, 2026

Summary

Adds python/openai_agents_streamable_http.py as a sibling to the existing python/openai_agents_tool.py. Same SDK (OpenAI Agents SDK), different transport: this one uses the streamable HTTP MCP transport against https://api.ejentum.com/mcp with bearer auth instead of an inline function tool against the REST gateway.

Registers the new file in README.md directly under the existing openai_agents_tool.py row.

Why

This is the example body that openai/openai-agents-python#3497 declined to host upstream. The code is equally useful here for OpenAI Agents SDK users who already wire other tools via MCP servers and want the harness to plug in alongside them. Two patterns side by side in the same folder makes the "function tool vs MCP transport" choice explicit, instead of users discovering it the hard way.

Files

  • python/openai_agents_streamable_http.py (new, 81 lines)
  • README.md (one-line registration under the existing openai_agents_tool.py entry)

Other modifications in the working tree (skill-files/* and a couple of n8n CSVs) are deliberately NOT in this PR. Scoped to the OpenAI Agents addition only.

Test plan

  • Voice scrubbed: zero em dashes.
  • Single-file shape matches the existing python/*.py examples.
  • Module docstring covers install + env requirements.
  • Branch off latest main (no rebase needed).
  • DCO sign-off on the commit.

Adds a sibling to python/openai_agents_tool.py that demonstrates the
streamable-HTTP MCP transport instead of the function-tool / REST shape.
Uses agents.mcp.MCPServerStreamableHttp with the Authorization: Bearer
header against https://api.ejentum.com/mcp and lets the agent see all
four harness_* tools at once.

This is the example body that openai/openai-agents-python#3497 declined
to host upstream. The code is equally useful here for OpenAI Agents SDK
users who already wire other tools as MCP servers, so it lives next to
the function-tool variant in the integration examples.

Signed-off-by: Ejentum <info@ejentum.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant