Skip to main content
Glama
pad-actions

pad-actions

by zhzaill

⚠️ 实验性 / 不成熟(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

等待若干毫秒

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

Related MCP server: windows-computer-use-mcp

开发与运行

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 确认实际路径):

{
  "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"这个动作闭环。

Available Tools

6 tools
app_runningA

检查进程是否在运行。

Args: name: 进程名(如 "Docker Desktop"、 "docker"、 "com.docker.backend")。

Returns: running: 是否在运行;pids: 匹配到的进程 ID(可能多个)。

Inputs: name (required).

get_screen_sizeA

返回虚拟桌面尺寸(物理像素)。

Inputs: no named parameters.

open_appA

启动一个已安装的应用。

Args: name: 应用显示名(如 "Docker Desktop")或 exe 名(如 "notepad")。 会按注册表 DisplayName 或 PATH 查找。 path: 应用 exe 的完整路径(优先于 name 使用)。

Returns: 是否成功启动,以及使用的路径/对象。

Inputs: name, path.

open_urlA

用浏览器打开一个 URL。

Args: url: 完整地址(如 http://localhost)。 browser: default | chrome | edge | firefox。

Returns: 是否成功发起打开。

Inputs: url (required), browser.

screenshotA

截取全屏 PNG。

Args: path: 保存路径;省略则存到临时目录。

Returns: 保存的文件路径。

Inputs: path.

waitA

等待 ms 毫秒(用于给服务启动/界面刷新留时间)。

Inputs: ms (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    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.

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables automation of native Windows desktop applications through screen capture, mouse/keyboard control, and waiting for UI changes, exposing them as MCP tools.
      1
      -
    • A
      license
      Not graded
      quality
      D
      maintenance
      Provides desktop automation tools for Windows, enabling mouse and keyboard control, screenshots, clipboard management, and application interaction via the MCP protocol.
      118 npm
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      Enables MCP clients to open and close applications, files, and folders on a Windows machine, manage running apps and File Explorer windows, control Chrome tabs, and perform system actions like shutdown and restart.
      27
      ISC
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables MCP-capable AI agents to control Windows desktops through UI Automation element trees, native screenshots, app launching, batched action sequences, smart waits, and safety gates using normalized coordinates.
      MIT