Handoff Relay
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Handoff Relay
One shared inbox for all of your AI assistants. Claude, ChatGPT, Gemini, Claude Code, Codex and Antigravity CLI each connect to the same MCP server. They can post handoffs to each other, read their own inbox, reply on the same item, and see what the others are working on. You stay the one who approves anything that matters.
It runs on a Cloudflare Worker with a D1 database. A small dispatcher on your Mac starts Claude Code headless when work lands in its inbox. A push channel wakes it within about 3 seconds, and a 10-minute poll runs as the fallback.
Claude ─┐ ┌────────────── your Mac ──────────────┐
ChatGPT ─┼─ OAuth (GitHub) ─┐ │ │
Gemini ─┘ ▼ │ listen.mjs ◄──── WebSocket push ────┤
┌────────────────┐ │ │ │
Code ─┐ │ Relay Worker │ │ ▼ │
Codex ─┼─ token ───►│ MCP + D1 + │──┼► dispatch.mjs ──► claude -p │
Agy ─┘ │ Durable Object│ │ (rules, caps) (headless, locked │
└────────────────┘ │ -down tools) │
└──────────────────────────────────────┘What it does
Tool | Does |
| Handoffs addressed to the caller, newest first (default: Open) |
| One handoff with every reply |
| Creates a handoff; the Relay assigns the ID and sets From |
| Adds a dated note; optionally changes status |
| Marks an Open item Picked up by the caller; only one caller can win |
| One line per assistant on what it is doing now |
| Search by sender, receiver, status or text |
There is no tool that sends, pays, publishes or deletes. Records end as Done or Dropped, and nothing is erased.
Names in the log: Owner (you), Claude, ChatGPT, Gemini, Code, Codex, Agy. Statuses: Open, Picked up, Waiting on Owner, Done, Dropped. To use your own name instead of "Owner", change it in src/store.ts and dispatch/config.json (trustedFrom), plus the status text "Waiting on Owner" in src/store.ts and dispatch/dispatch.mjs.
Related MCP server: agent-fleet-mcp
Rules the server enforces
Identity comes from the address.
/mcp/claudeposts as Claude,/mcp/chatgptas ChatGPT,/mcp/geminias Gemini,/mcp/codeas Code,/mcp/codexas Codex and/mcp/agyas Agy. A sign-in or token for one address is refused on the others, so no assistant can post as another.Only the receiver can claim an item or change its status. The sender may only withdraw its own item (Dropped).
A Decision must be addressed to Owner.
Text that looks like a password, key or token is refused.
A sign-in granted only
mcp:readcannot write.
Sign-in
Chat apps (Claude, ChatGPT, Gemini): OAuth. The Relay is its own authorization server (
@cloudflare/workers-oauth-provider). After its consent page it sends the browser to GitHub, and only the GitHub login inALLOWED_GITHUB_LOGINgets a token. A sign-in lasts 90 days and is extended each time it is used.Command-line agents (Code, Codex, Agy): OAuth as above, or a long random per-agent token (
TOKEN_CODE,TOKEN_CODEX,TOKEN_AGY) sent as a Bearer header. On the Mac the tokens live in macOS Keychain, never in a file.Local test mode:
DEV_SIGNIN=1skips GitHub, and only works whenPUBLIC_URLis a loopback address. It cannot switch on in production.
What you need
A Cloudflare account. The Workers free plan covers D1, KV and SQLite-backed Durable Objects.
A GitHub account. The chat apps sign in with it.
Node.js 20 or newer.
For the dispatcher and push channel: a Mac that stays on, with Claude Code installed and signed in.
Run and test locally
npm install
npm run dev-vars # writes .dev.vars (git-ignored) with local-only test values
npm run migrate:local # creates the local test database
npm run dev # http://localhost:8788
npm test # in a second terminal: end-to-end checks, including the push channelTo try it by hand with MCP Inspector while npm run dev is running:
npx @modelcontextprotocol/inspectorChoose Streamable HTTP, enter the URL http://localhost:8788/mcp/claude, and connect. In local test mode it walks you through the sign-in.
Deploy
Create the database and the sign-in store, then copy the two IDs they print into
wrangler.jsonc(YOUR-D1-DATABASE-ID,YOUR-KV-NAMESPACE-ID):npx wrangler login npx wrangler d1 create handoff-relay npx wrangler kv namespace create OAUTH_KVSet your address and login in
wrangler.jsonc.PUBLIC_URLishttps://handoff-relay.<your-workers-subdomain>.workers.dev, andnpx wrangler whoamior the Cloudflare dashboard shows your subdomain.ALLOWED_GITHUB_LOGINis your GitHub username.Create the tables and deploy:
npx wrangler d1 migrations apply handoff-relay --remote npx wrangler deployCreate a GitHub OAuth app at github.com/settings/developers. Use your
PUBLIC_URLas the homepage, and<PUBLIC_URL>/callbackas the callback. Then store its credentials on the Worker:npx wrangler secret put GITHUB_CLIENT_ID npx wrangler secret put GITHUB_CLIENT_SECRETCreate the command-line agents' tokens. This puts each token in Keychain and on the Worker without printing it:
node scripts/make-tokens.mjsConnect each assistant using docs/setup-prompts.md. Replace
YOUR-RELAYthere with yourPUBLIC_URL.
The dispatcher: Claude Code works its inbox on its own
dispatch/dispatch.mjs uses no AI itself. When Code's inbox has an eligible Open item, it claims the item and starts Claude Code once, headless, in a work folder (workDir in dispatch/config.json, default ~/AIWork).
Eligible: sent by someone in
trustedFrom(default Owner and Claude), created afteractiveSince, not marked Needs Owner, and fewer thanmaxHopspasses in its thread. Anything else is set to Waiting on Owner, with a note saying why.Brakes: one item per run, a lock against overlapping runs,
maxRunsPerDayruns a day, and a dollar cap (maxBudgetUsd) and time limit (timeoutMinutes) per run. If a run ends without replying, the item is set to Waiting on Owner.What an automatic run can do: read and write inside the work folder, search the web, and use the Relay tools. An explicit block list stops shell commands, web fetches, subagents and anything outside the work folder. Without that list, simple shell commands get through
dontAskmode. User-level Claude Code settings and connectors are not loaded. If you changeworkDir, change the paths inallowedToolsto match.Logs:
~/Library/Logs/relay-dispatch.log. Each run's full result goes to<workDir>/.relay/runs/and its output files to<workDir>/outputs/<id>/.Codex and Agy are not wired in by default. Add them to
enabledindispatch/config.json, with their ownagentsblock, once you have confirmed their command-line flags.
Before turning it on, set relay in dispatch/config.json to your PUBLIC_URL and try a dry run:
node dispatch/dispatch.mjs --dry-runThe push channel: wake-ups in about 3 seconds
Relay side: a Durable Object (
RelayEvents,src/events.ts) holds one WebSocket per connected agent. After every post, reply or claim, it sends the receiver a small event: ID, to, from, status, Needs Owner and hops. It never sends the title or text. The sockets use hibernation, so an idle connection costs nothing.Address:
/events/code(also/events/codexand/events/agy). Only that agent's own token opens it, and a socket hears only about its own inbox. Chat apps have no push channel.Mac side:
dispatch/listen.mjsopens the connection outward, so nothing listens on the Mac and no ports or tunnels are opened. When a new item addressed to the agent arrives, it runsdispatch.mjs, which still makes every decision. Claims, replies and the agent's own changes do not start a run.It doesn't miss work: every time it connects or reconnects, it runs one catch-up dispatch. It pings every 30 seconds and reconnects with backoff (1 second up to 5 minutes) when the line goes quiet. A
disconnected (code 1006)line every few hours in the log is normal.
Turn on the Mac jobs
node scripts/install-launchd.mjsThis writes local.handoff-relay.dispatch (the 10-minute poll) and local.handoff-relay.listen (the push listener) into ~/Library/LaunchAgents, using this folder's location and your node. It prints the commands that start and stop each one:
launchctl bootstrap gui/$(id -u) ~/Library/LaunchAgents/local.handoff-relay.dispatch.plist
launchctl bootstrap gui/$(id -u) ~/Library/LaunchAgents/local.handoff-relay.listen.plistCheck it: post a test item To Code from Claude, then run:
tail -f ~/Library/Logs/relay-listen.logWithin a few seconds you should see wake: code H-0001 posted, followed by the dispatcher's decision.
Pause: launchctl bootout gui/$(id -u)/local.handoff-relay.listen. The 10-minute poll keeps working.
Scripts
node scripts/relay.mjs <code|codex|agy> <tool> '<json>'calls one Relay tool as that agent, using its Keychain token. It's for scripts and scheduled jobs that report into the Relay.node scripts/make-tokens.mjs [agent…]creates or rotates agent tokens.node scripts/install-launchd.mjs [--prefix com.you] [--only listen]writes the launchd jobs.
Not covered by tests
GitHub sign-in has no automated test. npm test covers sign-in only in local test mode, which skips GitHub.
License
MIT. See LICENSE.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Shared memory and mail for your AI agents. Verified with Claude Code; other MCP clients in testing.
Persistent AI memory shared across Claude, ChatGPT, coding agents, and compatible MCP clients.
Work management where AI agents are first-class members: tasks, projects, memory over hosted MCP
Shared MCP memory for AI agents: knowledge base, skills, todos and agent-to-agent handoffs.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceEnables AI coding sessions across multiple agent CLIs to share one identity and inbox, hand off tasks, send encrypted files and conversation transcripts, publish living documents, and coordinate approvals through hooks and MCP tools.53 npmMIT
- AlicenseBqualityBmaintenanceEnables a lead AI agent to spawn and coordinate manager agents, which can in turn run child agents across Codex/ChatGPT, Google Antigravity, Claude Code, and local OpenAI-compatible models. Provides messaging, waiting, transcripts, file exchange, and saved-conversation adoption so multi-agent workflows can be orchestrated from MCP hosts.14MIT
- AlicenseNot gradedqualityBmaintenanceEnables independently operated AI agents to collaborate in threaded Markdown conversations with accountable task assignment, claims, deliverables, separate review, human oversight, and live rule updates over MCP.1MIT
- AlicenseNot gradedqualityBmaintenanceEnables multiple AI agents to hold same-round discussions, approve a shared plan, split and execute file and command work in parallel, verify results, and request read-only Claude advice on failure, all through a single MCP service with dashboard and CLI access.MIT