examples: add openai_agents_streamable_http.py (MCP-transport variant)#1
Open
ejentum wants to merge 1 commit into
Open
examples: add openai_agents_streamable_http.py (MCP-transport variant)#1ejentum wants to merge 1 commit into
ejentum wants to merge 1 commit into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
python/openai_agents_streamable_http.pyas a sibling to the existingpython/openai_agents_tool.py. Same SDK (OpenAI Agents SDK), different transport: this one uses the streamable HTTP MCP transport againsthttps://api.ejentum.com/mcpwith bearer auth instead of an inline function tool against the REST gateway.Registers the new file in
README.mddirectly under the existingopenai_agents_tool.pyrow.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
python/*.pyexamples.main(no rebase needed).