dsh-computer-use
# dsh-computer-use
DeepSeek Harness 的 Computer Use MCP 服务器。通过 Accessibility 优先的语义操作驱动鼠标、键盘与界面元素,仅在 Accessibility 无法触达目标时回退到屏幕坐标。
## 功能
- **观察** — 列出运行中的应用、读取 Accessibility 树、截取窗口/屏幕截图
- **指针** — 点击、双击、右键、滚轮、拖拽、鼠标移动
- **键盘** — 输入文本、按键组合、设置元素值
- **控制** — 权限请求、剪贴板读写、显示器切换、会话停止
- **验证** — 每次动作返回 `action_receipt`,`state_id` 驱动重新观察
## 平台
| 平台 | Accessibility | 输入 |
|------|--------------|------|
| Windows | UIAccess (COM) | user32.dll (koffi) |
| macOS | AX API | CGEvent (koffi) |
| Linux | AT-SPI | XTest (koffi) |
## 要求
- Node.js >= 20
- DSH >= 1.0.0(通过 `dsh-mcp-client` 消费)
- Windows 10+ / macOS 13+ / Ubuntu 20.04+
## 快速开始
### 安装
```bash
git clone https://github.com/bluechonk/dsh-computer-use.git
cd dsh-computer-use
pnpm install
pnpm build
```
产物位于 `dist/mcp/server.js`。
### 配置 DSH
在 DSH profile 配置中添加:
```yaml
- id: mcp-computer-use
name: '@deepseek-ai/dsh-mcp-client'
config:
serverName: computerUse
transport: stdio
command: /path/to/dsh-computer-use/dist/mcp/server.js
toolCallTimeoutMs: 90000
```
MCP 工具会以 `mcp__computerUse__<tool>` 格式出现在模型的工具列表中。
### 验证
```bash
pnpm build # 类型检查 + 打包
pnpm smoke # 验证 30 个工具注册
pnpm test # 单元 + 集成测试
```
## 核心循环
```
观察 → 行动 → 验证
1. get_app_state 读取 Accessibility 树,获取 state_id
2. left_click 优先使用 element target(后台安全)
3. action_sent=true 确认动作已执行,重新观察
```
## 30 个工具
观察:`list_apps` · `open_application` · `list_windows` · `get_app_state` · `screenshot` · `zoom` · `list_displays` · `switch_display` · `cursor_position`
指针:`left_click` · `double_click` · `triple_click` · `right_click` · `middle_click` · `scroll` · `left_click_drag` · `mouse_move` · `left_mouse_down` · `left_mouse_up`
键盘:`type` · `set_value` · `select_text` · `key` · `hold_key`
语义:`perform_action`
运行时:`request_access` · `stop_computer_control` · `wait` · `read_clipboard` · `write_clipboard`
## License
MIT
TDQS
Scored across 30 tools
Most tools are distinct input/output primitives, but the fine-grained mouse controls (left_click vs left_mouse_down/up vs left_click_drag) and overlapping text-entry helpers (type, set_value, key, perform_action) can require careful reading. The descriptions clarify intended usage enough that an agent can mostly tell them apart.
Names predominantly follow a snake_case verb_noun pattern such as list_apps, get_app_state, and read_clipboard, which makes the overall set predictable. A few bare verbs or nouns (wait, key, type, screenshot) and perform_action break the otherwise consistent rhythm.
30 tools is on the high side and pushes past the typical well-scoped range. Many mouse variants and utility operations could be consolidated, making the tool surface feel heavier than necessary for an agent to navigate effectively.
The tool set covers the core computer-use lifecycle well: permissions, observation, mouse/keyboard input, clipboard, display/window inspection, and session control. Minor gaps such as window manipulation or app termination remain, but common automation tasks are achievable.