Skip to content

Use WebSocket ping frames instead of tools/list_changed for keepalive#35

Open
joshvfleming wants to merge 1 commit intostevemolitor:mainfrom
joshvfleming:main
Open

Use WebSocket ping frames instead of tools/list_changed for keepalive#35
joshvfleming wants to merge 1 commit intostevemolitor:mainfrom
joshvfleming:main

Conversation

@joshvfleming
Copy link

The keepalive timer was sending notifications/tools/list_changed every 30 seconds, which caused Claude Code to re-fetch the tool list and clear its cached editor state (file path, cursor position). This made Claude lose track of the user's context on every ping cycle.

Replace the MCP-level notification with a WebSocket-level ping frame, which keeps the connection alive without touching the MCP protocol layer or triggering any state reset in Claude Code.

The keepalive timer was sending notifications/tools/list_changed every
30 seconds, which caused Claude Code to re-fetch the tool list and
clear its cached editor state (file path, cursor position). This made
Claude lose track of the user's context on every ping cycle.

Replace the MCP-level notification with a WebSocket-level ping frame,
which keeps the connection alive without touching the MCP protocol
layer or triggering any state reset in Claude Code.
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.

1 participant