pywinauto-mcp
A Windows computer use agent — FastMCP server that gives AI assistants hands on the real desktop: windows, UI elements, mouse, keyboard, screenshots, OCR, shortcuts, dialogs, and outcome verification.
README
pywinauto-mcp · Windows Computer Use Agent
<p align="center"> <a href="https://github.com/sandraschi/pywinauto-mcp"><img src="https://img.shields.io/github/stars/sandraschi/pywinauto-mcp?style=flat-square" alt="Stars"></a> <a href="https://github.com/sandraschi/pywinauto-mcp/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue?style=flat-square" alt="License"></a> <a href="https://python.org"><img src="https://img.shields.io/badge/Python-3.12+-3776AB?style=flat-square&logo=python&logoColor=white" alt="Python"></a> <a href="https://github.com/PrefectHQ/fastmcp"><img src="https://img.shields.io/badge/FastMCP-3.2-7c5cfc?style=flat-square" alt="FastMCP"></a> <a href="https://github.com/casey/just"><img src="https://img.shields.io/badge/just-ready_to_go-7c5cfc?style=flat-square&logo=just&logoColor=white" alt="Just"></a> <a href="https://github.com/astral-sh/ruff"><img src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json" alt="Ruff"></a> </p>
A Windows computer use agent — FastMCP server that gives AI assistants hands on the real desktop: windows, UI elements, mouse, keyboard, screenshots, OCR, shortcuts, dialogs, and outcome verification. Not a browser sandbox; runs in your session with HITL, kill switch, and rate limits.
Pair with virtualization-mcp for Windows Sandbox / VM isolation. Read docs/SAFETY.md before production use.
📖 INSTALL.md — desktop installer,
uvsetup, MCP client config
This repo is named after Pywinauto — the Python library that drives Windows UI Automation (UIA) and Win32 controls. The MCP server wraps that (and related libraries) as structured tools for AI clients. It is an operator-visible automation assistant, not covert surveillance software.
Contents
- Quick Start
- Python stack (py- modules)
- Optional invasive features
- Documentation
- Ports
- Tech Stack
- Fleet & siblings
- License
Quick Start
git clone https://github.com/sandraschi/pywinauto-mcp
cd pywinauto-mcp
just bootstrap
just serve
MCP (stdio) — add to Cursor / Claude Desktop:
{
"mcpServers": {
"pywinauto-mcp": {
"command": "uv",
"args": ["--directory", "<PATH-TO-CLONE>", "run", "pywinauto-mcp"]
}
}
}
Optional web operator UI: .\start.ps1 → http://127.0.0.1:10788 (proxies API on 10789).
Demos: just demo — mouse dance, Notepad grid, typewriter (see examples/README.md).
Python stack (py- modules)
| Package | Role in this project |
|---|---|
| pywinauto | Core — attach to HWNDs, walk UIA/Win32 control trees, click/type/read elements (automation_windows, automation_elements). |
| pywin32 | Low-level Win32 COM/API (session, processes, DPI helpers) used alongside pywinauto. |
| pygetwindow | Window titles/rectangles for discovery and layout. |
| pyautogui | Fallback screen-level pointer/screenshot helpers where UIA is not enough. |
| pynput | Injects and optionally listens to keyboard/mouse at the session level; powers normal automation_keyboard simulation and the opt-in global_keylogger hook. |
| pyperclip | Clipboard read/write for automation_system. |
| opencv-python-headless | Screenshots, camera index probe, template match paths in automation_visual / biometrics preview. |
| pytesseract | OCR in automation_visual (needs Tesseract installed on the host). |
| face_recognition + dlib | Optional extra only (uv sync --extra face) for automation_face — not installed in the default desktop bundle. |
Other important non-py deps: FastMCP (MCP server), FastAPI + uvicorn (REST + /mcp HTTP), Pillow, numpy, httpx.
Optional invasive features (off by default)
Default install: window/element/mouse/keyboard/visual automation only. No ambient monitoring.
| Feature | Shipped in code? | Default? | Enable |
|---|---|---|---|
automation_face |
Yes — local webcam capture/match | Off — tool not registered | PYWINAUTO_MCP_ENABLE_FACE=1 + uv sync --extra face (SAFETY.md §5) |
global_keylogger |
Yes — session keyboard hook | Off — tool not registered | PYWINAUTO_MCP_ENABLE_KEYLOGGER=1 (SAFETY.md §6) |
Keylogger is not stealth spyware. It is an explicit MCP tool: disabled unless you set the env flag, requires HITL approval to start, stores events in a bounded in-memory buffer (not hidden files), and the server stops the hook on shutdown. Use only on machines you own for debugging shortcut/focus issues — not for credential harvesting.
Face recognition is not a background plan-only sketch — the tool is implemented but opt-in like the keylogger. The operator UI Biometrics page is a control panel when you enable it; it does not run face matching unless you opt in and call the tool.
Documentation
For operators
| Doc | Content |
|---|---|
| INSTALL.md | Desktop app, uv / uvx, MCP client wiring |
| docs/SAFETY.md | HITL, kill switch, opt-in face & keylogger (non-stealth) |
| docs/OPERATOR_PROTOCOL.md | Foreground focus during automation |
| docs/DESKTOP_APP.md | Tauri operator app + PyInstaller sidecar |
| docs/MEMOPS_CUA.md | Computer use agent doctrine (fleet CUA role) |
| docs/CUA_ROADMAP.md | Closed-loop assistant roadmap |
| examples/README.md | Runnable demos and paint orchestration |
For developers
| Doc | Content |
|---|---|
| docs/README.md | Documentation hub |
| docs/DOCUMENTATION_INDEX.md | Full map + stale-doc warning |
| docs/PRD.md | Product requirements |
| docs/ARCHITECTURE.md | System diagram, components, fleet role |
| docs/TOOLS.md | Portmanteau MCP tools reference |
| docs/TESTING.md | CI vs local pytest, hardware markers |
| docs/mcp-technical/README.md | MCP transport, production checklist |
| docs/DEVELOPMENT.md | Contributor quick start (archived notes in docs/development/archive/) |
| CHANGELOG.md | Release history |
Packaging & distribution
| Doc | Content |
|---|---|
| mcpb/README.md | MCPB bundle (Claude Desktop .mcpb) |
| docs/mcpb-packaging/README.md | Build guide and fleet packaging standards |
Prompts & skills
| Asset | Purpose |
|---|---|
| skills/desktop-automation-protocol/SKILL.md | Cursor agent skill |
desktop_automation_operator_protocol |
MCP prompt (src/pywinauto_mcp/prompts.py) |
Ports
| Port | Service |
|---|---|
| 10788 | Frontend — Vite operator UI (web_sota) |
| 10789 | Backend — FastAPI /api/v1/* + FastMCP HTTP /mcp |
Stdio MCP has no port (host-launched process).
Tech Stack
- MCP: Python 3.12+, FastMCP 3.2+, portmanteau tools (windows, elements, mouse, keyboard, visual, assert, dialog, shortcut, task, system)
- Input:
win32_mouse(DPI-aware), optional Win32 keyboard (CUA_MCP_KEYBOARD=win32) - Web: Vite + React operator dashboard, local LLM proxy (Ollama / LM Studio)
- Desktop: Tauri 2 operator app (optional installer)
- Quality: Ruff, Biome, pytest (environment-aware),
justrecipes
Fleet & siblings
| Tool | What it does | When to use |
|---|---|---|
| pywinauto-mcp (here) | Computer use agent — structured native UI automation via UIA element tree, screenshots, OCR | You need to inspect controls, click buttons, read text from apps with accessibility trees. Best for modern Windows apps. Shows "CUA at work" HUD during analyze_winapp crawls and global_keylogger sessions. |
| autohotkey-mcp | AHK scriptlet depot — list, run, stop, generate .ahk scripts. Best for low-level input recording/replay and apps that don't expose UIA. |
You have a depot of AHK scripts or need raw keyboard/mouse recording via AHK's built-in recorder. Shows "CUA at work" HUD while scriptlets run. |
| openmanus-mcp | OpenManus agent bridge + computer/bash tools | You need a general-purpose agent with bash/computer access inside a sandbox. |
| virtualization-mcp | Sandbox / VM isolation | You need to isolate automation in a disposable VM. |
Overlap: both pywinauto-mcp and autohotkey-mcp control Windows input. Use AHK for raw low-level recording/replay (AHK's built-in recorder + run_scriptlet). Use pywinauto when you need UIA element tree access, OCR, or structured window state capture.
Fleet standards: mcp-central-docs — patterns/PYWINAUTO_MCP_SAFETY.md, standards/MCPB_PACKAGING_STANDARDS.md.
Browser vs desktop: This server drives Win32 / UI Automation. For HTML/DOM and websites, use a Playwright browser MCP alongside this one.
License
MIT — Copyright (c) 2026 Sandra Schipal.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。