mouse_click
Click the mouse at specified coordinates or current position using left, right, or middle buttons. Supports single or double-click actions for desktop automation in Hyprland.
Instructions
Click the mouse at a position (or current position if no coordinates given).
Args: button: "left", "right", or "middle" x: X coordinate to click at (optional — clicks at current position if omitted) y: Y coordinate to click at (optional) double: Whether to double-click
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| button | No | left | |
| x | No | ||
| y | No | ||
| double | No |
Implementation Reference
- hyprland_mcp/server.py:259-279 (handler)The handler function for the `mouse_click` tool, which optionally moves the cursor to (x, y) and then executes a mouse click via the input module.
async def mouse_click( button: str = "left", x: int | None = None, y: int | None = None, double: bool = False, ) -> str: """Click the mouse at a position (or current position if no coordinates given). Args: button: "left", "right", or "middle" x: X coordinate to click at (optional — clicks at current position if omitted) y: Y coordinate to click at (optional) double: Whether to double-click """ from . import input as inp if x is not None and y is not None: await inp.move_cursor(x, y) await inp.click(button, double=double) pos = f" at ({x},{y})" if x is not None and y is not None else "" kind = "Double-clicked" if double else "Clicked" return f"{kind} {button}{pos}" - hyprland_mcp/server.py:258-259 (registration)Registration of the `mouse_click` function as an MCP tool using the `@mcp.tool()` decorator.
@mcp.tool() async def mouse_click(