You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
claude mcp list shows the gradata MCP entry as red (✗ Failed to connect) even when the server is healthy and tools work end-to-end inside a real MCP session.
Claude Code's mcp list health probe sends NDJSON: {json}\n per message
The gradata server waits for a Content-Length: header that never arrives, so the probe times out and the entry shows red. Inside an actual MCP session (where the client knows to use Content-Length), everything works — the 55-tool catalogue loads correctly, tools/call works, no errors.
A. Auto-detect framing on first byte ({ → NDJSON, C → Content-Length)
Backward compatible; supports both clients
Slight complexity in the read loop
B. Switch to NDJSON entirely
Simpler; matches what Cursor + Claude Code use today
Breaks any existing client that already sends Content-Length
C. Document the red status as cosmetic
Zero code change
User-hostile; every health probe will be a false alarm
Recommend A — auto-detect. Implementation sketch: peek first byte of stdin; if { (NDJSON) or [ (NDJSON batch), use line-delimited reader; else parse LSP Content-Length: headers as today.
Acceptance criteria
claude mcp list | grep gradata shows green / connected
Existing Content-Length-speaking clients continue to work
Problem
claude mcp listshows the gradata MCP entry as red (✗ Failed to connect) even when the server is healthy and tools work end-to-end inside a real MCP session.Root cause: stdio framing protocol mismatch.
gradata.mcp_serverreads/writes LSP-style framing:Content-Length: N\r\n\r\n{json}mcp listhealth probe sends NDJSON:{json}\nper messageThe gradata server waits for a
Content-Length:header that never arrives, so the probe times out and the entry shows red. Inside an actual MCP session (where the client knows to use Content-Length), everything works — the 55-tool catalogue loads correctly, tools/call works, no errors.Evidence
python3 -m gradata.mcp_serverreturns the correct server-info response (verified during PR feat: daemon speaks both HTTP and MCP transports #191 work).claude mcp listconsistently reports✗ Failed to connectfor the gradata entry. Other MCP servers in the same~/.claude.jsonshow green.Options
{→ NDJSON,C→ Content-Length)Recommend A — auto-detect. Implementation sketch: peek first byte of stdin; if
{(NDJSON) or[(NDJSON batch), use line-delimited reader; else parse LSPContent-Length:headers as today.Acceptance criteria
claude mcp list | grep gradatashows green / connectedRelated
Follow-up from #191. Not a regression — pre-existing protocol issue exposed during verification.