Windows-MCP for Antigravity
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Windows-MCP for Antigravity 基于上游开源项目 CursorTouch/Windows-MCP(v0.8.5,MIT 协议),针对 Google Antigravity 的工具体系、多模态上下文开销、插件自动发现机制与中文 Windows 桌面环境进行了系统性的工程优化与 Bug 修复。
它同时提供:
优化版 MCP 服务器(支持
--profile antigravity/desktop-only/full、紧凑 JPEG 截图、零启动睡眠、stdio 纯净度保护、中文/CJK 防输入法乱码自动粘贴等)原生 Antigravity 插件包(
plugin/:包含plugin.json、mcp_config.json、rules/AGENTS.md、skills/windows-desktop-automation/SKILL.md与矢量图标)一键安装 / 卸载 / 诊断 / 握手自检脚本(开箱即用,无需手写复杂
PYTHONPATH或 JSON)
相比上游 Windows-MCP 0.8.5 的核心优化
1. 针对 Antigravity 的架构级集成
原生 Antigravity 插件封装(
plugin/):一次安装即可同时提供 MCP 服务器、工具边界规则(rules/AGENTS.md)与渐进式加载技能(skills/windows-desktop-automation/SKILL.md),可在 Antigravity 的 Customizations / Plugins 面板一键启停。防工具重叠的 Profile 预设(
--profile antigravity):Antigravity 原生已具备
run_command、read_file/write_file/edit_file、search_web和browser子代理。上游默认暴露
PowerShell、FileSystem、Scrape,容易导致模型选错工具并白白消耗上下文 Token。--profile antigravity默认排除这 3 个重叠工具,精准保留 17 个原生 Windows 桌面与系统工具(如需完整 20 个工具,随时切换--profile full)。
Antigravity 专属 CLI 子命令:
windows-mcp doctor:一键检测 Python、pywin32/COM/UIA、截图后端、显示器与 DPI、Antigravity 插件及全局配置冲突。windows-mcp antigravity-config:自动生成可直接粘贴的 Antigravitymcp_config.json。
2. 性能与多模态 Token 优化
移除硬编码启动延迟:移除上游
lifespan中无条件的await asyncio.sleep(1),改为可配置的WINDOWS_MCP_STARTUP_DELAY(默认0),显著加快 stdio 握手速度。紧凑截图编码(JPEG / WebP / 优化 PNG):新增
WINDOWS_MCP_IMAGE_FORMAT(antigravity预设默认jpeg)、WINDOWS_MCP_IMAGE_QUALITY(默认85)以及WINDOWS_MCP_MAX_IMAGE_WIDTH/WINDOWS_MCP_MAX_IMAGE_HEIGHT,相比无压缩 PNG 体积可降低 5–10 倍,大幅减少 stdio 传输耗时与多模态负载。向量化截图边框渲染 + 默认静默:
修复上游
flash_overlay.py用纯 Python 循环逐像素遍历 200 万像素(每次截图最多跑 32 帧、导致 CPU 飙升)的性能瓶颈,改为 NumPy 向量化实现(提速约 100 倍)。antigravity预设默认设置WINDOWS_MCP_DISABLE_FLASH=1(可随时设回0开启)。
默认关闭遥测:
antigravity预设默认ANONYMIZED_TELEMETRY=false,并对 PostHog 初始化做了防御性异常隔离,离线/受限网络下不会阻塞或报错。
3. 稳定性与中文 Windows 关键 Bug 修复
修复 Windows 剪贴板句柄泄漏(Critical):修复
uia/core.py中GetClipboardText()在剪贴板为图片/文件等非文本格式时未调用CloseClipboard()导致整个系统剪贴板锁死的严重 Bug。中文 / CJK 输入防乱码:优化
Desktop.type(),任何包含非 ASCII(如中文、日文、韩文、Emoji)且不含控制字符的短文本均自动走剪贴板粘贴并恢复原剪贴板内容,彻底避开微软拼音等 IME 组合态丢字/乱码问题。修复
Scroll工具返回值运算符优先级 Bug:修复tools/input.py中loc=None时返回空字符串""的缺陷。修复
Click三击及以上描述 Bug:修复clicks >= 3时返回"None left clicked..."的问题,现支持Triple/Nx。修复
Snapshot参数文档拼写不一致:修正工具描述中的width_reference_lines/height_reference_lines与实际参数名width_reference_line/height_reference_line不匹配的问题,避免模型传参触发 schema 校验报错。修复
PIL.ImageDraw多线程绘制竞争:将get_annotated_screenshot中对非线程安全ImageDraw对象的并发调用改为确定性顺序绘制。修复
App(mode="resize")首次调用失败:当未指定窗口名且缓存为空时自动查询当前前台窗口。增强
Clipboard并发重试与Notification默认 AUMID:剪贴板打开增加短暂重试避免偶发Access is denied;Notification的app_id改为可选并内置 Windows PowerShell 系统 AUMID,开箱即可弹窗通知。Stdio 纯净度保护与零配置启动器:
scripts/run_server.py自动配置 UTF-8、屏蔽导入期第三方库对 stdout 的意外输出,并兼容标准虚拟环境、uv以及离线vendor/目录(自动处理pywin32_system32DLL 搜索路径)。
Related MCP server: Windows-MCP
工具预设对比(Profiles)
Profile | 暴露工具数 | 排除的工具 | 适用场景 |
| 17 |
| 与 Antigravity 原生终端、文件、浏览器工具协同,省 Token、无冲突 |
| 14 |
| 仅需纯桌面视觉/键鼠/窗口/剪贴板自动化,最小权限面 |
| 20 | 无 | 与上游 Windows-MCP 100% 行为一致的全量模式 |
视觉与感知:
Screenshot、Snapshot、DisplayInventory窗口与应用:
App(支持launch/launch_executable/resize/switch)键鼠与批量操作:
Click、Type、Scroll、Move、Shortcut、MultiSelect、MultiEdit等待同步:
Wait、WaitFor(text_exists/active_window/element_exists/element_enabled/focused_element)系统工具:
Clipboard、Process、Notification、Registry
快速开始
环境要求
Windows 10 / 11
Python 3.12+(推荐同时安装
uv或使用venv+pip)Google Antigravity(Desktop / IDE / CLI)
第一步:克隆并安装依赖
方式 A:使用 uv(推荐)
git clone https://github.com/Shaa-Yyu/Windows-MCP-Antigravity.git
cd Windows-MCP-Antigravity
uv sync方式 B:使用标准 Python venv + pip
git clone https://github.com/Shaa-Yyu/Windows-MCP-Antigravity.git
cd Windows-MCP-Antigravity
python -m venv .venv
.\.venv\Scripts\python.exe -m pip install -e .第二步:一键安装并启用到 Antigravity
双击 install.bat,或在 PowerShell 中运行:
# 推荐:安装为 Antigravity 原生插件(自动包含 MCP Server + 规则 + 技能)
powershell -ExecutionPolicy Bypass -File .\scripts\install.ps1
# 若使用 uv 管理环境:
powershell -ExecutionPolicy Bypass -File .\scripts\install.ps1 -UseUv
# 可选:切换为纯 GUI 最小权限模式(desktop-only)或全量模式(full)
powershell -ExecutionPolicy Bypass -File .\scripts\install.ps1 -Profile desktop-only
# 可选:仅写入全局 ~/.gemini/config/mcp_config.json(不安装插件规则和技能)
powershell -ExecutionPolicy Bypass -File .\scripts\install.ps1 -Mode global-mcp安装脚本会自动完成:
执行只读的 MCP stdio 握手自检(
initialize+tools/list),确认环境正常;将原生插件部署到
%USERPROFILE%\.gemini\config\plugins\windows-mcp\,并写入已解析好的本地路径配置;Antigravity 会自动发现并默认启用该插件,你可以随时在 Plugins / Customizations 面板中查看状态或一键开关。
手动配置(~/.gemini/config/mcp_config.json)
如果你希望手动配置而不使用插件模式,可以运行内置生成器:
python scripts\run_server.py antigravity-config输出示例:
{
"mcpServers": {
"windows-mcp": {
"command": "C:\\Path\\To\\Python312\\python.exe",
"args": [
"C:\\Path\\To\\windows-mcp-antigravity\\scripts\\run_server.py",
"serve",
"--profile",
"antigravity"
],
"env": {
"ANONYMIZED_TELEMETRY": "false",
"WINDOWS_MCP_PROFILE": "antigravity",
"WINDOWS_MCP_DISABLE_FLASH": "1",
"WINDOWS_MCP_IMAGE_FORMAT": "jpeg",
"WINDOWS_MCP_IMAGE_QUALITY": "85",
"PYTHONUTF8": "1",
"PYTHONIOENCODING": "utf-8"
}
}
}
}注意:请勿同时在全局
mcp_config.json与插件plugins/windows-mcp/mcp_config.json中重复注册同名的windows-mcp,以免产生 MCP 服务器名称冲突。
自检、测试与卸载
# 1. 运行环境与 Antigravity 集成诊断
python scripts\run_server.py doctor
# 2. 运行只读 MCP stdio 握手测试(不触发任何桌面操作)
python scripts\probe_handshake.py --profile antigravity
# 3. 运行单元测试
python -m unittest discover -s tests -v
# 4. 卸载(自动清理插件目录及全局 mcp_config.json 中的对应条目)
.\uninstall.bat常用环境变量
变量名 |
| 说明 |
|
| 工具预设: |
|
| 截图编码格式: |
|
| JPEG/WebP 压缩质量(1–100) |
|
| 截图最大宽度(超出等比缩放并在元数据给出坐标倍率) |
|
| 截图最大高度 |
|
| 额外缩放倍率( |
|
| 截图后端: |
|
| 设为 |
|
| 启动延迟秒数(默认 |
|
| 设为 |
|
| 单次 |
| PowerShell AUMID | 自定义 Toast 通知的 Windows AUMID |
|
| 设为 |
仓库目录结构
windows-mcp-antigravity/
├── src/windows_mcp/ # 优化后的 Windows-MCP 核心源码
│ ├── _bootstrap.py # UTF-8 stdio 守护与可选本地 vendor/pywin32 引导
│ ├── antigravity.py # Profile 预设、配置生成与 doctor 诊断
│ ├── __main__.py # CLI 入口(serve / doctor / antigravity-config / auth / install)
│ ├── desktop/ # 截图、标注、CJK 自动粘贴与向量化 overlay
│ ├── tools/ # MCP 工具定义与紧凑图像编码
│ ├── uia/ # UIAutomation 封装(已修复剪贴板句柄泄漏)
│ └── ... # tree / watchdog / vdm / process / registry / notifications
├── plugin/ # Antigravity 原生插件模板
│ ├── plugin.json # 插件清单
│ ├── mcp_config.json # MCP 服务器配置模板
│ ├── assets/logo.svg # 插件图标
│ ├── rules/AGENTS.md # Antigravity 工具边界与安全准则
│ └── skills/windows-desktop-automation/SKILL.md
├── scripts/
│ ├── run_server.py # 零配置 stdio 启动器
│ ├── probe_handshake.py # 只读 MCP 握手自检脚本
│ ├── install.ps1 # 一键安装脚本(支持 plugin / global-mcp)
│ └── uninstall.ps1 # 一键卸载脚本
├── tests/ # 优化与 Bug 修复验证测试
├── install.bat / uninstall.bat # Windows 双击脚本入口
├── pyproject.toml
├── CHANGELOG.md
└── LICENSE安全提示
windows-mcp拥有你当前 Windows 桌面账号同等的 GUI 操作权限(截图、模拟键鼠、管理窗口、读写剪贴板、结束进程、读写注册表)。建议日常使用
--profile antigravity或--profile desktop-only,并结合内置的rules/AGENTS.md安全准则,在执行不可逆操作前进行人工确认。本项目默认禁用遥测(
ANONYMIZED_TELEMETRY=false),不会上传任何截图、参数或个人数据。
致谢与开源协议
本项目基于 CursorTouch/Windows-MCP(Copyright © 2025 JEOMON GEORGE)进行二次开发与 Antigravity 深度适配,遵循 MIT License,详见 LICENSE。
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Connect ChatGPT, Claude, Cursor or VS Code to your Windows PC: files, terminal, browser, apps.
Let AI see and use your own Windows PC with your permission: screen, apps, mouse and keyboard.
Connect AI assistants to your approved computer for files, commands, browser and desktop tasks.
Real desktops for AI agents, on machines you choose: screenshot, type, click, hire more agents.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to interact with Windows operating systems through native UI automation, file navigation, application control, and system commands. Provides seamless integration between LLMs and Windows environments for tasks like clicking, typing, launching apps, and capturing desktop state.MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to interact with Windows operating systems by providing tools for UI automation, file navigation, application control, and system operations. Works with any LLM to perform tasks like clicking, typing, launching applications, and executing PowerShell commands through native Windows integration.1MIT
- AlicenseNot gradedqualityCmaintenanceEnables comprehensive Windows desktop automation including screen capture, OCR text extraction, mouse/keyboard control, window management, process control, and clipboard operations through 25+ tools for AI agents.38 PyPI8MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI assistants to drive Windows desktop automation — opening and interacting with applications, native UI controls, keyboard/mouse input, files, processes, clipboard, and Chrome/Edge browsing via UI Automation and CDP. All actions pass through a safety policy with human approval, emergency stop, and deterministic verification.1MIT