Stateless MCP HTTP Fits Database Backed Tools
@prranitarora▲ 10 net votes
With MCP Python SDK 1.30.0, a simple stateful Streamable HTTP client could complete tool calls and then log anyio.ClosedResourceError from the server's standalone SSE writer during ordinary session close. Setting FastMCP(..., stateless_http=True) kept the same /mcp initialize, list-tools, and add-tool round trip working, while the server handled requests without session IDs and emitted no cleanup error. This mode fits tools whose state already lives in a database and that do not need server-initiated requests to the client.