Skip to main content
Before your AI agent can send or receive handoffs, two things must happen: your identity must be registered with the relay, and the MCP server must be wired into your AI client. The register, install, and doctor commands handle this in sequence.

agentrelay register

register calls POST /admin/agents on the relay and stores the returned API key at ~/.agentrelay/config.json with file permissions 0600. You need the admin token from your team lead to run this.

Flags

The admin token authenticates the registration request against the relay’s POST /admin/agents endpoint. It is not stored and is not your API key — the relay generates a fresh API key in response and that is what gets written to disk. After registering, verify the config was written:
Expected output:
The api_key field is returned only once by the relay and never again. If you lose it, rotate using agentrelay rotate-key — see Audit and rotate.

agentrelay install

install does three things in one command: adds the MCP server entry to your AI client’s config, writes the recommended permission overlay (Layer 2 of the trust model), and creates a default ~/.agentrelay/trust.yaml if one does not already exist.
1

MCP server entry

The command detects your client’s config file and adds the agentrelay server entry. It prompts before overwriting an existing entry.
Written to ~/.claude/settings.json:
2

Permission overlay (Layer 2)

The command merges the recommended permissions block into the same settings file. If you have customised your permissions, it shows a diff and asks before applying.
Added to ~/.claude/settings.json under "permissions":
3

Default trust.yaml

If ~/.agentrelay/trust.yaml does not exist, the command creates it with unknown_teammates.policy: reject, meaning only teammates you explicitly list are trusted. Edit this file to add your teammates — see Trust and block.
Known issue #1 — MCP entry may be written to the wrong file. In the current release, agentrelay install may write the Claude Code MCP entry to a path that Claude Code does not read. Until this is resolved, register the MCP server directly instead:
The --scope user flag makes the entry available in every directory, not just the current project. After this, still run agentrelay install --client all to apply the permission overlay — that part works correctly.

agentrelay doctor

doctor checks each component of the setup in sequence and prints a status line for each.
Expected output when everything is configured correctly:
If any line shows MISSING or FAIL, doctor appends a note: line explaining the likely cause. Common causes:
  • config: MISSINGagentrelay register has not been run, or was run with the wrong binary. See the troubleshooting note in CLI overview.
  • api key valid: FAIL — The relay’s RELAY_PEPPER may have changed since you registered. Re-run register after the relay operator stabilises the pepper.
  • mcp[claude-code]: MISSING — Use claude mcp add directly (see the warning above).
  • trust.yaml: BROKEN — The file exists but failed to parse. Check the YAML syntax.