Skip to content

Fix MCP stdio logging and prevent WebSocket port drift#2

Open
japd-dev wants to merge 2 commits intooO:mainfrom
japd-dev:fix/mcp-stdio-port-sync
Open

Fix MCP stdio logging and prevent WebSocket port drift#2
japd-dev wants to merge 2 commits intooO:mainfrom
japd-dev:fix/mcp-stdio-port-sync

Conversation

@japd-dev
Copy link
Copy Markdown

@japd-dev japd-dev commented Mar 9, 2026

Summary

This PR fixes a few issues that made the local Figma write integration unreliable:

  • route resource registry logging away from stdio so MCP JSON-RPC stays valid
  • fail fast on WebSocket port conflicts instead of silently drifting to a fallback port
  • align local plugin localhost/WebSocket development configuration
  • document the fixed-port expectation for the plugin/server pair

Why

The plugin currently connects to a fixed localhost port in practice. If the server silently falls back to another port, the MCP client and Figma plugin can end up connected to different server instances.

Also, non-protocol stdout output breaks MCP clients that expect clean JSON-RPC over stdio.

Testing

  • ran npm run build
  • verified duplicate startup no longer falls back to 8766
  • verified Claude Desktop restarted onto 8765
  • verified Figma plugin reconnected successfully over ws://localhost:8765

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