MCP server stderr output leaks into chat input placeholder · Issue #34271 · anomalyco/opencode · GitHub
Skip to content

MCP server stderr output leaks into chat input placeholder #34271

Description

@ChurzeXo

Description

Summary
When a local MCP server writes to stderr (as permitted by the MCP stdio transport spec), the output sometimes appears in the TUI input box placeholder text instead of being routed to the log file.
Environment

  • OpenCode version: (fill in)
  • OS: macOS
  • Terminal: (fill in your terminal emulator)
    Steps to reproduce
  1. Configure a local MCP server that writes startup/diagnostic logs to stderr (e.g., kevlar-4u via npx kevlar-4u)
  2. Start OpenCode in a project with that MCP server enabled
  3. Observe the input box at the bottom of the TUI
    Expected behavior
    MCP server stderr output should be written to ~/.local/share/opencode/log/ and should not appear anywhere in the TUI.
    Actual behavior
    Server stderr lines (timestamps, INFO/WARN logs, connection messages) appear concatenated into the chat input field's placeholder text. Example:
    12026using {"path":".../node_modules/kevlar-4u/skills"}
    [2026-06-28T01:55:25.297Z] INFO: ...
    [Kevlar-4u] Server connected via Stdio...
    Notes
    This is a rendering/UI issue — the MCP server is writing to stderr correctly per the stdio transport spec. The client should be capturing stderr to log files only, not exposing it in the UI.
Image

Plugins

No response

OpenCode version

1.17.11

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions