# Secure the AgentOS MCP endpoint with standards-based OAuth

> Set AgentOS(mcp_auth=...) to put standards-based OAuth in front of your /mcp endpoint. Instead of relying only on tokens, you can gate MCP access through a proper OAuth flow, so connecting clients…

- Published: 2026-07-09
- Author: Agno Team
- Category: Changelog
- Canonical: https://agno-com-nine.vercel.app/articles/secure-the-agentos-mcp-endpoint-with-standards-based-oauth
- Markdown: https://agno-com-nine.vercel.app/articles/secure-the-agentos-mcp-endpoint-with-standards-based-oauth.md

Set `AgentOS(mcp_auth=...)` to put standards-based OAuth in front of your `/mcp` endpoint. Instead of relying only on tokens, you can gate MCP access through a proper OAuth flow, so connecting clients authenticate the way the rest of your stack expects and you get a familiar, auditable path for granting and revoking access.

See cookbooks the for a working setup:

- <https://github.com/agno-agi/agno/blob/main/cookbook/05_agent_os/14_mcp/oauth_builtin.py>
- <https://github.com/agno-agi/agno/blob/main/cookbook/05_agent_os/14_mcp/oauth_authkit.py>
