Skip to content

feat(bridge): MCP server exposing gated wallet/launch/memory tools to external agents#201

Merged
nullxnothing merged 5 commits into
mainfrom
feat/daemon-bridge
Jun 20, 2026
Merged

feat(bridge): MCP server exposing gated wallet/launch/memory tools to external agents#201
nullxnothing merged 5 commits into
mainfrom
feat/daemon-bridge

Conversation

@nullxnothing

Copy link
Copy Markdown
Owner

@

What

DAEMON Bridge v1 — external agents (Claude Code, Cursor) can call a gated subset of ARIA tools over MCP.

  • stdio shim (electron/services/bridge/shim.ts) forwards MCP calls to a loopback HTTP server on 7337 in the main process
  • BridgeToolGateway enforces the same risk tiers as ARIA: reads run, writes block on an approval card inside DAEMON, sensitive tools keep typed confirm; approval summaries carry the [MAINNET] mark
  • Per-install token auth; 13-tool allowlist (wallet/launch/memory packs + read_project_status) intersected with enabled packs at runtime
  • cwd-based project resolution, 120s approval timeout
  • Per-project .mcp.json registration flow in Settings → Bridge
  • Smoke script: scripts/smoke/bridge-shim.mjs

Why

Keys never leave the vault. External agents request actions, a human approves on a card, DAEMON signs. This is the companion-layer path for Cursor/VS Code users — they keep their editor and add DAEMON as the approval surface.

Tests

Four new test files (gateway, server, executeToolCall risk gating, approval host DOM). Full gate green locally: typecheck + vitest suite + build.
@

… external agents

Claude Code and Cursor can now call DAEMON tools through a stdio shim that
forwards to a loopback HTTP server in the main process. Every write tool
blocks on an approval card inside DAEMON; sensitive tools keep typed confirm
and approval summaries now carry the [MAINNET] mark. Token auth, 13-tool
allowlist intersected with enabled packs, cwd-based project resolution,
120s approval timeout, and a per-project .mcp.json registration flow.
resolveProjectForCwd leaned on path.resolve + path.sep, which only behave
correctly on Windows. On Linux CI path.resolve mangles C:\ paths and path.sep
is /, so the longest-prefix match returned nothing and two gateway tests failed.
Normalize separators and case ourselves instead of trusting host path semantics.
Bump vulnerable transitive deps to their fixed versions via pnpm overrides,
and the two direct deps (vite, nodemailer) in place:

- dompurify 3.4.0 -> 3.4.7   (XSS via hook tag/attr mutation)
- hono 4.12.21 -> 4.12.25     (CORS credential reflection)
- protobufjs 7.5.8 -> 7.6.1   (Any-expansion DoS)
- tmp 0.2.6 -> 0.2.7          (path traversal via _assertPath bypass)
- ws 8.20.1 -> 8.21.0         (fragment memory-exhaustion DoS)
- undici 6.25.0 -> 6.27.0     (websocket fragment DoS)
- tar 7.5.13 -> 7.5.16        (PAX size override)
- form-data 4.0.5 -> 4.0.6    (CRLF injection in field names)
- js-yaml 4.1.1 -> 4.2.0      (merge-key quadratic DoS)
- nodemailer 8.x -> 9.0.1     (raw option file-access bypass)
- vite 6.4.2 -> 6.4.3         (server.fs.deny bypass on Windows)

@babel/core (CVSS 3.2, build-time only, no stable 7.x fix) is suppressed
in osv-scanner.toml with justification and a review date.
OSV flagged newer advisories against the interim pins:
- dompurify 3.4.7 -> 3.4.11 (ALLOWED_ATTR pollution, SAFE_FOR_TEMPLATES
  bypass, Trusted Types policy persistence)
- protobufjs 7.6.1 -> 7.6.3 (schema-name property shadowing)
The rebase onto main pulled in the BUILD/PLAN toggle and one-row composer
layout, which legitimately changes the agent panel header and composer
renders. Update only those 6 baselines; the rest match within tolerance.
@nullxnothing nullxnothing merged commit 3845f0c into main Jun 20, 2026
5 checks passed
@nullxnothing nullxnothing deleted the feat/daemon-bridge branch June 20, 2026 15: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