Skip to content

Configure Flipper server open URL, plugin install, and activation - #24

Draft
sugarmanz wants to merge 1 commit into
mainfrom
flipper-server-config
Draft

Configure Flipper server open URL, plugin install, and activation#24
sugarmanz wants to merge 1 commit into
mainfrom
flipper-server-config

Conversation

@sugarmanz

@sugarmanz sugarmanz commented Sep 9, 2026

Copy link
Copy Markdown
Member

Summary

Gives FlipperServerTransport control over three things that previously required a manual Flipper desktop app:

  • Configurable browser open/URLopen/url constructor options (env vars PLAYER_DEVTOOLS_FLIPPER_OPEN/PLAYER_DEVTOOLS_FLIPPER_URL in the CLI). Off by default; when enabled, opens a caller-supplied URL instead of always opening http://localhost:52342. flipper-server itself is always launched with --open=false and browser-opening is now driven by the transport.
  • Plugin installationensurePluginInstalled() uses Flipper's own documented plugin-management RPCs (plugins-get-installed-plugins, plugins-install-from-npm) — the same commands the desktop UI's "Install Plugin" button calls — instead of reaching into ~/.flipper/installed-plugins or shelling out to this repo's local just install-flipper-client recipe. flipper-plugin-player-ui-devtools is already published to npm, so this works for any consumer of @player-devtools/mcp, not just repo checkouts.
  • Plugin activationenablePlugin(clientId?)/disablePlugin(clientId?) send the init/deinit handshake Flipper's device SDK requires before it will open a live plugin connection and relay messages. Nothing in flipper-server sends this automatically for a non-background, foreground-only plugin like ours without a full desktop Flipper app attached with the plugin's tab selected — these methods let a caller trigger the same handshake directly. An opt-in autoEnablePlugin constructor flag (used by bin/run) activates every connecting client automatically.

The CLI (player-devtools-mcp/bin/run) now calls ensurePluginInstalled() and enables the plugin for connected/connecting clients on startup, so no manual Flipper UI interaction is required end-to-end.

Test plan

  • bazel test //devtools/client/flipper:flipper_eslint //devtools/client/flipper:flipper_vitest //devtools/mcp:mcp_eslint //devtools/mcp:mcp_vitest — all pass
  • bazel build //devtools/mcp:mcp_ts_types_transitive_typecheck_test — passes across both packages
  • Manual: run player-devtools-mcp with a Player app instance connected as a device and no Flipper desktop UI running; confirm list_players/get_player_status succeed without any manual Flipper UI interaction
  • Manual: confirm PLAYER_DEVTOOLS_FLIPPER_OPEN=true PLAYER_DEVTOOLS_FLIPPER_URL=https://player-ui.tools:52342 opens the custom URL instead of localhost:52342

Release Notes

@player-devtools/mcp no longer requires any manual Flipper desktop app interaction to install or activate the Player UI Devtools plugin — the MCP server now installs the plugin (via Flipper's own plugin-management API) and activates it for connecting devices automatically on startup. FlipperServerTransport gains open/url options for controlling whether/where a browser UI opens (env vars PLAYER_DEVTOOLS_FLIPPER_OPEN/PLAYER_DEVTOOLS_FLIPPER_URL for the CLI), and new ensurePluginInstalled()/enablePlugin()/disablePlugin() methods for consumers embedding the transport directly.

📦 Published PR as canary version: 0.14.3--canary.24.1132

Try this version out locally by upgrading relevant packages to 0.14.3--canary.24.1132

Give FlipperServerTransport control over three things that previously
required a manual Flipper desktop app: a configurable browser-open URL
(instead of always opening http://localhost:52342), installing the
devtools plugin via Flipper's documented plugins-install-from-npm RPC
(instead of requiring the repo's local justfile/Bazel tooling), and
explicit enablePlugin/disablePlugin methods that send the init/deinit
handshake Flipper's device SDK requires before it will relay plugin
messages — something flipper-server never does on its own for a
non-background plugin without a desktop UI attached.
@sugarmanz

Copy link
Copy Markdown
Member Author

/canary

@AngelaVilladiego

Copy link
Copy Markdown

Canary version successfully sends the init message and works with dynex studio.

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.

2 participants