Rename customer-facing MCP server to agent-relay#2
Conversation
Register the messaging MCP server under the key `agent-relay` (was `relaycast`), so agents see `mcp__agent-relay__*` tools matching the binary and Zed entry. Setup now also removes any legacy `relaycast` entry from earlier installs. The Relaycast service name (SDK, host, message-source tags) is unchanged — only the MCP server key/prefix and agent-facing identity text move to Agent Relay. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
CodeAnt AI is reviewing your PR. |
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (6)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Code Review
This pull request renames the 'Relaycast' messaging service and its associated MCP tools to 'Agent Relay' across the codebase, updating both documentation and setup configurations. Additionally, the setup process is updated to clean up legacy 'relaycast' configurations. Feedback on these changes highlights an opportunity to optimize the setup flow by avoiding redundant registrations of the 'agent-relay' MCP server, which is currently registered twice (first without a token and then re-registered with one).
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| for (const staleKey of ['agent-relay', 'relaycast']) { | ||
| try { | ||
| execFileSync(mcp.cmd, [...mcp.prefix, 'config', 'remove', staleKey], { stdio: 'pipe' }); | ||
| } catch { | ||
| /* may not exist */ | ||
| } | ||
| } |
There was a problem hiding this comment.
Redundant MCP Server Registration Flow
Currently, the setup process registers the agent-relay MCP server twice if an agentToken is successfully retrieved:
- First, it registers
agent-relaywithout a token (lines 398-418). - Then, it retrieves the token, removes
agent-relay(and legacyrelaycast), and registersagent-relayagain with the token (lines 473-495).
Since execFileSync (especially with npx) can be slow, we can optimize this by:
- Retrieving the
agentTokenfirst (with a try-catch fallback). - Removing only the legacy
relaycastserver. - Registering the
agent-relayMCP server exactly once, appending theRELAY_AGENT_TOKENenv var only if the token was successfully retrieved.
This would simplify the setup flow, avoid redundant process executions, and prevent temporary invalid states.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 559373d921
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| 'config', | ||
| 'add', | ||
| 'relaycast', | ||
| 'agent-relay', |
There was a problem hiding this comment.
Keep installed MCP instructions in sync
When this registers the messaging server as agent-relay, setup still copies the bundled skill/SKILL.md into the workspace, and that file's MCP examples/troubleshooting paths still point to relaycast.* / mcpServers.relaycast (checked via repo-wide rg "relaycast|agent-relay|mcp__"). After the later removal of the legacy relaycast entry, users/agents following the installed skill will call a server key that no longer exists, so the rename leaves the primary setup instructions broken unless the skill/template/docs are updated or a compatibility alias is kept.
Useful? React with 👍 / 👎.
| '## Agent Relay Messaging (IMPORTANT)', | ||
| '', | ||
| 'You communicate with users and other agents via the Relaycast message bus.', | ||
| 'You communicate with users and other agents via the Agent Relay message bus.', | ||
| 'Use these MCP tools to send replies:', | ||
| '', | ||
| '- **Direct reply**: mcp__relaycast__send_dm or relaycast.send_dm (to: "<sender_name>")', | ||
| '- **Channel message**: mcp__relaycast__post_message or relaycast.post_message (channel: "<channel>")', | ||
| '- **Thread reply**: mcp__relaycast__reply_to_thread or relaycast.reply_to_thread', | ||
| '- **Check inbox**: mcp__relaycast__check_inbox or relaycast.check_inbox', | ||
| '- **Direct reply**: mcp__agent-relay__send_dm or agent-relay.send_dm (to: "<sender_name>")', | ||
| '- **Channel message**: mcp__agent-relay__post_message or agent-relay.post_message (channel: "<channel>")', | ||
| '- **Thread reply**: mcp__agent-relay__reply_to_thread or agent-relay.reply_to_thread', | ||
| '- **Check inbox**: mcp__agent-relay__check_inbox or agent-relay.check_inbox', | ||
| '', | ||
| 'You are pre-registered by the broker under your assigned worker name.', | ||
| 'Do not call mcp__relaycast__register_agent unless a send/reply fails with "Not registered".', | ||
| 'Do not call mcp__agent-relay__register_agent unless a send/reply fails with "Not registered".', | ||
| 'Self-termination is not automatic. Only call remove_agent(name: "<your-agent-name>") or output /exit on its own line when explicitly instructed to terminate.', |
There was a problem hiding this comment.
🟠 Architect Review — HIGH
Inline SOUL identity text now points agents at mcp__agent-relay__* / agent-relay.*, but other shipped docs (templates/SOUL.md.template, README.md examples, and skill/SKILL.md guidance) still instruct using relaycast MCP server/tool names, so following those documented flows will call a server key that setup no longer registers by default.
Suggestion: Update all agent-facing and operator-facing instruction sources (SOUL template, README messaging examples, SKILL.md usage/troubleshooting) to reference the agent-relay MCP server key and mcp__agent-relay__* tool names so every documented or templated path matches the configured MCP server.
Fix in Cursor | Fix in VSCode Claude
(Use Cmd/Ctrl + Click for best experience)
Prompt for AI Agent 🤖
This is an **Architect / Logical Review** comment left during a code review. These reviews are first-class, important findings — not optional suggestions. Do NOT dismiss this as a 'big architectural change' just because the title says architect review; most of these can be resolved with a small, localized fix once the intent is understood.
**Path:** src/identity/files.ts
**Line:** 62:74
**Comment:**
*HIGH: Inline SOUL identity text now points agents at `mcp__agent-relay__*` / `agent-relay.*`, but other shipped docs (templates/SOUL.md.template, README.md examples, and skill/SKILL.md guidance) still instruct using `relaycast` MCP server/tool names, so following those documented flows will call a server key that setup no longer registers by default.
Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
If a suggested approach is provided above, use it as the authoritative instruction. If no explicit code suggestion is given, you MUST still draft and apply your own minimal, localized fix — do not punt back with 'no suggestion provided, review manually'. Keep the change as small as possible: add a guard clause, gate on a loading state, reorder an await, wrap in a conditional, etc. Do not refactor surrounding code or expand scope beyond the finding.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fixThere was a problem hiding this comment.
1 issue found across 2 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src/setup.ts">
<violation number="1" location="src/setup.ts:404">
P2: This renames the configured MCP key to `agent-relay`, but installed skill instructions still need to be updated to the same key (or a compatibility alias retained). Otherwise agents following `relaycast` examples will call a server key that no longer exists after setup removes the legacy entry.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
| 'config', | ||
| 'add', | ||
| 'relaycast', | ||
| 'agent-relay', |
There was a problem hiding this comment.
P2: This renames the configured MCP key to agent-relay, but installed skill instructions still need to be updated to the same key (or a compatibility alias retained). Otherwise agents following relaycast examples will call a server key that no longer exists after setup removes the legacy entry.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/setup.ts, line 404:
<comment>This renames the configured MCP key to `agent-relay`, but installed skill instructions still need to be updated to the same key (or a compatibility alias retained). Otherwise agents following `relaycast` examples will call a server key that no longer exists after setup removes the legacy entry.</comment>
<file context>
@@ -394,14 +394,14 @@ export async function setup(options: SetupOptions): Promise<SetupResult> {
'config',
'add',
- 'relaycast',
+ 'agent-relay',
'--command',
'npx',
</file context>
| // authenticated. Also drop any legacy `relaycast` entry from earlier setups. | ||
| for (const staleKey of ['agent-relay', 'relaycast']) { | ||
| try { | ||
| execFileSync(mcp.cmd, [...mcp.prefix, 'config', 'remove', staleKey], { stdio: 'pipe' }); | ||
| } catch { | ||
| /* may not exist */ | ||
| } |
There was a problem hiding this comment.
Suggestion: The new reconfiguration flow deletes the active MCP server entry before confirming the replacement add succeeds. If the second config add fails (mcporter error, transient npx issue, invalid env payload), both agent-relay and relaycast entries are gone and messaging tools are left unconfigured even though setup had already configured one entry earlier. Remove only the legacy key first, or add/update the new entry before deleting the current one. [logic error]
Severity Level: Critical 🚨
- ❌ Agent Relay MCP tools disappear after mcporter token reconfigure failure.
- ⚠️ OpenClaw CLI setup claims success but MCP not configured.Steps of Reproduction ✅
1. Run the CLI setup entrypoint in `src/cli.ts:112` (for example via the published
`agent-relay` binary), which calls `setup()` in `src/setup.ts:126` and reaches the initial
mcporter registration block at `src/setup.ts:397-416` that executes `mcporter config add
agent-relay`, creating an MCP server entry keyed `agent-relay` (or leaving an existing
`relaycast` entry in place).
2. Confirm that mcporter now has a configured messaging server by running `mcporter config
list` and verifying at least one row with key `agent-relay` or `relaycast`, which
corresponds to the earlier `execFileSync(mcp.cmd, [..., 'config','add','agent-relay',
...])` call in `src/setup.ts:48-67` (absolute file lines ~397-416).
3. Run the same setup command again in an environment where
`RelayCast.agents.registerOrGet` at `src/setup.ts:106-110` returns a truthy `agentToken`,
but force the second `config add` to fail by making `execFileSync` at
`src/setup.ts:124-145` throw (for example by temporarily replacing the `mcporter` binary
on PATH with a script that exits non-zero or otherwise causes `mcporter config add
agent-relay` to error).
4. During this second run, `setup()` enters the token path, executes the stale-key cleanup
loop `for (const staleKey of ['agent-relay', 'relaycast'])` at `src/setup.ts:464-470`,
removing both the existing `agent-relay` and legacy `relaycast` entries, and then the
failing `config add` aborts before recreating `agent-relay`, so a subsequent `mcporter
config list` shows neither key present and the messaging MCP server is left unconfigured
despite having been configured before.Fix in Cursor | Fix in VSCode Claude
(Use Cmd/Ctrl + Click for best experience)
Prompt for AI Agent 🤖
This is a comment left during a code review.
**Path:** src/setup.ts
**Line:** 464:470
**Comment:**
*Logic Error: The new reconfiguration flow deletes the active MCP server entry before confirming the replacement add succeeds. If the second `config add` fails (mcporter error, transient npx issue, invalid env payload), both `agent-relay` and `relaycast` entries are gone and messaging tools are left unconfigured even though setup had already configured one entry earlier. Remove only the legacy key first, or add/update the new entry before deleting the current one.
Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix|
CodeAnt AI finished reviewing your PR. |
|
Reviewed and fixed the PR locally. Changes made:
Local verification:
|
|
✅ pr-reviewer applied fixes — committed and pushed Reviewed and fixed the PR locally. Changes made:
Local verification:
|
|
Reviewed PR #2 and fixed the breakage I found. Key fixes:
Local checks run:
|
|
✅ pr-reviewer applied fixes — committed and pushed Reviewed PR #2 and fixed the breakage I found. Key fixes:
Local checks run:
|
User description
Summary
The customer-facing MCP server (and its
mcp__<key>__tool prefix) is now keyedagent-relayinstead ofrelaycast, so it matches theagent-relaybinary and the existingAgent RelayZed entry. Agents seemcp__agent-relay__send_dm,mcp__agent-relay__post_message, etc.Changes
src/setup.ts—mcporter config addregisters the server asagent-relay(both the initial and token-authenticated passes); descriptions updated to "Agent Relay messaging MCP server". Setup now removes any legacyrelaycastentry from earlier installs before re-adding.src/identity/files.ts— agent identity instructions referencemcp__agent-relay__*/agent-relay.*and the "Agent Relay Messaging" heading.Not changed
The Relaycast service name stays where it refers to the product, not the MCP surface:
@relaycast/sdk,*.relaycast.devhosts, the openclaw workspace state dirs, and[relaycast:…]/source: 'relaycast'message tags.🤖 Generated with Claude Code
Summary by cubic
Renamed the customer-facing MCP server key from relaycast to agent-relay and updated tool names/CLI examples to the new message.* surface. Agents now see
mcp__agent-relay__message.*tools; setup removes legacy entries and re-registers the server.src/setup.ts: register asagent-relay; remove anyagent-relay/relaycastentries before re-adding; keep token-auth; description now "Agent Relay messaging MCP server".README.md,skill/SKILL.md: switch tomcporter call --server agent-relay --tool message.*; replacelist_agentswithmcporter resource agent-relay relay://agents; update examples (post_message→message.post, etc.).src/identity/files.ts,templates/SOUL.md.template: update identity text and tool names tomcp__agent-relay__message_*and Agent Relaymessage.*forms.src/spawn/process.ts: migrate torelay.spawn(...)(current SDK).@relaycast/sdk,*.relaycast.dev, and message tags stay "Relaycast".Written for commit 918628d. Summary will update on new commits.
CodeAnt-AI Description
Rename the customer-facing MCP server to Agent Relay
What Changed
agent-relay, so agents usemcp__agent-relay__*tools instead ofmcp__relaycast__*relaycastinstalls from earlier setupsImpact
✅ Consistent Agent Relay tool names✅ Fewer broken MCP setups after upgrades✅ Clearer agent instructions💡 Usage Guide
Checking Your Pull Request
Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.
Talking to CodeAnt AI
Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:
This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.
Example
Preserve Org Learnings with CodeAnt
You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:
This helps CodeAnt AI learn and adapt to your team's coding style and standards.
Example
Retrigger review
Ask CodeAnt AI to review the PR again, by typing:
Check Your Repository Health
To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.