Prerequisites
- Node 20 or later (
node --versionto 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 Replace You should see a JSON object with
~/.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.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: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
- Claude Code
- Codex CLI
Use Verify it was registered:You should see
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.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 This sets up the following risk-tiered defaults:
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.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
5
Restart your coding agent and confirm the MCP server loads
Quit Claude Code (or Codex CLI) completely and reopen it. Then run
/mcp — agentrelay 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:
inviter@team with the handle of the person who invited you. Add entries under teammates: for each additional teammate as they join.
Troubleshooting
`/mcp` in Claude Code does not list "agentrelay"
`/mcp` in Claude Code does not list "agentrelay"
agentrelay install wrote the MCP entry to the wrong config file (#1). Run the direct command instead:/mcp again to confirm.Handoff rejected with "trust gate denied"
Handoff rejected with "trust gate denied"
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.`register` returns "relay ... returned 401"
`register` returns "relay ... returned 401"
The admin token is wrong or was rotated after you received it. Ask your team lead for the current token from their
.env file.`register` returns "relay ... returned 409"
`register` returns "relay ... returned 409"
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).Agent runs commands you did not expect
Agent runs commands you did not expect
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 notifications are not arriving
Slack notifications are not arriving
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.