You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: replace console.log with console.error in handlers
console.log() writes to stdout, but on stdio MCP servers stdout is
reserved for JSON-RPC protocol messages. Any debug output on stdout
corrupts the framing, which Claude Code surfaces as "MCP error -32000:
Connection closed" — the entire MCP becomes unavailable until /mcp
reconnect.
This explains:
- Issue #11: "Running getLabels() always seems to crash the mcp server"
(likely same class — getLabels handler may have similar logs)
- Issue #8: "'Client Closed' error when installing Linear MCP Server
with Smithery in Cursor" (Cursor likely surfaces the same corruption
with a different error string)
- Reproducible deterministic crash on linear_searchIssues for any
workspace with non-trivial issue counts
The fix is one-line per call: console.log → console.error. stderr is
never read by the MCP transport and is the standard Node.js channel
for diagnostic logs.
Affected handlers:
- src/tools/handlers/initiative-handlers.ts (20 calls)
- src/tools/handlers/issue-handlers.ts (2 calls — both inside
searchIssues, which is why that path crashes deterministically)
Verified: post-patch, the linear_searchIssues call that crashed every
time previously now returns 124KB of data cleanly. Multiple sequential
heavy queries succeed in a row.
This is the official Node.js MCP guidance for stdio servers — see the
modelcontextprotocol/typescript-sdk README and the MCP spec discussion
on stdout reservation.
0 commit comments