[PR #342] [MERGED] Launcher MCP: play the running game through game_* tools #2501

Closed
opened 2026-11-02 15:56:44 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/342
Author: @ludovic111
Created: 10/15/2026
Status: ✅ Merged
Merged: 10/15/2026
Merged by: @ludovic111

Base: main ← Head: feat/launcher-mcp-game


📝 Commits (1)

  • b0abb62 Launcher MCP: play the running game through game_* tools

📊 Changes

5 files changed (+431 additions, -11 deletions)

View changed files

📝 launcher/README.md (+8 -0)
➕ launcher/src/game_tools.rs (+216 -0)
📝 launcher/src/main.rs (+1 -0)
📝 launcher/src/mcp.rs (+72 -11)
➕ tools/launcher_mcp_e2e.py (+134 -0)

📄 Description

What. An agent now needs one MCP server, horizon-launcher mcp:

  • it runs the selected version's horizon-ctl mcp as a child (releases ship it beside the game) and offers every game tool as game_<name> (game_state, game_ui, game_click, game_goto, game_inventory, game_screenshot with its image...), all but launch, which launch_client covers; calls and results pass through unchanged
  • launch_client starts the game with a control socket in the launcher's data folder, takes world, creative and offscreen, and returns once the socket answers (it waited a fixed 2 s before)
  • a game_* call while no game listens answers {"error": "...Start it with launch_client...", "kind": "state"}
  • design: docs/agent-control.md (#321), "The launcher's MCP proxies the game"

Only the MCP's launch_client adds the control socket: a game the player starts from the window or horizon-launcher play is unchanged (under control, losing focus does not pause).

How tested.

  • launcher/src/game_tools.rs unit tests: prefixing and hiding launch, the not-running error.
  • tools/launcher_mcp_e2e.py (new): a scratch launcher home with this checkout's horizon-client/horizon-ctl as an installed version, then an MCP client talks only to horizon-launcher mcp: tools listed (71), game_state before launch says to launch, launch_client {world, creative, offscreen}, game_wait_ready, game_state, game_pause, game_ui, game_click back-to-game, game_screenshot (a real frame), game_quit. PASS on the Mac mini (offscreen). It uses game_ui/game_click, so run it with builds of the UI-tree PR (merge after #349).
launcher: cargo fmt --check ok · cargo clippy --all-targets --features gpui/runtime_shaders -D warnings ok · cargo test: 30 + 4 + 1 passed
tools/parity.py --changed origin/main: 0 harnesses depend on these files
tools/launcher_mcp_e2e.py: PASS (71 tools)

Conflicts. #250 (telemetry) also edits launcher/src/mcp.rs (tool list and call); the hunks are apart, whichever lands second rebases trivially.

Needs Ludovic. Nothing.

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/342 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/15/2026 **Status:** ✅ Merged **Merged:** 10/15/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/launcher-mcp-game` --- ### 📝 Commits (1) - [`b0abb62`](https://github.com/horizon-rust/horizon/commit/b0abb62883015380351fba5acea8b09cc917756a) Launcher MCP: play the running game through game_* tools ### 📊 Changes **5 files changed** (+431 additions, -11 deletions) <details> <summary>View changed files</summary> 📝 `launcher/README.md` (+8 -0) ➕ `launcher/src/game_tools.rs` (+216 -0) 📝 `launcher/src/main.rs` (+1 -0) 📝 `launcher/src/mcp.rs` (+72 -11) ➕ `tools/launcher_mcp_e2e.py` (+134 -0) </details> ### 📄 Description **What.** An agent now needs one MCP server, `horizon-launcher mcp`: - it runs the selected version's `horizon-ctl mcp` as a child (releases ship it beside the game) and offers every game tool as `game_<name>` (`game_state`, `game_ui`, `game_click`, `game_goto`, `game_inventory`, `game_screenshot` with its image...), all but `launch`, which `launch_client` covers; calls and results pass through unchanged - `launch_client` starts the game with a control socket in the launcher's data folder, takes `world`, `creative` and `offscreen`, and returns once the socket answers (it waited a fixed 2 s before) - a `game_*` call while no game listens answers `{"error": "...Start it with launch_client...", "kind": "state"}` - design: `docs/agent-control.md` (#321), "The launcher's MCP proxies the game" Only the MCP's `launch_client` adds the control socket: a game the player starts from the window or `horizon-launcher play` is unchanged (under control, losing focus does not pause). **How tested.** - `launcher/src/game_tools.rs` unit tests: prefixing and hiding `launch`, the not-running error. - `tools/launcher_mcp_e2e.py` (new): a scratch launcher home with this checkout's `horizon-client`/`horizon-ctl` as an installed version, then an MCP client talks only to `horizon-launcher mcp`: tools listed (71), `game_state` before launch says to launch, `launch_client {world, creative, offscreen}`, `game_wait_ready`, `game_state`, `game_pause`, `game_ui`, `game_click back-to-game`, `game_screenshot` (a real frame), `game_quit`. PASS on the Mac mini (offscreen). It uses `game_ui`/`game_click`, so run it with builds of the UI-tree PR (merge after #349). ``` launcher: cargo fmt --check ok · cargo clippy --all-targets --features gpui/runtime_shaders -D warnings ok · cargo test: 30 + 4 + 1 passed tools/parity.py --changed origin/main: 0 harnesses depend on these files tools/launcher_mcp_e2e.py: PASS (71 tools) ``` **Conflicts.** #250 (telemetry) also edits `launcher/src/mcp.rs` (tool list and `call`); the hunks are apart, whichever lands second rebases trivially. **Needs Ludovic.** Nothing. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-02 15:56:44 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#2501
No description provided.