DeepSHPlugins
dsh-computer-use-win 專案預覽
GITHUB / COMMUNITY PROJECT

dsh-computer-use-win

工具與整合PowerShellMIT

為 DeepSeek Harness 提供 Windows 電腦操控:MCP stdio 伺服器 + PowerShell UIA 後端,22 個桌面工具(UIA 樹、截圖、鍵鼠輸入、OCR、視窗管理、急停保護)。

11 StarsYu-tao-Li 更新時間 2026-09-10
訪問 GitHub 倉庫
dsh-computer-use-win 專案預覽
dsh-computer-use-win 介面截圖dsh-computer-use-win 介面截圖dsh-computer-use-win 介面截圖

專案介紹

中文

為 DeepSeek Harness 提供 Windows 電腦操控:MCP stdio 伺服器 + PowerShell UIA 後端,22 個桌面工具(UIA 樹、截圖、鍵鼠輸入、OCR、視窗管理、急停保護)。

English

Windows computer use for DeepSeek Harness: an MCP stdio server over a PowerShell UIA backend exposing 22 desktop tools (UIA tree, screenshots, typed input, OCR, window management, failsafe).

專案資訊與收錄訊號

快照 2026-09-11
作者 / 組織
Yu-tao-Li
倉庫
Yu-tao-Li/dsh-computer-use-win
GitHub Stars
11
Forks
1
開發語言
PowerShell
許可證
MIT
最近推送
2026-09-10
Manifest
資料中檢測到宣告

公開倉庫不自動等於可商用;許可證與當前相容性以原專案文件為準。Manifest 和資料評分不構成安裝安全認證。

資料評分

74/ 100
維護活躍
100
文件與實用資訊
85
生態關注度
33
安裝便捷訊號
75
專案宣告訊號
100

近 1 天仍在更新;README 含完整安裝與使用說明。

評分來自已有資料快照的五維模型,僅作瀏覽參考,不是實際使用評測或安全檢測結論。

安裝與使用

所有專案資料與許可均以對應 GitHub 倉庫為準。

dsh plugin --profile web add github:Yu-tao-Li/dsh-computer-use-win

複製命令不會自動執行。請先閱讀倉庫文件,確認環境要求與許可證。

專案截圖

倉庫 README

GitHub 原文

已儲存的倉庫文件快照;文件抓取時間未記錄,可能與上方目錄介紹處於不同版本。安裝前請核對當前倉庫說明。

儲存庫檔案保留原文,指令與授權文字不作自動改寫。

English

dsh-computer-use-win

version CI license platform stars

Awesome DSH Plugin

给 DeepSeek Harness 装上 Windows 电脑操控能力——MCP stdio 服务器 + PowerShell/UIA 桌面引擎,22 个工具让 agent 能看(UIA 无障碍树、窗口裁剪截图、OCR 词框)也能做(鼠标、键盘、UIA 语义动作、窗口管理)真实的 Windows 桌面应用。

通过 DSH 内置的 @deepseek-ai/dsh-mcp-client 桥接,不改 DSH 本体,零运行时依赖。

① 文件资源管理器:find 定位 + 语义 invoke 选中文件(状态栏"选中 1 个项目")② type_text 写入真实文档(剪贴板路径,verifyValue 回读)③ UWP 计算器:find 定位按钮 + 语义 Invoke 点击(25×4=100)
123

特性

  • 文本优先的观察——UIA 无障碍树三视图(control/content/raw);按 name/automationId/类名/值找控件,不靠猜像素。元素 id 用 UIA RuntimeId(UI 刷新后仍稳定,过期报 stale 而非点错地方)。
  • 三级截图链——PrintWindow(非前台窗口也能抓)→ WGC(Windows.Graphics.Capture,DirectComposition/被遮挡窗口)→ 屏幕区域兜底(带 occludedPossible 标记)。窗口裁剪 + 降采样 + imageScale/origin 坐标映射,PNG 30 分钟自动清理。
  • 三条输入路径,诚实上报——语义(UIA pattern,不碰鼠标)/ 前台(SetCursorPos + SendInput + 剪贴板 / KEYEVENTF_UNICODE)/ 后台(PostMessage 直进窗口消息队列,不抢前台;投递未验证,如实 verified:false——Chromium/Electron/WinUI 会静默丢合成消息,工具会明说)。
  • UIA 盲区 OCR 回退——Windows.Media.Ocr(csc 编译的 C# WinRT 助手);返回文字 + 逐词屏幕坐标词框,query 命中后自动回查匹配词下的控件(ControlFromPoint)。
  • 内置安全机制
  • *坐标 homing*——观察后窗口被移动,点击自动补偿并回报 homed:{dx,dy}
  • *急停 failsafe*——物理鼠标停屏幕角落 500ms,所有输入被拒(EMERGENCY STOP),只有人把鼠标移开才恢复
  • *identity guard*——按 windowTitle 操作时窗口 HWND/PID 变了就拒绝(identity_changed)
  • *前台校验*——输入 fail-closed:目标窗口不是真前台就直接报错,绝不打进别的窗口
  • *Win 键黑名单*——Win+R/X/L/S 类组合按设计拦截
  • 持久化后端——一个常驻 PowerShell 进程 + JSON 行协议,热态延迟 6–100ms(首次 ~500ms 冷启动);C# P/Invoke 助手按 hash 编译成缓存 DLL,重启免重编。

安装

# 从 GitHub(--profile 指定装进哪个 profile)
dsh plugin --profile web add github:Yu-tao-Li/dsh-computer-use-win
# 或在 DSH 设置的插件市场(dshmarket)搜索 dsh-computer-use-win

重启 dsh web,工具以 mcp__wincu__windows_computer_use_* 出现。

bundle 在启动时自解析路径(cordis.patch.yml 的 !!js 从所在 profile 解析 server.mjs),任何 profile / $DSH_HOME 都能装,无硬编码路径。同一 profile 只保留一个 serverName: wincu 行。

工具清单(22 个,前缀 mcp__wincu__)

分组工具
观察health · snapshot(树+截图)· accessibility_tree · list_windows · find · element_info · ocr
动作click · double_click · move · drag · scroll · type_text(clipboard/sendinput/background)· keypress · focus · invoke · set_value
窗口activate_window · move_window · close_window(WM_CLOSE,应用可弹保存框否决)· wait_for · wait

所有工具都支持可选窗口定位(windowTitle 子串 / processId / nativeWindowHandle)+ activate: true;不指定 = 当前前台窗口。

架构

DSH agent
   │  模型看到 mcp__wincu__windows_computer_use_* 工具
   ▼
@deepseek-ai/dsh-mcp-client   ← DSH 内置桥接(官方 MCP SDK StdioClientTransport)
   │  JSON-RPC 2.0 over stdio(按行分帧)
   ▼
mcp/server.mjs                ← 本仓库:MCP 服务器(Node ≥22,零依赖)
   │  保活一个持久化后端;JSON 行协议
   ▼
scripts/windows-uia.ps1       ← 本仓库:桌面引擎(PowerShell 5.1 兼容)
   ├─ UI Automation 程序集        → 无障碍树
   ├─ user32 P/Invoke(C# 缓存 DLL)→ 鼠标/键盘/窗口操作
   ├─ Windows.Media.Ocr(C# WinRT)→ OCR
   └─ Windows.Graphics.Capture   → WGC 窗口捕获

安全与限制

  • 动作是真实的——敏感操作前让 agent 先 snapshot;重要窗口用 windowTitle 明确限定。
  • WinUI / Chromium / Electron 会丢弃 PostMessage 合成输入(verified:false 是诚实上报,不是成功)。这类目标走前台/剪贴板路径。
  • 提权窗口(UAC/管理员程序)UIA 与合成输入都被 Windows 拦截,读不到也点不了。
  • 坐标以物理像素为准(显式 Per-Monitor V2 DPI)。
  • OCR 对 CJK 按字符给词框(引擎特性),点选足够用。
  • 仅支持 Windows。

开发

mcp/server.mjs          MCP stdio 服务器 + 持久化后端管理
scripts/windows-uia.ps1 桌面引擎(one-shot 与 -Persistent 双模式)
test/                   self-test / MCP 协议 / Notepad E2E / 功能综合 / 延迟基准
docs/wiki/              上游架构文档(见 THIRD_PARTY.md)
docs/dev-notes.md       设计原理、踩坑记录、性能数据、测试记录
node mcp/server.mjs --self-test     # 全栈自检(仅 Windows)
node test/mcp-test.mjs              # initialize → tools/list → tools/call
node test/notepad-e2e.mjs           # 真实输入端到端(会开记事本)

CI(.github/workflows/ci.yml)在每次 push/PR 时于 windows-latest 跑自检 + 协议测试。

许可

MIT,见 LICENSE。本项目是 cgissing/windows-computer-use(MIT)的衍生作品,上游版权声明保留于 THIRD_PARTY.md。

使用前核對

安裝步驟、相容版本與授權範圍以原專案當前文件為準。Stars 和評分是快照中的導航訊號。

安裝與排錯 · 專案問題反饋

同類專案