openai-agents-python/examples/classic/mcp
Mark Stuart 3db0653fca
docs: Clarify Python SDK setup, tool names, and output limits (#6014)
docs: simplify Python SDK guides and correct examples

Co-authored-by: markstuart-oai <323302876+markstuart-oai@users.noreply.github.com>
2026-11-14 21:47:20 -08:00
..
filesystem_example docs: fix SDK example setup and alpha.7 guidance (#5663) 2026-11-11 14:56:23 -08:00
get_all_mcp_tools_example docs: fix SDK example setup and alpha.7 guidance (#5663) 2026-11-11 14:56:23 -08:00
git_example docs: fix MCP, MongoDB and voice examples (#5586) 2026-11-07 16:00:16 -08:00
manager_example docs: organize SDK guides around developer tasks (#5920) 2026-11-12 21:00:58 -08:00
prompt_server chore: restore classic examples and organize example collections (#5566) 2026-11-06 11:43:21 -08:00
sse_example docs: fix MCP, MongoDB and voice examples (#5586) 2026-11-07 16:00:16 -08:00
sse_remote_example chore: restore classic examples and organize example collections (#5566) 2026-11-06 11:43:21 -08:00
streamable_http_remote_example chore: restore classic examples and organize example collections (#5566) 2026-11-06 11:43:21 -08:00
streamablehttp_custom_client_example docs: Clarify Python SDK setup, tool names, and output limits (#6014) 2026-11-14 21:47:20 -08:00
streamablehttp_example chore: restore classic examples and organize example collections (#5566) 2026-11-06 11:43:21 -08:00
tool_filter_example docs: fix SDK example setup and alpha.7 guidance (#5663) 2026-11-11 14:56:23 -08:00
README.md docs: organize SDK guides around developer tasks (#5920) 2026-11-12 21:00:58 -08:00

Classic MCP examples

These examples connect Classic agents to Model Context Protocol servers. Complete Classic example setup and set OPENAI_API_KEY before model calls. The local HTTP server examples use the repository's locked MCP v2 environment; the SDK client itself supports MCP v1 and v2.

Task Example Additional setup
Read bundled files Filesystem Node.js, npm, and npx; the first run downloads a server package.
Inspect a local Git repository Git uvx, Git, and a repository path.
Prefetch tools Get all tools npx.
Restrict available tools Tool filtering npx.
Start a local SSE server SSE Repository development environment.
Override the SSE endpoint Remote SSE Optional MCP_SSE_REMOTE_URL; the default starts a local server.
Start a local HTTP server Streamable HTTP Repository development environment.
Connect to DeepWiki Remote Streamable HTTP Access to the remote MCP endpoint.
Customize HTTP clients Client factory Repository MCP v2 and httpx2 environment.
Load instructions from MCP prompts Prompt server Repository development environment.
Manage connections in FastAPI MCP manager The documented FastAPI dependency; offline smoke test available.

The tool-filtering and tool-prefetch examples automatically approve interruptions to exercise the approval path. This demonstration does not collect human consent. The Git example exposes the tools supplied by its MCP server to the model; use a disposable repository when testing possible changes.