windows-computer-use-mcp 0.3.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (21) hide show
  1. windows_computer_use_mcp-0.3.0/LICENSE +21 -0
  2. windows_computer_use_mcp-0.3.0/PKG-INFO +160 -0
  3. windows_computer_use_mcp-0.3.0/README.md +127 -0
  4. windows_computer_use_mcp-0.3.0/pyproject.toml +57 -0
  5. windows_computer_use_mcp-0.3.0/setup.cfg +4 -0
  6. windows_computer_use_mcp-0.3.0/src/agy_computer_use/__init__.py +3 -0
  7. windows_computer_use_mcp-0.3.0/src/agy_computer_use/capture.py +350 -0
  8. windows_computer_use_mcp-0.3.0/src/agy_computer_use/cli.py +90 -0
  9. windows_computer_use_mcp-0.3.0/src/agy_computer_use/input_ctrl.py +885 -0
  10. windows_computer_use_mcp-0.3.0/src/agy_computer_use/isolated_desktop.py +236 -0
  11. windows_computer_use_mcp-0.3.0/src/agy_computer_use/server.py +499 -0
  12. windows_computer_use_mcp-0.3.0/src/agy_computer_use/uia_forms.py +773 -0
  13. windows_computer_use_mcp-0.3.0/src/agy_computer_use/vdisplay.py +267 -0
  14. windows_computer_use_mcp-0.3.0/src/agy_computer_use/win32_core.py +700 -0
  15. windows_computer_use_mcp-0.3.0/src/windows_computer_use_mcp.egg-info/PKG-INFO +160 -0
  16. windows_computer_use_mcp-0.3.0/src/windows_computer_use_mcp.egg-info/SOURCES.txt +19 -0
  17. windows_computer_use_mcp-0.3.0/src/windows_computer_use_mcp.egg-info/dependency_links.txt +1 -0
  18. windows_computer_use_mcp-0.3.0/src/windows_computer_use_mcp.egg-info/entry_points.txt +4 -0
  19. windows_computer_use_mcp-0.3.0/src/windows_computer_use_mcp.egg-info/requires.txt +9 -0
  20. windows_computer_use_mcp-0.3.0/src/windows_computer_use_mcp.egg-info/top_level.txt +1 -0
  21. windows_computer_use_mcp-0.3.0/tests/test_computer_use.py +288 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 jeanluyac-sketch
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,160 @@
1
+ Metadata-Version: 2.4
2
+ Name: windows-computer-use-mcp
3
+ Version: 0.3.0
4
+ Summary: Zero-disturbance Windows computer-use MCP server: virtual displays, hidden isolated desktops, occlusion-proof window capture, background input and UI Automation form filling. Works with Claude, Antigravity, Cursor and any MCP client.
5
+ Author: jeanluyac-sketch
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/jeanluyac-sketch/antigravity-computer-use
8
+ Project-URL: Issues, https://github.com/jeanluyac-sketch/antigravity-computer-use/issues
9
+ Project-URL: Changelog, https://github.com/jeanluyac-sketch/antigravity-computer-use/blob/main/CHANGELOG.md
10
+ Keywords: mcp,model-context-protocol,computer-use,windows,automation,ui-automation,agents,claude
11
+ Classifier: Development Status :: 4 - Beta
12
+ Classifier: Environment :: Win32 (MS Windows)
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Operating System :: Microsoft :: Windows
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Classifier: Topic :: Desktop Environment
20
+ Classifier: Topic :: Software Development :: Testing
21
+ Requires-Python: >=3.11
22
+ Description-Content-Type: text/markdown
23
+ License-File: LICENSE
24
+ Requires-Dist: mcp>=1.2.0
25
+ Requires-Dist: pillow>=10.0.0
26
+ Requires-Dist: mss>=9.0.0
27
+ Requires-Dist: comtypes>=1.4.0
28
+ Requires-Dist: pywin32>=306
29
+ Provides-Extra: dev
30
+ Requires-Dist: ruff>=0.6; extra == "dev"
31
+ Requires-Dist: pytest>=8; extra == "dev"
32
+ Dynamic: license-file
33
+
34
+ # Windows Computer Use MCP
35
+
36
+ [![CI](https://github.com/jeanluyac-sketch/antigravity-computer-use/actions/workflows/ci.yml/badge.svg)](https://github.com/jeanluyac-sketch/antigravity-computer-use/actions/workflows/ci.yml)
37
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
38
+
39
+ **Zero-disturbance computer use for Windows, as an MCP server.** Let an AI agent drive native Windows apps (Win32, WPF, WinUI, Electron, Java, Qt) *without* stealing your mouse, keyboard or focus while you keep working.
40
+
41
+ Works with any [Model Context Protocol](https://modelcontextprotocol.io) client: Claude Desktop, Claude Code, Google Antigravity, Cursor, VS Code and others.
42
+
43
+ > Português: veja [docs/README.pt-BR.md](docs/README.pt-BR.md).
44
+
45
+ <!-- mcp-name: io.github.jeanluyac-sketch/windows-computer-use-mcp -->
46
+
47
+ ## Why
48
+
49
+ Most computer-use tools move the real cursor and type into whatever window has focus. If you touch the mouse at the wrong moment, the agent types into your browser. This server is built around the opposite default:
50
+
51
+ - **Background first.** Clicks and typing are posted to the target window (`WM_*` messages, UI Automation patterns) without taking OS focus.
52
+ - **User-Activity Guard.** Before any foreground input it checks `GetLastInputInfo`; if you moved the mouse or typed recently it aborts with `reason: "user_active"`.
53
+ - **Strict focus lock.** During `SendInput` the target is re-verified every 16 characters; if focus moves it aborts with `reason: "focus_lost"` and restores your cursor and window.
54
+ - **No blind global typing.** `type_text` and `press_keys` require a target window unless `allow_global=True`.
55
+ - **Somewhere else to work.** Apps can run on a virtual monitor (Virtual Display Driver) or on a hidden isolated desktop (`CreateDesktopW`, no admin rights).
56
+ - **Occlusion-proof capture.** `PrintWindow` + `PW_RENDERFULLCONTENT` captures a window even when it is covered or off-screen, with optional grid and Set-of-Mark badges for UI elements.
57
+
58
+ ## Tools
59
+
60
+ | Tool | What it does |
61
+ |---|---|
62
+ | `display_status` | Physical/virtual monitors, VDD status, recommended agent monitor |
63
+ | `user_idle_status` | Milliseconds since last user input and the foreground window |
64
+ | `list_windows` | Windows with HWND, title, process, monitor and rects |
65
+ | `move_window_to_display`, `launch_app_on_display` | Put an app on a given (virtual) monitor |
66
+ | `launch_on_isolated_desktop`, `list_isolated_windows` | Run apps on a hidden desktop |
67
+ | `capture_window`, `capture_monitor` | Screenshots, with optional grid / element marks |
68
+ | `inspect_ui` | UI Automation tree of a window |
69
+ | `click`, `click_element`, `drag`, `scroll` | Pointer actions (background by default) |
70
+ | `type_text`, `press_keys` | Keyboard actions with guards |
71
+ | `fill_form` | Batch-fill Edit/CheckBox/Radio/ComboBox fields and submit |
72
+
73
+ ## Install
74
+
75
+ Requires Windows 10/11 and Python 3.11+. The easiest way is [uv](https://docs.astral.sh/uv/).
76
+
77
+ Run it from PyPI:
78
+
79
+ ```powershell
80
+ uvx windows-computer-use-mcp
81
+ ```
82
+
83
+ Or straight from GitHub (latest `main`):
84
+
85
+ ```powershell
86
+ uvx --from git+https://github.com/jeanluyac-sketch/antigravity-computer-use windows-computer-use-mcp
87
+ ```
88
+
89
+ Or clone for development:
90
+
91
+ ```powershell
92
+ git clone https://github.com/jeanluyac-sketch/antigravity-computer-use
93
+ cd antigravity-computer-use
94
+ uv venv
95
+ uv pip install -e ".[dev]"
96
+ ```
97
+
98
+ ### Claude Desktop
99
+
100
+ Add to `%APPDATA%\Claude\claude_desktop_config.json`:
101
+
102
+ ```json
103
+ {
104
+ "mcpServers": {
105
+ "windows-computer-use": {
106
+ "command": "uvx",
107
+ "args": ["windows-computer-use-mcp"]
108
+ }
109
+ }
110
+ }
111
+ ```
112
+
113
+ ### Claude Code
114
+
115
+ ```powershell
116
+ claude mcp add windows-computer-use -- uvx windows-computer-use-mcp
117
+ ```
118
+
119
+ ### Google Antigravity
120
+
121
+ Copy `plugin-template\` to `%USERPROFILE%\.gemini\config\plugins\computer-use\` and set the paths in `mcp_config.json` to your clone. The plugin also ships a skill (`skills/computer-use/SKILL.md`) that teaches the agent the safe workflow.
122
+
123
+ ### Cursor / other clients
124
+
125
+ Use the same `command` + `args` as the Claude Desktop example in your client's MCP config.
126
+
127
+ ## Optional extras
128
+
129
+ - **Virtual Display Driver:** `scripts\install-vdd-admin.cmd` (asks for UAC) installs a virtual monitor; `scripts\manage-vdd.ps1` manages it. The agent then works on a screen you are not looking at.
130
+ - **Browser automation without focus:** `scripts\start-brave-cdp.cmd` opens Brave on a dedicated profile with `--remote-debugging-port=9222`, for use with `chrome-devtools-mcp`.
131
+
132
+ ## Recommended agent workflow
133
+
134
+ 1. `display_status` and `list_windows` (or `user_idle_status` before any foreground input).
135
+ 2. Isolate the app: `launch_app_on_display`, `move_window_to_display` or `launch_on_isolated_desktop`.
136
+ 3. Observe: `inspect_ui(hwnd=..., with_screenshot=true)` or `capture_window(hwnd=..., include_grid=true)`.
137
+ 4. Act: `fill_form`, `click_element`, `type_text(..., mode="background")`, `click(..., mode="message")`.
138
+ 5. Only if an app ignores background messages, use `mode="paste"` / `mode="sendinput"` with `wait_for_idle_seconds` and `restore_focus=True`.
139
+
140
+ ## Tests
141
+
142
+ The end-to-end suite opens a real WinForms dialog, captures it, fills it and checks the guards. Run it on a Windows machine with an interactive desktop:
143
+
144
+ ```powershell
145
+ python tests\test_computer_use.py
146
+ ```
147
+
148
+ CI runs lint, a build and an import/tool-registration smoke test on `windows-latest`.
149
+
150
+ ## Security
151
+
152
+ This server can click and type on your computer. Only connect it to clients and prompts you trust, and read [SECURITY.md](SECURITY.md) to report a vulnerability privately.
153
+
154
+ ## Contributing
155
+
156
+ Contributions are welcome, including docs and translations. Start with [CONTRIBUTING.md](CONTRIBUTING.md) and issues labelled `good first issue`.
157
+
158
+ ## License
159
+
160
+ [MIT](LICENSE)
@@ -0,0 +1,127 @@
1
+ # Windows Computer Use MCP
2
+
3
+ [![CI](https://github.com/jeanluyac-sketch/antigravity-computer-use/actions/workflows/ci.yml/badge.svg)](https://github.com/jeanluyac-sketch/antigravity-computer-use/actions/workflows/ci.yml)
4
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
5
+
6
+ **Zero-disturbance computer use for Windows, as an MCP server.** Let an AI agent drive native Windows apps (Win32, WPF, WinUI, Electron, Java, Qt) *without* stealing your mouse, keyboard or focus while you keep working.
7
+
8
+ Works with any [Model Context Protocol](https://modelcontextprotocol.io) client: Claude Desktop, Claude Code, Google Antigravity, Cursor, VS Code and others.
9
+
10
+ > Português: veja [docs/README.pt-BR.md](docs/README.pt-BR.md).
11
+
12
+ <!-- mcp-name: io.github.jeanluyac-sketch/windows-computer-use-mcp -->
13
+
14
+ ## Why
15
+
16
+ Most computer-use tools move the real cursor and type into whatever window has focus. If you touch the mouse at the wrong moment, the agent types into your browser. This server is built around the opposite default:
17
+
18
+ - **Background first.** Clicks and typing are posted to the target window (`WM_*` messages, UI Automation patterns) without taking OS focus.
19
+ - **User-Activity Guard.** Before any foreground input it checks `GetLastInputInfo`; if you moved the mouse or typed recently it aborts with `reason: "user_active"`.
20
+ - **Strict focus lock.** During `SendInput` the target is re-verified every 16 characters; if focus moves it aborts with `reason: "focus_lost"` and restores your cursor and window.
21
+ - **No blind global typing.** `type_text` and `press_keys` require a target window unless `allow_global=True`.
22
+ - **Somewhere else to work.** Apps can run on a virtual monitor (Virtual Display Driver) or on a hidden isolated desktop (`CreateDesktopW`, no admin rights).
23
+ - **Occlusion-proof capture.** `PrintWindow` + `PW_RENDERFULLCONTENT` captures a window even when it is covered or off-screen, with optional grid and Set-of-Mark badges for UI elements.
24
+
25
+ ## Tools
26
+
27
+ | Tool | What it does |
28
+ |---|---|
29
+ | `display_status` | Physical/virtual monitors, VDD status, recommended agent monitor |
30
+ | `user_idle_status` | Milliseconds since last user input and the foreground window |
31
+ | `list_windows` | Windows with HWND, title, process, monitor and rects |
32
+ | `move_window_to_display`, `launch_app_on_display` | Put an app on a given (virtual) monitor |
33
+ | `launch_on_isolated_desktop`, `list_isolated_windows` | Run apps on a hidden desktop |
34
+ | `capture_window`, `capture_monitor` | Screenshots, with optional grid / element marks |
35
+ | `inspect_ui` | UI Automation tree of a window |
36
+ | `click`, `click_element`, `drag`, `scroll` | Pointer actions (background by default) |
37
+ | `type_text`, `press_keys` | Keyboard actions with guards |
38
+ | `fill_form` | Batch-fill Edit/CheckBox/Radio/ComboBox fields and submit |
39
+
40
+ ## Install
41
+
42
+ Requires Windows 10/11 and Python 3.11+. The easiest way is [uv](https://docs.astral.sh/uv/).
43
+
44
+ Run it from PyPI:
45
+
46
+ ```powershell
47
+ uvx windows-computer-use-mcp
48
+ ```
49
+
50
+ Or straight from GitHub (latest `main`):
51
+
52
+ ```powershell
53
+ uvx --from git+https://github.com/jeanluyac-sketch/antigravity-computer-use windows-computer-use-mcp
54
+ ```
55
+
56
+ Or clone for development:
57
+
58
+ ```powershell
59
+ git clone https://github.com/jeanluyac-sketch/antigravity-computer-use
60
+ cd antigravity-computer-use
61
+ uv venv
62
+ uv pip install -e ".[dev]"
63
+ ```
64
+
65
+ ### Claude Desktop
66
+
67
+ Add to `%APPDATA%\Claude\claude_desktop_config.json`:
68
+
69
+ ```json
70
+ {
71
+ "mcpServers": {
72
+ "windows-computer-use": {
73
+ "command": "uvx",
74
+ "args": ["windows-computer-use-mcp"]
75
+ }
76
+ }
77
+ }
78
+ ```
79
+
80
+ ### Claude Code
81
+
82
+ ```powershell
83
+ claude mcp add windows-computer-use -- uvx windows-computer-use-mcp
84
+ ```
85
+
86
+ ### Google Antigravity
87
+
88
+ Copy `plugin-template\` to `%USERPROFILE%\.gemini\config\plugins\computer-use\` and set the paths in `mcp_config.json` to your clone. The plugin also ships a skill (`skills/computer-use/SKILL.md`) that teaches the agent the safe workflow.
89
+
90
+ ### Cursor / other clients
91
+
92
+ Use the same `command` + `args` as the Claude Desktop example in your client's MCP config.
93
+
94
+ ## Optional extras
95
+
96
+ - **Virtual Display Driver:** `scripts\install-vdd-admin.cmd` (asks for UAC) installs a virtual monitor; `scripts\manage-vdd.ps1` manages it. The agent then works on a screen you are not looking at.
97
+ - **Browser automation without focus:** `scripts\start-brave-cdp.cmd` opens Brave on a dedicated profile with `--remote-debugging-port=9222`, for use with `chrome-devtools-mcp`.
98
+
99
+ ## Recommended agent workflow
100
+
101
+ 1. `display_status` and `list_windows` (or `user_idle_status` before any foreground input).
102
+ 2. Isolate the app: `launch_app_on_display`, `move_window_to_display` or `launch_on_isolated_desktop`.
103
+ 3. Observe: `inspect_ui(hwnd=..., with_screenshot=true)` or `capture_window(hwnd=..., include_grid=true)`.
104
+ 4. Act: `fill_form`, `click_element`, `type_text(..., mode="background")`, `click(..., mode="message")`.
105
+ 5. Only if an app ignores background messages, use `mode="paste"` / `mode="sendinput"` with `wait_for_idle_seconds` and `restore_focus=True`.
106
+
107
+ ## Tests
108
+
109
+ The end-to-end suite opens a real WinForms dialog, captures it, fills it and checks the guards. Run it on a Windows machine with an interactive desktop:
110
+
111
+ ```powershell
112
+ python tests\test_computer_use.py
113
+ ```
114
+
115
+ CI runs lint, a build and an import/tool-registration smoke test on `windows-latest`.
116
+
117
+ ## Security
118
+
119
+ This server can click and type on your computer. Only connect it to clients and prompts you trust, and read [SECURITY.md](SECURITY.md) to report a vulnerability privately.
120
+
121
+ ## Contributing
122
+
123
+ Contributions are welcome, including docs and translations. Start with [CONTRIBUTING.md](CONTRIBUTING.md) and issues labelled `good first issue`.
124
+
125
+ ## License
126
+
127
+ [MIT](LICENSE)
@@ -0,0 +1,57 @@
1
+ [build-system]
2
+ requires = ["setuptools>=77"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "windows-computer-use-mcp"
7
+ version = "0.3.0"
8
+ description = "Zero-disturbance Windows computer-use MCP server: virtual displays, hidden isolated desktops, occlusion-proof window capture, background input and UI Automation form filling. Works with Claude, Antigravity, Cursor and any MCP client."
9
+ readme = "README.md"
10
+ license = "MIT"
11
+ license-files = ["LICENSE"]
12
+ authors = [{ name = "jeanluyac-sketch" }]
13
+ requires-python = ">=3.11"
14
+ keywords = ["mcp", "model-context-protocol", "computer-use", "windows", "automation", "ui-automation", "agents", "claude"]
15
+ classifiers = [
16
+ "Development Status :: 4 - Beta",
17
+ "Environment :: Win32 (MS Windows)",
18
+ "Intended Audience :: Developers",
19
+ "Operating System :: Microsoft :: Windows",
20
+ "Programming Language :: Python :: 3",
21
+ "Programming Language :: Python :: 3.11",
22
+ "Programming Language :: Python :: 3.12",
23
+ "Programming Language :: Python :: 3.13",
24
+ "Topic :: Desktop Environment",
25
+ "Topic :: Software Development :: Testing",
26
+ ]
27
+ dependencies = [
28
+ "mcp>=1.2.0",
29
+ "pillow>=10.0.0",
30
+ "mss>=9.0.0",
31
+ "comtypes>=1.4.0",
32
+ "pywin32>=306",
33
+ ]
34
+
35
+ [project.optional-dependencies]
36
+ dev = ["ruff>=0.6", "pytest>=8"]
37
+
38
+ [project.urls]
39
+ Homepage = "https://github.com/jeanluyac-sketch/antigravity-computer-use"
40
+ Issues = "https://github.com/jeanluyac-sketch/antigravity-computer-use/issues"
41
+ Changelog = "https://github.com/jeanluyac-sketch/antigravity-computer-use/blob/main/CHANGELOG.md"
42
+
43
+ [project.scripts]
44
+ windows-computer-use-mcp = "agy_computer_use.server:main"
45
+ agy-computer-use-mcp = "agy_computer_use.server:main"
46
+ agy-computer-use = "agy_computer_use.cli:main"
47
+
48
+ [tool.setuptools.packages.find]
49
+ where = ["src"]
50
+
51
+ [tool.ruff]
52
+ line-length = 140
53
+ target-version = "py311"
54
+
55
+ [tool.ruff.lint]
56
+ # Start with correctness-only rules; widen gradually (good first issue).
57
+ select = ["E9", "F63", "F7", "F82"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,3 @@
1
+ """Antigravity Computer Use toolkit for Windows."""
2
+
3
+ __version__ = "0.3.0"