Skip to main content
Glama
UIAutomationMcp

UIAutomationMcp

by trsdn

UIAutomationMcp

License: MIT .NET Platform

Windows UI 自动化工具包,提供三个对齐的入口点:

  • CLI(uiamcp)

  • MCP 服务器(UIAutomationMcp.McpServer)

  • VS Code 扩展(uia-mcp)

安装

VS Code 扩展(推荐)——在 Marketplace 中搜索“UI Automation MCP”,或从最新版本安装 UIAutomationMcp-<version>.vsix。自包含;捆绑了 MCP 服务器、CLI 和两个代理技能。

Claude Desktop —— 从最新版本下载 uia-mcp-<version>.mcpb 并双击它。

NuGet .NET 工具

dotnet tool install --global UIAutomationMcp.McpServer   # MCP server -> uiamcp-server
dotnet tool install --global UIAutomationMcp.CLI         # CLI        -> uiamcp

独立 ZIP —— UIAutomationMcp-MCP-Server-<version>-windows.zip 包含自包含的 MCP 服务器和 CLI;无需 .NET 运行时。

需要 Windows 和交互式桌面会话。UI 自动化无法在无头模式下运行。

Related MCP server: windows2text

谱系

此仓库是更广泛的 MCP 自动化谱系的一部分,并有意保留对 Stefan Brönner 早期工作的归属。

它还保留了对 Excel MCP 的历史引用,作为该谱系中的相关兄弟项目,尽管此仓库本身专注于 Windows UI 自动化。

功能

  • 通过 Interop.UIAutomationClient 启动类型化 UI 自动化客户端

  • 读取丰富的桌面根和焦点元素元数据,包括边界、运行时 ID 和支持的模式

  • 从原生窗口句柄和屏幕坐标解析元素

  • 按名称、类名、自动化 ID、框架 ID、控件类型和进程 ID 搜索 UIA 树

  • 从原始、控件或内容树视图枚举直接子元素

  • 从原始、控件或内容树视图枚举后代

  • 使用原始、控件和内容遍历器导航 UIA 树

  • 支持检查、搜索和导航的构建缓存请求

  • 读取文本、选择和键模式状态

  • 等待焦点、自动化、属性更改和结构更改事件

  • 执行常见操作,如焦点、调用、设置值、切换、展开/折叠、选择、窗口状态更改、移动/调整大小、滚动和范围值更新

  • 通过 CLI 和 MCP 公开相同的扩展表面

  • 将 CLI 和 MCP 服务器打包在 VS Code 扩展中

仓库布局

  • src\UIAutomationMcp.ComInterop

  • src\UIAutomationMcp.Service

  • src\UIAutomationMcp.CLI

  • src\UIAutomationMcp.McpServer

  • src\UIAutomationMcp.Smoke

  • vscode-extension

  • mcpb —— Claude Desktop 捆绑包源和构建脚本

  • skills —— 用于 uia-cli 和 uia-mcp 的代理技能

构建和验证

dotnet build .\UIAutomationMcp.sln -c Release
.\src\UIAutomationMcp.Smoke\bin\Release\net9.0-windows\UIAutomationMcp.Smoke.exe
.\src\UIAutomationMcp.CLI\bin\Release\net9.0-windows\uiamcp.exe inspect --root --cache
.\src\UIAutomationMcp.CLI\bin\Release\net9.0-windows\uiamcp.exe find --focused --scope children --max-results 10 --cache
.\src\UIAutomationMcp.CLI\bin\Release\net9.0-windows\uiamcp.exe children --focused --view raw --max-results 10
.\src\UIAutomationMcp.CLI\bin\Release\net9.0-windows\uiamcp.exe descendants --focused --view raw --max-results 25
.\src\UIAutomationMcp.CLI\bin\Release\net9.0-windows\uiamcp.exe wait-event --event-kind focus --timeout-ms 500
.\src\UIAutomationMcp.CLI\bin\Release\net9.0-windows\uiamcp.exe action focus --focused

相关文档

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    B
    maintenance
    Enables AI agents to select Windows desktop UI elements, windows, or screen regions via mouse hover, then obtain context through UI Automation, screenshots, and local OCR for MCP-compatible clients.
    2
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    Enables Windows UI Automation screen-to-text and computer-use via MCP, allowing agents to observe, decide, and act on Windows applications through accessibility data without OCR.
    1
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    Enables MCP clients to observe and control the Windows desktop through the UI Automation accessibility tree — no vision model required — by exposing tools for reading windows and interactive elements, clicking, typing, scrolling, shortcuts, PowerShell, screenshots, virtual desktops, web scraping, file operations and persistent memory, including background-window control without stealing focus. An optional agent mode adds a single natural-language task tool that runs the full upstream agent loop when an LLM provider is configured.
    1
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    Enables an MCP host to observe and control Windows desktop applications deterministically: reading UIA control trees, OCR text and pixel diffs, clicking, typing, scrolling and window management, plus verbatim text reading/appending via ValuePattern/TextPattern. Visual judgment is delegated back to the host model's own multimodal context through annotated screenshots, numbered element cards, grid maps and crosshair zoom-ins, so no separate vision model is needed.
    1
    AGPL 3.0