Skip to content

Route MCP and helper debug logs to stderr#49

Merged
a-bonus merged 2 commits intoa-bonus:mainfrom
wulymammoth:dwu/mcp-stdio-log-safety
Feb 12, 2026
Merged

Route MCP and helper debug logs to stderr#49
a-bonus merged 2 commits intoa-bonus:mainfrom
wulymammoth:dwu/mcp-stdio-log-safety

Conversation

@wulymammoth
Copy link
Copy Markdown
Contributor

Summary

This PR isolates stdio/logging safety changes from markdown-converter work.

MCP stdio transport uses stdout for protocol frames, so accidental console.log output can corrupt tool transport. This change routes those logs to stderr.

Changes

  • In src/server.ts, redirect top-level console.log(...) calls to console.error(...).
  • In src/googleDocsApiHelpers.ts, change verbose debug console.log(...) calls to console.error(...).

Why

  • Prevent non-protocol output from leaking into stdout on MCP transport.
  • Keep debug visibility while preserving protocol safety.

Validation

  • npm run build
  • node --test tests/markdown.test.js
    • 17 passed, 0 failed (on current main test set)

@a-bonus a-bonus merged commit 63af212 into a-bonus:main Feb 12, 2026
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.

2 participants