Skip to content

fix MCP stdio server output#391

Merged
brendanjryan merged 1 commit intowevm:mainfrom
brendanjryan:codex/fix-mcp-stdio
Apr 24, 2026
Merged

fix MCP stdio server output#391
brendanjryan merged 1 commit intowevm:mainfrom
brendanjryan:codex/fix-mcp-stdio

Conversation

@brendanjryan
Copy link
Copy Markdown
Collaborator

@brendanjryan brendanjryan commented Apr 24, 2026

Summary

Fixes two MCP stdio regressions in the CLI:

  • mppx --mcp exited immediately because the bin wrapper called process.exit(0) after cli.serve() resolved.
  • MCP tool calls returned null and leaked command output onto stdout because command handlers printed results instead of returning structured data through incur.

Changes

  • Keep the bin process alive by awaiting cli.serve() without forcing process.exit(0).
  • Add structured output schemas and structured return paths for MCP/explicit JSON mode while preserving existing human CLI output.
  • Prevent sign from reading MCP transport stdin when no challenge argument is provided.
  • Add live stdio MCP tests that spawn src/bin.ts --mcp, initialize JSON-RPC, list tools and schemas, and call tools across success and error scenarios without stdout pollution.

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Apr 24, 2026

Open in StackBlitz

npm i https://pkg.pr.new/mppx@391

commit: f332fd1

@brendanjryan brendanjryan marked this pull request as ready for review April 24, 2026 04:21
@brendanjryan brendanjryan merged commit 24604ff into wevm:main Apr 24, 2026
10 of 12 checks passed
@brendanjryan brendanjryan changed the title [codex] fix MCP stdio server output fix MCP stdio server output Apr 24, 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.

1 participant