Skip to main content
Glama
README.md
> ⚠️ **实验性 / 不成熟(EXPERIMENTAL / PRE-ALPHA)**
>
> 这是个人「边做边学」的作品,**尚未成熟、未上生产**。它只在我的 Windows 机器上真机验证过一次(打开 Dify 的场景),
> Windows 专属,代码简单、缺少测试与文档,接口随时可能变动,也不保证安全。
> **请不要在重要/生产环境使用**;如要用于他人机器或无人值守,风险自负。

# pad-actions — 通用 Windows 动作 MCP

一个**通用的、不局限于单一演示**的 MCP 服务器:把"打开应用 / 打开 URL / 截图 / 查询服务状态 / 等待"定义成可复用工具。首个落地场景 = 从人的视角演示打开 Dify。

## 工具(通用动作)

| 工具 | 参数 | 作用 |
|---|---|---|
| `open_app` | `name` (注册表 DisplayName 或 exe 名)、`path`? (exe 全路径) | 启动应用(如 `Docker Desktop`、`notepad`)。*注入:Explorer.exe 关联打开,非鼠标点击* |
| `open_url` | `url`、`browser`? (default/chrome/edge/firefox) | 用默认浏览器打开 URL |
| `screenshot` | `path`? | 全屏 PNG 截图,返回保存路径 |
| `get_screen_size` | — | 虚拟桌面尺寸 |
| `app_running` | `name` | 检查进程是否在运行(可用于轮询 Docker 引擎就绪) |
| `wait` | `ms` | 等待若干毫秒 |

所有工具返回结构化结果;不移动/点击鼠标,符合"鼠标不必要"。

## 开发与运行

```powershell
cd pad-actions
uv sync
uv run pad-actions            # stdio(默认)
# uv run pad-actions sse   | streamable-http   (可选传输)
```

环境:Python 3.11+;依赖 `mcp>=2`(v2 API,FastMCP 已更名为 `MCPServer`)、`mss`、`psutil`。

## 客户端接入示例(Claude Desktop config)

`uv sync` 之后,脚本入口在这里(`uv sync` 时会提示,或用 `uv run which pad-actions` 确认实际路径):

```json
{
  "mcpServers": {
    "pad-actions": {
      "command": "D:\\11\\Ayxi\\ai infra\\pad-actions\\.venv\\Scripts\\pad-actions.exe"
    }
  }
}
```

## 已真机验证的成果(2026-09-08)

1. `open_app("Docker Desktop")` → 解析到 `D:\Docker\Docker\Docker Desktop.exe` 并启动;
2. 轮询 ~15s 后 Docker 引擎就绪(v29.7.2,`npipe://./pipe/dockerDesktopLinuxEngine`);
3. 因 Dify 容器全部 `restart: always`,引擎一启容器**自动恢复**(nginx/api/web/db 等 15 个全部 Up);
4. `open_url("http://localhost")` → **HTTP 200**,页面标题 "Sign in - Dify"(DB 已有管理员,故登录页而非 /install);
5. `screenshot()` 保存为 `../dify/dify-open.png` 作为演示截图。

> 一次 `open_app` → 引擎自愈 → 容器自启 → 打开页面,完整串通了"从人的视角打开 Dify"这个动作闭环。

TDQS

A4/5.0

Scored across 6 tools

Disambiguation5/5

Each tool targets a distinct action: launching an app, opening a URL, capturing the screen, getting screen dimensions, checking a process, and waiting. There is no meaningful overlap or ambiguity among them.

Naming Consistency3/5

The naming is generally readable and mostly uses snake_case, but conventions vary: open_app/open_url/get_screen_size follow verb_noun, while app_running and screenshot break that pattern, and wait is just a bare verb. This is a minor inconsistency rather than chaos.

Tool Count5/5

Six tools is a reasonable, well-scoped set for a small desktop action utility. Every tool serves a practical purpose and the count feels neither bloated nor thin.

Completeness4/5

The set covers the core lifecycle of opening apps/URLs, checking whether they started, waiting, and capturing screen state. Minor gaps exist such as no close_app or window interaction, but agents can still complete common workflows without major dead ends.

Maintenance

ActivityMaintained
ResponsivenessNo issues