Skip to content

MCP: add browser_scroll tool #112

Description

@sujithps

Summary

Add a browser_scroll tool to the MCP server. Content below the fold or behind lazy-loading is currently hard to reach: an agent can only act on what a snapshot already exposes.

Scope

  • Add browser_scroll in mcp/rustwright_mcp/server.py supporting: scroll to a snapshot ref (element.scroll_into_view_if_needed()), and scroll the viewport by a direction/amount (page.mouse.wheel or window.scrollBy).
  • Return a fresh snapshot after scrolling.
  • Reuse the existing ref-or-selector resolver so target accepts a ref (e12) or CSS selector, consistent with browser_click.

Acceptance criteria

  • Scrolling to a ref that starts off-screen brings it into view (verify via bounding box in a fixture page).
  • Viewport scroll changes window.scrollY.
  • A test against a tall local fixture.

Pointers

  • Resolver + snapshot helpers in mcp/rustwright_mcp/server.py.
  • Fixture pattern: mcp/tests/fixtures/.

Proposed as a good first issue; a maintainer will apply the label.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions