cua icon indicating copy to clipboard operation
cua copied to clipboard

MCP stdio server rejects JSON-RPC ping (code -32601), causing MCP clients that health-check with ping to kill and restart the server every cycle (~55s observed)

Open rajpaulsingh6-stack opened this issue 2 months ago • 2 comments

MCP stdio server rejects JSON-RPC ping (code -32601), causing MCP clients that health-check with ping to kill and restart the server every cycle (~55s observed).

Affected version: cua-driver 0.22.0 (Windows x64; observed 2026-09-19). Channel note: 0.28.3-nightly advertised by the update checker; unknown whether fixed there.

Summary

cua-driver's MCP stdio server (invoked as cua-driver.exe mcp --socket \\\\.\\pipe\\cua-driver) responds to the standard JSON-RPC ping method with method-not-found instead of the empty-result response required by the MCP specification. Any MCP client that uses ping as a child-process health check (e.g. an MCP gateway client) will treat every ping as a failure and restart the server indefinitely, even though the server is fully functional.

Reproduction

  1. Start the server: cua-driver mcp --socket \\\\.\\pipe\\cua-driver (via ssh or local).
  2. Send initialize + notifications/initialized (both succeed; capabilities returned normally).
  3. Send {"jsonrpc":"2.0","id":2,"method":"ping"}.
  4. Observed: {"jsonrpc":"2.0","id":2,"error":{"code":-32601,"message":"Unknown method: ping"}} Expected: {"jsonrpc":"2.0","id":2,"result":{}} per MCP spec.
  5. Control: with zero pings sent, the same child ran 84 seconds with no self-exit, ruling out an idle timeout as the cause of client-side disconnect loops.

Observed impact

An MCP gateway hosting this server as a stdio child exhibited a deterministic ~53-57s connect/disconnect/restart cycle for every CUA client row (132 and 131 disconnects in 2 hours on two hosts), with client-visible 0-tool windows. Workaround: configure the client to not ping (is_ping_available: false on an MCP gateway client), after which the child is stable; the tradeoff is slower detection of genuinely dead children.

Request

Implement the MCP ping method (empty result response) in the cua-driver MCP server. Happy to provide additional traces from our gateway logs.

rajpaulsingh6-stack avatar Sep 19 '26 20:09 rajpaulsingh6-stack

Current main appears to have this protocol gap fixed already.

At 9bbfa7d, libs/cua-driver/rust/crates/cua-driver-core/src/mcp_wire.rs explicitly handles:

"ping" => Some(Response::ok(id, json!({}))),

so a raw MCP ping should now return the empty success result instead of -32601.

The original report was against 0.22.0, so it would be useful to re-run the same initialize → initialized → ping probe against current nightly/current main. If that returns {"result":{}}, this issue looks closure-ready; if it still reproduces, that would point to a second MCP path bypassing mcp_wire rather than the missing handler described here.

kvnloo avatar Sep 20 '26 06:09 kvnloo

Hello , I’d like to take this up. I can implement the standard MCP ping handler returning {} along with the corresponding test case. Could you please assign this issue to me?

Mohit20057 avatar Sep 20 '26 10:09 Mohit20057