Skip to content

Refuse pre-initialize requests locally (Claude Code's server/discover probe took the runtime down) - #18

Merged
SSFSKIM merged 1 commit into
mainfrom
fix/pre-initialize-probe
Oct 5, 2026
Merged

SSFSKIM merged 1 commit into
mainfrom
fix/pre-initialize-probe

Conversation

@SSFSKIM

@SSFSKIM SSFSKIM commented Oct 5, 2026

Copy link
Copy Markdown
Owner

Closes #17.

Bug. Claude Code 2.1.289 sends a feature probe, server/discover, before initialize. cua serve passed it through; rmcp 1.5.0 exits on any request before initialize, the connection latched connection_failed, and every cua serve registration showed "Failed to connect". verify.mjs and hand-rolled handshakes start with initialize, so they never saw it.

Fix. Any request other than initialize that arrives before initialize is answered locally with JSON-RPC -32601 and never forwarded. After initialize, rmcp answers the same probe with -32601 itself and survives (checked live), so post-initialize unknown methods stay pass-through.

Verification.

  • npm test 403/403 (new test: the probe is refused, never reaches the fake upstream, and initialize still succeeds).
  • Live against the installed runtime: probe before initialize → -32601, then initialize and tools/list (five tools); probe after initialize → rmcp's own -32601, runtime still serving.
  • Spec: Surprises entry and Decision Log line (2026-10-05).

…cover probe cannot take the runtime down

Claude Code 2.1.289 sends a server/discover probe before initialize. cua serve forwarded it to the vendor runtime, whose rmcp exits on any pre-initialize request, so every cua serve registration failed to connect. Any request other than initialize that arrives before initialize is now answered -32601 and never forwarded. Spec Surprises and Decision Log record the finding.

Closes #17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cua serve forwards Claude Code's pre-initialize server/discover probe to the runtime, which exits; the connection fails

1 participant