Summary
checkDewey() in internal/doctor/checks.go performs an HTTP GET to the Dewey MCP endpoint (http://localhost:3333/mcp/). The MCP Streamable HTTP transport only accepts POST for JSON-RPC calls; a plain GET without SSE headers returns a non-200 status. This causes the doctor check to report a spurious warning ("Dewey returned HTTP 405") even when Dewey is healthy and running.
To Reproduce
- Start Dewey with HTTP transport:
dewey --http :3333
- Run
replicator doctor
- Observe the Dewey check returns
warn with Dewey returned HTTP 400 at http://localhost:3333/mcp/ (1ms)
- Verify Dewey is healthy independently: send a JSON-RPC POST to
http://localhost:3333/mcp/ and confirm it returns success
Expected behavior
When Dewey is running and healthy, the doctor check should report pass with "Dewey is reachable."
Root Cause
checkDewey() (internal/doctor/checks.go:98) uses client.Get(deweyURL). The Dewey MCP endpoint is served by the Go SDK's StreamableHTTPHandler, which routes by HTTP method: POST for JSON-RPC, GET for SSE session establishment, DELETE for session termination. A plain GET without the required Accept: text/event-stream header is not treated as a successful health probe.
Suggested Fix
The replicator already has a proper JSON-RPC health call in internal/memory/proxy.go:102-106:
func (c *Client) Health() error {
_, err := c.Call("dewey_health", map[string]any{})
return err
}
This method is not used by the doctor check.
Replace the raw HTTP GET in checkDewey() with a call to memory.NewClient(deweyURL).Health(), which sends a proper JSON-RPC POST to the dewey_health method. Update tests to use a JSON-RPC mock server instead of a simple HTTP handler.
Location
- Health check: internal/doctor/checks.go:94-126
- Existing JSON-RPC health call: internal/memory/proxy.go:102-106
- Dewey URL default: internal/config/config.go:27 (http://localhost:3333/mcp/)
- Tests: internal/doctor/checks_test.go:93-122
Summary
checkDewey()ininternal/doctor/checks.goperforms an HTTP GET to the Dewey MCP endpoint (http://localhost:3333/mcp/). The MCP Streamable HTTP transport only accepts POST for JSON-RPC calls; a plain GET without SSE headers returns a non-200 status. This causes the doctor check to report a spurious warning ("Dewey returned HTTP 405") even when Dewey is healthy and running.To Reproduce
dewey --http :3333replicator doctorwarnwithDewey returned HTTP 400 at http://localhost:3333/mcp/ (1ms)http://localhost:3333/mcp/and confirm it returns successExpected behavior
When Dewey is running and healthy, the doctor check should report
passwith "Dewey is reachable."Root Cause
checkDewey()(internal/doctor/checks.go:98) usesclient.Get(deweyURL). The Dewey MCP endpoint is served by the Go SDK'sStreamableHTTPHandler, which routes by HTTP method: POST for JSON-RPC, GET for SSE session establishment, DELETE for session termination. A plain GET without the requiredAccept: text/event-streamheader is not treated as a successful health probe.Suggested Fix
The replicator already has a proper JSON-RPC health call in
internal/memory/proxy.go:102-106:This method is not used by the doctor check.
Replace the raw HTTP GET in checkDewey() with a call to memory.NewClient(deweyURL).Health(), which sends a proper JSON-RPC POST to the dewey_health method. Update tests to use a JSON-RPC mock server instead of a simple HTTP handler.
Location