agentic-windows-mcp 0.8.8__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 (182) hide show
  1. agentic_windows_mcp-0.8.8/LICENSE.md +27 -0
  2. agentic_windows_mcp-0.8.8/PKG-INFO +337 -0
  3. agentic_windows_mcp-0.8.8/README.md +267 -0
  4. agentic_windows_mcp-0.8.8/pyproject.toml +82 -0
  5. agentic_windows_mcp-0.8.8/setup.cfg +4 -0
  6. agentic_windows_mcp-0.8.8/src/agentic_windows_mcp/__init__.py +0 -0
  7. agentic_windows_mcp-0.8.8/src/agentic_windows_mcp/__main__.py +1189 -0
  8. agentic_windows_mcp-0.8.8/src/agentic_windows_mcp/browser/__init__.py +3 -0
  9. agentic_windows_mcp-0.8.8/src/agentic_windows_mcp/browser/consent.py +336 -0
  10. agentic_windows_mcp-0.8.8/src/agentic_windows_mcp/browser/devtools_manager.py +1782 -0
  11. agentic_windows_mcp-0.8.8/src/agentic_windows_mcp/config.py +11 -0
  12. agentic_windows_mcp-0.8.8/src/agentic_windows_mcp/desktop/__init__.py +0 -0
  13. agentic_windows_mcp-0.8.8/src/agentic_windows_mcp/desktop/config.py +15 -0
  14. agentic_windows_mcp-0.8.8/src/agentic_windows_mcp/desktop/control.py +633 -0
  15. agentic_windows_mcp-0.8.8/src/agentic_windows_mcp/desktop/control_context.py +32 -0
  16. agentic_windows_mcp-0.8.8/src/agentic_windows_mcp/desktop/control_hooks.py +122 -0
  17. agentic_windows_mcp-0.8.8/src/agentic_windows_mcp/desktop/control_ledger.py +82 -0
  18. agentic_windows_mcp-0.8.8/src/agentic_windows_mcp/desktop/control_overlay.py +494 -0
  19. agentic_windows_mcp-0.8.8/src/agentic_windows_mcp/desktop/control_overlay_art.py +187 -0
  20. agentic_windows_mcp-0.8.8/src/agentic_windows_mcp/desktop/control_recovery.py +99 -0
  21. agentic_windows_mcp-0.8.8/src/agentic_windows_mcp/desktop/control_win32.py +339 -0
  22. agentic_windows_mcp-0.8.8/src/agentic_windows_mcp/desktop/control_worker.py +90 -0
  23. agentic_windows_mcp-0.8.8/src/agentic_windows_mcp/desktop/flash_overlay.py +587 -0
  24. agentic_windows_mcp-0.8.8/src/agentic_windows_mcp/desktop/overlay_bitmap.py +41 -0
  25. agentic_windows_mcp-0.8.8/src/agentic_windows_mcp/desktop/screenshot.py +375 -0
  26. agentic_windows_mcp-0.8.8/src/agentic_windows_mcp/desktop/service.py +1712 -0
  27. agentic_windows_mcp-0.8.8/src/agentic_windows_mcp/desktop/utils.py +138 -0
  28. agentic_windows_mcp-0.8.8/src/agentic_windows_mcp/desktop/views.py +103 -0
  29. agentic_windows_mcp-0.8.8/src/agentic_windows_mcp/filesystem/__init__.py +18 -0
  30. agentic_windows_mcp-0.8.8/src/agentic_windows_mcp/filesystem/service.py +333 -0
  31. agentic_windows_mcp-0.8.8/src/agentic_windows_mcp/filesystem/views.py +74 -0
  32. agentic_windows_mcp-0.8.8/src/agentic_windows_mcp/infrastructure/__init__.py +57 -0
  33. agentic_windows_mcp-0.8.8/src/agentic_windows_mcp/infrastructure/analytics.py +231 -0
  34. agentic_windows_mcp-0.8.8/src/agentic_windows_mcp/infrastructure/auth.py +89 -0
  35. agentic_windows_mcp-0.8.8/src/agentic_windows_mcp/infrastructure/config.py +263 -0
  36. agentic_windows_mcp-0.8.8/src/agentic_windows_mcp/infrastructure/eventloop.py +90 -0
  37. agentic_windows_mcp-0.8.8/src/agentic_windows_mcp/infrastructure/oauth.py +288 -0
  38. agentic_windows_mcp-0.8.8/src/agentic_windows_mcp/infrastructure/security.py +266 -0
  39. agentic_windows_mcp-0.8.8/src/agentic_windows_mcp/infrastructure/thread_affinity.py +66 -0
  40. agentic_windows_mcp-0.8.8/src/agentic_windows_mcp/notifications/__init__.py +5 -0
  41. agentic_windows_mcp-0.8.8/src/agentic_windows_mcp/notifications/service.py +57 -0
  42. agentic_windows_mcp-0.8.8/src/agentic_windows_mcp/paths.py +94 -0
  43. agentic_windows_mcp-0.8.8/src/agentic_windows_mcp/powershell/__init__.py +5 -0
  44. agentic_windows_mcp-0.8.8/src/agentic_windows_mcp/powershell/service.py +268 -0
  45. agentic_windows_mcp-0.8.8/src/agentic_windows_mcp/powershell/utils.py +175 -0
  46. agentic_windows_mcp-0.8.8/src/agentic_windows_mcp/process/__init__.py +6 -0
  47. agentic_windows_mcp-0.8.8/src/agentic_windows_mcp/process/service.py +85 -0
  48. agentic_windows_mcp-0.8.8/src/agentic_windows_mcp/registry/__init__.py +11 -0
  49. agentic_windows_mcp-0.8.8/src/agentic_windows_mcp/registry/service.py +89 -0
  50. agentic_windows_mcp-0.8.8/src/agentic_windows_mcp/registry/views.py +26 -0
  51. agentic_windows_mcp-0.8.8/src/agentic_windows_mcp/tools/__init__.py +41 -0
  52. agentic_windows_mcp-0.8.8/src/agentic_windows_mcp/tools/_snapshot_helpers.py +239 -0
  53. agentic_windows_mcp-0.8.8/src/agentic_windows_mcp/tools/app.py +113 -0
  54. agentic_windows_mcp-0.8.8/src/agentic_windows_mcp/tools/browser_devtools.py +511 -0
  55. agentic_windows_mcp-0.8.8/src/agentic_windows_mcp/tools/clipboard.py +54 -0
  56. agentic_windows_mcp-0.8.8/src/agentic_windows_mcp/tools/control_notifications.py +342 -0
  57. agentic_windows_mcp-0.8.8/src/agentic_windows_mcp/tools/control_policy.py +72 -0
  58. agentic_windows_mcp-0.8.8/src/agentic_windows_mcp/tools/control_status.py +21 -0
  59. agentic_windows_mcp-0.8.8/src/agentic_windows_mcp/tools/display.py +61 -0
  60. agentic_windows_mcp-0.8.8/src/agentic_windows_mcp/tools/filesystem.py +82 -0
  61. agentic_windows_mcp-0.8.8/src/agentic_windows_mcp/tools/input.py +504 -0
  62. agentic_windows_mcp-0.8.8/src/agentic_windows_mcp/tools/multi.py +104 -0
  63. agentic_windows_mcp-0.8.8/src/agentic_windows_mcp/tools/notification.py +45 -0
  64. agentic_windows_mcp-0.8.8/src/agentic_windows_mcp/tools/process.py +42 -0
  65. agentic_windows_mcp-0.8.8/src/agentic_windows_mcp/tools/registry.py +51 -0
  66. agentic_windows_mcp-0.8.8/src/agentic_windows_mcp/tools/scrape.py +73 -0
  67. agentic_windows_mcp-0.8.8/src/agentic_windows_mcp/tools/shell.py +27 -0
  68. agentic_windows_mcp-0.8.8/src/agentic_windows_mcp/tools/snapshot.py +123 -0
  69. agentic_windows_mcp-0.8.8/src/agentic_windows_mcp/tree/__init__.py +0 -0
  70. agentic_windows_mcp-0.8.8/src/agentic_windows_mcp/tree/budget.py +91 -0
  71. agentic_windows_mcp-0.8.8/src/agentic_windows_mcp/tree/cache_utils.py +218 -0
  72. agentic_windows_mcp-0.8.8/src/agentic_windows_mcp/tree/config.py +92 -0
  73. agentic_windows_mcp-0.8.8/src/agentic_windows_mcp/tree/ia2.py +506 -0
  74. agentic_windows_mcp-0.8.8/src/agentic_windows_mcp/tree/service.py +1093 -0
  75. agentic_windows_mcp-0.8.8/src/agentic_windows_mcp/tree/utils.py +23 -0
  76. agentic_windows_mcp-0.8.8/src/agentic_windows_mcp/tree/views.py +290 -0
  77. agentic_windows_mcp-0.8.8/src/agentic_windows_mcp/uia/__init__.py +6 -0
  78. agentic_windows_mcp-0.8.8/src/agentic_windows_mcp/uia/comtypes_cache.py +146 -0
  79. agentic_windows_mcp-0.8.8/src/agentic_windows_mcp/uia/controls.py +6381 -0
  80. agentic_windows_mcp-0.8.8/src/agentic_windows_mcp/uia/core.py +2778 -0
  81. agentic_windows_mcp-0.8.8/src/agentic_windows_mcp/uia/enums.py +2187 -0
  82. agentic_windows_mcp-0.8.8/src/agentic_windows_mcp/uia/events.py +130 -0
  83. agentic_windows_mcp-0.8.8/src/agentic_windows_mcp/uia/exceptions.py +114 -0
  84. agentic_windows_mcp-0.8.8/src/agentic_windows_mcp/uia/patterns.py +2298 -0
  85. agentic_windows_mcp-0.8.8/src/agentic_windows_mcp/vdm/__init__.py +5 -0
  86. agentic_windows_mcp-0.8.8/src/agentic_windows_mcp/vdm/core.py +713 -0
  87. agentic_windows_mcp-0.8.8/src/agentic_windows_mcp/watchdog/__init__.py +1 -0
  88. agentic_windows_mcp-0.8.8/src/agentic_windows_mcp/watchdog/event_handlers.py +92 -0
  89. agentic_windows_mcp-0.8.8/src/agentic_windows_mcp/watchdog/service.py +312 -0
  90. agentic_windows_mcp-0.8.8/src/agentic_windows_mcp.egg-info/PKG-INFO +337 -0
  91. agentic_windows_mcp-0.8.8/src/agentic_windows_mcp.egg-info/SOURCES.txt +180 -0
  92. agentic_windows_mcp-0.8.8/src/agentic_windows_mcp.egg-info/dependency_links.txt +1 -0
  93. agentic_windows_mcp-0.8.8/src/agentic_windows_mcp.egg-info/entry_points.txt +2 -0
  94. agentic_windows_mcp-0.8.8/src/agentic_windows_mcp.egg-info/requires.txt +22 -0
  95. agentic_windows_mcp-0.8.8/src/agentic_windows_mcp.egg-info/top_level.txt +1 -0
  96. agentic_windows_mcp-0.8.8/tests/test_analytics.py +116 -0
  97. agentic_windows_mcp-0.8.8/tests/test_analytics_thread_affinity.py +247 -0
  98. agentic_windows_mcp-0.8.8/tests/test_annotation_thread_safety.py +123 -0
  99. agentic_windows_mcp-0.8.8/tests/test_app_launch_localized.py +51 -0
  100. agentic_windows_mcp-0.8.8/tests/test_app_switch_foreground.py +114 -0
  101. agentic_windows_mcp-0.8.8/tests/test_app_tool.py +273 -0
  102. agentic_windows_mcp-0.8.8/tests/test_as_point_parsing.py +55 -0
  103. agentic_windows_mcp-0.8.8/tests/test_browser_consent.py +218 -0
  104. agentic_windows_mcp-0.8.8/tests/test_browser_devtools.py +108 -0
  105. agentic_windows_mcp-0.8.8/tests/test_check_versions.py +168 -0
  106. agentic_windows_mcp-0.8.8/tests/test_cli_legacy_flags.py +73 -0
  107. agentic_windows_mcp-0.8.8/tests/test_cli_paired_flags.py +114 -0
  108. agentic_windows_mcp-0.8.8/tests/test_click_type_validation.py +213 -0
  109. agentic_windows_mcp-0.8.8/tests/test_clipboard_utf16.py +128 -0
  110. agentic_windows_mcp-0.8.8/tests/test_config_stateless.py +132 -0
  111. agentic_windows_mcp-0.8.8/tests/test_config_validation.py +92 -0
  112. agentic_windows_mcp-0.8.8/tests/test_control.py +405 -0
  113. agentic_windows_mcp-0.8.8/tests/test_control_cli.py +105 -0
  114. agentic_windows_mcp-0.8.8/tests/test_control_config.py +74 -0
  115. agentic_windows_mcp-0.8.8/tests/test_control_gate_timeout.py +118 -0
  116. agentic_windows_mcp-0.8.8/tests/test_control_hook_rotation.py +200 -0
  117. agentic_windows_mcp-0.8.8/tests/test_control_ime.py +147 -0
  118. agentic_windows_mcp-0.8.8/tests/test_control_input.py +432 -0
  119. agentic_windows_mcp-0.8.8/tests/test_control_lifecycle.py +82 -0
  120. agentic_windows_mcp-0.8.8/tests/test_control_mcp_ack.py +102 -0
  121. agentic_windows_mcp-0.8.8/tests/test_control_mcp_gate.py +587 -0
  122. agentic_windows_mcp-0.8.8/tests/test_control_mouse_distance.py +154 -0
  123. agentic_windows_mcp-0.8.8/tests/test_control_overlay.py +418 -0
  124. agentic_windows_mcp-0.8.8/tests/test_control_overlay_visuals.py +293 -0
  125. agentic_windows_mcp-0.8.8/tests/test_control_policy.py +198 -0
  126. agentic_windows_mcp-0.8.8/tests/test_control_recovery.py +418 -0
  127. agentic_windows_mcp-0.8.8/tests/test_control_recovery_stdio.py +88 -0
  128. agentic_windows_mcp-0.8.8/tests/test_control_request_lifetime.py +177 -0
  129. agentic_windows_mcp-0.8.8/tests/test_control_settings.py +187 -0
  130. agentic_windows_mcp-0.8.8/tests/test_control_stdio.py +75 -0
  131. agentic_windows_mcp-0.8.8/tests/test_control_worker.py +358 -0
  132. agentic_windows_mcp-0.8.8/tests/test_controls_handles_own_windows.py +40 -0
  133. agentic_windows_mcp-0.8.8/tests/test_desktop_utils.py +38 -0
  134. agentic_windows_mcp-0.8.8/tests/test_desktop_views.py +84 -0
  135. agentic_windows_mcp-0.8.8/tests/test_deterministic_drag_core.py +114 -0
  136. agentic_windows_mcp-0.8.8/tests/test_deterministic_drag_desktop.py +136 -0
  137. agentic_windows_mcp-0.8.8/tests/test_deterministic_drag_input.py +162 -0
  138. agentic_windows_mcp-0.8.8/tests/test_dialog_yield_heartbeat.py +57 -0
  139. agentic_windows_mcp-0.8.8/tests/test_display_inventory_tool.py +101 -0
  140. agentic_windows_mcp-0.8.8/tests/test_fake_ip_dns_diagnostic.py +74 -0
  141. agentic_windows_mcp-0.8.8/tests/test_filesystem_overlap.py +28 -0
  142. agentic_windows_mcp-0.8.8/tests/test_filesystem_service.py +321 -0
  143. agentic_windows_mcp-0.8.8/tests/test_filesystem_views.py +113 -0
  144. agentic_windows_mcp-0.8.8/tests/test_flash_overlay.py +291 -0
  145. agentic_windows_mcp-0.8.8/tests/test_install_hidden_console.py +32 -0
  146. agentic_windows_mcp-0.8.8/tests/test_iserror_compliance.py +87 -0
  147. agentic_windows_mcp-0.8.8/tests/test_label_bounds.py +58 -0
  148. agentic_windows_mcp-0.8.8/tests/test_manifest_tools.py +31 -0
  149. agentic_windows_mcp-0.8.8/tests/test_mouse_absolute_events.py +160 -0
  150. agentic_windows_mcp-0.8.8/tests/test_multi_tools.py +95 -0
  151. agentic_windows_mcp-0.8.8/tests/test_no_stdout_writes.py +105 -0
  152. agentic_windows_mcp-0.8.8/tests/test_paths.py +152 -0
  153. agentic_windows_mcp-0.8.8/tests/test_powershell_no_window.py +121 -0
  154. agentic_windows_mcp-0.8.8/tests/test_powershell_shell_resolution.py +89 -0
  155. agentic_windows_mcp-0.8.8/tests/test_registry.py +168 -0
  156. agentic_windows_mcp-0.8.8/tests/test_scrape_encoding.py +89 -0
  157. agentic_windows_mcp-0.8.8/tests/test_scrape_ssrf.py +234 -0
  158. agentic_windows_mcp-0.8.8/tests/test_scrape_tool.py +66 -0
  159. agentic_windows_mcp-0.8.8/tests/test_screenshot_capture.py +542 -0
  160. agentic_windows_mcp-0.8.8/tests/test_screenshot_fallback.py +176 -0
  161. agentic_windows_mcp-0.8.8/tests/test_selfpipe_guard.py +175 -0
  162. agentic_windows_mcp-0.8.8/tests/test_sendkeys_cleanup.py +151 -0
  163. agentic_windows_mcp-0.8.8/tests/test_shortcut_keys.py +77 -0
  164. agentic_windows_mcp-0.8.8/tests/test_snapshot_display_filter.py +756 -0
  165. agentic_windows_mcp-0.8.8/tests/test_startup_dependency_guard.py +17 -0
  166. agentic_windows_mcp-0.8.8/tests/test_startup_task.py +86 -0
  167. agentic_windows_mcp-0.8.8/tests/test_stdio_handshake.py +145 -0
  168. agentic_windows_mcp-0.8.8/tests/test_surrogate_repair.py +110 -0
  169. agentic_windows_mcp-0.8.8/tests/test_tool_boolean_flags.py +68 -0
  170. agentic_windows_mcp-0.8.8/tests/test_tree_budget.py +81 -0
  171. agentic_windows_mcp-0.8.8/tests/test_tree_cache_utils.py +52 -0
  172. agentic_windows_mcp-0.8.8/tests/test_tree_ia2.py +414 -0
  173. agentic_windows_mcp-0.8.8/tests/test_tree_service.py +789 -0
  174. agentic_windows_mcp-0.8.8/tests/test_tree_views.py +197 -0
  175. agentic_windows_mcp-0.8.8/tests/test_uia_timeouts.py +299 -0
  176. agentic_windows_mcp-0.8.8/tests/test_uia_walker_fallback.py +104 -0
  177. agentic_windows_mcp-0.8.8/tests/test_unicode_input.py +115 -0
  178. agentic_windows_mcp-0.8.8/tests/test_wait_for_tool.py +242 -0
  179. agentic_windows_mcp-0.8.8/tests/test_watchdog_backoff.py +140 -0
  180. agentic_windows_mcp-0.8.8/tests/test_watchdog_degradation.py +153 -0
  181. agentic_windows_mcp-0.8.8/tests/test_watchdog_recovery.py +97 -0
  182. agentic_windows_mcp-0.8.8/tests/test_watchdog_toggle.py +42 -0
@@ -0,0 +1,27 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Vu Manh Ruy
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.
22
+
23
+ ---
24
+
25
+ Portions of this software are derived from the windows-mcp project.
26
+ Copyright (c) 2025 JEOMON GEORGE. Retained in accordance with the MIT License
27
+ terms above.
@@ -0,0 +1,337 @@
1
+ Metadata-Version: 2.4
2
+ Name: agentic-windows-mcp
3
+ Version: 0.8.8
4
+ Summary: Agentic Windows MCP - an MCP server that gives AI agents full, safe control of a Windows PC: desktop automation, remote computer control, browser DevTools inspection, and remote software development.
5
+ Author: Vu Manh Ruy
6
+ License: MIT License
7
+
8
+ Copyright (c) 2026 Vu Manh Ruy
9
+
10
+ Permission is hereby granted, free of charge, to any person obtaining a copy
11
+ of this software and associated documentation files (the "Software"), to deal
12
+ in the Software without restriction, including without limitation the rights
13
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
+ copies of the Software, and to permit persons to whom the Software is
15
+ furnished to do so, subject to the following conditions:
16
+
17
+ The above copyright notice and this permission notice shall be included in all
18
+ copies or substantial portions of the Software.
19
+
20
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
+ SOFTWARE.
27
+
28
+ ---
29
+
30
+ Portions of this software are derived from the windows-mcp project.
31
+ Copyright (c) 2025 JEOMON GEORGE. Retained in accordance with the MIT License
32
+ terms above.
33
+
34
+ Project-URL: Homepage, https://github.com/homenewstar
35
+ Project-URL: Repository, https://github.com/homenewstar/agentic-agentic-windows-mcp
36
+ Project-URL: Issues, https://github.com/homenewstar/agentic-agentic-windows-mcp/issues
37
+ Keywords: windows,mcp,ai,desktop,ai agent
38
+ Classifier: Development Status :: 4 - Beta
39
+ Classifier: License :: OSI Approved :: MIT License
40
+ Classifier: Operating System :: Microsoft :: Windows :: Windows 10
41
+ Classifier: Operating System :: Microsoft :: Windows :: Windows 11
42
+ Classifier: Programming Language :: Python :: 3.14
43
+ Classifier: Topic :: Desktop Environment
44
+ Classifier: Topic :: System :: Shells
45
+ Requires-Python: >=3.14
46
+ Description-Content-Type: text/markdown
47
+ License-File: LICENSE.md
48
+ Requires-Dist: click>=8.2.1
49
+ Requires-Dist: comtypes>=1.4.15
50
+ Requires-Dist: dxcam>=0.3.0
51
+ Requires-Dist: fastmcp>=3.0
52
+ Requires-Dist: fuzzywuzzy>=0.18.0
53
+ Requires-Dist: markdownify>=1.1.0
54
+ Requires-Dist: pillow>=11.2.1
55
+ Requires-Dist: platformdirs>=4.3.8
56
+ Requires-Dist: posthog>=7.4.0
57
+ Requires-Dist: psutil>=7.0.0
58
+ Requires-Dist: pygments>=2.20.0
59
+ Requires-Dist: python-levenshtein>=0.27.1
60
+ Requires-Dist: pywin32>=311
61
+ Requires-Dist: requests>=2.33.0
62
+ Requires-Dist: tabulate>=0.9.0
63
+ Requires-Dist: thefuzz>=0.22.1
64
+ Requires-Dist: uuid7>=0.1.0
65
+ Provides-Extra: dev
66
+ Requires-Dist: ruff>=0.9.0; extra == "dev"
67
+ Requires-Dist: pytest>=8.0.0; extra == "dev"
68
+ Requires-Dist: pytest-asyncio>=0.24.0; extra == "dev"
69
+ Dynamic: license-file
70
+
71
+ <div align="center">
72
+
73
+ # Agentic Windows MCP
74
+
75
+ **Biến mọi AI Agent — dù đang chạy trên web, trên app, hay ở bất cứ đâu — thành đôi tay điều khiển chiếc máy tính Windows của bạn.**
76
+
77
+ Điều khiển máy tính từ xa toàn diện · Tự động hóa mọi thao tác · Lập trình trực tiếp trên máy của bạn, từ bất cứ nơi nào
78
+
79
+ [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE.md)
80
+ ![Platform](https://img.shields.io/badge/Platform-Windows%2010%20%7C%2011-blue)
81
+ ![Python](https://img.shields.io/badge/Python-3.14%2B-yellow)
82
+ ![Protocol](https://img.shields.io/badge/Protocol-MCP-purple)
83
+ ![Tools](https://img.shields.io/badge/Tools-40-orange)
84
+
85
+ </div>
86
+
87
+ ---
88
+
89
+ ## 💡 Ý tưởng cốt lõi — Ba trụ cột
90
+
91
+ Một mình, AI Agent chỉ "nói" được. Một mình, chiếc PC của bạn chỉ "ngồi" đó. **Agentic Windows MCP** là cầu nối khiến cả hai — cộng với GitHub — tạo thành một bộ máy làm việc hoàn chỉnh:
92
+
93
+ | Trụ cột | Vai trò | Nằm ở đâu? |
94
+ |---|---|---|
95
+ | **1. GitHub** | Kho mã nguồn trung tâm: đồng bộ, lịch sử phiên bản, điểm gặp gỡ của mọi thay đổi | Trên cloud của GitHub |
96
+ | **2. AI Agent** | "Bộ não": Muse, ChatGPT, Claude, Gemini, DeepSeek... phân tích, ra quyết định, viết code, ra lệnh | Web, app điện thoại, máy khác — bất cứ đâu |
97
+ | **3. Máy tính / Server của bạn** | "Đôi tay + nơi làm việc thật": dự án nằm đây, code chạy ở đây, ứng dụng thật mở ở đây — Agentic Windows MCP được cài tại đây để thi hành | PC ở nhà, máy ở công ty, VPS Windows... |
98
+
99
+ **Ba trụ cột hoàn toàn độc lập về vị trí địa lý**, chỉ kết hợp qua hai đường ống: giao thức **MCP** (Agent ⇄ máy của bạn) và **Git** (máy của bạn ⇄ GitHub). Nhờ vậy:
100
+
101
+ - Bạn ngồi quán cà phê, mở ChatGPT trên điện thoại → ra lệnh → Agent điều khiển chiếc PC ở nhà: mở dự án, sửa code, chạy test, commit và push lên GitHub. Về đến nhà, mọi thứ đã xong.
102
+ - Hoặc gộp cả ba vào **một máy duy nhất**: Agent chạy app trên chính PC, code nằm trên chính PC — Agentic Windows MCP cho phép Agent tự thao tác như một lập trình viên ngồi trước máy.
103
+
104
+ ```
105
+ ┌─────────────────────────────┐
106
+ │ GITHUB │
107
+ │ mã nguồn · đồng bộ · bản sao │
108
+ └──────────────┬──────────────┘
109
+ git push/pull
110
+ ┌──────────────▼──────────────┐
111
+ ┌─────────────┐ │ MÁY TÍNH CỦA BẠN │ ┌──────────────────┐
112
+ │ AI AGENT │ │ ┌───────────────────────┐ │ │ NGƯỜI DÙNG │
113
+ │ Muse · ├──┼──►│ AGENTIC WINDOWS MCP │◄─┼──────┤ giám sát · xem │
114
+ │ ChatGPT · │MCP│ │ 40 công cụ điều khiển │ │ nhìn │ viền phát sáng │
115
+ │ Claude · │◄──┼──┤ chuột · phím · app │ │ thấy │ · bảng cảnh báo │
116
+ │ Gemini · │ │ │ PowerShell · file │ │ │ · phím Space* │
117
+ │ DeepSeek... │ │ │ DevTools trình duyệt│ │ └──────────────────┘
118
+ └─────────────┘ │ └───────────────────────┘ │
119
+ (web / app / │ Windows 10 / 11 │
120
+ máy khác) └─────────────────────────────┘
121
+ *phím tắt lấy lại quyền điều khiển:
122
+ Ctrl + Alt + Shift + Space
123
+ ```
124
+
125
+ ---
126
+
127
+ ## ✨ Chức năng chính
128
+
129
+ ### 🖥️ Điều khiển máy tính toàn diện
130
+ - **Chuột & bàn phím như người thật**: click, double/right-click, kéo–thả theo đường nhiều đoạn, giữ chuột, vuốt/cào, gõ văn bản Unicode, tổ hợp phím tắt, cuộn — kể cả thao tác kéo chính xác từng điểm ảnh.
131
+ - **Đọc màn hình bằng cây UI (UI Automation)**: chụp "Snapshot" toàn bộ cây phần tử của cửa sổ đang mở (nút bấm, ô nhập, nhãn...) kèm ảnh chụp có đánh số — Agent hiểu giao diện **không cần mô hình thị giác**.
132
+ - **Quản lý cửa sổ & ứng dụng**: mở app, chuyển/đóng cửa sổ, thay đổi kích thước, nhiều màn hình, virtual desktop, chụp ảnh màn hình từng vùng.
133
+ - **Clipboard, thông báo, hiển thị**: đọc/ghi clipboard, gửi thông báo hệ thống, quản lý màn hình.
134
+
135
+ ### ⚙️ Tự động hóa hệ thống
136
+ - **PowerShell** không giới hạn: chạy lệnh, cài đặt phần mềm, quản trị hệ thống.
137
+ - **FileSystem**: đọc/ghi/liệt kê/di chuyển file & thư mục — đọc và sửa mã nguồn trực tiếp.
138
+ - **Registry & Process**: đọc/sửa registry, liệt kê & dừng tiến trình.
139
+ - **Scrape**: tải và trích xuất nội dung trang web.
140
+
141
+ ### 🌐 Kiểm tra trình duyệt như DevTools (F12) thật
142
+ Bộ công cụ Browser kết nối vào Chrome/Edge/Brave đang mở của bạn qua **CDP (Chrome DevTools Protocol)**:
143
+ - Điều hướng, quản lý tab, snapshot DOM, truy vấn phần tử, highlight trực quan, thực thi JavaScript tùy ý.
144
+ - CSS chuyên sâu: computed styles, **matched rules** (rule nào thắng, từ stylesheet nào), `::before`/`::after`, animation — và **cây Accessibility**.
145
+ - **Network chuyên sâu**: response body, request payload, timing từng pha (DNS/TCP/TLS/TTFB), kích thước truyền, redirect chain, request lỗi, frame WebSocket, chi tiết chứng chỉ TLS.
146
+ - **Application storage**: cookies (kể cả **HttpOnly**), local/session storage, IndexedDB, Cache Storage, Service Workers.
147
+ - **Sources**: liệt kê & đọc nguyên văn source của mọi script/stylesheet.
148
+
149
+ ### 👨‍💻 Lập trình từ xa trên chính máy của bạn
150
+ Kết hợp các nhóm công cụ trên, Agent có thể làm trọn vòng đời của một tác vụ lập trình ngay trên PC của bạn: mở IDE/thư mục dự án → đọc code → sửa file → chạy build/test bằng PowerShell → mở trình duyệt kiểm tra kết quả bằng DevTools → sửa tiếp → `git commit` & `git push` lên GitHub. Bạn chỉ cần ra lệnh và giám sát — từ điện thoại cũng được.
151
+
152
+ ### 🛡️ An toàn & quyền kiểm soát thuộc về bạn
153
+ - **Chỉ báo trực quan luôn bật**: khi AI đang điều khiển, màn hình có **viền phát sáng** + bảng báo ở cạnh trên + quầng sáng quanh con trỏ — không bao giờ điều khiển "lén".
154
+ - **Phím lấy lại quyền**: nhấn **`Ctrl + Alt + Shift + Space`** để giành lại quyền điều khiển ngay lập tức; Agent chỉ tiếp tục khi bạn đã nhàn rỗi đủ lâu.
155
+ - **Chính sách kiểm soát 3 mức** (`relaxed` / `balanced` / `strict`): ở mức strict, *mọi* thao tác đều phải qua cổng kiểm soát và hiện chỉ báo.
156
+ - **Chế độ ưu tiên Agent** (tùy chọn): Agent không bị ngắt bởi di chuột/gõ phím thông thường — chỉ phím tắt trên mới takeover được.
157
+ - **Xác thực bắt buộc**: API key qua header `Authorization: Bearer <token>` hoặc OAuth; chỉ nên phơi endpoint qua mạng riêng (Tailscale/WireGuard) hoặc HTTPS.
158
+ - **Không telemetry mặc định**: mã nguồn không chứa sẵn khóa theo dõi; phân tích sử dụng chỉ bật khi bạn tự đặt biến môi trường `POSTHOG_API_KEY`.
159
+
160
+ ---
161
+
162
+ ## 🚀 Cài đặt (trên máy Windows sẽ bị điều khiển)
163
+
164
+ **Yêu cầu**: Windows 10/11 · Python 3.14+ · [uv](https://docs.astral.sh/uv/) · Git.
165
+
166
+ ```powershell
167
+ git clone https://github.com/homenewstar/agentic-windows-mcp.git
168
+ cd agentic-windows-mcp
169
+ uv sync
170
+ uv pip install playwright # cần cho bộ công cụ Browser/DevTools
171
+ ```
172
+
173
+ ### Chạy server
174
+
175
+ **Chế độ HTTP (cho Agent ở xa / qua mạng)** — kèm khóa xác thực:
176
+
177
+ ```powershell
178
+ # Tạo / đổi khóa xác thực (lưu tại ~/.agentic-windows-mcp/)
179
+ uv run agentic-windows-mcp auth
180
+
181
+ # Khởi động server MCP qua HTTP
182
+ uv run agentic-windows-mcp serve --transport streamable-http --host 0.0.0.0 --port 8000
183
+ # Endpoint: http://<IP-máy-bạn>:8000/mcp
184
+ ```
185
+
186
+ **Chế độ stdio (cho Agent chạy cùng máy**, ví dụ Claude Desktop, Cursor, VS Code): xem cấu hình ở mục kết nối bên dưới — client sẽ tự khởi động server qua `uvx`.
187
+
188
+ ### Tự khởi động cùng Windows
189
+
190
+ ```powershell
191
+ uv run agentic-windows-mcp install # tạo Scheduled Task "agentic-windows-mcp-server"
192
+ uv run agentic-windows-mcp uninstall # gỡ task và dừng server
193
+ ```
194
+
195
+ ### Phơi endpoint ra ngoài an toàn
196
+
197
+ Đừng mở port trực tiếp ra Internet. Hãy dùng một trong các cách:
198
+
199
+ - **Tailscale** (khuyên dùng): cài Tailscale trên cả PC và thiết bị của bạn, rồi `tailscale serve --bg --https=443 http://127.0.0.1:8000` — endpoint chỉ xuất hiện trong tailnet riêng của bạn.
200
+ - **WireGuard / VPN** tự host, hoặc reverse proxy HTTPS (Caddy/Nginx) có xác thực.
201
+
202
+ ### Cấu hình
203
+
204
+ File cấu hình đặt tại `~/.agentic-windows-mcp/config.toml`:
205
+
206
+ ```toml
207
+ [server]
208
+ # host / port / transport mặc định...
209
+
210
+ [control]
211
+ enabled = true
212
+ policy = "strict" # relaxed | balanced | strict
213
+ idle_timeout_seconds = 10
214
+ ```
215
+
216
+ ---
217
+
218
+ ## 🔌 Kết nối các AI Agent
219
+
220
+ Nguyên tắc chung: **bất kỳ ứng dụng nào hỗ trợ giao thức MCP (Model Context Protocol) đều kết nối được**, qua stdio (cùng máy) hoặc Streamable HTTP (qua mạng, kèm header `Authorization: Bearer <API_KEY>`).
221
+
222
+ ### Muse (muse.ai) & các agent dạng web/app
223
+ Các agent chạy trên nền web không tự cài phần mềm lên máy bạn — chúng kết nối tới endpoint HTTP của Agentic Windows MCP:
224
+
225
+ 1. Chạy server ở chế độ HTTP như trên và phơi qua Tailscale/HTTPS.
226
+ 2. Trong agent, thêm **custom connector / MCP server** với URL `https://<máy-của-bạn>/mcp` và khóa xác thực.
227
+ 3. Agent sẽ thấy toàn bộ 40 công cụ và bắt đầu điều khiển được PC của bạn — kể cả việc mở dự án, sửa code và đẩy lên GitHub.
228
+
229
+ ### ChatGPT
230
+ ChatGPT hỗ trợ MCP qua **Developer mode / Connectors**:
231
+
232
+ 1. Settings → Connectors → bật Developer mode → *Create* một connector mới.
233
+ 2. Nhập URL MCP (`https://<máy-của-bạn>/mcp`) và khóa API.
234
+ 3. Trong cuộc trò chuyện, bật connector và ra lệnh, ví dụ: *"Mở thư mục dự án X trên máy tôi, chạy test và sửa các lỗi đang fail."*
235
+
236
+ ### Claude (Claude Desktop & Claude Code)
237
+ Cùng máy — dùng stdio, Claude tự khởi động server:
238
+
239
+ ```json
240
+ {
241
+ "mcpServers": {
242
+ "agentic-windows-mcp": {
243
+ "command": "uvx",
244
+ "args": ["agentic-windows-mcp"]
245
+ }
246
+ }
247
+ }
248
+ ```
249
+
250
+ Khác máy — trỏ tới endpoint HTTP:
251
+
252
+ ```json
253
+ {
254
+ "mcpServers": {
255
+ "agentic-windows-mcp": {
256
+ "url": "http://<IP-máy-bạn>:8000/mcp",
257
+ "headers": { "Authorization": "Bearer <API_KEY>" }
258
+ }
259
+ }
260
+ }
261
+ ```
262
+
263
+ Claude Code: `claude mcp add --transport http agentic-windows-mcp http://<IP-máy-bạn>:8000/mcp --header "Authorization: Bearer <API_KEY>"`.
264
+
265
+ ### Gemini
266
+ - **Gemini CLI**: thêm vào `~/.gemini/settings.json` đúng định dạng `mcpServers` như ví dụ của Claude ở trên (stdio hoặc `httpUrl` + `headers`).
267
+ - **Google AI Studio / Gemini API**: dùng MCP client tích hợp trong ứng dụng của bạn và trỏ tới cùng endpoint HTTP.
268
+
269
+ ### DeepSeek & mọi agent khác
270
+ DeepSeek (và các mô hình khác) kết nối được theo hai cách:
271
+
272
+ - **Qua một MCP host** có sẵn: Cursor, VS Code (Copilot agent mode), Cline, Continue, Windsurf... — chỉ cần thêm khối `mcpServers` ở trên; mô hình phía sau là gì không quan trọng, kể cả DeepSeek.
273
+ - **Qua HTTP trực tiếp**: bất kỳ framework agent nào (LangChain, LlamaIndex, code tự viết...) gọi JSON-RPC tới `POST /mcp` với header xác thực đều dùng được.
274
+
275
+ ### Bảng tra nhanh
276
+
277
+ | Agent / Client | Cách kết nối | Ghi chú |
278
+ |---|---|---|
279
+ | Muse (web/app) | HTTP connector | Agent ở xa, điều khiển PC qua Tailscale/HTTPS |
280
+ | ChatGPT | HTTP connector (Developer mode) | Cần bật Developer mode |
281
+ | Claude Desktop / Code | stdio hoặc HTTP | stdio khi cùng máy |
282
+ | Gemini CLI | stdio hoặc HTTP | Cấu hình `mcpServers` |
283
+ | DeepSeek | Qua MCP host (Cursor/Cline/VS Code...) | Mô hình thay thế linh hoạt |
284
+ | Cursor / VS Code / Windsurf | stdio hoặc HTTP | Thêm khối `mcpServers` |
285
+
286
+ ---
287
+
288
+ ## 🧰 Bộ công cụ (40 tools)
289
+
290
+ | Nhóm | Công cụ |
291
+ |---|---|
292
+ | **Điều khiển desktop** | `Click`, `Type`, `Move`, `Scroll`, `Shortcut`, `MultiSelect`, `MultiEdit`, `Snapshot`, `Screenshot`, `Wait`, `WaitFor` |
293
+ | **Ứng dụng & hệ thống** | `App`, `PowerShell`, `FileSystem`, `Registry`, `Process`, `Clipboard`, `Notification`, `DisplayInventory`, `Scrape` |
294
+ | **Cổng kiểm soát** | `ControlStatus` (xem ai đang giữ quyền điều khiển, chính sách đang áp dụng) |
295
+ | **Trình duyệt (CDP)** | `Browser_Connect`, `Browser_Navigate`, `Browser_ManageTabs`, `Browser_GetPageSnapshot`, `Browser_QueryElements`, `Browser_Interact`, `Browser_TakeScreenshot`, `Browser_Highlight`, `Browser_EvaluateScript` |
296
+ | **DevTools chuyên sâu** | `Browser_GetCssStyles`, `Browser_GetComputedStyle`, `Browser_GetMatchedStyles`, `Browser_GetAccessibilityTree`, `Browser_ListConsoleMessages`, `Browser_ListNetworkRequests`, `Browser_GetNetworkDetails`, `Browser_GetStorage`, `Browser_ListPageSources`, `Browser_GetSourceText` |
297
+
298
+ ---
299
+
300
+ ## 💬 Ví dụ ra lệnh cho Agent
301
+
302
+ - *"Mở dự án `D:\code\shop-web` trên máy tôi, chạy test, sửa hết lỗi đang fail rồi commit và push lên GitHub."*
303
+ - *"Trang chủ web của tôi tải chậm — mở nó trong Chrome, kiểm tra tab Network xem request nào chậm và vì sao."*
304
+ - *"Đọc file Excel báo cáo trong thư mục Downloads, tổng hợp doanh thu theo tháng và lưu thành file mới."*
305
+ - *"Cài đặt Node.js và VS Code lên máy này, cấu hình git với tên và email của tôi."*
306
+ - *"Mở ứng dụng ghi chú, chép nội dung cuộc họp hôm nay từ clipboard vào và lưu lại."*
307
+
308
+ ---
309
+
310
+ ## 🏗️ Kiến trúc
311
+
312
+ ```
313
+ Agent (MCP client)
314
+ │ JSON-RPC: stdio / Streamable HTTP (+ Bearer auth / OAuth)
315
+ ▼
316
+ Agentic Windows MCP (FastMCP, Python)
317
+ ├── Desktop layer .... Win32 API + UI Automation (cây phần tử, ảnh chụp)
318
+ ├── Control plane .... cổng kiểm soát: viền phát sáng, bảng báo, chính sách
319
+ │ relaxed/balanced/strict, phím takeover, hàng đợi lease
320
+ ├── System layer ..... PowerShell, FileSystem, Registry, Process
321
+ └── Browser layer .... Playwright + CDP trực tiếp (Network/CSS/DOM/
322
+ Accessibility/Debugger/Storage domains)
323
+ ▼
324
+ Windows 10 / 11
325
+ ```
326
+
327
+ Mã nguồn chính nằm trong `src/agentic_windows_mcp/` (`desktop/`, `browser/`, `tools/`, `infrastructure/`, `filesystem/`, `powershell/`, `registry/`, `uia/`...).
328
+
329
+ ---
330
+
331
+ ## 🤝 Đóng góp
332
+
333
+ Mọi đóng góp đều được hoan nghênh — mở issue hoặc pull request tại [github.com/homenewstar/agentic-windows-mcp](https://github.com/homenewstar/agentic-windows-mcp). Khi phát triển, chạy kiểm thử bằng `uv run pytest`.
334
+
335
+ ## 📄 Giấy phép
336
+
337
+ Phát hành theo giấy phép **MIT** — © 2026 **Vu Manh Ruy**. Xem chi tiết trong [LICENSE.md](LICENSE.md).
@@ -0,0 +1,267 @@
1
+ <div align="center">
2
+
3
+ # Agentic Windows MCP
4
+
5
+ **Biến mọi AI Agent — dù đang chạy trên web, trên app, hay ở bất cứ đâu — thành đôi tay điều khiển chiếc máy tính Windows của bạn.**
6
+
7
+ Điều khiển máy tính từ xa toàn diện · Tự động hóa mọi thao tác · Lập trình trực tiếp trên máy của bạn, từ bất cứ nơi nào
8
+
9
+ [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE.md)
10
+ ![Platform](https://img.shields.io/badge/Platform-Windows%2010%20%7C%2011-blue)
11
+ ![Python](https://img.shields.io/badge/Python-3.14%2B-yellow)
12
+ ![Protocol](https://img.shields.io/badge/Protocol-MCP-purple)
13
+ ![Tools](https://img.shields.io/badge/Tools-40-orange)
14
+
15
+ </div>
16
+
17
+ ---
18
+
19
+ ## 💡 Ý tưởng cốt lõi — Ba trụ cột
20
+
21
+ Một mình, AI Agent chỉ "nói" được. Một mình, chiếc PC của bạn chỉ "ngồi" đó. **Agentic Windows MCP** là cầu nối khiến cả hai — cộng với GitHub — tạo thành một bộ máy làm việc hoàn chỉnh:
22
+
23
+ | Trụ cột | Vai trò | Nằm ở đâu? |
24
+ |---|---|---|
25
+ | **1. GitHub** | Kho mã nguồn trung tâm: đồng bộ, lịch sử phiên bản, điểm gặp gỡ của mọi thay đổi | Trên cloud của GitHub |
26
+ | **2. AI Agent** | "Bộ não": Muse, ChatGPT, Claude, Gemini, DeepSeek... phân tích, ra quyết định, viết code, ra lệnh | Web, app điện thoại, máy khác — bất cứ đâu |
27
+ | **3. Máy tính / Server của bạn** | "Đôi tay + nơi làm việc thật": dự án nằm đây, code chạy ở đây, ứng dụng thật mở ở đây — Agentic Windows MCP được cài tại đây để thi hành | PC ở nhà, máy ở công ty, VPS Windows... |
28
+
29
+ **Ba trụ cột hoàn toàn độc lập về vị trí địa lý**, chỉ kết hợp qua hai đường ống: giao thức **MCP** (Agent ⇄ máy của bạn) và **Git** (máy của bạn ⇄ GitHub). Nhờ vậy:
30
+
31
+ - Bạn ngồi quán cà phê, mở ChatGPT trên điện thoại → ra lệnh → Agent điều khiển chiếc PC ở nhà: mở dự án, sửa code, chạy test, commit và push lên GitHub. Về đến nhà, mọi thứ đã xong.
32
+ - Hoặc gộp cả ba vào **một máy duy nhất**: Agent chạy app trên chính PC, code nằm trên chính PC — Agentic Windows MCP cho phép Agent tự thao tác như một lập trình viên ngồi trước máy.
33
+
34
+ ```
35
+ ┌─────────────────────────────┐
36
+ │ GITHUB │
37
+ │ mã nguồn · đồng bộ · bản sao │
38
+ └──────────────┬──────────────┘
39
+ git push/pull
40
+ ┌──────────────▼──────────────┐
41
+ ┌─────────────┐ │ MÁY TÍNH CỦA BẠN │ ┌──────────────────┐
42
+ │ AI AGENT │ │ ┌───────────────────────┐ │ │ NGƯỜI DÙNG │
43
+ │ Muse · ├──┼──►│ AGENTIC WINDOWS MCP │◄─┼──────┤ giám sát · xem │
44
+ │ ChatGPT · │MCP│ │ 40 công cụ điều khiển │ │ nhìn │ viền phát sáng │
45
+ │ Claude · │◄──┼──┤ chuột · phím · app │ │ thấy │ · bảng cảnh báo │
46
+ │ Gemini · │ │ │ PowerShell · file │ │ │ · phím Space* │
47
+ │ DeepSeek... │ │ │ DevTools trình duyệt│ │ └──────────────────┘
48
+ └─────────────┘ │ └───────────────────────┘ │
49
+ (web / app / │ Windows 10 / 11 │
50
+ máy khác) └─────────────────────────────┘
51
+ *phím tắt lấy lại quyền điều khiển:
52
+ Ctrl + Alt + Shift + Space
53
+ ```
54
+
55
+ ---
56
+
57
+ ## ✨ Chức năng chính
58
+
59
+ ### 🖥️ Điều khiển máy tính toàn diện
60
+ - **Chuột & bàn phím như người thật**: click, double/right-click, kéo–thả theo đường nhiều đoạn, giữ chuột, vuốt/cào, gõ văn bản Unicode, tổ hợp phím tắt, cuộn — kể cả thao tác kéo chính xác từng điểm ảnh.
61
+ - **Đọc màn hình bằng cây UI (UI Automation)**: chụp "Snapshot" toàn bộ cây phần tử của cửa sổ đang mở (nút bấm, ô nhập, nhãn...) kèm ảnh chụp có đánh số — Agent hiểu giao diện **không cần mô hình thị giác**.
62
+ - **Quản lý cửa sổ & ứng dụng**: mở app, chuyển/đóng cửa sổ, thay đổi kích thước, nhiều màn hình, virtual desktop, chụp ảnh màn hình từng vùng.
63
+ - **Clipboard, thông báo, hiển thị**: đọc/ghi clipboard, gửi thông báo hệ thống, quản lý màn hình.
64
+
65
+ ### ⚙️ Tự động hóa hệ thống
66
+ - **PowerShell** không giới hạn: chạy lệnh, cài đặt phần mềm, quản trị hệ thống.
67
+ - **FileSystem**: đọc/ghi/liệt kê/di chuyển file & thư mục — đọc và sửa mã nguồn trực tiếp.
68
+ - **Registry & Process**: đọc/sửa registry, liệt kê & dừng tiến trình.
69
+ - **Scrape**: tải và trích xuất nội dung trang web.
70
+
71
+ ### 🌐 Kiểm tra trình duyệt như DevTools (F12) thật
72
+ Bộ công cụ Browser kết nối vào Chrome/Edge/Brave đang mở của bạn qua **CDP (Chrome DevTools Protocol)**:
73
+ - Điều hướng, quản lý tab, snapshot DOM, truy vấn phần tử, highlight trực quan, thực thi JavaScript tùy ý.
74
+ - CSS chuyên sâu: computed styles, **matched rules** (rule nào thắng, từ stylesheet nào), `::before`/`::after`, animation — và **cây Accessibility**.
75
+ - **Network chuyên sâu**: response body, request payload, timing từng pha (DNS/TCP/TLS/TTFB), kích thước truyền, redirect chain, request lỗi, frame WebSocket, chi tiết chứng chỉ TLS.
76
+ - **Application storage**: cookies (kể cả **HttpOnly**), local/session storage, IndexedDB, Cache Storage, Service Workers.
77
+ - **Sources**: liệt kê & đọc nguyên văn source của mọi script/stylesheet.
78
+
79
+ ### 👨‍💻 Lập trình từ xa trên chính máy của bạn
80
+ Kết hợp các nhóm công cụ trên, Agent có thể làm trọn vòng đời của một tác vụ lập trình ngay trên PC của bạn: mở IDE/thư mục dự án → đọc code → sửa file → chạy build/test bằng PowerShell → mở trình duyệt kiểm tra kết quả bằng DevTools → sửa tiếp → `git commit` & `git push` lên GitHub. Bạn chỉ cần ra lệnh và giám sát — từ điện thoại cũng được.
81
+
82
+ ### 🛡️ An toàn & quyền kiểm soát thuộc về bạn
83
+ - **Chỉ báo trực quan luôn bật**: khi AI đang điều khiển, màn hình có **viền phát sáng** + bảng báo ở cạnh trên + quầng sáng quanh con trỏ — không bao giờ điều khiển "lén".
84
+ - **Phím lấy lại quyền**: nhấn **`Ctrl + Alt + Shift + Space`** để giành lại quyền điều khiển ngay lập tức; Agent chỉ tiếp tục khi bạn đã nhàn rỗi đủ lâu.
85
+ - **Chính sách kiểm soát 3 mức** (`relaxed` / `balanced` / `strict`): ở mức strict, *mọi* thao tác đều phải qua cổng kiểm soát và hiện chỉ báo.
86
+ - **Chế độ ưu tiên Agent** (tùy chọn): Agent không bị ngắt bởi di chuột/gõ phím thông thường — chỉ phím tắt trên mới takeover được.
87
+ - **Xác thực bắt buộc**: API key qua header `Authorization: Bearer <token>` hoặc OAuth; chỉ nên phơi endpoint qua mạng riêng (Tailscale/WireGuard) hoặc HTTPS.
88
+ - **Không telemetry mặc định**: mã nguồn không chứa sẵn khóa theo dõi; phân tích sử dụng chỉ bật khi bạn tự đặt biến môi trường `POSTHOG_API_KEY`.
89
+
90
+ ---
91
+
92
+ ## 🚀 Cài đặt (trên máy Windows sẽ bị điều khiển)
93
+
94
+ **Yêu cầu**: Windows 10/11 · Python 3.14+ · [uv](https://docs.astral.sh/uv/) · Git.
95
+
96
+ ```powershell
97
+ git clone https://github.com/homenewstar/agentic-windows-mcp.git
98
+ cd agentic-windows-mcp
99
+ uv sync
100
+ uv pip install playwright # cần cho bộ công cụ Browser/DevTools
101
+ ```
102
+
103
+ ### Chạy server
104
+
105
+ **Chế độ HTTP (cho Agent ở xa / qua mạng)** — kèm khóa xác thực:
106
+
107
+ ```powershell
108
+ # Tạo / đổi khóa xác thực (lưu tại ~/.agentic-windows-mcp/)
109
+ uv run agentic-windows-mcp auth
110
+
111
+ # Khởi động server MCP qua HTTP
112
+ uv run agentic-windows-mcp serve --transport streamable-http --host 0.0.0.0 --port 8000
113
+ # Endpoint: http://<IP-máy-bạn>:8000/mcp
114
+ ```
115
+
116
+ **Chế độ stdio (cho Agent chạy cùng máy**, ví dụ Claude Desktop, Cursor, VS Code): xem cấu hình ở mục kết nối bên dưới — client sẽ tự khởi động server qua `uvx`.
117
+
118
+ ### Tự khởi động cùng Windows
119
+
120
+ ```powershell
121
+ uv run agentic-windows-mcp install # tạo Scheduled Task "agentic-windows-mcp-server"
122
+ uv run agentic-windows-mcp uninstall # gỡ task và dừng server
123
+ ```
124
+
125
+ ### Phơi endpoint ra ngoài an toàn
126
+
127
+ Đừng mở port trực tiếp ra Internet. Hãy dùng một trong các cách:
128
+
129
+ - **Tailscale** (khuyên dùng): cài Tailscale trên cả PC và thiết bị của bạn, rồi `tailscale serve --bg --https=443 http://127.0.0.1:8000` — endpoint chỉ xuất hiện trong tailnet riêng của bạn.
130
+ - **WireGuard / VPN** tự host, hoặc reverse proxy HTTPS (Caddy/Nginx) có xác thực.
131
+
132
+ ### Cấu hình
133
+
134
+ File cấu hình đặt tại `~/.agentic-windows-mcp/config.toml`:
135
+
136
+ ```toml
137
+ [server]
138
+ # host / port / transport mặc định...
139
+
140
+ [control]
141
+ enabled = true
142
+ policy = "strict" # relaxed | balanced | strict
143
+ idle_timeout_seconds = 10
144
+ ```
145
+
146
+ ---
147
+
148
+ ## 🔌 Kết nối các AI Agent
149
+
150
+ Nguyên tắc chung: **bất kỳ ứng dụng nào hỗ trợ giao thức MCP (Model Context Protocol) đều kết nối được**, qua stdio (cùng máy) hoặc Streamable HTTP (qua mạng, kèm header `Authorization: Bearer <API_KEY>`).
151
+
152
+ ### Muse (muse.ai) & các agent dạng web/app
153
+ Các agent chạy trên nền web không tự cài phần mềm lên máy bạn — chúng kết nối tới endpoint HTTP của Agentic Windows MCP:
154
+
155
+ 1. Chạy server ở chế độ HTTP như trên và phơi qua Tailscale/HTTPS.
156
+ 2. Trong agent, thêm **custom connector / MCP server** với URL `https://<máy-của-bạn>/mcp` và khóa xác thực.
157
+ 3. Agent sẽ thấy toàn bộ 40 công cụ và bắt đầu điều khiển được PC của bạn — kể cả việc mở dự án, sửa code và đẩy lên GitHub.
158
+
159
+ ### ChatGPT
160
+ ChatGPT hỗ trợ MCP qua **Developer mode / Connectors**:
161
+
162
+ 1. Settings → Connectors → bật Developer mode → *Create* một connector mới.
163
+ 2. Nhập URL MCP (`https://<máy-của-bạn>/mcp`) và khóa API.
164
+ 3. Trong cuộc trò chuyện, bật connector và ra lệnh, ví dụ: *"Mở thư mục dự án X trên máy tôi, chạy test và sửa các lỗi đang fail."*
165
+
166
+ ### Claude (Claude Desktop & Claude Code)
167
+ Cùng máy — dùng stdio, Claude tự khởi động server:
168
+
169
+ ```json
170
+ {
171
+ "mcpServers": {
172
+ "agentic-windows-mcp": {
173
+ "command": "uvx",
174
+ "args": ["agentic-windows-mcp"]
175
+ }
176
+ }
177
+ }
178
+ ```
179
+
180
+ Khác máy — trỏ tới endpoint HTTP:
181
+
182
+ ```json
183
+ {
184
+ "mcpServers": {
185
+ "agentic-windows-mcp": {
186
+ "url": "http://<IP-máy-bạn>:8000/mcp",
187
+ "headers": { "Authorization": "Bearer <API_KEY>" }
188
+ }
189
+ }
190
+ }
191
+ ```
192
+
193
+ Claude Code: `claude mcp add --transport http agentic-windows-mcp http://<IP-máy-bạn>:8000/mcp --header "Authorization: Bearer <API_KEY>"`.
194
+
195
+ ### Gemini
196
+ - **Gemini CLI**: thêm vào `~/.gemini/settings.json` đúng định dạng `mcpServers` như ví dụ của Claude ở trên (stdio hoặc `httpUrl` + `headers`).
197
+ - **Google AI Studio / Gemini API**: dùng MCP client tích hợp trong ứng dụng của bạn và trỏ tới cùng endpoint HTTP.
198
+
199
+ ### DeepSeek & mọi agent khác
200
+ DeepSeek (và các mô hình khác) kết nối được theo hai cách:
201
+
202
+ - **Qua một MCP host** có sẵn: Cursor, VS Code (Copilot agent mode), Cline, Continue, Windsurf... — chỉ cần thêm khối `mcpServers` ở trên; mô hình phía sau là gì không quan trọng, kể cả DeepSeek.
203
+ - **Qua HTTP trực tiếp**: bất kỳ framework agent nào (LangChain, LlamaIndex, code tự viết...) gọi JSON-RPC tới `POST /mcp` với header xác thực đều dùng được.
204
+
205
+ ### Bảng tra nhanh
206
+
207
+ | Agent / Client | Cách kết nối | Ghi chú |
208
+ |---|---|---|
209
+ | Muse (web/app) | HTTP connector | Agent ở xa, điều khiển PC qua Tailscale/HTTPS |
210
+ | ChatGPT | HTTP connector (Developer mode) | Cần bật Developer mode |
211
+ | Claude Desktop / Code | stdio hoặc HTTP | stdio khi cùng máy |
212
+ | Gemini CLI | stdio hoặc HTTP | Cấu hình `mcpServers` |
213
+ | DeepSeek | Qua MCP host (Cursor/Cline/VS Code...) | Mô hình thay thế linh hoạt |
214
+ | Cursor / VS Code / Windsurf | stdio hoặc HTTP | Thêm khối `mcpServers` |
215
+
216
+ ---
217
+
218
+ ## 🧰 Bộ công cụ (40 tools)
219
+
220
+ | Nhóm | Công cụ |
221
+ |---|---|
222
+ | **Điều khiển desktop** | `Click`, `Type`, `Move`, `Scroll`, `Shortcut`, `MultiSelect`, `MultiEdit`, `Snapshot`, `Screenshot`, `Wait`, `WaitFor` |
223
+ | **Ứng dụng & hệ thống** | `App`, `PowerShell`, `FileSystem`, `Registry`, `Process`, `Clipboard`, `Notification`, `DisplayInventory`, `Scrape` |
224
+ | **Cổng kiểm soát** | `ControlStatus` (xem ai đang giữ quyền điều khiển, chính sách đang áp dụng) |
225
+ | **Trình duyệt (CDP)** | `Browser_Connect`, `Browser_Navigate`, `Browser_ManageTabs`, `Browser_GetPageSnapshot`, `Browser_QueryElements`, `Browser_Interact`, `Browser_TakeScreenshot`, `Browser_Highlight`, `Browser_EvaluateScript` |
226
+ | **DevTools chuyên sâu** | `Browser_GetCssStyles`, `Browser_GetComputedStyle`, `Browser_GetMatchedStyles`, `Browser_GetAccessibilityTree`, `Browser_ListConsoleMessages`, `Browser_ListNetworkRequests`, `Browser_GetNetworkDetails`, `Browser_GetStorage`, `Browser_ListPageSources`, `Browser_GetSourceText` |
227
+
228
+ ---
229
+
230
+ ## 💬 Ví dụ ra lệnh cho Agent
231
+
232
+ - *"Mở dự án `D:\code\shop-web` trên máy tôi, chạy test, sửa hết lỗi đang fail rồi commit và push lên GitHub."*
233
+ - *"Trang chủ web của tôi tải chậm — mở nó trong Chrome, kiểm tra tab Network xem request nào chậm và vì sao."*
234
+ - *"Đọc file Excel báo cáo trong thư mục Downloads, tổng hợp doanh thu theo tháng và lưu thành file mới."*
235
+ - *"Cài đặt Node.js và VS Code lên máy này, cấu hình git với tên và email của tôi."*
236
+ - *"Mở ứng dụng ghi chú, chép nội dung cuộc họp hôm nay từ clipboard vào và lưu lại."*
237
+
238
+ ---
239
+
240
+ ## 🏗️ Kiến trúc
241
+
242
+ ```
243
+ Agent (MCP client)
244
+ │ JSON-RPC: stdio / Streamable HTTP (+ Bearer auth / OAuth)
245
+ ▼
246
+ Agentic Windows MCP (FastMCP, Python)
247
+ ├── Desktop layer .... Win32 API + UI Automation (cây phần tử, ảnh chụp)
248
+ ├── Control plane .... cổng kiểm soát: viền phát sáng, bảng báo, chính sách
249
+ │ relaxed/balanced/strict, phím takeover, hàng đợi lease
250
+ ├── System layer ..... PowerShell, FileSystem, Registry, Process
251
+ └── Browser layer .... Playwright + CDP trực tiếp (Network/CSS/DOM/
252
+ Accessibility/Debugger/Storage domains)
253
+ ▼
254
+ Windows 10 / 11
255
+ ```
256
+
257
+ Mã nguồn chính nằm trong `src/agentic_windows_mcp/` (`desktop/`, `browser/`, `tools/`, `infrastructure/`, `filesystem/`, `powershell/`, `registry/`, `uia/`...).
258
+
259
+ ---
260
+
261
+ ## 🤝 Đóng góp
262
+
263
+ Mọi đóng góp đều được hoan nghênh — mở issue hoặc pull request tại [github.com/homenewstar/agentic-windows-mcp](https://github.com/homenewstar/agentic-windows-mcp). Khi phát triển, chạy kiểm thử bằng `uv run pytest`.
264
+
265
+ ## 📄 Giấy phép
266
+
267
+ Phát hành theo giấy phép **MIT** — © 2026 **Vu Manh Ruy**. Xem chi tiết trong [LICENSE.md](LICENSE.md).