[CLI] Fix Node 26 MCP Timeout#23
Open
rasulkireev wants to merge 1 commit into
Open
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
Users on Node 26 can now run live Readwise/Reader CLI commands again.
0.5.8fixed--versionand converted the old indefinite hang into a timeout, but actual MCP discovery/tool calls could still fail withMCP error -32001: Request timed outbefore commands were registered.Issue
After the MCP SDK initializes, it opens an optional long-lived
GET /mcpSSE stream for server-to-client messages. On Nodev26.4.0, leaving that stream open causes later MCPPOSTs (listTools/callTool) to stall until the CLI timeout fires. This is client-transport behavior: the same production MCP server and token work when that optional GET stream is skipped.Fix
The CLI now opts out of the optional GET SSE stream by returning a local
405 Method Not Allowed, which the SDK explicitly treats as "SSE stream not supported." Normal MCPPOSTrequests still go to the server unchanged. This is appropriate for the current CLI because commands are one-shot request/response flows and do not consume unsolicited server-push messages.Repro / Validation
v26.4.0:reader-list-documents --refreshfailed after ~32s withMCP error -32001and thenunknown command.v26.4.0:--refresh --help,readwise-list-highlights,reader-list-documents, andreader-search-documentsall exited 0 against production MCP in ~2-4s.reader-list-documents --refreshexited 0 on Node 22 and Node 24.npm test(15/15),npm run build,node dist/index.js --version,node dist/index.js --help.Ship Risk
Low. The change only affects the CLI's optional GET SSE setup path; read/write tool calls still use the same POST transport. The main caveat is future CLI functionality that might require server-initiated MCP messages would need to revisit this opt-out. Local rekindled MCP E2E was not run because
rekindled-mcp2was not running in this workspace; production read-only MCP smoke did pass.Related
Related: #10