Skip to main content
Every developer on the team completes this setup once on their own laptop. You need the relay URL and admin token from your team lead before you start — if you don’t have them yet, ask your lead to complete relay deployment first. On a good day this takes about 10 minutes. v0.1.x has some known sharp edges (tracked under v0.1.2) that the steps below work around explicitly.

Prerequisites

  • Node 20 or later (node --version to check)
  • Claude Code or Codex CLI installed
  • Relay URL and admin token from your team lead

Setup

1

Register your identity with the relay

This creates your developer profile on the relay and writes your API key to ~/.agentrelay/config.json (file mode 0600).
Use the agentrelay CLI binary, not agentrelay-mcp. The agentrelay-mcp binary is the MCP server — it speaks stdio and silently ignores CLI arguments. If you run it instead of agentrelay, the command will appear to hang and ~/.agentrelay/config.json will remain empty. This is a known issue tracked at #2.
Replace bob@acme, bob@acme.com, "Bob", and backend with your own values. The --handle is your team-scoped identity (used in trust configuration and handoff routing) — choose something stable like yourname@yourteam.Verify the config was written:
You should see a JSON object with relay_url, agent_handle, agent_id, and api_key fields. If the file is empty or missing, you likely ran the wrong binary — see Troubleshooting below.
2

Wire AgentRelay into your coding agent

Use claude mcp add directly. The --scope user flag makes the MCP entry active in every directory you open Claude Code in, not just one project.
Verify it was registered:
You should see agentrelay in the list.
Don’t rely on agentrelay install to register the MCP entry in Claude Code — it currently writes to the wrong file (#1). The claude mcp add command above is the correct workaround for v0.1.x.
3

Install the permission overlay

The permission overlay is Layer 2 of AgentRelay’s four-layer trust model. It writes allow / ask / deny rules to your coding agent’s settings file, ensuring that inbound handoffs from teammates cannot cause your agent to run destructive commands without your approval.
This sets up the following risk-tiered defaults:Even if a poisoned handoff somehow convinced your agent to attempt a git push, the harness denies the tool call before it executes.
4

Run the doctor check

Every line should read OK:
If any line shows MISSING or FAIL, see Troubleshooting below.
5

Restart your coding agent and confirm the MCP server loads

Quit Claude Code (or Codex CLI) completely and reopen it. Then run /mcpagentrelay should appear in the list of active MCP servers.Once it does, your agent has access to all AgentRelay tools: handoff_to_teammate, check_inbox, accept_handoff, send_message, complete_handoff, and list_teammates.Try asking your agent: “Use agentrelay to list my teammates.”

Configure trust

Before you can receive handoffs, you need a ~/.agentrelay/trust.yaml file. agentrelay install creates a default one, but you can also write it manually. See Trust configuration for the full schema and options. A minimal starting point that trusts the person who invited you:
Replace inviter@team with the handle of the person who invited you. Add entries under teammates: for each additional teammate as they join.

Troubleshooting

You ran the wrong binary. agentrelay-mcp is the MCP server — it starts in stdio mode and ignores CLI arguments.The correct command uses -p agentrelay-mcp (to install from that package) but invokes the agentrelay bin (the CLI):
Re-run with the correct form and verify cat ~/.agentrelay/config.json is populated. Tracked at #2.
agentrelay install wrote the MCP entry to the wrong config file (#1). Run the direct command instead:
Then quit and reopen Claude Code. Run /mcp again to confirm.
The sender is not in your ~/.agentrelay/trust.yaml. Add a <their-handle>: entry under teammates: using the schema from Trust configuration.Alternatively, set unknown_teammates.policy: allow_with_default_trust to let unlisted teammates through with default restrictions while you’re getting started.
The admin token is wrong or was rotated after you received it. Ask your team lead for the current token from their .env file.
Your chosen handle is already registered on this relay. Pick a different handle and re-run, or ask your team lead to remove the existing record (agentrelay block <handle> followed by re-registration).
The Layer 2 permission overlay is missing or incomplete. Check ~/.claude/settings.json — the permissions block should have ask rules for Edit, Write, and Bash(git commit*), and deny rules for git push, npm publish, aws, kubectl, and curl.If the block is absent, re-run:
Slack webhooks are per-agent and are set via your relay’s admin tooling. CLI support for configuring the webhook URL is tracked separately. Check with your team lead that your Agent Card has a webhook URL set.

Quick reference


Next step

Configure per-teammate trust settings to control what each teammate’s handoffs are allowed to trigger on your machine — see Trust configuration.