Skip to content

Log MCP protocol messages in the inspector console#23

Merged
abewheel merged 1 commit intomainfrom
abewheel/log-postmessage
Mar 25, 2026
Merged

Log MCP protocol messages in the inspector console#23
abewheel merged 1 commit intomainfrom
abewheel/log-postmessage

Conversation

@abewheel
Copy link
Copy Markdown
Contributor

Summary

  • Adds colored console logs for all MCP App protocol messages in the inspector, covering both directions (host → app and app → host)
  • Logs incoming app requests via a window message listener that filters out sunpeak-internal traffic
  • Logs outgoing host notifications (setHostContext, sendToolInput, sendToolResult, etc.) and response acks for all bridge handlers
  • Fixes a bug where early returns in openLink URL validation skipped the consistent return path

Test plan

  • pnpm --filter sunpeak typecheck passes
  • pnpm --filter sunpeak lint passes
  • pnpm --filter sunpeak test -- --run passes (233 tests)
  • Run sunpeak dev on a sample app and verify colored [MCP ↑] / [MCP ↓] logs appear in browser console
  • Verify no sunpeak-internal messages (fence, injectState, sandbox-proxy-ready) appear in the logs

Adds colored console logs for all MCP App protocol messages flowing
between host and app in the inspector, giving developers visibility
into the message passing without sunpeak-internal noise.
@abewheel abewheel merged commit 9916342 into main Mar 25, 2026
3 checks passed
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