Skip to content

Conversation

@ooojustin
Copy link

While using this package with the Zapier MCP (and likely many other remote providers), the server would automatically close the connection if a message isn't sent for some time.
This adds a --keep-alive flag which will automatically ping the remote server periodically.

@pkg-pr-new
Copy link

pkg-pr-new bot commented May 12, 2025

Open in StackBlitz

npx https://pkg.pr.new/mcp-remote@70

commit: 29886b5

@geelen
Copy link
Owner

geelen commented May 12, 2025

This looks great! I'll give this a try and release it soon, but in the interim you can test things yourself using https://pkg.pr.new/mcp-remote@70. Any changes you push to this branch should be automatically built and released to that URL so you can iterate/share it with others as needed.

@ooojustin
Copy link
Author

Thanks. Spotted an issue with the default interval (should've been in seconds, I had it set to milliseconds. Didn't notice since I was setting a custom value via the --ping-interval arg.)

I've been using this in my fork by building it locally and running the file with node. I've confirmed that it works as intended with both Claude Desktop and Cursor. I don't think the remote version from https://pkg.pr.new/mcp-remote@70 was updated automatically, but can confirm again once it is.

@ooojustin
Copy link
Author

Just rebased, resolved conflicts, and tested again with local build.

Copy link
Contributor

@clouatre clouatre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR solves a real problem (Zapier MCP timeouts) and the keep-alive mechanism is well-designed with proper cleanup, error handling, and MCP spec compliance.

Current Status:
The PR has merge conflicts with main due to significant changes merged since May (testing framework, OAuth scope handling, new CLI parameters). The branch needs to be rebased onto current main before it can be merged.

Code Review (based on May version):

  • TypeScript compilation: Clean
  • Core implementation: Solid
  • Minor suggestions for cleanup:
    • Remove unused pingTimeout variable (line 106 in src/lib/utils.ts)
    • Rename pingIntervaltimerId (it's a timer handle, not an interval value)
    • Use JSDoc /** consistently instead of /* (src/lib/types.ts)

Happy to help with the rebase if needed, or these cleanup items can be addressed during conflict resolution.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants