Skip to main content
This example defines an owner-only authorize callback without configuring JWT or MCP OAuth. Agno v2.7.4 therefore supplies user_id=None and rejects every MCP tool call.
custom_mcp_tool_example.py

Add MCP Authentication

Start with Built-in OAuth or WorkOS AuthKit OAuth. Add this source’s custom tools, enable_builtin_tools=False, and authorize settings only after the MCP auth provider supplies a verified caller ID that matches OWNER_IDS. Full source: cookbook/05_agent_os/mcp_demo/custom_mcp_tool_example.py