Enabling Vision Capability
To use coordinate-based tools, start the MCP server with the vision capability:Mouse Click Operations
browser_mouse_click_xy
Click left mouse button at a given position.X coordinate on the page
Y coordinate on the page
browser_mouse_down
Press mouse button down at current position.Button to press, defaults to “left”. Options: “left”, “right”, “middle”
browser_mouse_up
Release mouse button at current position.Button to release, defaults to “left”. Options: “left”, “right”, “middle”
Mouse Movement
browser_mouse_move_xy
Move mouse to a given position.X coordinate to move to
Y coordinate to move to
browser_mouse_drag_xy
Drag left mouse button from one position to another.Start X coordinate
Start Y coordinate
End X coordinate
End Y coordinate
Scrolling
browser_mouse_wheel
Scroll using the mouse wheel.Horizontal scroll amount (positive = right, negative = left)
Vertical scroll amount (positive = down, negative = up)
Use Cases
Drawing Applications
Coordinate-based tools are ideal for interacting with canvas-based drawing applications:Interactive Maps
Interact with map interfaces that use coordinate-based interactions:Games and Simulations
Control game interfaces or simulations that require precise coordinate input:Elements Without Accessibility Attributes
When elements lack proper accessibility attributes, coordinate-based clicks can serve as a fallback:Best Practices
Use as Last Resort
Use as Last Resort
Coordinate-based interactions are fragile and can break with layout changes. Always prefer semantic element selection using
browser_click, browser_type, and other element-based tools when available.Take Screenshots First
Take Screenshots First
Use
browser_take_screenshot to verify element positions before using coordinate-based tools. This helps ensure you’re clicking the right location.Consider Viewport Size
Consider Viewport Size
Coordinates are relative to the viewport. Ensure the browser window size is consistent with your expected coordinates using
browser_resize.Account for Scrolling
Account for Scrolling
Coordinates are relative to the current viewport. If the page is scrolled, the coordinates will be different. Use
browser_mouse_wheel to scroll if needed.Combining with Other Tools
Coordinate-based tools work well with other Playwright MCP tools:Related Tools
Core Automation
Prefer semantic element-based interactions
Browser Resize
Set consistent viewport for coordinate accuracy

