Agent Relay
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Agent RelayAsk the coding agent to fix the failing tests and return the job ID"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Agent Relay
Agent Relay is a small, asynchronous gateway for persistent coding agents.
It lets an MCP client, webhook, or automation submit work to an agent that is already running on a development machine, disconnect, and retrieve the result later. The first working adapter targets a named Herdr agent; the adapter boundary is designed for additional agent runtimes.
voice device / phone / MCP client / automation
|
| HTTPS + bearer token
v
Agent Relay
/ | \
policy job queue status/results
|
v
persistent agent session
|
v
repos / terminals / services / agentsWhy use it?
Interactive agent CLIs assume that a person is attached to their terminal. Remote devices and automations have different needs: requests should return quickly, long jobs must continue after the caller disconnects, two prompts must not collide in one terminal, and results need to be retrieved separately.
Agent Relay provides that missing boundary:
A cloud-accessible Streamable HTTP MCP endpoint
An authenticated webhook that forwards Pebble Index transcriptions without an intermediary agent
Static bearer-token authentication
A durable filesystem-backed job queue
Sequential delivery to one persistent agent
Asynchronous submission and status tools
Hot-reloaded Markdown policies
Short result handoff without exposing a terminal or agent RPC port
A typed adapter interface for additional runtimes
Related MCP server: cursor-agent-bridge
What works today
The current adapter sends prompts to a unique, named Herdr agent and waits for Herdr's lifecycle state. That target can be Pi, Codex, Claude Code, OpenCode, or another agent supported by Herdr. A supervisor agent can also coordinate other panes and agents on the same machine.
Agent Relay currently requires Herdr. Direct Pi, Codex, Claude Code, OpenCode, HTTP, command, and tmux adapters are planned but not implemented yet. See Adding adapters.
Agent Relay receives text. An audio device works when the device or its companion service transcribes speech and calls the MCP or webhook endpoint. Agent Relay does not currently transcribe raw audio.
MCP tools
Agent Relay exposes four tools and one optional client prompt:
Tool | Purpose |
| Forward a complete owner instruction without rewriting it |
| Queue a task and return its job ID immediately |
| Compatibility alias with a development-focused description |
| Retrieve a job by ID, or retrieve the latest job |
Enable the supervisor_router MCP prompt in clients that might otherwise solve or paraphrase a request before calling a tool.
Only one task is delivered to the target agent at a time. Jobs queued before a Relay restart resume afterward. A job that was already running is marked failed instead of being replayed, preventing accidental duplicate side effects.
Quick start
Requirements
Linux or macOS
Node.js 22.19 or newer
Herdr installed on the same machine
A supported agent running in Herdr under a unique name such as
supervisor, or recovery configured so Relay can start itA public HTTPS reverse proxy or tunnel if the MCP client is outside the machine
Start a supported agent in an available Herdr shell pane:
herdr agent start supervisor --kind pi --pane <pane-id>The agent keeps its normal operating-system permissions. Agent Relay does not create a sandbox.
Recover a closed supervisor automatically
By default, Relay reports an error when its named Herdr target is missing. Optional recovery makes a persistent supervisor self-healing: Relay checks the target before each queued task, reuses a running agent that owns the configured session, or creates a dedicated Herdr workspace and resumes the session.
AGENT_RELAY_HERDR_RECOVERY=true
AGENT_RELAY_HERDR_RECOVERY_KIND=pi
AGENT_RELAY_HERDR_RECOVERY_CWD=/home/ubuntu/repos
AGENT_RELAY_HERDR_RECOVERY_WORKSPACE=agent-relay
AGENT_RELAY_HERDR_RECOVERY_SESSION=/home/ubuntu/.pi/agent/sessions/project/supervisor.jsonl
AGENT_RELAY_HERDR_RECOVERY_ARGS_JSON='["--session","/home/ubuntu/.pi/agent/sessions/project/supervisor.jsonl","--name","supervisor"]'Recovery is opt-in because starting an agent is a state-changing operation. Agent arguments are passed directly without a shell. Use an absolute path inside the JSON array because shell expansion is not performed.
Install
git clone https://github.com/simozampa/agent-relay.git
cd agent-relay
npm install
npm run buildCreate configuration and choose a policy:
install -d -m 700 ~/.config/agent-relay
cp examples/env.example ~/.config/agent-relay/env
cp policies/developer.md ~/.config/agent-relay/policy.md
chmod 600 ~/.config/agent-relay/env ~/.config/agent-relay/policy.md
openssl rand -hex 32Copy the generated token into ~/.config/agent-relay/env as AGENT_RELAY_TOKEN, then update the Herdr binary and target if necessary.
Start Relay manually:
set -a
. ~/.config/agent-relay/env
set +a
npm startIt listens on http://127.0.0.1:8787/mcp by default. Verify it locally:
curl http://127.0.0.1:8787/healthRun with systemd
The example unit assumes the repository is cloned to ~/agent-relay:
install -d ~/.config/systemd/user
cp examples/systemd/agent-relay.service ~/.config/systemd/user/
systemctl --user daemon-reload
systemctl --user enable --now agent-relayTo start the user service during boot before an interactive login:
sudo loginctl enable-linger "$USER"Follow logs with:
journalctl --user -u agent-relay -fAdd HTTPS
Keep Relay on loopback and put a reverse proxy in front of it. A minimal Caddy configuration is included in examples/Caddyfile:
relay.example.com {
reverse_proxy 127.0.0.1:8787 {
flush_interval -1
}
}Configure your MCP client with:
URL: https://relay.example.com/mcp
Transport: Streamable HTTP
Authorization: Bearer <AGENT_RELAY_TOKEN>Pebble Index 01
For direct instructions, use Index's webhook. Pebble sends the transcription field directly to Relay as multipart/form-data; Relay preserves that field instead of asking an MCP Sandbox model to reinterpret it.
In the Pebble app's Index settings, set the webhook URL to
https://relay.example.com/webhook.Add an
Authorizationheader containing the fullBearer <token>value.Set Send to transcription.
Set Trigger to the button gesture you want to use for Relay.
Set that gesture's behavior to Webhook only so MCP Sandbox does not reinterpret or duplicate the instruction.
Keep the other gesture assigned to the normal Index agent if you still want its note-taking behavior.
Example requests:
Inspect the current project, run its tests, and summarize any failures.
Send “hello” to the Codex agent working in the API pane.
Check my latest task.Pebble MCP fallback
If your Pebble app does not deliver physical ring transcriptions through webhook-only mode, use MCP Sandbox with Relay's routing prompt:
Add Relay as a Streamable HTTP MCP server at
https://relay.example.com/mcpwith the bearer token.Open that server's Prompts setting and enable
supervisor_router.Assign Relay to the sandbox group used by your chosen ring gesture.
Set that gesture to MCP Sandbox.
The prompt tells Pebble's cloud agent to call forward_to_supervisor exactly once, copy your full instruction verbatim, preserve explicit Codex/Claude/Herdr routing, and never perform the task itself. This makes MCP a narrow router rather than a second development agent.
MCP still has an intermediary model, so prompt adherence cannot provide the same hard fidelity as a direct webhook. Relay stores whatever forward_to_supervisor receives without rewriting it.
The same design works with any audio device or companion app that can send Pebble-compatible multipart transcriptions or call MCP.
Policies
Relay reads the configured Markdown policy before every task. Edit the file and the next job uses the new policy; no restart is required.
Three examples are included:
policies/safe.md: read-only remote assistancepolicies/developer.md: normal development and agent coordinationpolicies/unrestricted.md: the same authority as an interactive owner prompt
Select one by copying it to the configured path:
cp policies/unrestricted.md ~/.config/agent-relay/policy.mdA policy is a model instruction, not a security boundary. If the agent must not access something, enforce that with operating-system permissions, a container, or a separate VM.
Configuration
Configuration uses environment variables so credentials stay outside the repository.
Variable | Default | Description |
| required | Bearer token; minimum 32 characters |
|
| HTTP bind address |
|
| HTTP port |
|
| Agent adapter; only |
|
| Herdr executable path |
|
| Unique live Herdr agent name |
|
| Recreate a missing named target before its next task |
|
| Agent kind passed to |
|
| Working directory for the recovered workspace |
|
| Label for a newly created recovery workspace |
| unset | Session identity used to find an already-running agent |
|
| JSON string array passed directly to the recovered agent |
|
| Recovered agent startup timeout |
|
| Hot-reloaded policy file |
|
| Jobs and result files |
|
| Agent task timeout in milliseconds |
|
| Maximum submitted prompt size |
|
| Maximum result returned to the MCP client |
|
| Maximum accepted multipart webhook body size |
Adding adapters
An adapter translates one queued Relay task into one run on a target runtime:
export interface AgentAdapter {
readonly kind: string;
readonly target: string;
run(context: AdapterRunContext): Promise<AdapterRunResult>;
}Potential adapters include:
Persistent Pi RPC sessions
Codex programmatic sessions
Claude Code headless sessions
OpenCode servers
Generic HTTP agent APIs
Noninteractive CLI commands
Existing tmux panes
Adapters should use structured APIs where available and avoid shell interpolation. The MCP, authentication, policy, queue, persistence, and result layers remain runtime-neutral.
Security
An internet-facing Relay can instruct an agent with all of that agent's permissions. Read SECURITY.md before deployment.
At minimum:
Generate a long random token and treat it like an SSH credential.
Keep Relay bound to loopback behind HTTPS.
Do not commit tokens or instance configuration.
Use a restricted operating-system user when you need enforceable limits.
Add reverse-proxy rate limiting for a public endpoint.
Development
npm install
npm run validatevalidate checks formatting and types, runs the test suite, and creates a clean production build.
License
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseCqualityBmaintenanceEnables MCP hosts to delegate coding tasks to Pi CLI as a programmable sub-agent with session tracking and process management.72MIT
- AlicenseNot gradedqualityBmaintenanceEnables MCP clients like Claude Code to delegate coding tasks to the local Cursor Agent CLI, with persistent per-workspace sessions that resume across calls.12MIT
- AlicenseNot gradedqualityBmaintenanceEnables ChatGPT (or any MCP client) to delegate coding tasks to a local Hermes-backed agent with async job management, supporting read-only investigation, implementation, and continuation of sessions via secure MCP tunnel.1MIT
- FlicenseNot gradedqualityCmaintenanceEnables AI clients to run Google Antigravity coding sub-agents as MCP tools, with synchronous and asynchronous execution, task polling, and sandboxed Docker workspace isolation.
Related MCP Connectors
Persistent memory and cross-session learning for AI coding assistants (hosted remote MCP).
An authenticated remote MCP server for user-owned devices and one-shot capability invocation.
Agent-native collaboration network: orchestrate a team of long-running agents from any MCP client.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/simozampa/agent-relay'
If you have feedback or need assistance with the MCP directory API, please join our Discord server