Skip to content

Add opt-in status and Play API with MCP support - #10

Open
saphid wants to merge 2 commits into
elripalda:mainfrom
saphid:feat/local-control-api-mcp
Open

saphid wants to merge 2 commits into
elripalda:mainfrom
saphid:feat/local-control-api-mcp

Conversation

@saphid

@saphid saphid commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Scripts and MCP clients can now see installed/running games and press Play through an off-by-default Local control switch in desktop and Big Picture Settings. Reworked and rebased onto Beta 38 main (a101ffe) to address the maintainer review.

The public surface is limited to GET /v1/status, POST /v1/play with an id, and /mcp with launcher_status and play_game. Play uses the shared shortcut launch path and reports started, already running/starting, busy, or needs setup. Installer/setup and administrator branches require permission that API Play cannot obtain. The previous command registry, jobs, events, settings mutations and app lifecycle endpoints are removed.

Local control binds only to loopback, authenticates with a random token and rejects browser-origin requests. Endpoint publication checks current-user ownership and private permissions, including macOS ACLs and Windows owner/protected DACLs. Unsafe data paths fail closed with a Settings error. A small Python stdio adapter forwards the same two operations and is provided as a separate script, not bundled into installers.

Turning the switch off removes the endpoint, closes the listener and prevents pending Plays from launching, including after re-enabling. Safe waits cancel; an in-progress cloud sync retains its game-start claim and save lock until restore/cleanup finishes, with unfinished work tracked in Settings. Settings-save failures reconcile the running state.

Validation on macOS:

  • Full Rust suite: 483 passed, 1 ignored; focused control/launch tests: 91 passed.
  • Node: all 76 tests passed, including Beta 38, background settings, save sharing and Local control Settings; all four JavaScript CI syntax checks passed.
  • Python adapter: 10 passed on Python 3.14 and 3.9; clippy completed with existing upstream warnings.
  • Independent GPT-6.1 Sol reviews drove security/lifecycle fixes. Final Claude Opus 5.5 review of the frozen patch found no actionable findings, reran 90 focused tests and ten repeated cloud/regression runs, and confirmed that restoring the old shutdown abort makes the new save-restore regression fail. Fresh Claude Opus 5.5 high reviews of the Beta 37 and Beta 38 integrations also found no actionable issues. The latest review checked updater/macOS exit handling, background settings and save-sharing reservations, and reran 15 Node and 9 Rust tests.

CI on a1aa98a is green: Windows, Ubuntu and macOS build/test/installer jobs all passed, and the Flatpak build passed. The Windows run includes the private-file tests and a test-only LF/CRLF normalization fix for the Play policy checks; the new regression and independent review passed.

Platform/runtime limits: Windows and Linux validation comes from CI; neither platform was run locally. CI builds/tests and packages the app but does not exercise a real GUI/game/cloud-account session. No GUI, real game, installer or cloud-account flow was exercised for this rework. Private-path checks are conservative: group-writable Unix paths and Windows reparse-point routes are refused, and Flatpak may refuse to enable Local control. New UI strings are English only.

Created and reworked with Claude Opus 5.5 and GPT-6.1 Sol in T3 Code through the Claude Code and Codex harnesses. Original authorship remains Alex Southwell.

@elripalda elripalda left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for all the work on this. A local control API and MCP server is a big, interesting idea. We're parking it until the current betas are done, for these reasons:

  • It's about 6,000 lines and conflicts with five files on main now.
  • Windows isn't supported yet (it refuses to start until token ACLs exist), and most players are on Windows.
  • It opens a local control surface for every launcher command, so it needs its own security review before it can ship.

What would make it mergeable:

  1. Windows support, with the token file locked to the current user.
  2. A smaller first step: read-only status (installed games, what's running) plus Play, behind a switch in Settings that's off by default. Installing, removing and changing settings can come later, once that's been reviewed.
  3. A rebase onto main when you pick it up again.

Thanks again, and no rush.


Generated by Claude Code

@saphid
saphid force-pushed the feat/local-control-api-mcp branch from d118c00 to db93b5b Compare November 11, 2026 12:31
@saphid saphid changed the title Add opt-in local control API and MCP server Add opt-in status and Play API with MCP support Nov 11, 2026
@saphid
saphid force-pushed the feat/local-control-api-mcp branch from db93b5b to ec6f711 Compare November 11, 2026 15:38
@saphid
saphid force-pushed the feat/local-control-api-mcp branch from ec6f711 to f30fd32 Compare November 12, 2026 06:30
elripalda added a commit that referenced this pull request Nov 25, 2026
…less asked for (#548)

Start the launcher with RECOMPLAUNCHER_TEST_CONTROL set to a token of 16+ characters and an MCP client can drive it like a tester. Without the variable nothing listens and nothing is added to the window. The HTTP and MCP handling started from #10 by Alex Southwell.
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