Linux HID Node for Hermes MCP Hub — Screen capture (mss) + Virtual input (uinput/xdotool) + WebSocket event streaming.
Hermes (Brain) ←MCP stdio→ hermes-hid-linux (Body) ←WebSocket→ Dashboard/Telegram
↑
Vision→Action Loop Skill
| File | Purpose |
|---|---|
hid_core.py |
Core: screenshot (mss), click/type/key (uinput + xdotool fallback), resource self-limitation |
hid_server.py |
MCP stdio server exposing tools: screenshot, click, type, key, hotkey, drag, scroll, mouse_move, get_mouse_pos, list_monitors |
vision_loop.py |
Skill: screenshot → analyze → act → verify reflection loop |
{
"screenshot": {},
"screenshot_region": {"x": 0, "y": 0, "width": 1920, "height": 1080},
"click": {"x": 100, "y": 200, "button": "left"},
"double_click": {"x": 100, "y": 200},
"drag": {"x1": 0, "y1": 0, "x2": 100, "y2": 100, "duration_ms": 200},
"type": {"text": "hello", "delay_ms": 50},
"key": {"key": "enter"},
"hotkey": {"keys": ["ctrl", "c"]},
"scroll": {"x": 100, "y": 200, "delta_x": 0, "delta_y": -120},
"mouse_move": {"x": 100, "y": 200},
"get_mouse_pos": {},
"list_monitors": {}
}{"type": "tool_call", "data": {"tool": "click", "args": {"x": 100, "y": 200}}}
{"type": "tool_result", "data": {"tool": "click", "result": "ok"}}
{"type": "screenshot", "data": {"width": 1920, "height": 1080}}
{"type": "resource_warning", "data": {"message": "RAM below 500MB"}}
{"type": "token_delta", "data": {"model": "ollama", "response_length": 1234}}Before every action, checks:
MemAvailable > 500MBCPU load1 < 90% per coreThermal < 80°C
Blocks action if stressed. Mirrors adb-autonomous-awareness principle: agent chooses not to when it can.
# System deps
sudo apt install -y xdotool python3-evdev
# Python deps
pip install mss python-uinput websockets
# uinput permissions
sudo usermod -a -G input $USER
# Reboot or: newgrp input# As MCP stdio server (Hermes launches this)
python3 hid_server.py
# Or with run script
./run.shmcp_hub:
servers:
hermes-hid-linux:
command: "bash"
args: ["~/github/hermes-hid-linux/run.sh"]
type: "stdio"
enabled: trueSeparate skill hermes-hid-linux-vision-loop uses:
screenshot()→ base64 PNG- Hermes analyzes (vision model)
click()/type()/key()screenshot()→ verify- Retry up to N times
MIT