mcp: Add hover, press, selectOption, setChecked#2070
Merged
karlseguin merged 5 commits intomainfrom Apr 4, 2026
Merged
Conversation
New browser actions and MCP tools for AI agent interaction: - hover: dispatches mouseover/mouseenter events on an element - press: dispatches keydown/keyup keyboard events (Enter, Tab, etc.) - selectOption: selects a dropdown option by value with input/change events - setChecked: checks/unchecks checkbox or radio with input/change/click events
- Fix setChecked event order: click fires before input/change to match browser behavior - Add tests for hover, press, selectOption, setChecked MCP tools - Merge all action tests into a single test case sharing one page load - Add test elements to mcp_actions.html (hover target, key input, second select, checkbox, radio)
- fill action now calls focus() on the element before setting its value, ensuring focus/focusin events fire for JS listeners - Add findElement MCP tool for locating interactive elements by ARIA role and/or accessible name (case-insensitive substring match) - Add tests for findElement (by role, by name, no matches, missing params)
- Extract dispatchInputAndChangeEvents() in actions.zig, used by fill, selectOption, and setChecked - Extract resolveNodeAndPage() in tools.zig, used by click, fill, hover, selectOption, setChecked, and nodeDetails handlers
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
New browser actions and MCP tools for AI agent interaction:
This increases compatibility with other frameworks such as browser use or stagehand.