Skip to content

Fix: Replace console.log with console.error to prevent MCP protocol errors#223

Open
ymrdf wants to merge 1 commit intoAgentDeskAI:mainfrom
ymrdf:main
Open

Fix: Replace console.log with console.error to prevent MCP protocol errors#223
ymrdf wants to merge 1 commit intoAgentDeskAI:mainfrom
ymrdf:main

Conversation

@ymrdf
Copy link
Copy Markdown

@ymrdf ymrdf commented Mar 12, 2026

Summary

Fixes issue #103 where Claude Desktop shows 'Unexpected token' JSON errors.

Changes

  • Replaced all console.log statements with console.error
  • MCP protocol expects JSON messages on stdout; logs should go to stderr
  • This prevents plain text logs from breaking the JSON protocol

Impact

  • Fixes connection issues in Claude Desktop and other MCP clients
  • No functional changes to tool behavior
  • Logs still appear in stderr for debugging

Closes #103

…rrors

- Replace all console.log statements with console.error
- MCP protocol expects JSON on stdout, logs should go to stderr
- Fixes issue AgentDeskAI#103 where Claude Desktop shows 'Unexpected token' JSON errors
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.

Unexpected token 'S' is not valid JSON in Claude Desktop

1 participant