mcp-remotetouch
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.
README
mcp-remotetouch
An MCP server for remotely controlling a touchscreen on any Linux device over SSH.
Injects tap, swipe, long press, and double tap events directly into the physical touchscreen device. The daemon auto-detects the touchscreen and screen resolution. No installation required on the remote device — the Python daemon is sent via stdin over SSH, using only Python's standard library.
Architecture
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│
│ 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.
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)
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
git clone https://github.com/signal-slot/mcp-remotetouch.git
cd mcp-remotetouch
npm install
npm run build
Registering as an MCP Server
Add to Claude Desktop's claude_desktop_config.json:
{
"mcpServers": {
"remotetouch": {
"command": "node",
"args": ["/path/to/mcp-remotetouch/build/index.js"],
"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 |
x |
number | X coordinate |
y |
number | Y coordinate |
duration_ms |
number? | Press duration (default: 800ms) |
touch_double_tap
Double tap at the given coordinates.
| Parameter | Type | Description |
|---|---|---|
sessionId |
string | Session ID |
x |
number | X coordinate |
y |
number | Y coordinate |
touch_disconnect
Disconnect a session and clean up the remote daemon.
| Parameter | Type | Description |
|---|---|---|
sessionId |
string | Session ID |
touch_list_sessions
List all active sessions. No parameters.
Usage
From Claude Desktop:
touch_connectto connect to the remote devicetouch_tapto tap a coordinate on the screentouch_swipeto scroll or swipetouch_disconnectto 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
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
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.