Skip to content

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

Closed

Description

@SSFSKIM

Bug

Claude Code 2.1.289 sends a feature-probe request, method server/discover (id server-discover-probe-1, carrying the client's protocol version and capabilities in _meta), before initialize. cua serve passes every request it does not handle itself through to the vendor runtime; rmcp 1.5.0 rejects any request before initialize and the runtime exits with code 1:

Error: failed to start stdio MCP server
Caused by:
    expect initialized request, but received: Some(Request(JsonRpcRequest { ... method: "server/discover" ... }))
cua serve: runtime exited unexpectedly (code 1)
cua serve: connection failed (upstream_exit); tearing down its runtime

The connection latches connection_failed, the probe and the following initialize both get -32000, and Claude Code reports "Failed to connect". verify.mjs and a hand-rolled handshake pass because they start with initialize. Found on 2026-10-05 while replacing the cua_repl registration with cua serve (the old cua-shim.mjs route was unaffected).

Success criteria

  • A request that arrives before initialize and is not initialize is answered locally with JSON-RPC -32601 (method not found) and never reaches the runtime; the connection stays usable and the following initialize succeeds.
  • Unknown non-MCP methods after initialize keep their current behaviour (pass-through) unless the runtime is shown to exit on them too; record what rmcp does.
  • Unit test with the exact server/discover sequence; claude mcp list shows cua_repl Connected with the cua serve registration (recorded in the PR).

Activity

  1. added
    bug
    status:ready-for-implementer
    priority:P0
    status:in-progress
    and removed
    status:ready-for-implementer
    on Oct 5, 2026
  2. SSFSKIM commented on Oct 5, 2026

    @SSFSKIM
    OwnerAuthor

    [board] in-progress: fix on fix/pre-initialize-probe: pre-initialize requests refused locally

  3. added
    status:in-review
    and removed
    status:in-progress
    on Oct 5, 2026
  4. SSFSKIM commented on Oct 5, 2026

    @SSFSKIM
    OwnerAuthor

    [board] in-review: PR #18 opened; npm test 403/403; live check against the installed runtime passed; reviewer-medium running

  5. removed
    status:in-review
    on Oct 5, 2026
  6. SSFSKIM commented on Oct 5, 2026

    @SSFSKIM
    OwnerAuthor

    [board] done: merged to main

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugpriority:P0

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions