About Pywinauto MCP
Pywinauto MCP is an MCP server published by sandraschi in the Security category: mCP 2.12 Server for Windows Automation. Conduid read 86 tools from its source: add_face, analyze_winapp, approve_automation, automation_assert, automation_dialog, automation_elements and 80 more. No package is published for it, so it installs from a source checkout.
The repository has 61 stars and 17 forks, is licensed MIT, and its last commit was on 1 Dec 2026. The latest release is v0.8.0 (10 Oct 2026): Assfix 2026-10-10: POST /api/v1/shutdown, /capabilities, /skills, /llm/discover, /llm/onboarding, /llm/chat/stream; S110/S112/E722 un-ignored and fixed (55 sites log ins… It follows v0.7.1 (17 Aug 2026), and the 4 most recent releases go back to v0.6.0 (15 Jun 2026). It passes 2 of the 3 static checks Conduid ran on the repository; it does not pass Scoped permissions. Its topics include security, automation, face-recognition and windows.
Install
git clone https://github.com/sandraschi/pywinauto-mcpTools (86)
add_faceAdd a new face to the recognition system.| Parameter | Type | Description |
|---|---|---|
| image_path * | string | Path to the image file containing the face |
| name * | string | Name of the person |
analyze_winappCrawl a Windows app and produce UI element map + screenshot portfolio.| Parameter | Type | Description |
|---|---|---|
| header_row | boolean | extract_table treats the first row as headers -> records. |
| max_depth | integer | Max UI tree depth for crawl (default 5). |
| min_cols | integer | extract_table drops rows with fewer cells (default 1). |
| operation | string | Which analysis operation to perform. |
| output_dir | string | Directory for screenshot files + markdown report. Defaults to ./winapp_analysis/ |
| row_tolerance_px | integer | extract_table vertical banding tolerance (default 8). |
| scroll_amount | integer | Wheel units per crawl_scroll page, negative = down (default -10). |
| scroll_pages | integer | Max extra scroll pages for crawl_scroll (default 3). |
| states | array | State names for portfolio mode. |
| window_handle | integer | Target HWND (optional if window_title is set). |
| window_title | string | Find window by title substring. |
approve_automationApprove UI automation actions for a specified duration to prevent repetitive prompts.| Parameter | Type | Description |
|---|---|---|
| duration_minutes | number | Number of minutes to allow automated actions (default 5.0). |
automation_assertUI verification for computer-use automation - stability polling, image diff, template/OCR asserts. WHAT IT DOES: Polls screenshots until the UI stabilizes, compares before/after images, and asserts expected visual or text state. Use after keyboard shortcuts or clicks to confirm the action succeeded before continuing. WHEN TO USE: - wait_stable: after navigation shortcuts (F-keys, Ctrl+N) - wait for rendering to finish - assert_changed: confirm a step produced a visible UI change - assert_unchanged: confirm a no-op or focus-only action did not alter the canvas - diff: get changed_pct and a heatmap PNG for failure logs - assert_template: check a dialog or button icon is visible (OpenCV template match) - assert_text: OCR a region and check for expected dialog title or label - hash / hash_region: fingerprint a screen region (dhash tolerates GPU rendering noise) RECOVERY: If wait_stable times out, increase timeout_s or narrow region_* to the editor panel only. If assert_changed fails with low changed_pct, the shortcut may not have reached the focused window. ## Return Format {"status": "success" | "error", "message": str, "data": {"changed_pct": float, ...}, "recovery_tip": str | null} ## Examples - automation_assert(request={"operation": "wait_stable", "timeout_s": 10}) -> {"status": "success", ...} - automation_assert(request={"operation": "assert_text", "expected_text": "Save", "region_left": 0, "region_top": 0, "region_right": 800, "region_bottom": 600}) -> {"status": "success", ...}| Parameter | Type | Description |
|---|---|---|
| request * | any |
automation_dialogWindows file dialog helpers - set path field and confirm. WHAT IT DOES: Fills Save/Open/Export dialog path fields using clipboard paste (default) or typed entry, then confirms with Enter. Prefer this over manual ctrl+a + type sequences. WHEN TO USE: - submit_path: full flow after a Save As / Open / Export shortcut opened a dialog - set_path: only fill the path field (confirm separately) - confirm: press Enter after path is already set RECOVERY: Ensure the target dialog field is focused (Tab into it if needed). Call automation_windows(focus) on the parent app first. For long paths, keep use_clipboard=true. ## Return Format {"status": "success" | "error", "message": str, "data": {...}, "recovery_tip": str | null} ## Examples - automation_dialog(request={"operation": "set_path", "path": "C:/Exports/report.pdf"}) -> {"status": "success", ...} - automation_dialog(request={"operation": "confirm"}) -> {"status": "success", "message": "Dialog confirmed.", ...}| Parameter | Type | Description |
|---|---|---|
| request * | any |
automation_elementsComprehensive UI element interaction and inspection system. WHAT IT DOES: This tool provides granular control over individual UI elements (buttons, text fields, lists, etc.) within a target window. It handles complex selection logic based on Control IDs, Automation IDs, titles, or relative coordinates, and executes actions like clicking, typing, and visibility verification. WHEN TO USE: - Use 'list' to browse the element tree of a window to find interactable controls. - Use 'click' or 'double_click' to trigger UI actions on specific buttons or items. - Use 'set_text' to fill out forms, enter search queries, or update field values. - Use 'wait' or 'exists' when automating dynamic UIs where elements take time to load. - Use 'info' to audit a control's properties (enabled state, read-only status, etc.). RECOVERY AND TROUBLESHOOTING: - 'ElementNotFoundError': The selection criteria (control_id, title) may be incorrect or the element might be nested deeper than expected. Use 'list' with a higher 'max_depth' to verify the exact hierarchy. - 'ElementNotVisible': The element exists but is hidden or scrolled out of view. Try 'activate' on the parent window first, or use mouse tools to scroll. - Ambiguous targets: If multiple elements match your criteria, PyWinAuto might fail. Be as specific as possible by combining 'control_type' and 'title'. RETURNS: A ToolResult object containing standardized outcome, message, and element data. ## Return Format {"status": "success" | "error", "message": str, "data": {...}, "recovery_tip": str | null} ## Examples - automation_elements(request={"window_handle": 123456, "operation": "list"}) -> {"status": "success", "message": "Listed 40 elements.", ...} - automation_elements(request={"window_handle": 123456, "operation": "click", "title": "Save"}) -> {"status": "success", ...}| Parameter | Type | Description |
|---|---|---|
| request * | any |
automation_faceIndustrialized local face recognition and biometric enrollment tool. WHAT IT DOES: This tool provides local-only biometric capabilities for registering and recognizing individuals via facial encodings. It can enroll new faces from static images, match unknown faces against a local encrypted database, and capture live frames from primary or secondary UVC webcams. WHEN TO USE: - Use 'add' to enroll a person into the system (e.g., for personalized automation triggers). - Use 'recognize' to identify individuals present in a provided image file. - Use 'capture' to engage a local camera (laptop built-in or USB webcam) for real-time identification. - Use 'presence' for human-presence detection (notebook scenario): captures, recognizes, and folds the result into an armed state machine (present / away-short inside grace / away-long past lock timeout). Coffee runs do nothing; going home recommends locking. - Use 'test' for a dry presence check that never locks. - Use 'arm' / 'disarm' / 'set_timeouts' / 'presence_status' to manage the monitor without a camera. Timeouts: grace_s (default 300), lock_timeout_s (default 900), auto_lock (default off). - Use 'enroll' to capture from the camera and register in one call (name + camera_index only, no image file needed). - Use 'list' or 'delete' for managing the local biometric database. SAFETY AND PRIVACY: This tool operates entirely locally and requires explicit opt-in via 'windows_computer_use_mcp_ENABLE_FACE=1'. It does not transmit biometric data to remote servers. If recognition fails, ensure adequate lighting and centered positioning of the target face. RECOVERY: If 'capture' fails to open the camera, verify the 'camera_index' (0 is usually the default) and ensure no other application is currently locking the device. ## Return Format {"status": "success" | "error", "message": str, "data": {...}, "recovery_tip": str | null} ## Examples - automation_face(request={"operation": "presence_status"}) -> {"status": "success", "data": {"state": "present", ...}} - automation_face(request={"operation": "list"}) -> {"status": "success", "data": {"faces": [...]}, ...}| Parameter | Type | Description |
|---|---|---|
| request * | any |
automation_keyboardComprehensive keyboard input and sequence simulation system. WHAT IT DOES: This tool provides a unified interface for simulating keyboard input. It supports sequential typing ('type'), single key presses ('press'), complex multi-key combinations ('hotkey'), and modifier-key holding ('hold'). WHEN TO USE: - Use 'type' to enter text into boxes, editors, or command lines. - Use 'background_type' with a window_handle to type without focus changes (PostMessage WM_CHAR; rich/IME input may need 'type' or element set_text). - Use 'background_key' with a window_handle for enter/tab/escape/arrows/F-keys without focus changes. - Use 'press' for navigation keys (tab, enter, arrows, escape). - Use 'hotkey' for application shortcuts (ctrl+c, alt+f4, win+r). - Use 'hold' when you need to sustain a state (like Shift or Ctrl) while performing other UI actions. RECOVERY AND TROUBLESHOOTING: - If typing appears missing, the window might have lost focus. Use 'automation_windows' with 'focus' before sending keyboard input. - For special keys like 'enter' or 'tab', ensure you are using the correct string identifier (pyautogui standard). RETURNS: A ToolResult object containing standardized outcome, message, and focus metadata. ## Return Format {"status": "success" | "error", "message": str, "data": {...}, "recovery_tip": str | null} ## Examples - automation_keyboard(request={"operation": "type", "text": "hello"}) -> {"status": "success", ...} - automation_keyboard(request={"operation": "hotkey", "keys": ["ctrl", "s"]}) -> {"status": "success", ...}| Parameter | Type | Description |
|---|---|---|
| request * | any |
automation_macroRecord, replay, and verify UI automation macros. WHAT IT DOES: Captures every tool call during a recording session into a replayable JSONL file. Replay executes the same sequence. Replay-with-verify checks each step's outcome against the recorded result (hash-based screenshot comparison when available). OPERATIONS: - record: Start recording. Every subsequent tool call is captured until 'stop'. - stop: Stop recording and save the macro to a named file. - replay: Execute a saved macro step by step. - replay_with_verify: Replay and verify each step matches the recorded outcome. - list: List saved macros with metadata. ## Return Format {"status": "success" | "error", "message": str, "data": {...}, "recovery_tip": str | null} ## Examples - automation_macro(operation="record", name="login-flow") -> {"status": "success", ...} - automation_macro(operation="replay", name="login-flow") -> {"status": "success", ...}| Parameter | Type | Description |
|---|---|---|
| name | string | |
| operation * | string | |
| record_video | boolean | |
| steps | array |
automation_missionAutonomous multi-step orchestration and complex mission management tool. WHAT IT DOES: This tool elevates automation from individual clicks to high-level objectives. Give it a natural-language goal - it decomposes into steps, executes each with retry + verification, and returns pass/fail with evidence. WHEN TO USE: - Use 'run' to execute a full autonomous mission from a goal. - Use 'plan' to preview the step decomposition without executing. - Use 'status' to track progress of a running mission. - Use 'cancel' to stop a running mission. RECOVERY: If a step fails, the mission continues with remaining steps (non-fatal). Missions run a session preflight first (blocked when the session is locked or a UAC prompt is up - approve on the console and re-run), pause for UAC mid-run, and honor WINDOWS_COMPUTER_USE_MCP_ALLOWED_APPS when set. Use 'status' with the mission_id to review step-level results. RETURNS: A ToolResult object with mission progress, step results, and next steps. ## Return Format {"status": "success" | "error", "message": str, "data": {"mission_id": str, ...}, "recovery_tip": str | null} ## Examples - automation_mission(request={"operation": "plan", "goal": "open Notepad and type hello"}) -> {"status": "success", ...} - automation_mission(request={"operation": "run", "goal": "open Notepad and type hello"}) -> {"status": "success", ...}| Parameter | Type | Description |
|---|---|---|
| request * | any |
automation_mouseComprehensive mouse control and cursor simulation system. WHAT IT DOES: Moves, clicks, drags, and scrolls using **Win32** ``SetCursorPos`` / ``mouse_event`` (DPI-aware), not PyAutoGUI alone - reliable move/click/drag on scaled monitors. WHEN TO USE: - Use 'position' to get current screen coordinates before planning a movement. - Use 'click' or 'double_click' for rapid UI interaction. - Use 'background_click' with a window_handle to click without moving the cursor or stealing focus (PostMessage; some controls ignore it - fall back to 'click'). - Use 'move_relative' to nudge the cursor from its current spot. - Use 'scroll' to browse lists or web pages. - Use 'telemetry' to visually debug coordinates on the user's screen. RECOVERY AND TROUBLESHOOTING: - FailSafe: Moving the cursor to the **upper-left** corner aborts (same idea as PyAutoGUI). Disabled when windows_computer_use_mcp_BYPASS_HITL=1. - If coordinates seem 'off', confirm single-monitor expectations or use 'position' first. RETURNS: A ToolResult object containing standardized outcome, message, and movement data. ## Return Format {"status": "success" | "error" | "blocked", "message": str, "data": {...}, "recovery_tip": str | null} ## Examples - automation_mouse(request={"operation": "position"}) -> {"status": "success", "data": {"x": 960, "y": 540, ...}} - automation_mouse(request={"operation": "click", "x": 960, "y": 540}) -> {"status": "success", ...}| Parameter | Type | Description |
|---|---|---|
| request * | any |
automation_safetyInspect or reset server-side safety limits (rate, kill switch, dry-run). Not a substitute for HITL.| Parameter | Type | Description |
|---|---|---|
| operation | string |
automation_shortcutSemantic application shortcuts - send by action name, not raw key codes. WHAT IT DOES: Maps app-specific action names (e.g. vroidstudio/export_vrm → F8) to keyboard sequences, optionally focuses the target HWND (win32 backend), and waits for UI stability after send. WHEN TO USE: - send: execute a named shortcut (prefer over raw automation_keyboard hotkey) - list: enumerate shortcuts for an app - describe: metadata for one action SUPPORTED APPS: vroidstudio (alias vroid, vroid_studio) RECOVERY: Call automation_windows(focus) first. Set windows_computer_use_mcp_KEYBOARD=win32 for HWND-targeted send. ## Return Format {"status": "success" | "error", "message": str, "data": {...}, "recovery_tip": str | null} ## Examples - automation_shortcut(request={"operation": "list", "app": "vroidstudio"}) -> {"status": "success", "data": {"shortcuts": [...]}} - automation_shortcut(request={"operation": "send", "app": "vroidstudio", "action": "export_vrm"}) -> {"status": "success", ...}| Parameter | Type | Description |
|---|---|---|
| request * | any |
automation_smartIntent-based discovery and interaction across all windows. OPERATIONS: - discover: Scan all visible windows and return a structured inventory of running apps and their controls. Optional query filters by app name or window title. - list_apps: Quick list of identified running applications with window handles. - list_controls: List controls for a specific window handle. - click: Find an element by description (e.g. 'the Save button') across all windows using element scanning. Fallback to OCR when UIA fails. ## Return Format {"status": "success" | "error", "message": str, "data": {"apps": [...]}, "recovery_tip": str | null} ## Examples - automation_smart(operation="list_apps") -> {"status": "success", "message": "5 running apps detected.", ...} - automation_smart(operation="click", description="the Save button") -> {"status": "success", ...}| Parameter | Type | Description |
|---|---|---|
| button | string | |
| description | string | |
| operation * | string | |
| query | string | |
| window_handle | integer |
automation_systemIndustrialized Windows system utility and synchronization tool. WHAT IT DOES: This tool provides low-level system utilities including application launching, process monitoring, clipboard manipulation, and advanced synchronization primitives (e.g., waiting for windows to appear). It acts as the 'glue' for complex automation sequences. WHEN TO USE: - Use 'status' for real-time health checks of the MCP server. - Use 'info' to collect detailed host telemetry (CPU, RAM, GPU). - Use 'preflight' before a mission: session liveness + UAC + disk/RAM in one call. - Use 'detect_uac' when steps fail oddly - a UAC prompt or locked session explains it. - Use 'wait' or 'wait_for_window' to synchronize automation steps with OS state. - Use 'clipboard_get/set' for data transfer between the agent and local applications. - Use 'processes' and 'start_app' for lifecycle management of Windows software. RECOVERY: If 'wait_for_window' times out, verify the 'title' exists or increase 'timeout'. If 'clipboard' operations fail, ensure the 'pyperclip' dependancy is installed and no other app is locking the clipboard. ## Return Format {"status": "success" | "error", "message": str, "data": {...}, "recovery_tip": str | null} ## Examples - automation_system(request={"operation": "status"}) -> {"status": "success", "message": "System status OK.", ...} - automation_system(request={"operation": "wait", "seconds": 2}) -> {"status": "success", "message": "Waited for 2 seconds.", ...}| Parameter | Type | Description |
|---|---|---|
| request * | any |
automation_taskClosed-loop task runner - the MVP computer use assistant. WHAT IT DOES: Executes a list of steps (shortcut, dialog, wait_stable, assert_file, focus, screenshot, click, preflight) with automatic retry, refocus recovery, and per-step evidence (screenshot paths). WHEN TO USE: - Prefer over manual tool chaining for multi-step GUI workflows - VRoid export: shortcut steps + dialog + assert_file in one call - Returns evidence trail on failure for host LLM review OPERATIONS: - run: execute steps - status: query task session - cancel: mark task cancelled - list_profiles: app profiles (foreground policy, window title, stable_region) - list_templates: per-app template library manifest (T2.3) See docs/CUA_ASSISTANT_TODO.md and docs/MEMOPS_CUA.md. ## Return Format {"status": "success" | "error", "message": str, "data": {...}, "recovery_tip": str | null} ## Examples - automation_task(request={"operation": "list_profiles"}) -> {"status": "success", "data": {"profiles": [...]}} - automation_task(request={"operation": "run", "app": "notepad.exe", "steps": [...]}) -> {"status": "success", ...}| Parameter | Type | Description |
|---|---|---|
| request * | any |
automation_visualComprehensive computer vision and OCR tool for Windows UI automation. WHAT IT DOES: This tool provides multimodal capabilities for interacting with the desktop when traditional UI element selectors (UIA/MSAA) are insufficient or unavailable (e.g., in remote desktops, games, or legacy apps). It supports pixel-perfect screenshots, Tesseract-based OCR text extraction, OpenCV template matching to find graphical assets, and temporary visual highlighting. WHEN TO USE: - Use 'screenshot' to capture current UI states for verification or documentation. - Use 'extract_text' (OCR) to read text from custom-drawn controls, icons, or web-in-app views. - Use 'find_image' when you have a template image (e.g., a specific button icon) and need to click its center coordinates. - Use 'highlight' to visually confirm the identified target during complex automation sequences. RECOVERY AND AMBIGUITY: If 'find_image' fails to meet the confidence threshold (default 0.8), consider decreasing the 'threshold' parameter or verifying that the template image is not resolution-dependent. If OCR results are noisy, ensure the target region coordinates are precisely bounded or use 'ocr_config' to specify page segmentation modes. ## Return Format {"status": "success" | "error", "message": str, "data": {"screenshot_base64": str, ...}, "recovery_tip": str | null} ## Examples - automation_visual(request={"operation": "screenshot"}) -> {"status": "success", "data": {"screenshot_base64": "..."}} - automation_visual(request={"operation": "extract_text", "region_left": 0, "region_top": 0, "region_right": 800, "region_bottom": 600}) -> {"status": "success", ...}| Parameter | Type | Description |
|---|---|---|
| request * | any |
automation_watchPersistent watcher for event-driven automation triggers. OPERATIONS: - start: Begin monitoring for a condition. Runs in a background thread. Conditions: window_appears, window_closes, text_appears, element_appears. Returns a watcher_id for status/cancel. - status: Check whether a watcher has triggered. - stop: Cancel a running watcher. - list: List all active watchers. ## Return Format {"status": "success" | "error" | "blocked", "message": str, "data": {"watcher_id": str, ...}, "recovery_tip": str | null} ## Examples - automation_watch(operation="start", condition="window_appears", target="Save As") -> {"status": "success", "data": {"watcher_id": "watch_ab12cd34"}} - automation_watch(operation="status", watcher_id="watch_ab12cd34") -> {"status": "success", ...}| Parameter | Type | Description |
|---|---|---|
| condition | string | |
| interval | number | |
| operation * | string | |
| target | string | |
| timeout | number | |
| watcher_id | string | |
| window_handle | integer |
automation_windowsComprehensive Windows window management and lifecycle control system. WHAT IT DOES: This tool provides a unified interface for discovering, locating, and controlling windows on the Windows desktop. It handles window state transitions (maximize, minimize, restore), visibility, and spatial positioning via the unique window handle (HWND). WHEN TO USE: - Use 'list' to discover available windows and their handles when starting a task. - Use 'find' to locate a specific window by its title or class name. - Use 'focus' or 'activate' to bring a window to the foreground before sending input. - Use 'manage' with actions (maximize, close, etc.) to control window lifecycle. - Use 'position' to precisely align windows for multi-window automation scenarios. - Use 'tray_list' to enumerate system-tray icons (tooltip text per icon), then 'tray_click' by index or tooltip substring. Overflow icons need tray_overflow=True with the chevron flyout open. RECOVERY AND TROUBLESHOOTING: - If a 'WindowNotFoundError' occurs, the handle (HWND) may have become stale. Call 'list' to refresh your knowledge of active window handles. - If 'focus' fails, the window might be minimized or blocked. The tool automatically attempts to restore minimized windows before focusing. RETURNS: A ToolResult object containing standardized outcome, message, and window metadata. ## Return Format {"status": "success" | "error", "message": str, "data": {"count": int, "windows": [...]}, "recovery_tip": str | null} ## Examples - automation_windows(request={"operation": "list"}) -> {"status": "success", "message": "Successfully listed 12 visible windows.", ...} - automation_windows(request={"operation": "find", "title": "Notepad", "partial": True}) -> {"status": "success", "data": {"count": 1, ...}}| Parameter | Type | Description |
|---|---|---|
| request * | any |
bring_window_to_foregroundBring a window to the foreground by its title.| Parameter | Type | Description |
|---|---|---|
| exact_match | boolean | Whether to match the window title exactly (default: True) |
| window_title * | string | Title or partial title of the window |
capture_and_recognizeCapture an image from the webcam and recognize faces in it.| Parameter | Type | Description |
|---|---|---|
| camera_index | integer | Index of the camera to use (default: 0) |
| save_path | string | Optional path to save the captured image |
click_at_positionClick at specific screen coordinates.| Parameter | Type | Description |
|---|---|---|
| button | string | Mouse button to click ("left", "right", "middle") |
| x * | integer | X coordinate to click |
| y * | integer | Y coordinate to click |
click_elementClick on a UI element.| Parameter | Type | Description |
|---|---|---|
| absolute | boolean | Whether the coordinates are screen-absolute (default: window-relative) |
| button | string | The mouse button to use ("left", "right", "middle") |
| control_id | string | The control ID of the element to click (optional if x and y are provided) |
| double | boolean | Whether to perform a double-click |
| window_handle * | integer | The handle of the parent window |
| x | integer | X coordinate relative to the window (optional if control_id is provided) |
| y | integer | Y coordinate relative to the window (optional if control_id is provided) |
close_windowClose a window.| Parameter | Type | Description |
|---|---|---|
| handle * | integer | The window handle to close |
cua_computer_use_screenshotWindow-scoped screenshot for Claude Code computer-use style grounding. Requires window_handle (HWND). Does not activate the window when windows_computer_use_mcp_DISPATCH=background. Wraps automation_visual(screenshot) with return_base64=true. ## Return Format {"status": "success" | "error", "message": str, "data": {"screenshot_base64": str, "compat": str}, "recovery_tip": str | null} ## Examples - cua_computer_use_screenshot(window_handle=123456) -> {"status": "success", "data": {"screenshot_base64": "...", ...}}| Parameter | Type | Description |
|---|---|---|
| format | string | |
| window_handle * | integer |
delete_faceDelete a known face from the system.| Parameter | Type | Description |
|---|---|---|
| name * | string | Name of the person to delete |
double_clickDouble-click on an element or at specific coordinates.| Parameter | Type | Description |
|---|---|---|
| element | any | Optional element info dict to click on |
| x | integer | X coordinate (if element not provided) |
| y | integer | Y coordinate (if element not provided) |
double_click_elementDouble-click on a UI element.| Parameter | Type | Description |
|---|---|---|
| button | string | The mouse button to use ("left", "right", "middle") |
| control_id | string | The control ID of the element to click (optional if x and y are provided) |
| window_handle * | integer | The handle of the parent window |
| x | integer | X coordinate relative to the window (optional if control_id is provided) |
| y | integer | Y coordinate relative to the window (optional if control_id is provided) |
drag_and_dropDrag from source to target element.| Parameter | Type | Description |
|---|---|---|
| duration | number | Duration of the drag in seconds (default: 0.5) |
| source * | any | Source element info dict with rect/position |
| target * | any | Target element info dict with rect/position |
drag_mouseDrag the mouse from one point to another.| Parameter | Type | Description |
|---|---|---|
| button | string | Mouse button to use ("left", "right", "middle") |
| duration | number | Time in seconds to take for the drag |
| tween | string | Tweening function for the movement |
| x1 * | integer | Starting X coordinate |
| x2 * | integer | Ending X coordinate |
| y1 * | integer | Starting Y coordinate |
| y2 * | integer | Ending Y coordinate |
element_existsCheck if a UI element exists.| Parameter | Type | Description |
|---|---|---|
| app_param | any | Optional Application instance to use for finding the element |
| selector * | any | Element selector (title, class_name, or dict of properties) |
| timeout | number | Maximum time to wait for element (default: 5 seconds) |
extract_textExtract text from an image or screen region using OCR.| Parameter | Type | Description |
|---|---|---|
| config | string | Tesseract configuration parameters |
| image_path | string | Path to the image file (if not using window/region) |
| language | string | Language code for OCR (e.g., 'eng', 'fra', 'spa') |
| region | array | Region to capture (left, top, right, bottom) |
| window_handle | integer | Handle of the window to capture (if not using image_path) |
find_imageFind a template image within a screenshot or window.| Parameter | Type | Description |
|---|---|---|
| region | array | Optional region (left, top, right, bottom) to search within |
| template_path * | string | Path to the template image to find |
| threshold | number | Confidence threshold (0-1) for template matching |
| window_handle | integer | Optional handle of the window to search in (None for entire screen) |
find_image_on_screenFind an image on the screen using template matching.| Parameter | Type | Description |
|---|---|---|
| confidence | number | Confidence threshold (0-1) for matching (default: 0.8) |
| grayscale | boolean | Whether to convert images to grayscale for matching (faster) |
| image_path * | string | Path to the template image to find |
| region | object | Optional dict with 'left', 'top', 'width', 'height' to search within |
find_window_by_titleFind window by title text.| Parameter | Type | Description |
|---|---|---|
| partial | boolean | Whether to do partial match (default: True) |
| title * | string | Window title to search for |
get_active_windowGet the currently active window.get_all_elementsGet all UI elements in a window.| Parameter | Type | Description |
|---|---|---|
| max_depth | integer | Maximum depth to traverse the element tree |
| window_handle * | integer | The handle of the parent window |
get_all_windowsGet information about all visible windows.get_cursor_positionGet current mouse cursor position.get_desktop_stateCaptures the complete hierarchical state of the Windows desktop UI. WHAT IT DOES: This tool traverses the UI tree of all active windows to produce a structured JSON representation of every discoverable element (buttons, panes, edit boxes, etc.). It optionally integrates computer vision (capturing element screenshots) and OCR (reading text from purely graphical controls) to enrich the metadata. WHEN TO USE: - Use this as your 'Primary Discovery' tool when starting a new automation task. - Use it to find stable selectors (Control IDs, Class Names, Names) for 'automation_elements' calls. - Use 'use_vision=True' to get visual snapshots of the elements for multi-modal analysis. - Use capture_mode='ax'|'som'|'vision' (Cua-style); prefer get_window_state for one HWND. RECOVERY: If the UI tree is exceptionally deep, increase 'max_depth' or target a specific window first using 'automation_windows'. If capture is slow, decrease 'max_depth' or disable 'use_ocr'. ## Return Format {"status": "success" | "error", "message": str, "data": {"element_count": int, ...}, "recovery_tip": str | null} ## Examples - get_desktop_state(request={"max_depth": 5}) -> {"status": "success", "message": "Desktop state capture completed: 120 elements found", ...} - get_desktop_state(request={"capture_mode": "ax", "use_ocr": False}) -> {"status": "success", ...}| Parameter | Type | Description |
|---|---|---|
| request * | any |
get_element_infoGet detailed information about a UI element.| Parameter | Type | Description |
|---|---|---|
| control_id * | string | The control ID of the element |
| window_handle * | integer | The handle of the parent window |
get_element_rectGet the rectangle of a UI element.| Parameter | Type | Description |
|---|---|---|
| control_id * | string | The control ID of the element |
| window_handle * | integer | The handle of the parent window |
get_element_textGet the text of a UI element.| Parameter | Type | Description |
|---|---|---|
| control_id * | string | The control ID of the element |
| window_handle * | integer | The handle of the parent window |
get_helpGet comprehensive help and documentation for all available tools.| Parameter | Type | Description |
|---|---|---|
| category | string | Filter by tool category (system, windows, elements, mouse, input, visual, face-recognition, desktop_state) |
| tool_name | string | Get detailed help for a specific tool |
get_mouse_positionGet the current mouse cursor position.get_process_listGet a list of running processes.get_system_clipboardGet current clipboard content.get_text_under_cursorGet text at the current cursor position using OCR.| Parameter | Type | Description |
|---|---|---|
| region | object | Optional dict with 'width' and 'height' to define a region around the cursor |
get_ui_treeGet a hierarchical representation of the UI tree.| Parameter | Type | Description |
|---|---|---|
| app_param | any | Optional Application instance to get UI tree from |
| max_depth | integer | Maximum depth to traverse the UI tree (default: 3) |
get_window_rectGet the rectangle of a window.| Parameter | Type | Description |
|---|---|---|
| handle * | integer | The window handle |
get_window_stateCapture UI state for one window (Cua Driver-shaped loop). WHAT IT DOES: Returns a snapshot_id, element_index-addressable elements, and optional set-of-mark screenshot for a single HWND. Use before automation_elements(click, snapshot_id=..., element_index=...). capture_mode: - ax: accessibility tree only (no screen grab) - som: tree + annotated screenshot (default) - vision: window image only (no element_index clicks) WHEN TO USE: - Agent drives one app (Excel, Notepad) while the user keeps another app (Cursor) focused. - Prefer this over get_desktop_state for targeted loops. See docs/CUA_PARITY.md and windows_computer_use_mcp_DISPATCH for background vs foreground dispatch. ## Return Format {"status": "success" | "error", "message": str, "data": {"snapshot_id": str, "elements": [...]}, "recovery_tip": str | null} ## Examples - get_window_state(request={"window_handle": 123456, "capture_mode": "som"}) -> {"status": "success", "data": {"snapshot_id": "abc123", ...}} - get_window_state(request={"window_handle": 123456, "capture_mode": "ax"}) -> {"status": "success", ...}| Parameter | Type | Description |
|---|---|---|
| request * | any |
get_window_titleGet the title of a window.| Parameter | Type | Description |
|---|---|---|
| handle * | integer | The window handle |
global_keyloggerSession-wide keyboard event capture (Windows low-level hook via pynput). WHAT IT DOES: Records key press (and optionally key release) events into a bounded in-memory ring buffer. Use 'read' to retrieve the most recent events without stopping the listener. WHEN TO USE: - Debugging shortcut or focus issues during UI automation. - Auditing keystrokes in a controlled, authorized environment only. SECURITY: - Disabled unless the server is started with windows_computer_use_mcp_ENABLE_KEYLOGGER=1. - Starting capture requires the same HITL approval window as other input tools (unless windows_computer_use_mcp_BYPASS_HITL is set). - Do not use for spying; comply with law and policy. OPERATIONS: - 'start' - begin listening (optional max_buffer, include_release). - 'stop' - stop listener; buffer remains until cleared or new start. - 'status' - running flag, buffer fill, limits. - 'read' - return most recent events (limit, flush removes only those events from buffer). - 'clear' - empty buffer without stopping the listener. RETURNS: ToolResult with status, message, and data (events list, counts, etc.). ## Return Format {"status": "success" | "error", "message": str, "data": {"events": [...], ...}, "recovery_tip": str | null} ## Examples - global_keylogger(request={"operation": "status"}) -> {"status": "success", "data": {"running": False, ...}} - global_keylogger(request={"operation": "start"}) -> {"status": "success", ...} (requires HITL approval + ENABLE_KEYLOGGER=1)| Parameter | Type | Description |
|---|---|---|
| request * | any |
health_checkCheck if the PyWinAuto MCP server is running and operational.highlight_elementHighlight a UI element with a colored rectangle.| Parameter | Type | Description |
|---|---|---|
| color | string | Highlight color (name or hex code, e.g., "red" or "#FF0000") |
| control_id * | string | Control ID of the element to highlight |
| duration | number | Duration to show the highlight in seconds (0 for just save/return) |
| output_path | string | Optional path to save the highlighted image |
| thickness | integer | Thickness of the highlight border in pixels |
| window_handle * | integer | Handle of the window containing the element |
hover_elementHover the mouse over a UI element.| Parameter | Type | Description |
|---|---|---|
| control_id | string | The control ID of the element to hover over (optional if x and y are provided) |
| duration | number | Duration of the hover in seconds |
| window_handle * | integer | The handle of the parent window |
| x | integer | X coordinate relative to the window (optional if control_id is provided) |
| y | integer | Y coordinate relative to the window (optional if control_id is provided) |
hover_mouseMove mouse to coordinates and hover for specified duration.| Parameter | Type | Description |
|---|---|---|
| duration | number | How long to hover in seconds (default: 0.5) |
| x * | integer | X coordinate to hover at |
| y * | integer | Y coordinate to hover at |
is_element_enabledCheck if a UI element is enabled.| Parameter | Type | Description |
|---|---|---|
| control_id * | string | The control ID of the element |
| window_handle * | integer | The handle of the parent window |
is_element_visibleCheck if a UI element is visible.| Parameter | Type | Description |
|---|---|---|
| control_id * | string | The control ID of the element |
| window_handle * | integer | The handle of the parent window |
list_known_facesList all known faces in the system.list_windowsList all visible windows on the desktop.maximize_windowMaximize a window.| Parameter | Type | Description |
|---|---|---|
| handle * | integer | The window handle to maximize |
minimize_windowMinimize a window.| Parameter | Type | Description |
|---|---|---|
| handle * | integer | The window handle to minimize |
mouse_hoverHover over an element.| Parameter | Type | Description |
|---|---|---|
| duration | number | Time in seconds to hover (default: 0.5) |
| element * | any | Element info dict with rect/position |
mouse_move_relativeMove mouse relative to current position.| Parameter | Type | Description |
|---|---|---|
| x * | integer | Pixels to move horizontally (positive = right, negative = left) |
| y * | integer | Pixels to move vertically (positive = down, negative = up) |
mouse_move_to_elementMove mouse to a UI element.| Parameter | Type | Description |
|---|---|---|
| element * | any | Element info dict with rect/position |
| x | integer | Optional x offset from element's center |
| y | integer | Optional y offset from element's center |
mouse_scrollScroll the mouse wheel.| Parameter | Type | Description |
|---|---|---|
| amount * | integer | Number of 'clicks' to scroll (positive = up, negative = down) |
| x | integer | Optional X coordinate to move to before scrolling |
| y | integer | Optional Y coordinate to move to before scrolling |
move_mouseMove mouse to specific coordinates.| Parameter | Type | Description |
|---|---|---|
| x * | integer | X coordinate to move to |
| y * | integer | Y coordinate to move to |
press_hotkeyPress a combination of keys (hotkey/shortcut).| Parameter | Type | Description |
|---|---|---|
| interval | number | Delay between repeated presses in seconds |
| keys * | array | List of keys to press simultaneously (e.g., ['ctrl', 'c']) |
| pause | number | Pause after pressing in seconds |
| presses | integer | Number of times to press the hotkey |
press_keyPress a key or combination of keys.| Parameter | Type | Description |
|---|---|---|
| interval | number | Delay between repeated presses in seconds |
| keys * | any | The key or list of keys to press (e.g., 'a', 'ctrl+c', ['ctrl', 'c']) |
| pause | number | Pause after pressing in seconds |
| presses | integer | Number of times to press the key(s) |
recognize_faceRecognize faces in an image.| Parameter | Type | Description |
|---|---|---|
| image_path * | string | Path to the image file |
restore_windowRestore a window to its normal state.| Parameter | Type | Description |
|---|---|---|
| handle * | integer | The window handle to restore |
right_clickRight-click on an element or at specific coordinates.| Parameter | Type | Description |
|---|---|---|
| element | any | Optional element info dict to click on |
| x | integer | X coordinate (if element not provided) |
| y | integer | Y coordinate (if element not provided) |
right_click_elementRight-click on a UI element.| Parameter | Type | Description |
|---|---|---|
| control_id | string | The control ID of the element to click (optional if x and y are provided) |
| window_handle * | integer | The handle of the parent window |
| x | integer | X coordinate relative to the window (optional if control_id is provided) |
| y | integer | Y coordinate relative to the window (optional if control_id is provided) |
scroll_mouseScroll mouse wheel at current or specified position.| Parameter | Type | Description |
|---|---|---|
| amount * | integer | Scroll amount (positive = up, negative = down) |
| x | integer | Optional X coordinate to scroll at |
| y | integer | Optional Y coordinate to scroll at |
send_keysSend special key combinations.| Parameter | Type | Description |
|---|---|---|
| keys * | string | Key combination (e.g., "ctrl+c", "alt+tab", "enter") |
set_element_textSet the text of a UI element.| Parameter | Type | Description |
|---|---|---|
| control_id * | string | The control ID of the element |
| text * | string | The text to set |
| window_handle * | integer | The handle of the parent window |
set_system_clipboardSet clipboard content.| Parameter | Type | Description |
|---|---|---|
| content * | string | Text content to copy to clipboard |
set_window_foregroundBrings a window to the foreground and activates it.| Parameter | Type | Description |
|---|---|---|
| handle * | integer | The window handle |
set_window_positionSet the position and size of a window.| Parameter | Type | Description |
|---|---|---|
| handle * | integer | The window handle |
| height * | integer | The height of the window |
| width * | integer | The width of the window |
| x * | integer | The x-coordinate of the top-left corner |
| y * | integer | The y-coordinate of the top-left corner |
take_screenshotTake a screenshot of the entire screen or a specific window.| Parameter | Type | Description |
|---|---|---|
| format | string | Image format ("png" or "jpg") |
| region | array | Optional tuple (left, top, right, bottom) defining the region to capture |
| return_base64 | boolean | If True, return the image as a base64-encoded string |
| window_handle | integer | Optional handle of the window to capture (None for entire screen) |
type_textType text at current cursor position.| Parameter | Type | Description |
|---|---|---|
| text * | string | Text to type |
verify_textVerify that an element contains the expected text.| Parameter | Type | Description |
|---|---|---|
| app_param | any | Optional Application instance to use for finding the element |
| exact_match | boolean | If True, text must match exactly (default: True) |
| expected_text * | string | Text to verify |
| selector * | any | Element selector (title, class_name, or dict of properties) |
| timeout | number | Maximum time to wait for element (default: 5 seconds) |
waitPause execution for specified seconds.| Parameter | Type | Description |
|---|---|---|
| seconds * | number | Number of seconds to wait |
wait_for_elementWait for a UI element to appear.| Parameter | Type | Description |
|---|---|---|
| app_param | any | Optional Application instance to use for finding the element |
| selector * | any | Element selector (title, class_name, or dict of properties) |
| timeout | number | Maximum time to wait in seconds (default: 10) |
wait_for_windowWait for a window with the specified title to become active.| Parameter | Type | Description |
|---|---|---|
| exact_match | boolean | Whether to match the window title exactly (default: True) |
| timeout | number | Maximum time to wait in seconds (default: 10) |
| title * | string | Window title or partial title to wait for |
Security checks
- ✓README presentThe repository's README runs to about 1.7K words.
- ✓License declaredThe repository declares the MIT license.
- !Scoped permissionsDoesn't declare a permission scope. Assume it can do anything its process can.
3 checks have not been run yet.
Releases
README
The repository's README runs to about 1.7K words. The original in the repository is authoritative.
Read full README