### Setup commands for Windows-MCP benchmark Source: https://github.com/ask-812/oswright/blob/master/benchmarks/README.md Installs Python 3.14 via uv, clones Windows-MCP, creates a virtual environment, and installs the package. Required before running the head-to-head benchmark. ```bash uv python install 3.14 git clone https://github.com/CursorTouch/Windows-MCP.git %TEMP%/Windows-MCP cd %TEMP%/Windows-MCP uv venv --python 3.14 .venv uv pip install --python .venv/Scripts/python.exe -e . ``` -------------------------------- ### Install development dependencies Source: https://github.com/ask-812/oswright/blob/master/README.md Installs the package in editable mode with development dependencies. ```bash pip install -e ".[dev]" ``` -------------------------------- ### Install OSWright with EasyOCR Source: https://github.com/ask-812/oswright/blob/master/README.md On Windows, EasyOCR is not installed by default because the built-in Windows OCR engine is faster and needs no model download. Install it only if you need a language Windows OCR does not support. ```bash pip install "oswright[easyocr]" ``` -------------------------------- ### Install OSWright via pip Source: https://github.com/ask-812/oswright/blob/master/README.md Install the OSWright package using pip. This is an alternative to using `uvx`. ```bash pip install oswright ``` -------------------------------- ### observe() incremental perception output example Source: https://github.com/ask-812/oswright/blob/master/README.md Shows the JSON structure returned by observe() when using incremental perception, including changed flag, added/removed text regions, and the fraction of the screen scanned. This output is used to illustrate the reduced work compared to full-screen re-perception. ```json observe() -> {"changed": true, "added": [{"text": "Saved", "x": 812, "y": 447}], "removed": ["Unsaved changes"], "screen_fraction_scanned": 0.015} ``` -------------------------------- ### OSWright Python library usage example Source: https://github.com/ask-812/oswright/blob/master/README.md Shows the Playwright-style API for OSWright as a standalone Python library. The with block creates an OSWright instance, gets a screen, and performs actions like clicking, typing, pressing keys, and taking a screenshot. ```python from oswright import OSWright with OSWright() as ow: screen = ow.screen() screen.click(text="Start") screen.type_text("Hello World") screen.press("Ctrl+S") screen.screenshot("desktop.png") ``` -------------------------------- ### get_active_window Source: https://github.com/ask-812/oswright/blob/master/README.md Gets info about the currently focused window. ```APIDOC ## get_active_window ### Description Gets info about the currently focused window. ### Read-only **true** ``` -------------------------------- ### get_clipboard Source: https://github.com/ask-812/oswright/blob/master/README.md Gets the current text content of the system clipboard. This is a read-only operation. ```APIDOC ## get_clipboard ### Description Get the current text content of the system clipboard. ### Method Tool ### Endpoint `get_clipboard` ### Parameters None ### Response Returns the current clipboard text. ``` -------------------------------- ### Standard MCP server config for OSWright Source: https://github.com/ask-812/oswright/blob/master/README.md Use this JSON configuration to register the OSWright MCP server in most MCP-compatible tools. It runs the server via `uvx` with the `oswright` package. If `uvx` is not available, install with `pip install oswright` and set `"command": "oswright"` instead. ```json { "mcpServers": { "oswright": { "command": "uvx", "args": ["oswright"] } } } ``` -------------------------------- ### MCP server config for OSWright using pip-installed command Source: https://github.com/ask-812/oswright/blob/master/README.md Use this JSON configuration when OSWright is installed via pip. It sets the command directly to `oswright` instead of using `uvx`. ```json { "mcpServers": { "oswright": { "command": "oswright" } } } ``` -------------------------------- ### get_ui_tree Source: https://github.com/ask-812/oswright/blob/master/README.md Gets the accessibility tree of the focused window. Returns all interactive elements with names, types, positions. Deterministic and instant. ```APIDOC ## get_ui_tree ### Description Gets the accessibility tree of the focused window. Returns all interactive elements with names, types, positions. Deterministic and instant. ### Parameters - `window_title` (string) - Optional - The title of the window to get the tree from. - `max_depth` (integer) - Optional - Maximum depth of the tree to traverse. ### Read-only **true** ``` -------------------------------- ### Standalone MCP server with SSE transport Source: https://github.com/ask-812/oswright/blob/master/README.md Start the OSWright server with SSE transport on port 8931, then configure the MCP client to connect to the SSE endpoint. ```bash uvx oswright --port 8931 ``` ```json { "mcpServers": { "oswright": { "url": "http://127.0.0.1:8931/sse" } } } ``` -------------------------------- ### get_ocr_info Source: https://github.com/ask-812/oswright/blob/master/README.md Gets info about the active OCR backend and available backends. This is a read-only operation. ```APIDOC ## get_ocr_info ### Description Get info about the active OCR backend and available backends. ### Method Tool ### Endpoint `get_ocr_info` ### Parameters None ### Response Returns information about the active OCR backend and available backends. ``` -------------------------------- ### get_mouse_position Source: https://github.com/ask-812/oswright/blob/master/README.md Gets the current mouse cursor position. This is a read-only operation. ```APIDOC ## get_mouse_position ### Description Get the current mouse cursor position. ### Method Tool ### Endpoint `get_mouse_position` ### Parameters None ### Response Returns the current mouse cursor position. ``` -------------------------------- ### Run tests, lint, and benchmarks Source: https://github.com/ask-812/oswright/blob/master/CONTRIBUTING.md Commands for running the test suite, linting, and task benchmarks. Desktop tests skip without a display. ```bash pytest tests/ # 259 tests; desktop ones skip without a display ``` ```bash pytest tests/ -m "not e2e" # unit tests only ``` ```bash ruff check oswright tests benchmarks # lint ``` ```bash python benchmarks/bench_tasks.py # task success, opens real windows ``` -------------------------------- ### Run benchmarks Source: https://github.com/ask-812/oswright/blob/master/README.md Reproduces the performance numbers and task success metrics. The second command opens Calculator repeatedly. ```bash python benchmarks/bench_pipeline.py # reproduce the performance numbers ``` ```bash python benchmarks/bench_tasks.py # task success (opens Calculator repeatedly) ``` -------------------------------- ### focus_window Source: https://github.com/ask-812/oswright/blob/master/README.md Brings a window to the foreground by title. Returns a screenshot. ```APIDOC ## focus_window ### Description Bring a window to the foreground by title. Returns screenshot. ### Method Tool ### Endpoint `focus_window` ### Parameters - **title** (string) - Required - The title of the window to focus. ### Response Returns a screenshot. ``` -------------------------------- ### launch_app Source: https://github.com/ask-812/oswright/blob/master/README.md Launches an application and optionally waits for it to load. Runs the program directly, never through a shell. Reports whether the app actually loaded. ```APIDOC ## launch_app ### Description Launch an application and optionally wait for it to load. Runs the program directly, never through a shell. ### Method Tool ### Endpoint `launch_app` ### Parameters - **command** (string) - Required - The command to run. - **args** (array) - Optional - List of arguments. - **wait_text** (string) - Optional - Text to wait for to confirm loading. - **timeout** (number) - Optional - Timeout in seconds. ### Response Reports `wait_text_found` so you can tell whether the app actually loaded. ``` -------------------------------- ### Run all benchmark scripts Source: https://github.com/ask-812/oswright/blob/master/benchmarks/README.md Commands to run each benchmark script. Results depend on the live desktop, so run them yourself. bench_tasks.py takes ~6 minutes and requires a free machine. ```bash python benchmarks/bench_change.py # how much the screen actually changes python benchmarks/bench_methods.py # cost of each perception method python benchmarks/bench_pipeline.py # v0.4.0 path vs v0.5.0 path, end to end python benchmarks/bench_atlas.py # cost of a return visit to a known screen python benchmarks/bench_settle.py # how long screens really take to respond python benchmarks/bench_speculate.py # predicting an action instead of observing it python benchmarks/bench_tasks.py # does any of it help complete tasks? ``` -------------------------------- ### Run tests Source: https://github.com/ask-812/oswright/blob/master/README.md Runs the test suite. Use the second command to run only unit tests, excluding end-to-end tests that require a desktop. ```bash pytest tests/ # everything available on this machine ``` ```bash pytest tests/ -m "not e2e" # unit tests only, no desktop needed ``` -------------------------------- ### Lint with ruff Source: https://github.com/ask-812/oswright/blob/master/README.md Runs the ruff linter on the source and test directories. ```bash ruff check oswright tests # lint ``` -------------------------------- ### Python: acquire_shared() for shared DxgiDirtySource Source: https://github.com/ask-812/oswright/blob/master/docs/ENGINEERING_LOG.md Acquires a shared DxgiDirtySource keyed by thread and output index, reference-counted, to model Windows' one-per-process Desktop Duplication constraint. The fix ensures only one duplication per output per process is created. ```python def acquire_shared(output_index: int = 0) -> "DxgiDirtySource": key = (threading.get_ident(), output_index) with _shared_lock: source = _shared_sources.get(key) if source is None: source = DxgiDirtySource(output_index) source._shared_key = key _shared_sources[key] = source _shared_refs[key] = _shared_refs.get(key, 0) + 1 return source ``` -------------------------------- ### Configure OSWright MCP server with delta observation mode Source: https://github.com/ask-812/oswright/blob/master/skills/oswright/SKILL.md JSON configuration for the OSWright MCP server using uvx. Run with --observation-mode delta to reduce token usage; without it, every action returns a full screenshot. Use 'both' instead of 'delta' if images are needed after every action. ```json { "mcpServers": { "oswright": { "command": "uvx", "args": ["oswright", "--observation-mode", "delta"] } } } ``` -------------------------------- ### bench_change.py output Source: https://github.com/ask-812/oswright/blob/master/benchmarks/README.md Output from bench_change.py showing changed pixel and tile percentages. The mean is ~350x the median, indicating rare full repaints; tuning for the mean would optimize a case that rarely occurs. ```text changed pixels per frame median 0.012% mean 4.297% max 93.150% changed 64px tiles per frame median 0.417% mean 8.587% max 100.000% => analysing only dirty tiles is ~240x less work ``` -------------------------------- ### wait_for_change Source: https://github.com/ask-812/oswright/blob/master/README.md Waits for the screen to visually change. Takes a baseline screenshot, polls until different. ```APIDOC ## wait_for_change ### Description Waits for the screen to visually change. Takes a baseline screenshot, polls until different. ### Parameters - `timeout` (integer) - Optional - Maximum time to wait for a change. - `poll_interval` (integer) - Optional - How often to check for changes. ``` -------------------------------- ### list_windows Source: https://github.com/ask-812/oswright/blob/master/README.md Lists all visible windows. Optionally filters by title substring. This is a read-only operation. ```APIDOC ## list_windows ### Description List all visible windows. Optionally filter by title substring. ### Method Tool ### Endpoint `list_windows` ### Parameters - **title_filter** (string) - Optional - Substring to filter window titles. ### Response Returns a list of visible windows. ``` -------------------------------- ### press_key Source: https://github.com/ask-812/oswright/blob/master/README.md Presses a key or combo like Enter, Ctrl+C, Alt+Tab. Returns a screenshot. ```APIDOC ## press_key ### Description Press a key or combo like `Enter`, `Ctrl+C`, `Alt+Tab`. Returns screenshot. ### Method Tool ### Endpoint `press_key` ### Parameters - **key** (string) - Required - The key or combo to press. ### Response Returns a screenshot. ``` -------------------------------- ### Log output: Desktop Duplication unavailable (COMError E_INVALIDARG) Source: https://github.com/ask-812/oswright/blob/master/docs/ENGINEERING_LOG.md Log line produced during a full sweep, showing the fallback to tile hashing when Desktop Duplication fails with E_INVALIDARG. This output is the symptom of the resource-ownership bug described in the section. ```text Desktop Duplication unavailable (COMError: (-2147024809, 'The parameter is incorrect.', ...)); using tile hashing ``` -------------------------------- ### set_clipboard Source: https://github.com/ask-812/oswright/blob/master/README.md Copies text to the system clipboard. ```APIDOC ## set_clipboard ### Description Copy text to the system clipboard. ### Method Tool ### Endpoint `set_clipboard` ### Parameters - **text** (string) - Required - The text to copy to the clipboard. ### Response No return value specified. ``` -------------------------------- ### minimize_window Source: https://github.com/ask-812/oswright/blob/master/README.md Minimizes a window by title. Returns a screenshot. ```APIDOC ## minimize_window ### Description Minimize a window by title. Returns screenshot. ### Method Tool ### Endpoint `minimize_window` ### Parameters - **title** (string) - Required - The title of the window to minimize. ### Response Returns a screenshot. ``` -------------------------------- ### fill_field Source: https://github.com/ask-812/oswright/blob/master/README.md Finds a label, clicks it, clears, and types a value. Returns a screenshot. ```APIDOC ## fill_field ### Description Find a label, click it, clear, and type a value. Returns screenshot. ### Method Tool ### Endpoint `fill_field` ### Parameters - **target_text** (string) - Required - The label text to find. - **value** (string) - Required - The value to type. - **exact** (boolean) - Optional - Whether to match exact text. - **timeout** (number) - Optional - Timeout in seconds. - **monitor** (integer) - Optional - Monitor index. ### Response Returns a screenshot. ``` -------------------------------- ### get_screen_info Source: https://github.com/ask-812/oswright/blob/master/README.md Retrieves screen dimensions and monitor count. This is a read-only operation. ```APIDOC ## get_screen_info ### Description Get screen dimensions and monitor count. ### Method Tool ### Endpoint `get_screen_info` ### Parameters None ### Response Returns screen dimensions and monitor count. ``` -------------------------------- ### Add OSWright MCP server via Claude Code CLI Source: https://github.com/ask-812/oswright/blob/master/README.md Use this command to add the OSWright MCP server to Claude Code. It runs `uvx oswright` as the server command. ```bash claude mcp add oswright uvx oswright ``` -------------------------------- ### screenshot Source: https://github.com/ask-812/oswright/blob/master/README.md Takes a screenshot of the screen or a specified region. Returns the image as native MCP image content, optionally saving to a file path. ```APIDOC ## screenshot ### Description Takes a screenshot of the screen or a specified region. Returns the image as native MCP image content, optionally saving to a file path. ### Method Tool ### Endpoint `screenshot` ### Parameters - **save_path** (string) - Optional - File path to save the screenshot. ### Response Returns the image as native MCP image content. ``` -------------------------------- ### wait_for_time Source: https://github.com/ask-812/oswright/blob/master/README.md Waits for a specified duration (capped at 30s), then takes a screenshot. ```APIDOC ## wait_for_time ### Description Wait for a specified duration (capped at 30s), then screenshot. ### Method Tool ### Endpoint `wait_for_time` ### Parameters - **duration** (number) - Required - Duration to wait in seconds (capped at 30). ### Response Returns a screenshot. ``` -------------------------------- ### type_text Source: https://github.com/ask-812/oswright/blob/master/README.md Types text character by character. Returns a screenshot. ```APIDOC ## type_text ### Description Type text character by character. Returns screenshot. ### Method Tool ### Endpoint `type_text` ### Parameters - **text** (string) - Required - The text to type. - **delay** (number) - Optional - Delay between characters. ### Response Returns a screenshot. ``` -------------------------------- ### screenshot_window Source: https://github.com/ask-812/oswright/blob/master/README.md Captures a screenshot of just one window. This is a read-only operation. ```APIDOC ## screenshot_window ### Description Capture a screenshot of just one window. ### Method Tool ### Endpoint `screenshot_window` ### Parameters - **title** (string) - Required - The title of the window to capture. - **save_path** (string) - Optional - File path to save the screenshot. ### Response Returns the screenshot image. ``` -------------------------------- ### hover_text Source: https://github.com/ask-812/oswright/blob/master/README.md Finds text via OCR and hovers over it. Returns a screenshot. ```APIDOC ## hover_text ### Description Find text via OCR and hover over it. Returns screenshot. ### Method Tool ### Endpoint `hover_text` ### Parameters - **text** (string) - Required - The text to find and hover over. - **exact** (boolean) - Optional - Whether to match exact text. - **button** (string) - Optional - Mouse button to use. - **timeout** (number) - Optional - Timeout in seconds. - **poll_interval** (number) - Optional - Polling interval in seconds. - **monitor** (integer) - Optional - Monitor index. ### Response Returns a screenshot. ``` -------------------------------- ### fill_form Source: https://github.com/ask-812/oswright/blob/master/README.md Fills multiple fields in one call. Reduces round-trips. ```APIDOC ## fill_form ### Description Fill multiple fields in one call. Reduces round-trips. ### Method Tool ### Endpoint `fill_form` ### Parameters - **fields** (array) - Required - List of `{label, value}` objects. - **timeout** (number) - Optional - Timeout in seconds. - **monitor** (integer) - Optional - Monitor index. ### Response No return value specified. ``` -------------------------------- ### mouse_click Source: https://github.com/ask-812/oswright/blob/master/README.md Clicks the mouse at specified coordinates or current position. Returns a screenshot. ```APIDOC ## mouse_click ### Description Click the mouse at coordinates or current position. Returns screenshot. ### Method Tool ### Endpoint `mouse_click` ### Parameters - **x** (integer) - Optional - X coordinate. - **y** (integer) - Optional - Y coordinate. - **button** (string) - Optional - Mouse button (e.g., left, right). - **clicks** (integer) - Optional - Number of clicks. ### Response Returns a screenshot. ``` -------------------------------- ### click_ui_element Source: https://github.com/ask-812/oswright/blob/master/README.md Clicks a UI element using the accessibility tree. More reliable than OCR. ```APIDOC ## click_ui_element ### Description Clicks a UI element using the accessibility tree. More reliable than OCR. ### Parameters - `name` (string) - Optional - The name of the UI element to click. - `control_type` (string) - Optional - The control type of the UI element. - `automation_id` (string) - Optional - The automation ID of the UI element. - `window_title` (string) - Optional - The title of the window containing the element. ``` -------------------------------- ### click_element Source: https://github.com/ask-812/oswright/blob/master/README.md Finds text via the cascade and clicks it. The cheap alternative to `click_text`. ```APIDOC ## click_element ### Description Finds text via the cascade and clicks it. The cheap alternative to `click_text`. ### Parameters - `text` (string) - Required - The text to find and click. - `exact` (boolean) - Optional - Whether to match text exactly. - `button` (string) - Optional - The mouse button to use for clicking. - `window_title` (string) - Optional - The title of the window to search in. ``` -------------------------------- ### remember_screen Source: https://github.com/ask-812/oswright/blob/master/README.md Remembers the current screen so future visits skip reading it. Persists across sessions. ```APIDOC ## remember_screen ### Description Remembers the current screen so future visits skip reading it. Persists across sessions. ### Read-only **true** ``` -------------------------------- ### close_window Source: https://github.com/ask-812/oswright/blob/master/README.md Closes a window by title (sends WM_CLOSE). Returns a screenshot. ```APIDOC ## close_window ### Description Close a window by title (sends WM_CLOSE). Returns screenshot. ### Method Tool ### Endpoint `close_window` ### Parameters - **title** (string) - Required - The title of the window to close. ### Response Returns a screenshot. ``` -------------------------------- ### Add OSWright MCP server via VS Code CLI Source: https://github.com/ask-812/oswright/blob/master/README.md Use this command to add the OSWright MCP server to VS Code from the command line. It passes the server configuration as a JSON string. ```bash code --add-mcp '{"name":"oswright","command":"uvx","args":["oswright"]}' ``` -------------------------------- ### mouse_move Source: https://github.com/ask-812/oswright/blob/master/README.md Moves the mouse cursor to screen coordinates. ```APIDOC ## mouse_move ### Description Move the mouse cursor to screen coordinates. ### Method Tool ### Endpoint `mouse_move` ### Parameters - **x** (integer) - Required - X coordinate. - **y** (integer) - Required - Y coordinate. ### Response No return value specified. ``` -------------------------------- ### observe Source: https://github.com/ask-812/oswright/blob/master/README.md Reports what changed on screen since the last observation. Rescans only the regions that moved. This is a read-only operation. ```APIDOC ## observe ### Description Report what changed on screen since the last observation. Rescans only the regions that moved. ### Method Tool ### Endpoint `observe` ### Parameters - **force_full** (boolean) - Optional - Force a full rescan. ### Response Returns information about what changed on screen. ``` -------------------------------- ### Run OSWright directly via Python module Source: https://github.com/ask-812/oswright/blob/master/README.md Run the OSWright MCP server directly using the Python module. This is an alternative to using the `oswright` command. ```bash python -m oswright ``` -------------------------------- ### mouse_drag Source: https://github.com/ask-812/oswright/blob/master/README.md Drags from one point to another. Returns a screenshot. ```APIDOC ## mouse_drag ### Description Drag from one point to another. Returns screenshot. ### Method Tool ### Endpoint `mouse_drag` ### Parameters - **start_x** (integer) - Required - Starting X coordinate. - **start_y** (integer) - Required - Starting Y coordinate. - **end_x** (integer) - Required - Ending X coordinate. - **end_y** (integer) - Required - Ending Y coordinate. - **button** (string) - Optional - Mouse button. - **duration** (number) - Optional - Duration of the drag. ### Response Returns a screenshot. ``` -------------------------------- ### fill_ui_element Source: https://github.com/ask-812/oswright/blob/master/README.md Sets the value of a UI element (e.g., text box). More reliable than OCR-based fill. ```APIDOC ## fill_ui_element ### Description Sets the value of a UI element (e.g., text box). More reliable than OCR-based fill. ### Parameters - `value` (string) - Required - The value to set. - `name` (string) - Optional - The name of the UI element. - `automation_id` (string) - Optional - The automation ID of the UI element. - `window_title` (string) - Optional - The title of the window containing the element. ``` -------------------------------- ### Cline MCP server configuration for OSWright Source: https://github.com/ask-812/oswright/blob/master/README.md Add this JSON to your `cline_mcp_settings.json` to register the OSWright MCP server in Cline. It uses `stdio` transport and `uvx` to run the server. ```json { "mcpServers": { "oswright": { "type": "stdio", "command": "uvx", "args": ["oswright"], "disabled": false } } } ``` -------------------------------- ### VS Code MCP server configuration for OSWright Source: https://github.com/ask-812/oswright/blob/master/README.md Add this JSON to your user or workspace `settings.json` under `mcp.servers` to register the OSWright MCP server in VS Code. It uses `uvx` to run the server. ```json { "mcp": { "servers": { "oswright": { "command": "uvx", "args": ["oswright"] } } } } ``` -------------------------------- ### right_click_text Source: https://github.com/ask-812/oswright/blob/master/README.md Finds text via OCR and right-clicks on it. Returns a screenshot. ```APIDOC ## right_click_text ### Description Find text via OCR and right-click on it. Returns screenshot. ### Method Tool ### Endpoint `right_click_text` ### Parameters - **text** (string) - Required - The text to find and right-click. - **exact** (boolean) - Optional - Whether to match exact text. - **button** (string) - Optional - Mouse button to use. - **timeout** (number) - Optional - Timeout in seconds. - **poll_interval** (number) - Optional - Polling interval in seconds. - **monitor** (integer) - Optional - Monitor index. ### Response Returns a screenshot. ``` -------------------------------- ### find_element Source: https://github.com/ask-812/oswright/blob/master/README.md Finds on-screen text using the cheapest method that can answer. Reports which cascade rung responded. ```APIDOC ## find_element ### Description Finds on-screen text using the cheapest method that can answer. Reports which cascade rung responded. ### Parameters - `text` (string) - Required - The text to find on screen. - `exact` (boolean) - Optional - Whether to match text exactly. - `window_title` (string) - Optional - The title of the window to search in. ### Read-only **true** ``` -------------------------------- ### OSWright project architecture tree Source: https://github.com/ask-812/oswright/blob/master/README.md Displays the directory structure of the OSWright project, listing the main package modules and test files with brief comments on their purposes. Useful for understanding the codebase layout. ```text oswright/ __init__.py # Package entry point (single source of __version__) core.py # OSWright class (= Browser) screen.py # Screen class (= Page) locator.py # Locator + Assertions (= Locator + expect) capture.py # Screen capture (mss - cross-platform, thread-safe) dirty.py # Change detection - which parts of the screen moved screenmodel.py # Persistent screen model, updated incrementally cascade.py # Resolution cascade - cheapest method that can answer atlas.py # Remembers screens across visits and sessions settle.py # Knowing when the screen has finished responding speculate.py # Predicting what an action does, instead of looking textprovider.py # Exact text from the app itself via UIA TextPattern detect.py # OCR dispatcher with caching (auto-selects best backend) _ocr_windows.py # Windows OCR backend (instant, built-in) accessibility.py # Windows UI Automation (deterministic element finding) cache.py # Screenshot diffing, image hashing, OCR result cache _dpi.py # Process DPI awareness (keeps every API in physical pixels) _dxgi_windows.py # Compositor dirty rectangles via DXGI Desktop Duplication input.py # Platform dispatcher for input backends _input_windows.py # Windows input backend (Win32 API) _input_pynput.py # Linux/macOS input backend (pynput) window.py # Window management (list, focus, close) clipboard.py # Clipboard read/write (cross-platform) mcp_server.py # MCP server (43 tools for AI agents) tests/ conftest.py # Fixtures that skip when no display/OCR is available test_core.py # Unit tests (no desktop required) test_perception.py # Incremental perception (stubbed, runs headless) test_atlas.py # Screen memory and its failure modes (headless) test_speculate.py # Prediction, settling, and their limits (headless) test_e2e.py # End-to-end tests against the real desktop (marked `e2e`) ``` -------------------------------- ### mouse_scroll Source: https://github.com/ask-812/oswright/blob/master/README.md Scrolls the mouse wheel. Returns a screenshot. ```APIDOC ## mouse_scroll ### Description Scroll the mouse wheel. Returns screenshot. ### Method Tool ### Endpoint `mouse_scroll` ### Parameters - **amount** (integer) - Required - Scroll amount. - **x** (integer) - Optional - X coordinate. - **y** (integer) - Optional - Y coordinate. ### Response Returns a screenshot. ``` -------------------------------- ### double_click_text Source: https://github.com/ask-812/oswright/blob/master/README.md Finds text via OCR and double-clicks on it. Returns a screenshot. ```APIDOC ## double_click_text ### Description Find text via OCR and double-click on it. Returns screenshot. ### Method Tool ### Endpoint `double_click_text` ### Parameters - **text** (string) - Required - The text to find and double-click. - **exact** (boolean) - Optional - Whether to match exact text. - **button** (string) - Optional - Mouse button to use. - **timeout** (number) - Optional - Timeout in seconds. - **poll_interval** (number) - Optional - Polling interval in seconds. - **monitor** (integer) - Optional - Monitor index. ### Response Returns a screenshot. ``` -------------------------------- ### Multi-language OCR configuration Source: https://github.com/ask-812/oswright/blob/master/README.md Configure the OSWright MCP server with multiple OCR languages using the --ocr-languages flag. This JSON is placed in the mcpServers configuration for the client. ```json { "mcpServers": { "oswright": { "command": "uvx", "args": ["oswright", "--ocr-languages", "en", "es", "fr"] } } } ``` -------------------------------- ### wait_for_text_gone Source: https://github.com/ask-812/oswright/blob/master/README.md Waits for text to disappear from screen. This is a read-only operation. ```APIDOC ## wait_for_text_gone ### Description Wait for text to disappear from screen. ### Method Tool ### Endpoint `wait_for_text_gone` ### Parameters - **text** (string) - Required - The text to wait for disappearance. - **exact** (boolean) - Optional - Whether to match exact text. - **timeout** (number) - Optional - Timeout in seconds. - **poll_interval** (number) - Optional - Polling interval in seconds. - **monitor** (integer) - Optional - Monitor index. ### Response No return value specified. ``` -------------------------------- ### find_image_on_screen Source: https://github.com/ask-812/oswright/blob/master/README.md Finds all occurrences of a template image on screen using OpenCV template matching. This is a read-only operation. ```APIDOC ## find_image_on_screen ### Description Find all occurrences of a template image on screen using OpenCV template matching. ### Method Tool ### Endpoint `find_image_on_screen` ### Parameters - **template_path** (string) - Required - Path to the template image. - **threshold** (number) - Optional - Matching threshold. - **monitor** (integer) - Optional - Monitor index. ### Response Returns matches with coordinates and confidence. ``` -------------------------------- ### mouse_double_click Source: https://github.com/ask-812/oswright/blob/master/README.md Double-clicks at specified coordinates or current position. Returns a screenshot. ```APIDOC ## mouse_double_click ### Description Double-click at coordinates or current position. Returns screenshot. ### Method Tool ### Endpoint `mouse_double_click` ### Parameters - **x** (integer) - Optional - X coordinate. - **y** (integer) - Optional - Y coordinate. - **button** (string) - Optional - Mouse button. ### Response Returns a screenshot. ``` -------------------------------- ### wait_for_text Source: https://github.com/ask-812/oswright/blob/master/README.md Waits for text to appear on screen. Polls via OCR. This is a read-only operation. ```APIDOC ## wait_for_text ### Description Wait for text to appear on screen. Polls via OCR. ### Method Tool ### Endpoint `wait_for_text` ### Parameters - **text** (string) - Required - The text to wait for. - **exact** (boolean) - Optional - Whether to match exact text. - **timeout** (number) - Optional - Timeout in seconds. - **poll_interval** (number) - Optional - Polling interval in seconds. - **monitor** (integer) - Optional - Monitor index. ### Response No return value specified. ``` -------------------------------- ### click_text Source: https://github.com/ask-812/oswright/blob/master/README.md Finds text via OCR and clicks on it. Auto-retries until found or timeout. Returns a screenshot. ```APIDOC ## click_text ### Description Find text via OCR and click on it. Auto-retries until found or timeout. Returns screenshot. ### Method Tool ### Endpoint `click_text` ### Parameters - **text** (string) - Required - The text to find and click. - **exact** (boolean) - Optional - Whether to match exact text. - **button** (string) - Optional - Mouse button to use. - **timeout** (number) - Optional - Timeout in seconds. - **poll_interval** (number) - Optional - Polling interval in seconds. - **monitor** (integer) - Optional - Monitor index. ### Response Returns a screenshot. ``` -------------------------------- ### SSH tunnel to OSWright server Source: https://github.com/ask-812/oswright/blob/master/README.md Use this command to securely reach the OSWright server from another machine. The server binds to 127.0.0.1 by default and refuses non-loopback addresses unless --allow-remote is passed, so an SSH tunnel is preferred over exposing the port. ```bash ssh -L 8931:127.0.0.1:8931 user@desktop-host ``` -------------------------------- ### read_model_text Source: https://github.com/ask-812/oswright/blob/master/README.md Reads on-screen text from the incremental model without re-OCRing the display. ```APIDOC ## read_model_text ### Description Reads on-screen text from the incremental model without re-OCRing the display. ### Parameters - `query` (string) - Required - The text query to search for. - `limit` (integer) - Optional - Maximum number of results to return. ### Read-only **true** ``` -------------------------------- ### atlas_stats Source: https://github.com/ask-812/oswright/blob/master/README.md Reports what the screen atlas has remembered and how often it helped. ```APIDOC ## atlas_stats ### Description Reports what the screen atlas has remembered and how often it helped. ### Read-only **true** ``` -------------------------------- ### perception_stats Source: https://github.com/ask-812/oswright/blob/master/README.md Reports how much perception work the model has avoided. ```APIDOC ## perception_stats ### Description Reports how much perception work the model has avoided. ### Read-only **true** ``` -------------------------------- ### read_screen_text Source: https://github.com/ask-812/oswright/blob/master/README.md Reads all visible text on the screen using OCR. Returns every detected text element with position. This is a read-only operation. ```APIDOC ## read_screen_text ### Description Read ALL visible text on the screen using OCR. Returns every detected text element with position. ### Method Tool ### Endpoint `read_screen_text` ### Parameters - **region bounds** (object) - Optional - Region bounds for the search. - **monitor** (integer) - Optional - Monitor index. ### Response Returns every detected text element with position. ``` -------------------------------- ### find_text_on_screen Source: https://github.com/ask-812/oswright/blob/master/README.md Finds all occurrences of text on screen using OCR. Returns matches with coordinates and confidence. This is a read-only operation. ```APIDOC ## find_text_on_screen ### Description Find all occurrences of text on screen using OCR. Returns matches with coordinates and confidence. ### Method Tool ### Endpoint `find_text_on_screen` ### Parameters - **text** (string) - Required - The text to search for. - **exact** (boolean) - Optional - Whether to match exact text. - **region bounds** (object) - Optional - Region bounds for the search. - **monitor** (integer) - Optional - Monitor index. ### Response Returns matches with coordinates and confidence. ``` -------------------------------- ### Chrome flags to prevent backgrounding and occlusion Source: https://github.com/ask-812/oswright/blob/master/docs/ENGINEERING_LOG.md Use these three Chrome flags to prevent the browser from stopping painting when it is not visible, which can cause OCR to read a blank page. Needed for any tool that drives or records a browser not in the foreground. ```text --disable-features=CalculateNativeWinOcclusion --disable-backgrounding-occluded-windows --disable-renderer-backgrounding ```