Skip to content

Comments

fix: Claude Desktop MCP JSON parsing errors after July 23, 2025 breaking change#4

Open
WSHAPER wants to merge 1 commit intofkesheh:mainfrom
WSHAPER:main
Open

fix: Claude Desktop MCP JSON parsing errors after July 23, 2025 breaking change#4
WSHAPER wants to merge 1 commit intofkesheh:mainfrom
WSHAPER:main

Conversation

@WSHAPER
Copy link
Contributor

@WSHAPER WSHAPER commented Jul 28, 2025

  • Add wrapper.ts to redirect console output away from JSON-RPC channel
  • Comment out console.error/log statements in index.ts and start.ts
  • Implement factory pattern for clean, DRY logging architecture

CONTEXT: On July 23, 2025, Anthropic deployed infrastructure changes (ASN 399358) that enforced strict JSON-RPC parsing in Claude Desktop. Console output mixing with JSON-RPC now causes parsing failures: "Unexpected token 'S', 'Starting C'... is not valid JSON"

SOLUTION: Console output wrapper redirects all debug logs to /tmp/mcp-code-context.log while preserving pure JSON-RPC communication on stdout/stdin.

Resolves: Complete MCP functionality breakdown
Affected: All MCP servers with console.log/error statements
Timeline: Issue began July 23, 2025 (GitHub issues #4188, #4228)

The wrapper approach restores pre-July 23 compatibility while maintaining full debug capabilities for troubleshooting.

…ing change

- Add wrapper.ts to redirect console output away from JSON-RPC channel
- Comment out console.error/log statements in index.ts and start.ts
- Implement factory pattern for clean, DRY logging architecture

CONTEXT: On July 23, 2025, Anthropic deployed infrastructure changes
(ASN 399358) that enforced strict JSON-RPC parsing in Claude Desktop.
Console output mixing with JSON-RPC now causes parsing failures:
"Unexpected token 'S', 'Starting C'... is not valid JSON"

SOLUTION: Console output wrapper redirects all debug logs to
/tmp/mcp-code-context.log while preserving pure JSON-RPC
communication on stdout/stdin.

Resolves: Complete MCP functionality breakdown
Affected: All MCP servers with console.log/error statements
Timeline: Issue began July 23, 2025 (GitHub issues [#4188](anthropics/claude-code#4188), [#4228](anthropics/claude-code#4228))

The wrapper approach restores pre-July 23 compatibility while
maintaining full debug capabilities for troubleshooting.
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