MCP server for Deepin desktop application automated testing via AT-SPI
Project description
Deepin MCP
MCP (Model Context Protocol) 服务器,用于通过 AT-SPI 对 Deepin 桌面应用进行自动化测试。
Features
- AT-SPI 应用检测 — 自动发现运行中的桌面应用及其控件树
- UI 控件操作 — 通过 AT-SPI 对按钮、输入框、菜单等控件执行点击、输入等操作
- 菜单 Comb 操作 — 支持 DTK 主菜单和右键菜单的 hover-crawl 操作
- D-Bus 调用 — 直接通过 D-Bus 接口与应用交互
- 编排式测试 — 支持 YAML/JSON 格式的测试用例定义和执行
- 截图诊断 — 操作过程中自动截图辅助调试
Architecture
三层隔离架构:
| 层级 | 组件 | 职责 |
|---|---|---|
| 检测层 | TreeWalker, MenuScanner, Monitor, Snapshot | 只读的控件发现与状态监控 |
| 执行层 | ElementActor, InputController, MenuOperator, DBusExecutor | 精准的控件操作执行 |
| 编排层 | Parser, Runner, Assertions | 测试用例解析与执行编排 |
Prerequisites
- Python >= 3.10
- 桌面 Linux 环境(Deepin / UOS),依赖 AT-SPI 和 xdotool
安装 uv(推荐)
# macOS / Linux
curl -LsSf https://astral.sh/uv/install.sh | sh
# 或使用 pip
pip install uv
Installation
# 从 PyPI 安装
pip install deepin-mcp
# 或使用 uv
uv pip install deepin-mcp
Usage
作为 MCP 服务器运行(stdio 模式,默认)
deepin-mcp
作为 MCP 服务器运行(HTTP 模式)
DEEPIN_MCP_TRANSPORT=http deepin-mcp
运行测试用例
# test_case.yaml
name: "Calculator addition"
app: "deepin-calculator"
steps:
- name: "Click 5"
action: element_action
selector: {name: "5"}
- name: "Click +"
action: element_action
selector: {name: "+"}
- name: "Click 3"
action: element_action
selector: {name: "3"}
- name: "Click ="
action: element_action
selector: {name: "="}
- name: "Verify result"
assert:
- type: element_text
selector: {role: "text"}
contains: "8"
Development
# 安装开发依赖
uv sync --group dev
# 运行测试
uv run pytest
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
deepin_mcp-0.2.0.tar.gz
(36.2 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file deepin_mcp-0.2.0.tar.gz.
File metadata
- Download URL: deepin_mcp-0.2.0.tar.gz
- Upload date:
- Size: 36.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.30 {"installer":{"name":"uv","version":"0.9.30","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Deepin","version":"25","id":"crimson","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eb82bf235b1a87cff6917a39191196336ce7077ce21728875175231c3a97a915
|
|
| MD5 |
6634a3753caf6c79839aeebf9b7a3d72
|
|
| BLAKE2b-256 |
b83d0c4d6e32fecd86ba757f80677b602aab510ca809698bd3cd3e4850407759
|
File details
Details for the file deepin_mcp-0.2.0-py3-none-any.whl.
File metadata
- Download URL: deepin_mcp-0.2.0-py3-none-any.whl
- Upload date:
- Size: 47.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.30 {"installer":{"name":"uv","version":"0.9.30","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Deepin","version":"25","id":"crimson","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f75f2f84e8233030485818603d260da9cc6bd62e036172ff08e16d9f65b2cf73
|
|
| MD5 |
7576ae48970a70496ea7c27cfad08903
|
|
| BLAKE2b-256 |
77a799b17646bb4fcf6243731f04f84582501c25729ce02d28311db6b8cb57d7
|