🐞 Bug Summary
There seem to be a problem with a ContextForge session management when running against stateful MCP Gateways over HTTP Streamable transport
🧩 Affected Component
Select the area of the project impacted:
🔁 Steps to Reproduce
- Start a stateful MCP Gateway for example :
git clone `https://github.com/modelcontextprotocol/rust-sdk/; cd rust-sdk/examples/servers; cargo run --example servers_counter_streamhttp. This should start MCP counter server on 127.0.0.1:8000
make serve and configure context forge (add servers and gateways, etc.)
- From a client Initialize MCP session (mcp inspector or curl)
- Increase the counter N times (mcp inspector or curl)
- Get the counter -> response should be N (mcp inspector or curl)
🤔 Expected Behavior
Minimally, we would expect that if there is only one client then the counter works for that single client.
Long term expected behavior is that the counter stays consistent per mcp-session. So if for every client that goes through Intialize/Notify process, there should be a unique session with an independent counter. Unfortunately, this doesn't seem to be the case. It looks like ContextForge will create ONE session with the MCP server at startup and will re-use this session for all future interactions.
📓 Logs / Error Output
🧠 Environment Info
Commit #77bd03d2cca41f9c3597d5d7abc8012ad54d38fa
🐞 Bug Summary
There seem to be a problem with a ContextForge session management when running against stateful MCP Gateways over HTTP Streamable transport
🧩 Affected Component
Select the area of the project impacted:
mcpgateway- APImcpgateway- UI (admin panel)mcpgateway.wrapper- stdio wrapper🔁 Steps to Reproduce
git clone `https://github.com/modelcontextprotocol/rust-sdk/; cd rust-sdk/examples/servers; cargo run --example servers_counter_streamhttp. This should start MCP counter server on 127.0.0.1:8000make serveand configure context forge (add servers and gateways, etc.)🤔 Expected Behavior
Minimally, we would expect that if there is only one client then the counter works for that single client.
Long term expected behavior is that the counter stays consistent per mcp-session. So if for every client that goes through Intialize/Notify process, there should be a unique session with an independent counter. Unfortunately, this doesn't seem to be the case. It looks like ContextForge will create ONE session with the MCP server at startup and will re-use this session for all future interactions.
📓 Logs / Error Output
🧠 Environment Info
Commit #77bd03d2cca41f9c3597d5d7abc8012ad54d38fa