Added engine-side state introspection via WebMCP tools#10
Merged
Conversation
celso
approved these changes
May 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds WebMCP tools that let agents play Doom directly from the browser. The page now exposes a context-dependent toolset that swaps as the screen changes (home → IWAD picker → in-game), giving agents structured access to menus, HUD state, and input — no vision or DOM scraping required.
Tools
Home screen
start_game— Start a new game.mode: "solo" | "multiplayer". Advances to the IWAD picker.IWAD picker
choose_iwad— Pick the game data.iwad: "doom1" | "doom2" | "tnt" | "plutonia" | "doomu".In-game
press_key— Press and release a single key.keycovers movement (forward,backward,strafeLeft,strafeRight,up,down,left,right), actions (fire,use,speed), menus (enter,escape,backspace,yes,no), weapons (1–7), and game keys (tab,pause,say,f2,f3,f6quicksave,f9quickload). OptionalholdMsfor held inputs (default 50 ms; use a few hundred for movement).get_state— Structured engine state:screen(title|menu|playing|demo|automap|intermission|dead|finale),hud(health, armor, ammo, ammo_type, weapon, face_state, keys),enemies_visible(bearing + distance bins),in_combat,low_health,caption.screen: "demo"signals attract-mode playback — agents should callstart_new_gameorpress_key('escape')instead of trying to play.get_screenshot— Pixel-perfect 320×200 PNG read directly from the engine's framebuffer with the gamma-corrected palette applied.get_menu— Engine-level menu read:{ cursor_index, is_save_menu, is_load_menu, items: [{ index, label, enabled, cursor, hot_key }] }, ornullwhen no menu is open. KnownM_XXXXXlump names are translated to human-readable labels (e.g.M_NGAME→"New Game"); save/load slots return user-typed names. Drive the cursor withpress_key('up' | 'down'), activate withpress_key('enter'), back out withpress_key('escape').start_new_game— Fast-path Esc → New Game. Works from the title screen and from attract-mode demos. Lands on the skill picker; Nightmare confirmation answered withpress_key('yes').