fix(mcp): keep servers healthy when ping is unsupported - #2871
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Prevent usable Streamable HTTP MCP servers from entering a reconnect loop when they do not implement
ping. For the typed JSON-RPC method-not-found error only, verifytools/listwhen the server advertises tools support. Other ping errors and failed fallback checks still fail health checks.Type and Areas
Type: Bug fix
Areas: MCP remote transport, Rust services, Desktop E2E
Motivation / Impact
Huawei Developer Knowledge successfully handles initialization, tool discovery, search, and document retrieval, but returns
-32601: Method not found: ping. The immediate heartbeat changed the desktop status toReconnectingdespite the working connection. With this fix, the same endpoint remainsHealthyacross subsequent health checks.The official Huawei configuration uses
type: "http"and the public developerknowledge endpoint without OAuth credentials. The live reproduction used that configuration.Verification
cargo test -p openbitfun-services-integrations --no-default-features --features mcp --test mcp_streamable_http_contracts— passed in the source checkout; repeated against upstream/main in this PR worktree. Covers normal ping, method-not-found fallback, propagation of other errors, and failed fallback.cargo build -p openbitfun-desktop— passed in the source checkout with existing compiler warnings.OPENBITFUN_E2E_HUAWEI_MCP=1 OPENBITFUN_E2E_STORAGE_ROOT=<fresh temporary directory> pnpm --dir tests/e2e exec wdio run ./config/wdio.conf.ts --spec './specs/l1-mcp-huawei-health.spec.ts'— live desktop reproduction failed before the fix (Reconnecting) and passed after it. Verified settings UI,searchDocuments,getDocumentsById, and continued health after the next 30-second heartbeat. Tool results explicitly report success. Screenshot inspected: green healthy status.git diff --check— passed.The E2E is opt-in, uses public queries without credentials, and restores its isolated MCP config. A repeated run using an old test profile encountered an unrelated workspace-format startup rejection; the final run used a fresh profile and passed. Desktop/E2E evidence was collected in the source checkout before transplanting this focused patch onto upstream/main.
Reviewer Notes
This change lives in the shared remote transport and adds no hostname-specific policy. The live scenario was local Desktop communicating with remote HTTPS MCP. Remote workspace, remote control, Peer Device Mode, and Detached Dispatch were not exercised on real hosts.
Checklist