Skip to content

Latest commit

 

History

History
91 lines (64 loc) · 1.94 KB

File metadata and controls

91 lines (64 loc) · 1.94 KB

MCP Examples

Integration with MCP (Model Context Protocol) servers using OpenAI agents in Temporal workflows.

Adapted from OpenAI Agents SDK MCP examples

Before running these examples, be sure to review the prerequisites and background on the integration.

Running the Examples

Stdio MCP

First, start the worker:

uv run openai_agents/mcp/run_file_system_worker.py

Run the workflow:

uv run openai_agents/mcp/run_file_system_workflow.py

This sample assumes that the worker and run_file_system_workflow.py are on the same machine.

Streamable HTTP MCP

First, start the worker:

uv run openai_agents/mcp/servers/tools_server.py --transport=streamable-http

Then start the worker:

uv run openai_agents/mcp/run_streamable_http_worker.py

Finally, run the workflow:

uv run openai_agents/mcp/run_streamable_http_workflow.py

SSE MCP

First, start the MCP server:

uv run openai_agents/mcp/servers/tools_server.py --transport=sse

Then start the worker:

uv run openai_agents/mcp/run_sse_worker.py

Finally, run the workflow:

uv run openai_agents/mcp/run_sse_workflow.py

Prompt Server MCP

First, start the MCP server:

uv run openai_agents/mcp/servers/prompt_server.py

Then start the worker:

uv run openai_agents/mcp/run_prompt_server_worker.py

Finally, run the workflow:

uv run openai_agents/mcp/run_prompt_server_workflow.py

Memory MCP (Research Scratchpad)

Demonstrates durable note-taking with the Memory MCP server: write seed notes, query by tags, synthesize a brief with citations, then update and delete notes.

Start the worker:

uv run openai_agents/mcp/run_memory_research_scratchpad_worker.py

Run the research scratchpad workflow:

uv run openai_agents/mcp/run_memory_research_scratchpad_workflow.py