Skip to content

fix: redirect stdio banner to stderr to prevent MCP protocol pollution - #1209

Open
3ni8ma wants to merge 1 commit into
sansan0:masterfrom
3ni8ma:fix/stdio-banner-stderr
Open

fix: redirect stdio banner to stderr to prevent MCP protocol pollution#1209
3ni8ma wants to merge 1 commit into
sansan0:masterfrom
3ni8ma:fix/stdio-banner-stderr

Conversation

@3ni8ma

@3ni8ma 3ni8ma commented Aug 24, 2026

Copy link
Copy Markdown

Description

In stdio mode, stdout is reserved for JSON-RPC messages. The startup banner was being printed to stdout, which broke MCP clients like Claude Code that strictly follow the stdio protocol.

Fix

Redirect the banner to stderr when transport='stdio', keeping stdout clean for JSON-RPC communication.

Changes

  • Save original stdout
  • Redirect to stderr when in stdio mode
  • Restore stdout after banner

Closes #1204

In stdio mode, stdout is reserved for JSON-RPC messages. The startup
banner was being printed to stdout, which broke MCP clients like
Claude Code that strictly follow the stdio protocol.

This fix redirects the banner to stderr when transport='stdio',
keeping stdout clean for JSON-RPC communication.

Closes sansan0#1204
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.

stdio 模式下启动 banner 打到 stdout,污染 MCP 协议导致客户端加载失败

1 participant