fix: resolve Claude Desktop stdio communication issues and update documentation

- Fixed console output interference with stdio JSON-RPC protocol:
  - Modified logger to suppress ALL output in stdio mode
  - Added DISABLE_CONSOLE_OUTPUT environment variable support
  - Updated error handlers to respect stdio mode

- Updated Claude Desktop configuration documentation:
  - Added required environment variables for clean stdio communication
  - Promoted local installation as recommended method
  - Fixed remote connection instructions (removed broken mcp-remote)
  - Added troubleshooting section for common issues
  - Updated both README.md and docs/README_CLAUDE_SETUP.md

- Environment variables now required for stdio mode:
  - MCP_MODE=stdio
  - LOG_LEVEL=error
  - DISABLE_CONSOLE_OUTPUT=true
  - NODE_ENV=production

This ensures clean JSON-RPC communication without console output corruption.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
czlonkowski
2025-06-16 00:50:06 +02:00
parent 7d6691cd42
commit 4d955a5b4b
4 changed files with 116 additions and 72 deletions

View File

@@ -54,6 +54,12 @@ export class Logger {
if (level <= this.config.level) {
const formattedMessage = this.formatMessage(levelName, message);
// In stdio mode, suppress ALL console output to avoid corrupting JSON-RPC
if (process.env.MCP_MODE === 'stdio' || process.env.DISABLE_CONSOLE_OUTPUT === 'true') {
// Silently drop all logs in stdio mode
return;
}
// In HTTP mode during request handling, suppress console output
// The ConsoleManager will handle this, but we add a safety check
if (process.env.MCP_MODE === 'http' && process.env.MCP_REQUEST_ACTIVE === 'true') {