Basic MCP Usage
This example is available on GitHub: examples/01_standalone_sdk/07_mcp_integration.py
examples/01_standalone_sdk/07_mcp_integration.py
Running the Example
MCP Configuration
Configure MCP servers using a dictionary with server names and connection details following this configuration formatTool Filtering
Usefilter_tools_regex to control which MCP tools are available to the agent
MCP with OAuth
This example is available on GitHub: examples/01_standalone_sdk/08_mcp_with_oauth.py
examples/01_standalone_sdk/08_mcp_with_oauth.py
Running the Example
OAuth Configuration
- Configure OAuth-enabled MCP servers by specifying the URL and auth type
- The SDK automatically handles the OAuth flow when first connecting
- When the agent first attempts to use an OAuth-protected MCP server’s tools, the SDK initiates the OAuth flow via FastMCP
- User will be prompted to authenticate
- Access tokens are securely stored and automatically refreshed by FastMCP as needed
Next Steps
- Custom Tools - Creating native SDK tools
- Security Analyzer - Securing tool usage
- MCP Package Source Code - MCP integration implementation

