Summary
All MCP tool calls via the SSE transport on pi.ruv.io return HTTP 404. The SSE connection establishes successfully and returns a valid session endpoint, but POSTing to that endpoint fails. The REST API (/v1/...) is unaffected and fully functional.
Environment
- Endpoint:
https://pi.ruv.io/sse (hosted instance)
- Transport: MCP SSE (as configured in
~/.claude/settings.json → mcpServers.pi-brain)
- Client: Claude Code (Sonnet 4.6) — deferred tool schema for all 37
brain_* tools
- Observed: 2026-03-28 (multiple attempts across several hours)
Steps to Reproduce
# Step 1 — SSE connection: WORKS (returns session endpoint)
curl -s "https://pi.ruv.io/sse" \
-H "Authorization: Bearer $BRAIN_API_KEY" \
-H "Accept: text/event-stream" \
--max-time 3
# Output:
# event: endpoint
# data: /messages?sessionId=ba8abff6-cb7a-4790-9f84-4a14fdeab867
# Step 2 — POST tool call to session endpoint: FAILS with 404
curl -s -w "\nHTTP: %{http_code}" \
-X POST "https://pi.ruv.io/messages?sessionId=ba8abff6-cb7a-4790-9f84-4a14fdeab867" \
-H "Authorization: Bearer $BRAIN_API_KEY" \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"brain_status","arguments":{}}}' \
--max-time 8
# Output: HTTP: 404
# Step 3 — REST API: WORKS fine
curl -s "https://pi.ruv.io/v1/status" \
-H "Authorization: Bearer $BRAIN_API_KEY"
# Output: {"total_memories":5190,"total_contributors":97,...} HTTP: 200
Observed vs Expected
| Endpoint |
Expected |
Actual |
GET /sse |
200, streams endpoint event |
✅ 200, event received |
POST /messages?sessionId=<id> |
200, JSON-RPC response |
❌ 404 |
POST /messages (no session) |
405 |
✅ 405 (route exists) |
GET /v1/status |
200 |
✅ 200 |
Suspected Root Cause
Likely a session affinity / distributed state issue introduced during or after the Cloud Run redeployment that fixed issue #305.
The MCP SSE transport works as follows:
- Client connects to
/sse → server registers an in-memory session, streams endpoint event
- Client POSTs JSON-RPC messages to
/messages?sessionId=<id>
If Cloud Run routes the SSE connection to Instance A (session registered there) but routes the subsequent POST to Instance B (no knowledge of that session), the POST gets 404.
Issue #305 noted session affinity: enabled — if the recent redeployment (ruvbrain-00159-cjl) reset or misconfigured session affinity, this would explain the symptom exactly.
Alternative: The session TTL may have been shortened to < the roundtrip time for a client to receive the SSE event and send the first POST.
Impact
- All 37
brain_* MCP tools are non-functional on the hosted pi.ruv.io instance
- Any Claude Code / MCP client configured to use
https://pi.ruv.io/sse cannot call any tools
- The REST API is a functional workaround but requires direct
curl calls — not usable from MCP clients
Collective Stats at Time of Report
The underlying data is healthy and growing:
- 5,190 memories (up from 3,154 in late March)
- 8,694,179 graph edges (up from 2,758,924)
- LoRA epoch 86 (up from 59)
- avg_quality: 0.754
Suggested Fix
- Verify Cloud Run session affinity is still enabled on the current revision (
ruvbrain-00159-cjl) — check --session-affinity flag
- If affinity is on: Check whether session state is correctly restored after the restart — in-memory sessions would not survive a restart even with affinity
- Longer term: Move session state to a persistent store (Redis or the existing ruvector DB) so sessions survive instance restarts and multi-instance routing
Related
Summary
All MCP tool calls via the SSE transport on
pi.ruv.ioreturn HTTP 404. The SSE connection establishes successfully and returns a valid session endpoint, but POSTing to that endpoint fails. The REST API (/v1/...) is unaffected and fully functional.Environment
https://pi.ruv.io/sse(hosted instance)~/.claude/settings.json→mcpServers.pi-brain)brain_*toolsSteps to Reproduce
Observed vs Expected
GET /sseendpointeventPOST /messages?sessionId=<id>POST /messages(no session)GET /v1/statusSuspected Root Cause
Likely a session affinity / distributed state issue introduced during or after the Cloud Run redeployment that fixed issue #305.
The MCP SSE transport works as follows:
/sse→ server registers an in-memory session, streamsendpointevent/messages?sessionId=<id>If Cloud Run routes the SSE connection to Instance A (session registered there) but routes the subsequent POST to Instance B (no knowledge of that session), the POST gets 404.
Issue #305 noted
session affinity: enabled— if the recent redeployment (ruvbrain-00159-cjl) reset or misconfigured session affinity, this would explain the symptom exactly.Alternative: The session TTL may have been shortened to < the roundtrip time for a client to receive the SSE event and send the first POST.
Impact
brain_*MCP tools are non-functional on the hostedpi.ruv.ioinstancehttps://pi.ruv.io/ssecannot call any toolscurlcalls — not usable from MCP clientsCollective Stats at Time of Report
The underlying data is healthy and growing:
Suggested Fix
ruvbrain-00159-cjl) — check--session-affinityflagRelated
pi.ruv.iocognitive cycle blocking HTTP handlers (504 timeouts, redeployment fix) — the redeployment that fixed pi.ruv.io: cognitive cycle blocks HTTP handler causing 504 upstream timeouts #305 may have introduced this regression