Skip to main content

MCP server for Windows desktop UI automation inspection and scripting via UI Automation API

Project description

uiautomation-mcp

GitHub

基于 UI Automation API 的 MCP Server,用于检查和自动化 Windows 桌面 UI 元素。

为 AI 助手提供探索 UI 控件树、检查元素属性、执行操作(点击、输入、切换等)以及生成可直接使用的 Python 自动化脚本的能力。

安装

pip install uiautomation-mcp

或使用 uv

uv pip install uiautomation-mcp

使用方式

命令行启动

uiautomation-mcp

通过 stdio 启动 MCP Server。

MCP 客户端配置

添加到 MCP 客户端配置文件(如 .kiro/settings/mcp.json):

{
  "mcpServers": {
    "uiautomation": {
      "command": "uiautomation-mcp",
      "disabled": false,
      "autoApprove": []
    }
  }
}

也可以通过 uvx 直接运行(无需预装):

{
  "mcpServers": {
    "uiautomation": {
      "command": "uvx",
      "args": ["uiautomation-mcp"],
      "disabled": false,
      "autoApprove": []
    }
  }
}

工具列表

工具 说明
list_windows 列出桌面上所有可见的顶层窗口
inspect_element_tree 从指定元素开始探索 UI 控件树
get_element_detail 获取元素的完整详情,包括自动化模式和定位策略
inspect_at_point 检查屏幕坐标处的 UI 元素
find_elements 按名称、类型、AutomationId 或类名搜索元素
capture_screenshot 截取窗口或桌面的屏幕截图
activate_window 将窗口激活并置于前台
perform_action 对元素执行操作(点击、输入、切换、展开等)
generate_script_snippet 生成可直接复制使用的 Python 自动化代码

典型工作流

  1. list_windows — 找到目标应用窗口
  2. activate_window — 将窗口置于前台
  3. inspect_element_tree — 探索 UI 结构
  4. find_elements / get_element_detail — 定位具体控件
  5. perform_action — 与元素交互
  6. generate_script_snippet — 获取可复用的自动化代码

系统要求

  • Windows 操作系统
  • Python >= 3.12

许可证

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

uiautomation_mcp-0.1.1.tar.gz (72.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

uiautomation_mcp-0.1.1-py3-none-any.whl (10.3 kB view details)

Uploaded Python 3

File details

Details for the file uiautomation_mcp-0.1.1.tar.gz.

File metadata

  • Download URL: uiautomation_mcp-0.1.1.tar.gz
  • Upload date:
  • Size: 72.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.10 {"installer":{"name":"uv","version":"0.10.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for uiautomation_mcp-0.1.1.tar.gz
Algorithm Hash digest
SHA256 d8c3d9cd3a4a1871e65df6a7fa49a0c6b8ee621da9a447ad37576f6ea25053e3
MD5 f6c384906c2e2e9b70a102c73d82c425
BLAKE2b-256 3672e000a24fdcd1d0eaa4a2242529a1ff9634e8f7e9d0a24fb1e7e908d21670

See more details on using hashes here.

File details

Details for the file uiautomation_mcp-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: uiautomation_mcp-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 10.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.10 {"installer":{"name":"uv","version":"0.10.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for uiautomation_mcp-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 eff72788ea08189f21a7b920afa3d51b627d43b373721c93b2ad51e73164f27d
MD5 30720e5f6269eea156b0c18e6e072d5b
BLAKE2b-256 0a0059382ad225f4cb26952aaf459a633a23840f07d8029eabac4d340994094b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page