SonicloudTech/mouse-mcp
Hardware mouse MCP server for AI agents on Windows x64. USB HID control and voice dictation; requires compatible uMouse hardware and firmware. 面向 AI 智能体的硬件鼠标 MCP:USB HID 控制与语音听写,需要兼容的 uMouse 设备与固件。
What it solves
AI agents normally manipulate software through APIs, but many real-world tasks need actual mouse movements on the desktop - clicking buttons, dragging windows, scrolling, or controlling applications that expose no API. This project is a Model Context Protocol (MCP) server that gives agents a real hardware mouse: it translates agent commands into physical mouse actions on a Windows machine through a compatible USB HID uMouse device. It also adds voice dictation, where spoken text is typed into whichever window currently has focus.
How it works
The server runs on Windows x64 and requires a compatible uMouse device with matching firmware - an ordinary USB mouse will not work. It exposes MCP tools that agents can call:
- umouse_mouse_action - move, click, scroll, and drag in physical-pixel desktop coordinates, with multi-monitor support and negative coordinates, plus an optional precision mode (standard or high).
- umouse_control - a begin/end guard so only one task drives the mouse and keyboard at a time; dead connections are cleaned up automatically.
- umouse_input_status - read-only sensors reporting cursor position, live key state, and the foreground window identity, never intercepting input.
Under the hood the data path is: Model → MCP host → shared daemon (port 47192) → C++ native host → USB HID (0xF0/0xF1) → uMouse device → Windows input pipeline. One shared daemon runs per machine and is shared across ZCode, Codex, and Claude hosts, reclaimed when idle.
Voice dictation uses a pluggable speech recognition interface: a provider implements four methods (begin, writePcm, finishInput, cancel) and emits events (preview, segmentFinal, warning, terminal). Providers include sinicloud (cloud streaming), windows-speech (built-in offline), whisper-cpp (self-hosted offline), http (custom endpoint), or disabled. Credentials are read from a local config file or environment variables on each session - never hardcoded, printed, or logged - so keys can be swapped without a restart.
The server also compensates for Windows pointer ballistics ("Enhance pointer precision") using an 11-step adaptive gain curve seeded from local pointer settings, learned online frame-by-frame, and decaying back after 60 seconds idle, so no tuning is needed when changing machines.
Who it's for
AI agent users on Windows x64 who need real hardware mouse control - for example, ZCode, Claude Desktop, or Cursor, all of which the installer supports. It requires compatible uMouse hardware and firmware, a separately installed Node.js 22 x64 runtime, and Windows x64. It does not support macOS or Linux. Developers who want mouse events and audio in their own applications should use the separate uMouse SDK instead.
Highlights
- Real hardware mouse actions: move, click, scroll, and drag on the actual desktop, with multi-monitor support
- Task exclusivity so only one agent task drives the mouse and keyboard at a time
- Pluggable ASR providers - swapping speech recognition means swapping one factory function; the sinicloud provider ships as a complete reference implementation
- Read-only sensor status (cursor, keys, foreground window) that never intercepts input
- Adaptive pointer positioning that learns Windows ballistic curves automatically across machines
- 32 automated acceptance test cases verified in closed loop on a real browser page: click counts, double-click intervals, wheel scrollTop, drag linearity, and 1px bullseye hits
- Safety properties: actions on locked screens, UAC, or secure desktops are rejected; transport success is never treated as application effect confirmation
- Credentials for cloud ASR are hot-read per session, never hardcoded, printed, logged, or committed
Related
- Project
- Project
- Project
- Project