-
Notifications
You must be signed in to change notification settings - Fork 152
Description
Starting from mcp-remote v0.1.22, ping messages initiated by MCP servers are not being properly forwarded all the way to the end-client, making it impossible for MCP servers to use ping mechanism to detect client liveness when clients connect via mcp-remote. This appears to be a regression as v0.1.21 and earlier work correctly.
Reproduction
Minimal reproduction available at: https://github.com/TheLunarCompany/mcp-remote-ping
Steps:
- Clone the repo and
run npm install
- Start MCP server (terminal 1):
npm run server
(sends ping to connected clients every 5s, disconnect clients after 3 failed pings) - Run client (terminal 2) with working version:
npm run client 0.1.21
✅ - Then run client with affected version:
npm run client 0.1.22
❌
Expected behavior
Clients should respond to ping messages from server indefinitely.
Actual behavior (v0.1.22+)
- Only first ping message is responded correctly, subsequent pings fail to reach end-client (they do reach
mcp-remote-fallback-test
probe client) - mcp-remote logs error in client for these subsequent pings (
TypeError: Cannot read properties of undefined (reading 'method')
) - Server disconnects client after 3 failed pings (~15 seconds)
Environment
- OS: macOS Sequoia 15.5
- Hardware: MacBook Pro 16-inch 2021, Apple M1 Pro
- Node version: v22.9.0
- @modelcontextprotocol/sdk: 1.17.4 (both client and server)
- Tested mcp-remote versions:
- working: 0.1.18, 0.1.21
- affected: 0.1.22, 0.1.23, 0.1.24, 0.1.27, 0.1.29
This breaking change prevents proper connection health monitoring in production MCP servers when clients are using mcp-remote (e.g. when connecting from Claude Desktop).
Lastly, thank you for this fantastic package and for all your hard work! If helpful, I am happy to discuss a PR that adds a failing test.