# desktop-touch-mcp

An MCP server that lets Claude or Cursor see and control a Windows 10/11 desktop: screenshots, UI Automation, mouse, keyboard, Chrome.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 22
- Author: Harusame64
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/Harusame64/desktop-touch-mcp
- Updated: 2026-10-24
- HTML: https://affpapa.org/en/nevibecode/mcp/desktop-touch-mcp

## What it does

The server exposes 32 tools: screen capture, UI Automation reads, keyboard and mouse input, terminal runs, Chrome work. The agent does not guess pixel positions. It calls `desktop_discover` first and gets back interactive entities with short-lived leases and `clickAt` coordinates, then `desktop_act` targets what the element is rather than where it sat.

Per-action guards check the window's identity and bounds before input lands. Typing aimed at a covered window, a closed one or a window on another virtual desktop never gets sent; the reply names the reason. When UI Automation sees nothing, the server falls back to Windows OCR, clusters the hits and returns numbered boxes over a PNG. Each act also reports what changed on screen, so the agent can skip a follow-up screenshot.

Windows 10/11 64-bit only. Without the Rust addon every function runs through PowerShell — slower, same surface. Sending input to Windows Terminal requires an MCP client that supports elicitation over stdio, since the server asks the user each time. Start it with `npx -y @harusame64/desktop-touch-mcp`.

## Requirements
- Needs: Node.js (commands run via npx)
- Environment variables: `DESKTOP_TOUCH_AUTO_GUARD`, `DESKTOP_TOUCH_PERCEPTION_RESOURCES`, `DESKTOP_TOUCH_PERCEPTION_IDLE_MS`, `DESKTOP_TOUCH_PERCEPTION_DORMANCY_DISABLE`, `DESKTOP_TOUCH_DIAGNOSTIC_LOG_DISABLE`, `DESKTOP_TOUCH_DIAGNOSTIC_LOG_PATH`, `DESKTOP_TOUCH_DIAGNOSTIC_LOG_MAX_BYTES`, `DESKTOP_TOUCH_RESOLVE_LOG_RAW` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add --env DESKTOP_TOUCH_AUTO_GUARD=<DESKTOP_TOUCH_AUTO_GUARD> --env DESKTOP_TOUCH_PERCEPTION_RESOURCES=<DESKTOP_TOUCH_PERCEPTION_RESOURCES> --env DESKTOP_TOUCH_PERCEPTION_IDLE_MS=<DESKTOP_TOUCH_PERCEPTION_IDLE_MS> --env DESKTOP_TOUCH_PERCEPTION_DORMANCY_DISABLE=<DESKTOP_TOUCH_PERCEPTION_DORMANCY_DISABLE> --env DESKTOP_TOUCH_DIAGNOSTIC_LOG_DISABLE=<DESKTOP_TOUCH_DIAGNOSTIC_LOG_DISABLE> --transport stdio desktop-touch-mcp -- npx -y @harusame64/desktop-touch-mcp
```
Replace <…> with your own values. 3 more environment variables are in the server README

### Codex

**Platform CLI**
```bash
codex mcp add desktop-touch-mcp --env DESKTOP_TOUCH_AUTO_GUARD=<DESKTOP_TOUCH_AUTO_GUARD> --env DESKTOP_TOUCH_PERCEPTION_RESOURCES=<DESKTOP_TOUCH_PERCEPTION_RESOURCES> --env DESKTOP_TOUCH_PERCEPTION_IDLE_MS=<DESKTOP_TOUCH_PERCEPTION_IDLE_MS> --env DESKTOP_TOUCH_PERCEPTION_DORMANCY_DISABLE=<DESKTOP_TOUCH_PERCEPTION_DORMANCY_DISABLE> --env DESKTOP_TOUCH_DIAGNOSTIC_LOG_DISABLE=<DESKTOP_TOUCH_DIAGNOSTIC_LOG_DISABLE> -- npx -y @harusame64/desktop-touch-mcp
```
Replace <…> with your own values. 3 more environment variables are in the server README

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "desktop-touch-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "@harusame64/desktop-touch-mcp"
            ],
            "env": {
                "DESKTOP_TOUCH_AUTO_GUARD": "<DESKTOP_TOUCH_AUTO_GUARD>",
                "DESKTOP_TOUCH_PERCEPTION_RESOURCES": "<DESKTOP_TOUCH_PERCEPTION_RESOURCES>",
                "DESKTOP_TOUCH_PERCEPTION_IDLE_MS": "<DESKTOP_TOUCH_PERCEPTION_IDLE_MS>",
                "DESKTOP_TOUCH_PERCEPTION_DORMANCY_DISABLE": "<DESKTOP_TOUCH_PERCEPTION_DORMANCY_DISABLE>",
                "DESKTOP_TOUCH_DIAGNOSTIC_LOG_DISABLE": "<DESKTOP_TOUCH_DIAGNOSTIC_LOG_DISABLE>"
            }
        }
    }
}
```
Replace <…> with your own values. 3 more environment variables are in the server README

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "desktop-touch-mcp": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "@harusame64/desktop-touch-mcp"
            ],
            "env": {
                "DESKTOP_TOUCH_AUTO_GUARD": "<DESKTOP_TOUCH_AUTO_GUARD>",
                "DESKTOP_TOUCH_PERCEPTION_RESOURCES": "<DESKTOP_TOUCH_PERCEPTION_RESOURCES>",
                "DESKTOP_TOUCH_PERCEPTION_IDLE_MS": "<DESKTOP_TOUCH_PERCEPTION_IDLE_MS>",
                "DESKTOP_TOUCH_PERCEPTION_DORMANCY_DISABLE": "<DESKTOP_TOUCH_PERCEPTION_DORMANCY_DISABLE>",
                "DESKTOP_TOUCH_DIAGNOSTIC_LOG_DISABLE": "<DESKTOP_TOUCH_DIAGNOSTIC_LOG_DISABLE>"
            }
        }
    }
}
```
Replace <…> with your own values. 3 more environment variables are in the server README

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e DESKTOP_TOUCH_AUTO_GUARD=<DESKTOP_TOUCH_AUTO_GUARD> -e DESKTOP_TOUCH_PERCEPTION_RESOURCES=<DESKTOP_TOUCH_PERCEPTION_RESOURCES> -e DESKTOP_TOUCH_PERCEPTION_IDLE_MS=<DESKTOP_TOUCH_PERCEPTION_IDLE_MS> -e DESKTOP_TOUCH_PERCEPTION_DORMANCY_DISABLE=<DESKTOP_TOUCH_PERCEPTION_DORMANCY_DISABLE> -e DESKTOP_TOUCH_DIAGNOSTIC_LOG_DISABLE=<DESKTOP_TOUCH_DIAGNOSTIC_LOG_DISABLE> desktop-touch-mcp npx -y @harusame64/desktop-touch-mcp
```
Replace <…> with your own values. 3 more environment variables are in the server README

## When to use it
- read a window's controls through UI Automation and click the right one
- type into an app field that ignores background input
- capture a screen in native resolution so pixels match coordinates
- fill an SSH password from the credential locker during a console session
- map an interface by OCR when no accessibility tree exists

## Example prompts
- Open Chrome, find the address bar with `desktop_discover` and type the local server URL
- Capture the Excel window with `dotByDot=true` and show which cells changed
- Start `ssh` in a console through `key_locker` and let it fill the password

## Similar
- [REA](https://affpapa.org/en/nevibecode/mcp/rea.md) — MCP server · ★ 386989
- [GitHub](https://affpapa.org/en/nevibecode/mcp/github.md) — MCP server · ★ 33918
- [Netdata](https://affpapa.org/en/nevibecode/mcp/netdata.md) — MCP server · ★ 81115
- [browser-use](https://affpapa.org/en/nevibecode/mcp/browser-use.md) — MCP server · ★ 119160
- [Codebase Memory](https://affpapa.org/en/nevibecode/mcp/codebase-memory.md) — MCP server · ★ 47392
- [mcp-server](https://affpapa.org/en/nevibecode/mcp/mcp-server.md) — MCP server · ★ 43872

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
