Enables remote control of touchscreens on Linux devices by injecting tap, swipe, long press, and double tap events via SSH and the uinput system.
Allows for remote interaction with touchscreens on Raspberry Pi devices by sending touch event commands over an SSH connection to a virtual touch device.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-remotetouchconnect to my Raspberry Pi and tap the center of the screen"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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)
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)
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:
Re-login for the change to take effect. Alternatively, use the useSudo option.
Installation
Or run directly with npx:
Usage
Add to your MCP client configuration (e.g. Claude Desktop's claude_desktop_config.json):
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 |
| (none) | SSH host of the remote device |
|
| SSH username |
|
| SSH port |
| (none) | Path to SSH private key |
| auto-detected | Screen width in pixels |
| auto-detected | Screen height in pixels |
|
| 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 |
| string? | SSH host |
| string? | SSH username |
| number? | SSH port |
| string? | Path to SSH private key |
| number? | Screen width (auto-detected if omitted) |
| number? | Screen height (auto-detected if omitted) |
| boolean? | Run with sudo |
touch_tap
Tap at the given coordinates.
Parameter | Type | Description |
| string | Session ID |
| number | X coordinate |
| number | Y coordinate |
| number? | Tap duration (default: 50ms) |
touch_swipe
Swipe from (x1, y1) to (x2, y2).
Parameter | Type | Description |
| string | Session ID |
| number | Start X coordinate |
| number | Start Y coordinate |
| number | End X coordinate |
| number | End Y coordinate |
| number? | Swipe duration (default: 300ms) |
| number? | Number of interpolation steps |
touch_long_press
Long press at the given coordinates.
Parameter | Type | Description |
| string | Session ID |
| number | X coordinate |
| number | Y coordinate |
| number? | Press duration (default: 800ms) |
touch_double_tap
Double tap at the given coordinates.
Parameter | Type | Description |
| string | Session ID |
| number | X coordinate |
| number | Y coordinate |
key_press
Press a key with optional modifier keys. Requires /dev/uinput access on the remote device.
Parameter | Type | Description |
| string | Session ID |
| string | Key name (e.g. |
| string[]? | Modifier keys to hold (e.g. |
key_type
Type a string of text by simulating individual key presses. Requires /dev/uinput access on the remote device.
Parameter | Type | Description |
| string | Session ID |
| string | Text to type (e.g. |
touch_disconnect
Disconnect a session and clean up the remote daemon.
Parameter | Type | Description |
| string | Session ID |
touch_list_sessions
List all active sessions. No parameters.
HTTP Server Mode
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.
Starting the server
CLI arguments
Argument | Default | Description |
| (off) | Enable HTTP server mode |
|
| HTTP listen port |
|
| Bind address |
Without --server, the process runs in stdio mode (the default, backward-compatible behavior).
Workflow
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 session
Troubleshooting
Permission denied
The user on the remote device needs access to /dev/input/eventN. Either:
Add the user to the
inputgroup:sudo usermod -aG input $USER(re-login required)Or set
REMOTETOUCH_USE_SUDO=true
No physical touchscreen device found
The daemon could not find a touchscreen in /proc/bus/input/devices. Verify:
The device has a touchscreen connected and its driver is loaded
The device shows
INPUT_PROP_DIRECTand hasABS_MT_POSITION_Xcapability
Keyboard input not available
The key_press and key_type tools require write access to /dev/uinput. If keyboard is reported as unavailable:
Add a udev rule to grant access:
echo 'KERNEL=="uinput", GROUP="input", MODE="0660"' | sudo tee /etc/udev/rules.d/99-uinput.rules sudo udevadm control --reload-rules && sudo udevadm triggerEnsure the user is in the
inputgroup:sudo usermod -aG input $USER(re-login required)Or set
REMOTETOUCH_USE_SUDO=true
Touch tools continue to work even if /dev/uinput is not accessible.
SSH connection fails
Ensure SSH public key authentication is configured for the remote device (password authentication is not supported since the connection uses
BatchMode=yes)Verify the hostname and port are correct
License
MIT