Skip to main content

PyAutoGUI-MCP exposes MCP tools dynamically from the PyAutoGUI API. It does not manually reimplement or wrap each function: it auto-registers the available API.

Install with pip

pip install pyautogui-mcp

Run the server:

pyautogui-mcp --transport stdio
pyautogui-mcp --transport http --host 127.0.0.1 --port 8000

MCP client config example:

{
  "mcpServers": {
    "pyautogui-mcp": {
      "command": "pyautogui-mcp",
      "args": ["--transport", "stdio"]
    }
  }
}

Run with uv

Dependencies are declared in pyproject.toml, so uv can resolve and run directly:

{
  "mcpServers": {
    "pyautogui-mcp": {
      "command": "uv",
      "args": [
        "--directory",
        "/full/path/to/pyautogui-mcp",
        "run",
        "python",
        "-m",
        "pyautogui_mcp"
      ]
    }
  }
}

You can also launch manually:

uv run python -m pyautogui_mcp --transport stdio
uv run python -m pyautogui_mcp --transport http --host 127.0.0.1 --port 8000

Use in your own project

Import only what you need and run it under your own server lifecycle:

from pyautogui_mcp import mcp, register_pyautogui_api

register_pyautogui_api(prefix="pyautogui_")
mcp.run()  # or mcp.run(transport="http", host="127.0.0.1", port=8000)

Other exports:

from pyautogui_mcp import pyautogui_diagnose, pyautogui_tools

Desktop control notes

  • The server runs actions on the machine where it is launched (current desktop/display).
  • PyAutoGUI requires a real GUI session; headless environments will fail.
  • Safety: moving the mouse to a corner triggers the PyAutoGUI failsafe.
  • Optional pause between actions via PYAUTOGUI_PAUSE=0.1.

Tool examples

Tool names are exposed with the default pyautogui_ prefix (configurable with --prefix).

Tool Inputs (common) Output
pyautogui_screenshot imageFilename (optional), region (optional [left, top, width, height]) MCP image content (PNG bytes)
pyautogui_position none cursor coordinates { "x": int, "y": int }
pyautogui_click x, y, clicks, button, interval, duration null (mouse click performed)
pyautogui_doubleClick x, y, button, interval, duration null (double-click performed)
pyautogui_rightClick x, y, interval, duration null (right-click performed)
pyautogui_moveTo x, y, duration null (mouse moved)
pyautogui_moveRel xOffset, yOffset, duration null (mouse moved relative)
pyautogui_dragTo x, y, duration, button null (drag performed)
pyautogui_dragRel xOffset, yOffset, duration, button null (drag performed)
pyautogui_write message, interval null (text typed)
pyautogui_typewrite message, interval null (text typed)
pyautogui_press keys, presses, interval null (key press performed)
pyautogui_hotkey keys, interval null (hotkey chord performed)
pyautogui_scroll clicks, x, y null (scroll performed)
pyautogui_tools none tool list { note, tools:[{name, description}] }
pyautogui_diagnose none { python, platform, deps } diagnostic info

Use pyautogui_tools to list the exact tool set for your environment and PyAutoGUI version.

Metadata

Release files for pyautogui-mcp 2026.1.101808

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyautogui-mcp 2026.1.101808
File Size Uploaded
pyautogui_mcp-2026.1.101808.tar.gz 8.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyautogui-mcp 2026.1.101808
File Interpreter ABI Platform
pyautogui_mcp-2026.1.101808-py3-none-any.whl Python 3 none any Details

Total release size: 16.6 kB

Release files / pyautogui_mcp-2026.1.101808.tar.gz

Download URL pyautogui_mcp-2026.1.101808.tar.gz
Size 8.0 kB
Tags Source
SHA-256 checksum
How to use checksums
5d1d5281dc661d8b046c51861c8e2950b8529c55adcd9e83a56010ed00070966
BLAKE2b-256 checksum
How to use checksums
955344d7c7cb0c6399e4ce0dafc75ac8a4c9bcb5b9da6855b7d0d19944fd1c34
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.14

Release files / pyautogui_mcp-2026.1.101808-py3-none-any.whl

Download URL pyautogui_mcp-2026.1.101808-py3-none-any.whl
Size 8.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6a0ddc1fa2add5c248879c44297c4a7efe3151e2d48c9fef6ae393fb943ce1b4
BLAKE2b-256 checksum
How to use checksums
eff3b5c0dd838d054adada5698e11772718af3c8f626a540fa64ebf866c8d6c5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.14
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page