User Guide

Agent Access and MCP

Expose Loom over /mcp/loom for Claude Code and Codex, connect mcp.json servers, and enforce tool confirmation policies.

External coding agents such as Claude Code and Codex can connect to Loom through its authenticated Streamable HTTP MCP gateway at /mcp/loom. With a gateway token, an agent can inspect paired machines, run non-interactive commands on them, query your Second Brain, and—when Codeman is connected—start and supervise other agent sessions.

Connect an external agent

Open Settings → Security → Agent access to inspect your gateway URL and generate a Bearer token:

  • One-time secret: The raw token is displayed once when created; Loom stores only its hash and tracks the most recent client name and timestamp.
  • Instant revocation: Rotating or revoking the token (POST /api/mcp/gateway/token with {"revoke":true} or DELETE /api/mcp/gateway/token) immediately disconnects any client holding the previous token.

Ready-to-copy client configurations provided in the panel:

  • Claude Code (user scope makes Loom available to all sessions, including sessions launched by Codeman):
claude mcp add --scope user --transport http loom http://127.0.0.1:2510/mcp/loom \
  --header "Authorization: Bearer <token>"
  • Codex (~/.codex/config.toml):
[mcp_servers.loom]
url = "http://127.0.0.1:2510/mcp/loom"
http_headers = { "Authorization" = "Bearer <token>" }
  • Standard .mcp.json (type: "http"):
{
  "mcpServers": {
    "loom": {
      "type": "http",
      "url": "http://127.0.0.1:2510/mcp/loom",
      "headers": {
        "Authorization": "Bearer <token>"
      }
    }
  }
}

Gateway tools and Codeman bridge

When a client connects, Loom supplies MCP server instructions guiding the agent to start with loom_overview.

ToolPurpose
loom_overviewReports Loom version, machines, active capability bricks, and whether agents__* tools are available.
loom_machinesLists local, paired Loom nodes, and saved SSH machines along with their modules.
loom_machine_runExecutes one non-interactive command on a target machine via local PTY, SSH, or node terminal, returning the exit code and the last 64 KiB of plain-text output (default timeout 60 seconds, max 600).
loom_gateway_statusReports upstream MCP servers and the Codeman agents bridge status.
agents__*Proxies codeman mcp (list_sessions, start_session, send_prompt, wait_for_session, read_output, interrupt_session, delete_session) when Codeman is connected and codeman is installed on the Loom host.
brain_*, memory_*Exposes Second Brain search, notes, and memory retrieval tools.

Loom passes the Codeman credential to codeman mcp strictly through process environment variables—never on the command line or on disk. An external agent can prompt, interrupt, or delete only the Codeman sessions it started itself.

Managing mcp.json and linked sources

Loom stores its own MCP client configuration at LOOM_HOME/mcp.json with owner-only (0600) file writes and automatic change detection (no restart needed after editing):

  • Transports: command / args / env for stdio servers, or url / headers for Streamable HTTP servers, plus Loom's enabled and disabledTools fields.
  • Read-only linked sources: Under Settings → MCP, link existing ~/.claude.json, .mcp.json, ~/.cursor/mcp.json, or .vscode/mcp.json files (POST /api/mcp/sources) without modifying them.
  • Safe adoption: Adopting a linked server (POST /api/mcp/sources/adopt) copies it into LOOM_HOME/mcp.json with enabled: false and empty credential placeholders unless with_env: true is explicitly requested (headers are never copied automatically).

Capability policies and approvals

Every gateway tool call is evaluated against Loom's capability policy engine using the subject mcp.tool:<server>/<tool> (such as mcp.tool:loom/loom_machine_run or mcp.tool:agents/start_session):

  1. Ask me before acting: Enabling this toggle in Agent access creates two global confirm rules (agent-access-ask-run and agent-access-ask-session) editable in Settings → Permissions.
  2. Live approval queue: Waiting calls appear in Loom's notification bell, mobile Inbox, and optional ntfy/Web Push notifications for up to 24 hours. Command and argument details stay in memory only and are never written to audit logs or pushed to external notification servers.
  3. API inspection: Inspect pending requests with GET /api/policy/pending and answer them with POST /api/workspace/sessions/<session_id>/requests/<request_id> using {"decision":"allow_once"} or {"decision":"deny"}.

Continue to Security and Reverse Proxy to harden remote access.