docs: simplify Python SDK guides and correct examples Co-authored-by: markstuart-oai <323302876+markstuart-oai@users.noreply.github.com> |
||
|---|---|---|
| .. | ||
| filesystem_example | ||
| get_all_mcp_tools_example | ||
| git_example | ||
| manager_example | ||
| prompt_server | ||
| sse_example | ||
| sse_remote_example | ||
| streamable_http_remote_example | ||
| streamablehttp_custom_client_example | ||
| streamablehttp_example | ||
| tool_filter_example | ||
| README.md | ||
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.