Remote Control¶
Drive local coding agents remotely from your phone or another browser using the /rc mobile web app (PWA), while keeping /admin strictly restricted to loopback (127.0.0.1).
What Remote Control is¶
Remote Control exposes a dedicated mobile-friendly control surface at /rc without opening the MCC configuration dashboard (/admin) to the network:
- Opt-in by default:
RC_ENABLEDdefaults tofalse. Until you turn it on,/rcanswers503and no remote pairing or WebSocket endpoints accept sessions. - Strict
/adminisolation:/adminand/admin/api/*always require a loopback client address (127.0.0.1,::1, orlocalhost). Even when a tunnel forwards external HTTPS traffic to MCC, requests arriving through the tunnel are blocked from/admin. - Signed device cookies + CSRF: Pairing exchanges a single-use 60-second token (
POST /rc/api/pair, rate-limited to 8 attempts per 60 seconds) for an HttpOnly HMAC-SHA256 signedmcc_rc_sessioncookie (usingRC_SESSION_SECRET, auto-generated and persisted under~/.mccwhen blank) plus anmcc_rc_csrfdouble-submit token and WebSocketOriginvalidation. - Fail-closed directory containment: New sessions and the mobile folder picker (
/rc/api/fs/dirs) only accept directories insideRC_ALLOWED_DIRS(verified with symlink-safePath.resolve()checks). WhenRC_ALLOWED_DIRSis empty, remote path selection is refused. - Session cap and instant revocation:
RC_MAX_SESSIONSbounds concurrent active sessions (default12, range1to64). Pressing Revoke all devices (or Revoke on one device) on the Remote Control page invalidates device cookies and closes active WebSockets immediately.
Transport comparison: Tailscale Serve vs Tailnet Direct vs Cloudflare Tunnel¶
MCC supports four ways to reach /rc. Choose the transport on the Remote Control page (or via RC_TUNNEL_MODE):
| Transport | RC_TUNNEL_MODE |
URL shape | Security & browser support | When to use it |
|---|---|---|---|---|
| Local Loopback | off |
http://127.0.0.1:8082/rc |
Same machine only; zero external exposure. | Local testing, or when you run your own TLS reverse proxy. |
| Tailscale Serve (recommended) | tailscale_serve |
https://<node>.ts.net/rc |
End-to-end WireGuard + Tailnet HTTPS (tailscale serve --bg). Keeps HOST=127.0.0.1 loopback-only and never exposes /admin. Enables PWA install, Service Workers, and Web Push alerts. |
You already use Tailscale on your workstation and phone. |
| Tailnet Direct | tailscale_local |
http://100.x.y.z:8082/rc |
Plain HTTP over your Tailnet WireGuard interface. Requires HOST=0.0.0.0 (with ANTHROPIC_AUTH_TOKEN set) if reached directly without tailscale serve. Browsers restrict Web Push and PWA install over plain HTTP. |
Quick access on your Tailnet when Tailscale Serve is not enabled in your Tailnet ACLs. |
| Cloudflare Tunnel | cloudflare |
https://*.trycloudflare.com/rc or your custom hostname |
Outbound-only cloudflared tunnel with HTTPS. Without a token, starts an ephemeral quick tunnel; with RC_CLOUDFLARE_TUNNEL_TOKEN and RC_CLOUDFLARE_PUBLIC_HOSTNAME, uses your Zero Trust Named Tunnel. |
Your phone is not on Tailscale and you want HTTPS access without opening router ports. |
Note: Clicking Stop tunnel on the Remote Control page immediately stops an active
cloudflaredprocess or tears downtailscale serve. Stoppingmcc-serveralso cleans up any tunnel it started.
Supported harnesses and driver tiers¶
Remote Control supervises coding agents across structured bidirectional drivers and a full interactive PTY terminal bridge:
| Driver tier | Harnesses | Capabilities |
|---|---|---|
| Tier 1B (Claude bidirectional) | claude |
Persistent bidirectional stream-json driver with live streaming text/thinking, inline tool approvals, runtime mode and model switching, and session forking. |
| Tier 1A (Structured RPC) | opencode, opencode2, kilo, codex, openclaw |
Structured JSON-RPC / app-server / gateway streams with message turns, tool approval cards, and session controls. |
| Tier 2 (ACP, Pi RPC, CommandCode) | hermes, gemini_cli, qwen_code, kimi_code, cline_cli, goose, droid, pi, commandcode_cli |
Structured turn events and tool approvals via ACP, Pi RPC, or Command Code structured drivers. |
Tier 3 (PTY bridge & --rc sidecars) |
terminal (shell) or any harness in PTY mode |
Live interactive xterm.js terminal over /rc/ws/sessions/{session_id}/pty. Any structured session can also be upgraded to PTY mid-flight (switch-pty). |
Additional session features¶
- Local session discovery and import: Inspect and resume existing local agent sessions on the machine (
/rc/api/discovered-sessions,/rc/api/sessions/import) insideRC_ALLOWED_DIRS. - Opt-in
--rcterminal dual-sync: Pass--rcto any launcher before--(for examplemcc-claude --rcormcc-codex --rc) to spawn a detached PTY sidecar registered via/admin/api/rc/sidecars/register, so you can watch and steer the same live terminal from both your desk and your phone. - Git worktrees and diffs: Optionally isolate a new session in its own git worktree (
create_worktree) and inspect live repository changes (/rc/api/sessions/{session_id}/diff). - Live MCC proxy controls: Change the routed model or tier, reasoning effort, and preferred wire surface for multi-door providers directly from a session (
/rc/api/sessions/{session_id}/proxy-controls). - Push and messenger alerts: Subscribe mobile browsers to RFC 8291/8292 VAPID Web Push notifications (
/rc/api/push/subscribe) for approval prompts and completed turns, or forward alerts to Telegram/Discord viaRC_MESSAGING_ALERTS.
Permission modes¶
RC_PERMISSION_MODE sets the default (and ceiling) permission policy for new Remote Control sessions:
| Mode | Behaviour | Claude driver mapping |
|---|---|---|
ask (default) |
Prompts in /rc before executing write or shell tools. |
--permission-mode default |
auto_edits |
Auto-approves file edit tools (Edit, Write, MultiEdit, NotebookEdit, etc.) while still asking on shell commands and external tools. |
--permission-mode acceptEdits |
yolo |
Auto-approves all tool calls without prompting. High risk — never default; opt in deliberately per session or config. | --permission-mode bypassPermissions --allow-dangerously-skip-permissions |
Pairing and quickstart¶
- Enable and scope
/rc: Open the Remote Control page in the local dashboard (http://127.0.0.1:8082/admin), enableRC_ENABLED, setRC_ALLOWED_DIRSto the project folder(s) you want remote sessions to access, pickRC_PERMISSION_MODEandRC_TUNNEL_MODE, and save your settings. - Start a transport (if connecting from another device): Click Start Tailscale Serve, Use Tailnet Direct, or Start Cloudflare Tunnel on the Remote Control page.
- Pair your phone: Click Generate pairing QR. Scan the QR code (or copy the
?pair=...URL, which/rcexchanges for a cookie and strips from browser history immediately), or paste the 60-second token into the pairing form. - Launch or attach a session: Pick a harness and an allowed folder, or attach a discovered/sidecar session (
mcc-claude --rc). - Tear down when finished: Click Stop tunnel to close external reachability, or Revoke all devices to sign out every paired browser immediately.
Settings and environment variables reference¶
| Variable | Default | Description |
|---|---|---|
RC_ENABLED |
false |
Master switch enabling /rc, pairing exchange, session supervision, and /rc WebSockets. |
RC_PERMISSION_MODE |
ask |
Default and ceiling permission mode for new sessions (ask, auto_edits, yolo). |
RC_ALLOWED_DIRS |
"" |
Comma- or path-separator-delimited workspace roots allowed for sessions and directory browsing. Empty disables remote path selection. |
RC_MAX_SESSIONS |
12 |
Maximum concurrent active Remote Control sessions (1 to 64). |
RC_TUNNEL_MODE |
off |
Preferred transport (off, tailscale_serve, tailscale_local, cloudflare). |
RC_TAILSCALE_BINARY |
"" |
Optional explicit path to the tailscale executable; blank auto-detects on PATH and standard OS paths. |
RC_TAILSCALE_HOSTNAME |
"" |
Optional override for the Tailnet DNS name or IP used in pairing URLs. |
RC_CLOUDFLARE_BINARY |
"" |
Optional explicit path to the cloudflared executable; blank auto-detects on PATH. |
RC_CLOUDFLARE_TUNNEL_TOKEN |
"" |
Optional Cloudflare Zero Trust Named Tunnel token; blank starts an ephemeral quick trycloudflare.com tunnel. |
RC_CLOUDFLARE_PUBLIC_HOSTNAME |
"" |
Public HTTPS URL or hostname mapped to your Cloudflare Named Tunnel for QR pairing links. |
RC_SESSION_SECRET |
"" |
HMAC-SHA256 signing key for mcc_rc_session cookies; blank auto-generates and persists one under ~/.mcc. |
RC_MESSAGING_ALERTS |
false |
Forward Remote Control approval prompts, turn completions, and errors to your configured Telegram or Discord chat. |
Loopback admin control endpoints¶
The Remote Control page drives these loopback-only admin endpoints:
GET /admin/api/rc/status— current/rcstate, session counts, and Tailscale/Cloudflare tunnel inspection.POST /admin/api/rc/pair-token— issue a 60-second single-use pairing token and QR SVG.GET /admin/api/rc/devices— list paired devices.POST /admin/api/rc/devices/{device_id}/revokeandPOST /admin/api/rc/devices/revoke-all— invalidate device sessions and close active WebSockets.POST /admin/api/rc/tunnel/startandPOST /admin/api/rc/tunnel/stop— start or stop the active tunnel transport.GET /admin/api/rc/sessionsandPOST /admin/api/rc/sessions/{session_id}/stop— list or stop supervised sessions.GET /admin/api/rc/sidecarsandPOST /admin/api/rc/sidecars/register— inspect and register detached--rclauncher sidecars.