MCP RemoteTouch MCP Server

Remotely control a touchscreen on any Linux device over SSH.

README.md

mcp-remotetouch

An MCP server for remotely controlling a touchscreen on any Linux device over SSH.

Injects tap, swipe, long press, double tap, and keyboard events directly into the device. The daemon auto-detects the touchscreen and screen resolution. Keyboard input is injected via a virtual keyboard device created through /dev/uinput. No installation required on the remote device — the Python daemon is sent via stdin over SSH, using only Python's standard library.

Architecture

Stdio mode (default)

Dev Machine                              Remote Linux Device
┌──────────────────┐    SSH (persistent)  ┌──────────────────┐
│ MCP Server (TS)  │ ──────────────────> │ Python daemon    │
│ stdio transport   │    JSON-line proto  │ (stdlib only)     │
│                   │ <────────────────── │                  │
│ touch_tap         │                     │ Auto-detect      │
│ touch_swipe       │                     │ touchscreen      │
│ touch_long_press  │                     │   ↓              │
│ touch_double_tap  │                     │ /dev/input/eventN│
│ key_press         │                     │   ↓              │
│ key_type          │                     │ /dev/uinput (kbd)│
│ touch_disconnect  │                     │   ↓              │
│                   │                     │ Linux Input      │
└──────────────────┘                     └──────────────────┘

The daemon scans /proc/bus/input/devices to find the physical touchscreen (by checking INPUT_PROP_DIRECT and ABS_MT_POSITION_X), then injects events directly into it. This works reliably with containerized compositors (e.g., Torizon with Qt EGLFS) where virtual uinput devices may not be detected.

HTTP server mode (`--server`)

AI Agent (remote) ──HTTP/SSE──> Express + StreamableHTTPServerTransport
                                         │
                                   McpServer (per MCP session)
                                         │
                                SshTouchSessionManager (shared)
                                         │
                                   SSH ──> Linux Device

Prerequisites

Dev Machine

  • Node.js 18+
  • SSH client

Remote Device

  • Any Linux device with a touchscreen (Raspberry Pi, SBC, embedded system, etc.)
  • Python 3
  • Read/write access to /dev/input/eventN (the touchscreen device)
  • Write access to /dev/uinput (for keyboard input — optional, touch works without it)

Add the user to the input group on the remote device:

sudo usermod -aG input $USER

Re-login for the change to take effect. Alternatively, use the useSudo option.

Installation

npm install -g mcp-remotetouch

Or run directly with npx:

npx mcp-remotetouch

Usage

Add to your MCP client configuration (e.g. Claude Desktop's claude_desktop_config.json):

{
  "mcpServers": {
    "remotetouch": {
      "command": "npx",
      "args": ["mcp-remotetouch"],
      "env": {}
    }
  }
}

Screen resolution is auto-detected from the device. You can override it with REMOTETOUCH_SCREEN_WIDTH and REMOTETOUCH_SCREEN_HEIGHT if needed.

Environment Variables

Variable Default Description
REMOTETOUCH_SSH_HOST (none) SSH host of the remote device
REMOTETOUCH_SSH_USER pi SSH username
REMOTETOUCH_SSH_PORT 22 SSH port
REMOTETOUCH_SSH_KEY (none) Path to SSH private key
REMOTETOUCH_SCREEN_WIDTH auto-detected Screen width in pixels
REMOTETOUCH_SCREEN_HEIGHT auto-detected Screen height in pixels
REMOTETOUCH_USE_SUDO false Run daemon with sudo

Tools

`touch_connect`

Connect to a remote Linux device via SSH and start the touch daemon. Returns a session ID.

Parameter Type Description
host string? SSH host
user string? SSH username
port number? SSH port
sshKey string? Path to SSH private key
screenWidth number? Screen width (auto-detected if omitted)
screenHeight number? Screen height (auto-detected if omitted)
useSudo boolean? Run with sudo

`touch_tap`

Tap at the given coordinates.

Parameter Type Description
sessionId string Session ID
x number X coordinate
y number Y coordinate
duration_ms number? Tap duration (default: 50ms)

`touch_swipe`

Swipe from (x1, y1) to (x2, y2).

Parameter Type Description
sessionId string Session ID
x1 number Start X coordinate
y1 number Start Y coordinate
x2 number End X coordinate
y2 number End Y coordinate
duration_ms number? Swipe duration (default: 300ms)
steps number? Number of interpolation steps

`touch_long_press`

Long press at the given coordinates.

Parameter Type Description
sessionId string Session ID

Tools 4

touch_connectConnect to a remote Linux device via SSH and start the touch daemon.
touch_tapTap at the given coordinates.
touch_swipeSwipe from (x1, y1) to (x2, y2).
touch_long_pressLong press at the given coordinates.

Environment Variables

REMOTETOUCH_SSH_HOSTSSH host of the remote device
REMOTETOUCH_SSH_USERSSH username
REMOTETOUCH_SSH_PORTSSH port
REMOTETOUCH_SSH_KEYPath to SSH private key
REMOTETOUCH_SCREEN_WIDTHScreen width in pixels
REMOTETOUCH_SCREEN_HEIGHTScreen height in pixels
REMOTETOUCH_USE_SUDORun daemon with sudo

Try it

Connect to my Raspberry Pi at 192.168.1.50 and tap the center of the screen.
Perform a swipe gesture from the bottom to the top of the screen on my remote Linux device.
Execute a long press on the touchscreen of my embedded device to open the context menu.
Connect to the remote device and tap the coordinates 500, 500.

Frequently Asked Questions

What are the key features of MCP RemoteTouch?

Zero-installation required on the remote Linux device. Auto-detection of touchscreen and screen resolution. Supports tap, swipe, long press, and double tap gestures. Injects keyboard events via virtual uinput device. Works with containerized compositors like Torizon.

What can I use MCP RemoteTouch for?

Automating UI testing on embedded Linux devices. Remotely controlling kiosks or digital signage displays. Interacting with headless or remote touchscreen interfaces. Testing touch-based applications on Raspberry Pi or SBCs.

How do I install MCP RemoteTouch?

Install MCP RemoteTouch by running: npm install -g mcp-remotetouch

What MCP clients work with MCP RemoteTouch?

MCP RemoteTouch works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep MCP RemoteTouch docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Open Conare