Skip to content

TheLunarCompany/mcp-remote-ping

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mcp-remote Ping Bug Reproduction

This repository contains a minimal client-server setup to demonstrate what seems like a bug in mcp-remote where ping responses are not getting back to the end-client in version 0.1.22 onwards.

Bug Description

Starting from mcp-remote version 0.1.22, ping messages initiated by server are not being properly forwarded back to the end-client by mcp-remote, causing connection issues. Version 0.1.21 and earlier work correctly. In this test setup, the server sends a ping message every 5 seconds, and will disconnect client after 3 failed pings, an approach commonly used to detect dead connections.

Setup Instructions

  1. Install dependencies:

    npm install
  2. Start the server (Terminal 1):

    npm run server
  3. Run the client (Terminal 2):

    npm run client <version>

    Example versions to test:

    • npm run client 0.1.21 - Working version
    • npm run client 0.1.22 - Affected version

Expected Behavior

  • Version <= 0.1.21: Ping messages should successfully round-trip between client and server. We can see ping requests and responses in the logs, continuing indefinitely, on all three participants (server, mcp-remote-fallback-test, client).
  • Version >= 0.1.22: Ping messages fail to reach end-client after an initial, single ping. mcp-remote-fallback-tests does keep responding continuously. The server logs show ping requests being sent, but no corresponding responses are logged on the end-client side. After 3 failed pings, the server disconnects the client. We can see that there is an error from mcp-remote logs (Error from remote server: TypeError: Cannot read properties of undefined (reading 'method')) that did not occur in earlier versions.

Repository Structure

  • src/server.ts - MCP server implementation
  • src/client.ts - MCP client that connects via mcp-remote (version supplied as argument)
  • src/logger.ts - Shared logging configuration

About

Reproduction kit for issue with mcp-remote ping handling

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published