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
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。