loading…
Search for a command to run...
loading…
An MCP server for remotely controlling touchscreens on Linux devices over SSH using virtual touch input. It enables actions like tapping and swiping without req
An MCP server for remotely controlling touchscreens on Linux devices over SSH using virtual touch input. It enables actions like tapping and swiping without requiring any software installation on the target machine.
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.
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.
--server)AI Agent (remote) ──HTTP/SSE──> Express + StreamableHTTPServerTransport
│
McpServer (per MCP session)
│
SshTouchSessionManager (shared)
│
SSH ──> Linux Device
/dev/input/eventN (the touchscreen device)/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.
npm install -g mcp-remotetouch
Or run directly with npx:
npx mcp-remotetouch
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.
| 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 |
touch_connectConnect 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_tapTap 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_swipeSwipe 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_pressLong press at the given coordinates.
| Parameter | Type | Description |
|---|---|---|
sessionId |
string | Session ID |
x |
number | X coordinate |
y |
number | Y coordinate |
duration_ms |
number? | Press duration (default: 800ms) |
touch_double_tapDouble tap at the given coordinates.
| Parameter | Type | Description |
|---|---|---|
sessionId |
string | Session ID |
x |
number | X coordinate |
y |
number | Y coordinate |
key_pressPress a key with optional modifier keys. Requires /dev/uinput access on the remote device.
| Parameter | Type | Description |
|---|---|---|
sessionId |
string | Session ID |
key |
string | Key name (e.g. enter, a, tab, f1, up, space) |
modifiers |
string[]? | Modifier keys to hold (e.g. ["ctrl"], ["ctrl", "shift"]) |
key_typeType a string of text by simulating individual key presses. Requires /dev/uinput access on the remote device.
| Parameter | Type | Description |
|---|---|---|
sessionId |
string | Session ID |
text |
string | Text to type (e.g. Hello, World!) |
touch_disconnectDisconnect a session and clean up the remote daemon.
| Parameter | Type | Description |
|---|---|---|
sessionId |
string | Session ID |
touch_list_sessionsList all active sessions. No parameters.
Instead of running as a stdio MCP server, you can run mcp-remotetouch as an HTTP server that AI agents can connect to remotely over HTTP.
# Default: listen on 0.0.0.0:3000
npx mcp-remotetouch --server
# Custom port and host
npx mcp-remotetouch --server --port 8080 --host 127.0.0.1
| Argument | Default | Description |
|---|---|---|
--server |
(off) | Enable HTTP server mode |
--port <N> |
3000 (or REMOTETOUCH_PORT env) |
HTTP listen port |
--host <addr> |
0.0.0.0 |
Bind address |
Without --server, the process runs in stdio mode (the default, backward-compatible behavior).
A typical session from Claude Desktop:
touch_connect — connect to the remote devicetouch_tap / touch_swipe / touch_long_press / touch_double_tap — interact with the screenkey_press / key_type — send keyboard inputtouch_disconnect — end the sessionThe user on the remote device needs access to /dev/input/eventN. Either:
input group: sudo usermod -aG input $USER (re-login required)REMOTETOUCH_USE_SUDO=trueThe daemon could not find a touchscreen in /proc/bus/input/devices. Verify:
INPUT_PROP_DIRECT and has ABS_MT_POSITION_X capabilityThe key_press and key_type tools require write access to /dev/uinput. If keyboard is reported as unavailable:
echo 'KERNEL=="uinput", GROUP="input", MODE="0660"' | sudo tee /etc/udev/rules.d/99-uinput.rules
sudo udevadm control --reload-rules && sudo udevadm trigger
input group: sudo usermod -aG input $USER (re-login required)REMOTETOUCH_USE_SUDO=trueTouch tools continue to work even if /dev/uinput is not accessible.
BatchMode=yes)MIT
Добавь это в claude_desktop_config.json и перезапусти Claude Desktop.
{
"mcpServers": {
"mcp-remotetouch": {
"command": "npx",
"args": []
}
}
}