Best practice for MCPTools with stateful multi-pod MCP gateway (Lunar MCPx) — per-run session routing #7813
user1500177
started this conversation in
General
Replies: 1 comment 1 reply
-
|
For a stateful multi-pod MCP gateway, I would treat “per-run routing” as a first-class part of the agent run context, not just an HTTP concern. The pattern I would aim for:
If the gateway owns state, the agent framework should not have to guess which pod has it. Either sticky routing must be deterministic from the run/session key, or the gateway needs an external session store. Otherwise retries and resumed runs become very hard to reason about. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Context & Architecture
We're building a production AI agent system using agno with the following stack:
AgentOS+ AG-UI interfaceOur Setup (Simplified)
The Problem: Stateful MCP Gateway with Multiple Pods
Our MCP gateway (Lunar MCPx) is stateful — each session is bound to the pod that created it. When we have 2+ gateway pods:
tools.connect()at startup → creates a session on Pod AError we see on the agno app side:
Error on the MCP gateway side:
What We've Tried (DevOps-Side Routing Strategies)
User-IdheaderQuestions
Is there a better way we can make sure that the both of the pods of the mcp server can be used ; this beacem a issue in stateful mcp server gateway like lunar
Isnt the Mcp-session-id passed as a header for the remaing BY AGNO if not shouldnt it be or IS it a mistake on my part ? - FEEL free to correct me- can we use that for the MAPPING TO THE CORRECT POD is that POSSIBLE or is this scenario arising due to wrong imeplemntation from my side ?
(https://zhimin-wen.medium.com/scaling-http-streamable-mcp-servers-on-kubernetes-handling-sticky-sessions-24212857c8ca)
Environment
Related (Could dynamic headrs be used for this ? )
Thank you for any guidance! Happy to provide more details about our architecture.
Beta Was this translation helpful? Give feedback.
All reactions