📱 Remote Harness MCP — control any PC from Gemini (App & Web)
An MCP server that turns Google Gemini from a chatbot into a full-fledged mobile agent.
Type a task in the Gemini app on your phone — your PC, laptop or server executes it, and Gemini reports back with real results.
English | 🇷🇺 Русская версия
💡 The idea
Gemini in a browser or on a phone can talk, but it cannot do anything on your computer.
Remote Harness MCP closes that gap. It is a free, open-source Model Context Protocol (MCP) server that you connect to Gemini Spark (gemini.google.com/customize/connectors or the Gemini mobile app) with a single link. After that, Gemini gets hands:
- runs shell commands, builds and tests code, manages git;
- reads, writes and edits files;
- searches the file system;
- starts long-running jobs and checks on them later;
- watches CPU, RAM and disk.
📱 Gemini app / 🌐 gemini.google.com (Spark)
│ MCP (SSE / Streamable HTTP) over HTTPS
▼
☁️ Tailscale Funnel https://<node>.<tailnet>.ts.net ← ingress and TLS
│ 127.0.0.1:<port>
▼
💻 Your machine: the MCP node executes the task · PC · laptop · server
Since 0.7.0 no separate relay gateway is required: the node publishes itself. Details below.
Result: your phone becomes a remote control for every machine you own — and Gemini is the agent that operates them.
🛡️ Threat Model
Remote Harness MCP is designed to give an AI client controlled access to your own machine while minimizing unintended exposure.
Protected by default:
- Loopback-only bind (
127.0.0.1) — the standalone server never listens on 0.0.0.0 by default; public ingress goes only through TLS (Tailscale Funnel or --quick-tunnel via cloudflared).
- Mandatory authentication — every MCP request requires a secret token (
MESH_TOKEN / lk_…) or OAuth 2.1 with PKCE S256 (/.well-known/oauth-authorization-server, /oauth/register, /oauth/authorize, /oauth/token); unauthenticated requests receive HTTP 401.
- Protected git metadata —
write_file, edit_file, and batch_edit block writes to .git/hooks/* and .git/config; git_status and git_diff run without a shell (shell=False) and with -c core.fsmonitor=false -c core.hooksPath=.
- SSRF protection in
fetch_url — HTTPS only, every resolved IP is checked via ipaddress (blocking loopback, private/RFC1918, link-local, and metadata ranges), max 5 redirects, 300 KB response cap.
- Scoped & isolated modes —
--folder <dir> pins workspace and write roots to one directory; --no-shell (MESH_ENABLE_SHELL=0) disables bash_exec, run_script, and run_job; read_only (MESH_READ_ONLY=1) blocks all mutations; Docker/Podman sandbox (node_control(action="sandbox")) isolates shell execution to /workspace with networking off by default and --cap-drop ALL.
Residual risks when shell is enabled:
- With shell execution enabled (
full mode without --no-shell or Docker sandbox), anyone who holds the MCP URL/token — or a prompt-injected model session — can run arbitrary commands with the privileges of the OS user running the node.
- Treat the MCP link and token like a password. For untrusted prompts or single-project access, combine
--folder, --no-shell, read_only, or Docker sandbox isolation (see also docs/SANDBOX_SECURITY.md).
🏗️ Architecture in 0.7.0 — the whole stack runs on your machine
Up to and including 0.6.x every node needed a bridge: a separate VPS with a
shared domain that terminated TLS and forwarded calls over an outbound WebSocket
tunnel. The node had no address of its own — the link named the bridge's domain and
?user= picked the node, so without that server the machine was unreachable.
From 0.7.0 there is no bridge. By default the installer puts the whole stack on
the machine itself and publishes it with Tailscale Funnel: the node has its own
HTTPS address https://<node>.<your-tailnet>.ts.net, and Gemini's calls arrive
directly at the local MCP server on 127.0.0.1:<port>. No VPS, no domain, no DNS,
no ports opened on the router, and no second place that holds your token. The public
ingress and the TLS certificate come from Tailscale, which stays the only external
dependency.
📱 Gemini (App/Web)
│ HTTPS https://<node>.<tailnet>.ts.net/sse?token=…
▼
☁️ Tailscale Funnel ← public ingress and TLS; no server or domain of your own
│ 127.0.0.1:<port>
▼
💻 The MCP node on your machine: tools, files, shares, autostart
What now lives on the machine
| Component |
Where |
Written by |
| MCP server |
127.0.0.1:<port> (8096, or the next free port) |
the node's autostart |
| Public address and TLS |
Tailscale Funnel on 443 |
tailscale funnel --bg --https=443 |
| Token and allowed hosts |
<ConfigDir>/standalone.env (0600) |
the installer |
| What was actually registered |
<ConfigDir>/autostart.state.json |
the installer |
| File and page shares |
the node itself |
share_file / serve_dir |
How installation works now
- Start the wizard (
install-gui.cmd) or the console installer
(install.ps1 -Mode standalone -Funnel on Windows, ./install.sh --mode=funnel
on Linux/macOS). Funnel is the default option in both.
- The installer installs the Tailscale client when it is missing, opens the browser
once for the tailnet sign-in, and waits for
BackendState=Running.
- It reads
<node>.<tailnet>.ts.net from tailscale status --json and writes
MESH_TOKEN, MESH_ALLOWED_HOSTS and MESH_PUBLIC_URL into standalone.env.
- It picks a free port and registers autostart: the
RemoteHarnessMCPService task
(SYSTEM, starts before anyone logs on, restarts on failure) or rhm-node.vbs at
logon when elevation was refused. What was registered is recorded in
autostart.state.json, and the wizard reports that record, not a checkbox.
- It runs
tailscale funnel --bg --https=443 http://127.0.0.1:<port> and checks
that the public address answers.
- It prints the ready link
https://<node>.<tailnet>.ts.net/sse?token=… — that is
what you paste into the Gemini connector. The token is already inside it.
- Once per tailnet: allow Funnel in the ACL —
"nodeAttrs": [{"target": ["autogroup:member"], "attr": ["funnel"]}].
A reinstall restarts the running task: otherwise the old process keeps serving in its
previous mode and the Funnel answers 502.
How it differs from the old scheme
|
Up to 0.6.x: bridge |
From 0.7.0: the node publishes itself |
| What you must run |
a VPS with a shared domain |
nothing but Tailscale |
| Public address |
https://<bridge-domain>/sse?user=<node> |
https://<node>.<tailnet>.ts.net/sse?token=… |
| Where TLS terminates |
on the bridge |
at the Tailscale Funnel ingress |
| What the middleman sees |
call metadata and share payloads |
only Tailscale's network ingress |
| File and page links |
built by the bridge: <domain>/<node>/<slug>/… |
built by the node: <node>.<tailnet>/<slug>/… |
| Where the token lives |
the node's agent.env + the bridge registry |
standalone.env on the machine |
| The bridge goes down |
every node is unreachable at once |
other machines are unaffected |
| Several machines |
one domain, ?user= selects the node |
one address and one connector per node |
| Inbound ports |
none (outbound tunnel) |
none (Funnel accepts the ingress itself) |
| Upkeep |
VPS, domain, certificates, bridge upgrades |
the Tailscale client |
What did not change
Same MCP server and tools, same access modes (read_only / full), timers and cron,
the chat goal, self-update, the rhm menu and the web settings page. The link is
still a secret: whoever holds it can run commands on that machine.
If you still want the bridge
Tunnel mode is still there: ./install.sh --mode=tunnel (or
install.ps1 -Mode tunnel) sets up the old shared-domain scheme, which makes sense
when you run many nodes behind one address. It is simply no longer the default, and
rhm now reports the address of the node that is actually installed, not what an
earlier install left behind.
Migrating from 0.6.x
- Run the installer again (the wizard already offers Funnel first).
- Take the new
https://<node>.<tailnet>.ts.net/sse?token=… link and update the
Gemini connector — a Funnel node has its own address and token.
- Files from the previous install (
agent.env, domain.env) stay on disk as
history: a Funnel node does not read them and never dials the bridge.
- If the old bridge is no longer needed, its VPS can be switched off.
⚠️ 0.7.0-rc1-alpha is a pre-release of the architecture change. It installs and
runs on this machine, but try it on one node before rolling it out.
🔥 What you can do with it
Just ask Gemini in plain language, from anywhere:
- "Check why my home server is slow and show the top processes"
- "Pull the latest changes in ~/projects/api, run the tests and tell me what failed"
- "Fix the typo in config.yaml and restart the service"
- "Start a full backup in the background and tell me when it's done"
- "How much free disk space is left on my laptop?"
- "Turn on the phone's torch, and tell me its battery level and signal"
No SSH client, no terminal on your phone, no VPN — only a chat.
📸 In action
Three exchanges from one chat, each answered by a different machine on the other
side of the bridge. The phone never opened a terminal.
The laptop describes itself — "@Rem Matebook-deb, give me the system and hardware specs":
The phone reports its own battery, radio and VPN — "@Rem Phone, check".
The SSID and both addresses are mosaicked; everything else came from device_info:
The desktop is photographed, published and read back — "take a screenshot of @RemMatebook-deb",
then "describe what is running on the screens":
Every answer was produced by system_vitals, device_info, device_capture and
share_file running on the node itself — the model only ever saw tool results.
✨ Why it works this way
|
|
| 📱 Mobile-first agent |
Works in the official Gemini mobile app and on the web through Gemini Spark. |
| 🖥️ Any PC |
Linux, macOS, Windows — desktops, laptops, VPS, containers. Android phones and tablets run the same node inside Termux. |
| 🌐 Behind any NAT |
The node publishes itself through Tailscale Funnel. No public IP, no port forwarding, no router setup. |
| ⚡ One-line install |
Detects OS, architecture and device type; installs autostart (systemd / launchd / Windows task / runit + Termux:Boot on Android); copies your connection link to the clipboard. |
| 🛡️ The link is the credential |
In Funnel mode the URL carries the node's own token (/sse?token=…), exactly as the installer prints it; treat the link as a password and rotate the token by reinstalling. In tunnel mode the URL carries only the rotatable link key (lk_…), while the device token that opens the tunnel travels in an Authorization: Bearer header. Everything else gets HTTP 401. |
| 🔁 One address per machine |
Every node has its own HTTPS address https://<node>.<tailnet>.ts.net and its own Gemini connector; no separate relay is needed. |
| 🆓 Free & open source |
MIT license, works with the free Gemini tier. |
🛠️ What Gemini can do on your machine (MCP tools)
36 tools on the node (ALL_TOOLS), 38 through the gateway. Every one of them runs on your machine under your own user account — the gateway only carries the calls. The two extra ones in bridge mode are the confirmed twins system_change (install/remove) and system_write (write into a system path); a standalone node does not have them. To save LLM context tokens, tools/list supports toolset profiles via MESH_TOOLSETS (all, core, git, web, device, admin) and a platform auto-profile (non-Android desktop nodes hide phone-only device_capture and device_messages by default, advertising 34 tools unless MESH_DEVICE=1 or MESH_TOOLSETS=all).
Which calls ask for your confirmation