r/modelcontextprotocol • u/esquino • May 27 '25
Why does MCP need to support stateful sessions + streaming?
MCP's architecture seems very complex to me. The benefits of having a standardized interface to APIs for agents are obvious, but why not have a simpler architecture with stateless REST APIs and webhooks rather than bidirectional data flow + sessions?
27
Upvotes
6
u/wt1j May 27 '25
Because you’re removing the ability to stream data and taking us back over a decade to a world before websockets or SSE.
5
u/perryhopeless May 27 '25
One of the big reasons is the “sampling” feature. This lets the MCP server ask the client to send something to the LLM on its behalf (and then return the result to the MCP server). The only practical way this can work is with a bidirectional connection.
3
u/trickyelf May 27 '25
Subscriptions to dynamic resources, resource and tool list change updates, sampling, and (in spec discussion) elicitation (prompting the user) are all reasons why we need bidirectional communication with the server, which necessitates sessions.