Metadata-Version: 2.4
Name: pyautogui_mcp_server
Version: 0.1.2
Summary: MCP server package for running Python with pyautogui instrumentation.
Author: DIYer22
Maintainer: DIYer22
License-Expression: MIT
Project-URL: Homepage, https://github.com/on-panda/pyautogui_mcp_server
Project-URL: Repository, https://github.com/on-panda/pyautogui_mcp_server
Project-URL: Issues, https://github.com/on-panda/pyautogui_mcp_server/issues
Keywords: mcp,pyautogui,automation,server
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: mcp>=1.26.0
Requires-Dist: pyautogui>=0.9.54
Requires-Dist: Pillow>=10.0.0
Requires-Dist: starlette>=0.46.0
Requires-Dist: uvicorn>=0.30.0
Provides-Extra: dev
Requires-Dist: build>=1.2.0; extra == "dev"
Requires-Dist: pytest>=8.0.0; extra == "dev"
Requires-Dist: twine>=5.0.0; extra == "dev"
Dynamic: license-file

# MCP server for simplest GUI agent 🕹️🤖

`pyautogui_mcp_server` packages a Streamable HTTP MCP server for running Python code with `pyautogui` instrumentation.

It is designed for GUI automation workflows where plain `pyautogui` execution is not enough. The package adds MCP-friendly output handling, and richer screenshots.

## ✨ What this package adds

Compared with running raw `pyautogui` calls directly, this library adds extra effort in the following areas:

- Fresh Python execution state for every tool call.
- Captured `stdout`, `stderr`, and final expression results in one MCP response stream.
- Inline screenshot delivery as MCP image content instead of requiring manual file handling.
- Annotated mouse-operation previews that show the target point or path before the action runs.
- Screenshot normalization so captured images line up better with logical screen coordinates.

## 🛠️ Tool response example  
```
<stdout>
Cut the right rope by dragging left to right through it.
</stdout>
<pyautogui-mcp.dragTo x=860 y=430 duration=0.2 button='left' 
    time_offset="T+1.1s" pyautogui.size=(1440, 900)>
```
<img width="512" alt="cut-the-rope-by-gui-agent" src="https://yl-data.github.io/2506.onPanda/pyautogui_mcp_server_assets/image/2603.cut-the-rope.webp" />

```
</pyautogui-mcp.dragTo>
```

## 📦 Installation

```bash
pip install pyautogui_mcp_server
```

For local development:

```bash
pip install -e .[dev]
```

## 🚀 Run the MCP server

Use the module entrypoint:

```bash
python -m pyautogui_mcp_server --host 127.0.0.1 --port 9300
```

Or use the installed console script:

```bash
pyautogui-mcp-server --port 9300
```

Show CLI help:

```bash
python -m pyautogui_mcp_server --help
```

The server exposes a `run_python_with_pyautogui` MCP tool that executes Python in a fresh interpreter state with instrumented `pyautogui` behavior.

## 📄 License

MIT
