Skip to main content

RealTimeX MCP server for deterministic GUI control via PyAutoGUI

Project description

realtimex-pyautogui-server

RealTimeX's MCP server for deterministic desktop control with PyAutoGUI. This fork adapts the reference implementation with production defaults, a dedicated wait tool, and safeguards that prevent accidental keystrokes during pauses.

Features

  • Mouse movement, clicks, and drag support with automatic coordinate scaling
  • Keyboard typing and hotkeys
  • Screen size, pixel, and screenshot utilities
  • Dedicated wait(seconds) tool for precise pauses without injecting keystrokes
  • Resolution-independent coordinates: Automatically scales coordinates from reference resolution to current screen
  • Automatically releases modifier keys before typing to prevent stuck-shift issues
  • Global PyAutoGUI defaults tuned for automation (PAUSE, FAILSAFE)

Coordinate Scaling

The server automatically scales mouse coordinates from a reference resolution (default: 1920×1080) to your current screen resolution. This allows you to use consistent coordinate values across different display configurations.

How It Works

  • Define coordinates based on a reference screen (1920×1080 by default)
  • move_mouse and drag_mouse automatically scale to your actual screen size
  • Success messages show both original and scaled coordinates for debugging

Example

# On a 2560×1440 screen:
move_mouse(500, 90)  # Input: reference coordinates
# Output: "Mouse moved to coordinates (500, 90) [scaled to (666, 120)]."

Configuration

PyAutoGUI Settings

  • Set REALTIMEX_FAILSAFE to 0 or 1 (default 1) to control PyAutoGUI's failsafe corner abort.
  • Set REALTIMEX_PAUSE to a float (seconds) to override the global pause between PyAutoGUI actions (default 0.3).

Coordinate Scaling Settings

  • Set REFERENCE_SCREEN_WIDTH to customize the reference screen width (default: 1920)
  • Set REFERENCE_SCREEN_HEIGHT to customize the reference screen height (default: 1080)

Example:

export REFERENCE_SCREEN_WIDTH=2560
export REFERENCE_SCREEN_HEIGHT=1440
uvx realtimex-pyautogui-server

Usage

uvx realtimex-pyautogui-server

The server communicates over stdio and is compatible with MCP clients like Claude Desktop and the MCP Inspector.

Development

uv sync
uv run ruff check
uv run pytest

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

realtimex_pyautogui_server-0.2.0.dev5.tar.gz (225.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

realtimex_pyautogui_server-0.2.0.dev5-py3-none-any.whl (76.8 kB view details)

Uploaded Python 3

File details

Details for the file realtimex_pyautogui_server-0.2.0.dev5.tar.gz.

File metadata

File hashes

Hashes for realtimex_pyautogui_server-0.2.0.dev5.tar.gz
Algorithm Hash digest
SHA256 9cb0708428b89fd3ead32bfaf2ab19120c5b3c8ab0e818f4b7d38e9be6de597a
MD5 f30d82ebfe9b889eb696c61a10e2b8e0
BLAKE2b-256 4879b9dfb52469a33d69eceef7dbbfd52ed290aa2cfb9ef307b55bbb5a567c59

See more details on using hashes here.

File details

Details for the file realtimex_pyautogui_server-0.2.0.dev5-py3-none-any.whl.

File metadata

File hashes

Hashes for realtimex_pyautogui_server-0.2.0.dev5-py3-none-any.whl
Algorithm Hash digest
SHA256 dea809c4bd28fa529d67b76cb36d259c9a91bade4964432195d1df849fdc9456
MD5 43c22a16858210b9ef07dd8007391b1c
BLAKE2b-256 ea3a4e67af0ae76c0243650b2d7c9003b381f586c5d69be78b97f38e5bf2020d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page