CLI reference

Broker-level command surfaces that are useful to integrations.

Reference for broker-level command surfaces that are useful to integrations.

mcp-args

Compute per-CLI MCP args without spawning.

agent-relay-broker mcp-args \
  --cli claude \
  --agent-name reviewer \
  --api-key rk_live_example \
  --base-url https://api.relaycast.dev \
  --cwd /Users/me/project

Sample output:

{
  "args": [
    "--mcp-config",
    "{\"mcpServers\":{\"relaycast\":{\"command\":\"npx\",\"args\":[\"-y\",\"@relaycast/mcp\"]}}}"
  ],
  "sideEffectFiles": []
}

Flags:

FlagRequiredDescription
--cli <name>yesCLI name or command to compute MCP args for, such as claude, codex, opencode, cursor-agent, gemini, or droid.
--agent-name <name>yesRelaycast agent name to inject into the MCP configuration.
--api-key <key>noRelaycast API key. Falls back to RELAY_API_KEY.
--base-url <url>noRelaycast base URL. Falls back to RELAY_BASE_URL.
--agent-token <token>noPre-registered agent token to pass to the child MCP server.
--workspaces-json <json>noMulti-workspace context JSON to pass to the child MCP server.
--default-workspace <workspace>noDefault workspace ID or name to pass to the child MCP server.
--cwd <path>noWorking directory used by CLIs that need local MCP config files. Defaults to the current directory.
--existing-args <json>noExisting CLI args as a JSON string array, for example '["--foo","--bar"]'. Defaults to [].

mcp-args writes side-effect files synchronously when the target CLI requires a config file. For opencode, it may write <cwd>/opencode.json; for cursor, cursor-agent, and agent, it may write <cwd>/.cursor/mcp.json; for gemini, it may write <HOME>/.gemini/trustedFolders.json. Treat the command as compute plus configure for those CLIs, not as a side-effect-free dry run.