Skip to content

feat: activate remote reverse-MCP connection — config file + WS transport + UI button (Part B) - #43

Merged
brettchien merged 2 commits into
mainfrom
feat/remote-connection-v2
Aug 14, 2026
Merged

brettchien merged 2 commits into
mainfrom
feat/remote-connection-v2

Conversation

@brettchien

Copy link
Copy Markdown
Contributor

Drafted by Orca (ecs-claude) — flagging authorship (shared GitHub identity).

The operator-triggered remote reverse-MCP-over-ACP connection (reverse-MCP client ADR, Part B) — the piece that makes path (i) real. Studio dials the configured /acp endpoint, declares its oab server, and relays tunnelled MCP to the running oab-mcp sidecar (§4.3). Connection is explicit (a button), configured via an editable file, per operator direction.

What

  • Config — acp_tunnel::config::RemoteConfig (~/.config/oab-studio/remote.toml: url / token / cwd), parse/serialize/validate. editable in-app via the same CodeMirror TOML editor as fleets.toml.
  • Transport — src-tauri/remote.rs: dial /acp (tokio-tungstenite, bearer sub-protocol), drive the acp-tunnel Session (initialize → session/new declaring oab → resume on reconnect), and serve the gateway-initiated tunnel by relaying initialize (answered locally) / tools/list / tools/call to the sidecar McpClient. Reconnect w/ backoff; abort on disconnect.
  • Commands — remote_config / remote_config_write / remote_connect (the Activate) / remote_disconnect; remote-status events.
  • UI — a remote panel: status badge, endpoint, Activate remote connection / Disconnect button (disabled until configured), Edit config. Live status via the remote-status event.

Verification

  • cargo test -p acp-tunnel — 18/18 (13 protocol + 5 config), local.
  • console tsc + vite build clean; vitest 41/41 (7 new remote-panel cases).
  • ⚠️ src-tauri/remote.rs compiles under desktop.yml (macOS) — not locally (webkit). Its end-to-end wire behaviour is validated against the live gateway once the §5 endpoint exists (the Jelly thread on endpoint + bearer). Live-validation items flagged in-code: exact ACP initialize/session/new params, and the rustls crypto-provider at dial time.

Security note

The /acp bearer lives in remote.toml (plaintext, editable) and is surfaced in the editor — acceptable for a local single-operator desktop tool (same posture as any editable secret-bearing config); a keychain-backed token is a possible follow-up.

🤖 Generated with Claude Code

… + commands

The operator-triggered remote reverse-MCP-over-ACP connection (reverse-MCP client
ADR, Part B): Studio dials the /acp endpoint, declares its `oab` server, and
relays tunnelled MCP to the running oab-mcp sidecar.

- acp-tunnel::config::RemoteConfig — the remote.toml schema (url/token/cwd),
  parse/serialize/validate. Unit-tested (5 cases; empty=not-configured, bad
  scheme rejected, cwd defaults). aws-free, runs locally.
- src-tauri/remote.rs — the WS transport: dial /acp (tokio-tungstenite, bearer
  sub-protocol), drive the acp-tunnel Session (initialize → session/new declaring
  oab → resume on reconnect), and serve the gateway-initiated tunnel by relaying
  initialize (answered locally) / tools/list / tools/call to the sidecar
  McpClient. Reconnect with backoff; abort on disconnect. Config file IO with
  validate-before-write.
- commands: remote_config / remote_config_write (editable remote.toml, same
  pattern as fleets.toml) / remote_connect (the explicit Activate) /
  remote_disconnect; `remote-status` events. McpClient::request made pub so the
  tunnel relays raw MCP results.

Verification: `cargo test -p acp-tunnel` 18/18 (13 protocol + 5 config) locally.
The src-tauri transport compiles under desktop.yml (macOS); its end-to-end wire
behaviour is validated against the live gateway once the §5 endpoint exists
(exact ACP initialize/session params + TLS provider are live-validation items).

🤖 Generated with [Claude Code](https://claude.com/claude-code)
…l editor (Part B)

The UI for the operator-triggered reverse-MCP connection:
- A `remote` panel: live status badge (disconnected/connecting/connected/error),
  the /acp endpoint, and an explicit **Activate remote connection** / Disconnect
  button (Activate disabled until url+token are configured).
- Editing: the existing CodeMirror TOML editor is generalized to two targets
  (fleets.toml + remote.toml); "Edit config" on the panel opens remote.toml.
- Live status: subscribes to the backend `remote-status` event so the badge
  reflects the real transport state without polling.
- `RemoteConfig` view type + Source methods (remoteConfig / writeRemoteConfig /
  remoteConnect / remoteDisconnect), with MockSource for the browser build.

Verification: tsc clean; vitest 41/41 (7 new remote-panel cases: configured
vs not, connected→Disconnect, error, edit action, escaping); vite build clean.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
@brettchien
brettchien merged commit 420f6ec into main Aug 14, 2026
2 checks passed
@brettchien
brettchien deleted the feat/remote-connection-v2 branch August 14, 2026 06:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant