Expose PyAutoGUI through MCP.
Project description
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_screenshot_encoded |
format (png/jpeg), quality (1-95, JPEG only), region |
MCP image content (PNG/JPEG 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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyautogui_mcp-2026.1.101837.tar.gz.
File metadata
- Download URL: pyautogui_mcp-2026.1.101837.tar.gz
- Upload date:
- Size: 8.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1525e29b29308cf6f43f6cd9bfe18ce910b5124ff0d89db50745864a62962dd2
|
|
| MD5 |
418555e3e3085626f7dc5cca7b32998c
|
|
| BLAKE2b-256 |
f6bf30c29d0510fa8eedc2b9d802809a6fe706bddfba76d81229aa37425badc0
|
File details
Details for the file pyautogui_mcp-2026.1.101837-py3-none-any.whl.
File metadata
- Download URL: pyautogui_mcp-2026.1.101837-py3-none-any.whl
- Upload date:
- Size: 9.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bc1b8481058396923c6d1c2caa99fc95f1664e5f57869e179ec2196b4b4a4997
|
|
| MD5 |
8fa6476dac21184bcde4e2ab9c7c7c23
|
|
| BLAKE2b-256 |
02a5a83e3c38dfd6ba777732572dca55c894b2cd67debdc54ed52bc07f0a652c
|