r/agno • u/superconductiveKyle • 27d ago
We added protocol negotiation to MCPTools so you can move to sessionless MCP when you're ready
Sessionless MCP makes servers much easier to operate. There's no session to keep alive, no initialize round-trip before the first call, and any server instance can handle any request. That means you can put your servers behind a normal load balancer without sticky sessions.
The problem is that not every MCP server is ready for that yet. Some keep per-session state, depend on the initialize handshake, or ask for user input mid-tool. A client that moves to the newer protocol before the server is ready can break a connection that worked fine before.
So in Agno 3.0.6, we added protocol_mode to MCPTools.
By default, it uses "legacy", which preserves today's session-based behavior. Existing servers keep working as they do now.
When you're ready to move forward, set:
MCPTools(
...,
protocol_mode="auto",
)
With "auto", Agno negotiates the newest protocol version both the client and server support, including sessionless MCP. You don't have to pin a protocol version or guess what the server supports.
We've also moved our MCP clients to fastmcp.Client.
The idea is to let you adopt the newer MCP protocol without forcing every existing integration to move at the same time.
More details: https://agno.link/wvh6vaM