Skip to main content
Protect /mcp with an OS security key plus a database-backed agno_pat_ service account. The MCP allow-list sees the PAT principal, only core built-ins are exposed, localhost host validation is enabled, and run results use the complete structured form.
secure_mcp.py

Run the Example

1

Set up your virtual environment

2

Install dependencies

3

Export environment variables

4

Run the example

Save the code above as secure_mcp.py, then run:
Full source: cookbook/05_agent_os/14_mcp/secure_mcp.py