Skip to content

Rename customer-facing MCP server to agent-relay#2

Open
willwashburn wants to merge 3 commits into
mainfrom
rename-mcp-to-agent-relay
Open

Rename customer-facing MCP server to agent-relay#2
willwashburn wants to merge 3 commits into
mainfrom
rename-mcp-to-agent-relay

Conversation

@willwashburn
Copy link
Copy Markdown
Member

@willwashburn willwashburn commented Jun 3, 2026

User description

Summary

The customer-facing MCP server (and its mcp__<key>__ tool prefix) is now keyed agent-relay instead of relaycast, so it matches the agent-relay binary and the existing Agent Relay Zed entry. Agents see mcp__agent-relay__send_dm, mcp__agent-relay__post_message, etc.

Changes

  • src/setup.tsmcporter config add registers the server as agent-relay (both the initial and token-authenticated passes); descriptions updated to "Agent Relay messaging MCP server". Setup now removes any legacy relaycast entry from earlier installs before re-adding.
  • src/identity/files.ts — agent identity instructions reference mcp__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.dev hosts, 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.

  • Refactors
    • src/setup.ts: register as agent-relay; remove any agent-relay/relaycast entries before re-adding; keep token-auth; description now "Agent Relay messaging MCP server".
    • README.md, skill/SKILL.md: switch to mcporter call --server agent-relay --tool message.*; replace list_agents with mcporter resource agent-relay relay://agents; update examples (post_messagemessage.post, etc.).
    • src/identity/files.ts, templates/SOUL.md.template: update identity text and tool names to mcp__agent-relay__message_* and Agent Relay message.* forms.
    • src/spawn/process.ts: migrate to relay.spawn(...) (current SDK).
    • No product rename: @relaycast/sdk, *.relaycast.dev, and message tags stay "Relaycast".

Written for commit 918628d. Summary will update on new commits.

Review in cubic


CodeAnt-AI Description

Rename the customer-facing MCP server to Agent Relay

What Changed

  • The messaging MCP server now appears as agent-relay, so agents use mcp__agent-relay__* tools instead of mcp__relaycast__*
  • Agent identity text now refers to the Agent Relay message bus and shows the new tool names
  • Setup now clears out old MCP entries before re-adding the server, which helps fix leftover relaycast installs from earlier setups

Impact

✅ 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:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

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:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

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.

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
Copy link
Copy Markdown

codeant-ai Bot commented Jun 3, 2026

CodeAnt AI is reviewing your PR.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 3, 2026

Warning

Rate limit exceeded

@agent-relay-code[bot] has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 49 minutes and 20 seconds before requesting another review.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: e1b8da9c-a78e-43dd-9bc4-76a3adf25316

📥 Commits

Reviewing files that changed from the base of the PR and between 849e13c and 918628d.

📒 Files selected for processing (6)
  • README.md
  • skill/SKILL.md
  • src/identity/files.ts
  • src/setup.ts
  • src/spawn/process.ts
  • templates/SOUL.md.template
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch rename-mcp-to-agent-relay

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codeant-ai codeant-ai Bot added the size:S This PR changes 10-29 lines, ignoring generated files label Jun 3, 2026
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/setup.ts
Comment on lines +465 to 471
for (const staleKey of ['agent-relay', 'relaycast']) {
try {
execFileSync(mcp.cmd, [...mcp.prefix, 'config', 'remove', staleKey], { stdio: 'pipe' });
} catch {
/* may not exist */
}
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Redundant MCP Server Registration Flow

Currently, the setup process registers the agent-relay MCP server twice if an agentToken is successfully retrieved:

  1. First, it registers agent-relay without a token (lines 398-418).
  2. Then, it retrieves the token, removes agent-relay (and legacy relaycast), and registers agent-relay again with the token (lines 473-495).

Since execFileSync (especially with npx) can be slow, we can optimize this by:

  1. Retrieving the agentToken first (with a try-catch fallback).
  2. Removing only the legacy relaycast server.
  3. Registering the agent-relay MCP server exactly once, appending the RELAY_AGENT_TOKEN env var only if the token was successfully retrieved.

This would simplify the setup flow, avoid redundant process executions, and prevent temporary invalid states.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread src/setup.ts
'config',
'add',
'relaycast',
'agent-relay',
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Comment thread src/identity/files.ts Outdated
Comment on lines 62 to 74
'## 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.',
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟠 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 fix

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread src/setup.ts
'config',
'add',
'relaycast',
'agent-relay',
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>

Comment thread src/setup.ts Outdated
Comment on lines +464 to +470
// 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 */
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Copy Markdown

codeant-ai Bot commented Jun 3, 2026

CodeAnt AI finished reviewing your PR.

@agent-relay-code
Copy link
Copy Markdown

Reviewed and fixed the PR locally.

Changes made:

  • Updated shipped README, skill docs, and SOUL.md.template to use agent-relay.* / mcp__agent-relay__* MCP names.
  • Made setup idempotent across the relaycast -> agent-relay MCP server rename by removing stale entries before re-adding.
  • Fixed a TypeScript build failure in src/spawn/process.ts by using the published AgentRelay.spawn(...) SDK API instead of nonexistent spawnAgent(...).
  • Rebuilt generated dist output to match source.

Local verification:

  • npm run build passed.
  • npm test passed: 6 test files, 83 tests.

@agent-relay-code
Copy link
Copy Markdown

pr-reviewer applied fixes — committed and pushed 23bc33c to this PR. The notes below describe what changed.

Reviewed and fixed the PR locally.

Changes made:

  • Updated shipped README, skill docs, and SOUL.md.template to use agent-relay.* / mcp__agent-relay__* MCP names.
  • Made setup idempotent across the relaycast -> agent-relay MCP server rename by removing stale entries before re-adding.
  • Fixed a TypeScript build failure in src/spawn/process.ts by using the published AgentRelay.spawn(...) SDK API instead of nonexistent spawnAgent(...).
  • Rebuilt generated dist output to match source.

Local verification:

  • npm run build passed.
  • npm test passed: 6 test files, 83 tests.

@agent-relay-code
Copy link
Copy Markdown

Reviewed PR #2 and fixed the breakage I found.

Key fixes:

  • Corrected README and skill command examples for agent-relay MCP usage.
  • Replaced invalid legacy agent-relay.post_message-style calls with mcporter call --server agent-relay --tool message.post ....
  • Used mcporter resource agent-relay relay://agents where agent listing is exposed as a resource, not a call tool.
  • Updated generated SOUL instructions and setup fallback skill text to use canonical Agent Relay MCP tool names.

Local checks run:

  • npm run build
  • npm test passed: 6 test files, 83 tests.

@agent-relay-code
Copy link
Copy Markdown

pr-reviewer applied fixes — committed and pushed 918628d to this PR. The notes below describe what changed.

Reviewed PR #2 and fixed the breakage I found.

Key fixes:

  • Corrected README and skill command examples for agent-relay MCP usage.
  • Replaced invalid legacy agent-relay.post_message-style calls with mcporter call --server agent-relay --tool message.post ....
  • Used mcporter resource agent-relay relay://agents where agent listing is exposed as a resource, not a call tool.
  • Updated generated SOUL instructions and setup fallback skill text to use canonical Agent Relay MCP tool names.

Local checks run:

  • npm run build
  • npm test passed: 6 test files, 83 tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S This PR changes 10-29 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant