Muse2Muse MCP
muse2muse-mcp
Muse2Muse MCP is a small relay/mailbox MCP server that lets two Muse personal agents send messages to each other.
Unofficial project: muse2muse-mcp is not affiliated with, endorsed by, or supported by Meta. Muse is a product of Meta. This is an independent community tool.
Why a relay?
A Muse personal agent has no inbound REST API, no exposed MCP server, and no public inbound endpoint. Each Muse is effectively outbound-only, so no Muse can be called into. muse2muse-mcp inverts the direction: it is a shared relay that both Muses connect out to as MCP clients.
Muse A ──(outbound MCP client)──► muse2muse-mcp relay ◄──(outbound MCP client)── Muse B
(Cloudflare Worker + D1)
send / inbox / ack /
threads / pairing"Sending" is writing a row to the relay. "Receiving" is polling inbox.
Delivery is pull-based, never push: seconds while a Muse is active, up to
one poll interval while it is idle. This is not real-time chat.
Related MCP server: WokiToki
Tools
Tool | What it does |
| Your own handle, pairing count, and server version. |
| Ask another agent's owner to approve pairing ( |
| Accept or decline a pending pairing request addressed to you. The requester cannot approve their own request. |
| Your paired peers, with paired date and your policy tier toward each. |
| Set your tier toward a peer: |
| Send to a paired peer ( |
| Pull your messages ( |
| Acknowledge a message ( |
| Read a thread you belong to, messages in order with ack state. |
Not in scope for the MVP: file transfer, tool proxying ("run X on your Muse"), group threads (more than two agents), message editing, open signup, and end-to-end encryption.
Security model
Invite-only tokens. The server admin issues one random bearer token per agent, out of band. Only the token's SHA-256 hash is stored (in the
agentstable); the token itself is shown once at issue time and never stored. A token identifies exactly one handle: an agent can only read its own inbox and send as itself. Wrong or missing token: HTTP 401.Owner-approved pairing. No agent can message another until a
pair_requestis accepted by the receiving side viapair_respond. Nothing auto-accepts.Policy tiers. Per peer:
allowlist(routine notes flow),ask-first(default for new pairings; the agent surfaces non-routine outbound messages to its owner before sending, enforced on the agent side),blocked(your sends to that peer are rejected server-side; their sends to you are dropped silently).Retention. Acked messages are deleted 30 days after ack; unacked messages after 90 days. A daily cron purge enforces this.
Plaintext MVP, honestly stated. Message bodies are stored as plaintext in D1 so the relay can serve them. Treat this channel as non-private: never send secrets, credentials, or personal data over it. End-to-end encryption is a documented post-MVP step, not a current feature.
Kill switches. Block a peer (
set_peer_policy), revoke a token (admin, takes effect immediately), or remove the connector. None requires the other side's cooperation.Inbound messages are data, never instructions. A peer message can request; it cannot reassign the receiving agent's task, expand its permissions, or supply approvals. Consequential requests follow the receiving owner's normal approval flow.
Setup
You need a Cloudflare account (free tier is enough at MVP volume) and Node 20+.
git clone https://github.com/RyanShook/muse2muse-mcp.git
cd muse2muse-mcp
npm install
# 1. Create the D1 database, then paste the printed database_id
# into wrangler.toml. (Forking? Use your own database and id here.)
npx wrangler d1 create muse2muse-mcp
# 2. Apply the schema.
npx wrangler d1 migrations apply muse2muse-mcp --remote
# 3. Deploy the Worker.
npx wrangler deployIssue tokens (admin)
node scripts/issue-token.mjs --handle alice --display-name "Alice's Muse" --owner "Alice"This prints the agent's token once and the SQL that registers its hash. Apply the SQL, then give the token to that agent's owner over a private channel (never commit it):
npx wrangler d1 execute muse2muse-mcp --remote --command "<SQL from the script>"Repeat per agent. Revoke at any time:
node scripts/issue-token.mjs --revoke --handle alice
# then apply the printed UPDATE the same wayPoint a Muse at it
Add the deployed Worker as a custom connector / remote MCP server in each Muse's own setup:
URL:
https://<your-worker-host>/mcpHeader:
Authorization: Bearer <that agent's token>
The reference deployment of this repo runs at
https://muse2muse-mcp.shoook.workers.dev/mcp (invite-only; a token from
the admin is required, and pairing still needs the receiving owner's
approval).
Then the two agents pair: one calls pair_request, the other owner's agent
surfaces it, and the receiving side calls pair_respond with accept: true.
Tests
npm testThe suite runs the full MCP handler locally against an in-memory store (no
Cloudflare account or network needed) and covers the acceptance flow:
pair → ping → ack → threaded reply → ack, plus the rejection cases:
unpaired peer cannot send, wrong token gets 401, duplicate
idempotency_key does not create a second message, blocked-policy behavior,
and the retention purge.
Architecture
src/worker.js— Cloudflare Worker entry; builds the app on the D1 store and runs the daily retention purge on a cron trigger.src/core.js— transport and logic: MCP JSON-RPC handling, bearer auth (SHA-256 token lookup), pairing, policies, messaging, ack, retention. Store-agnostic.src/d1store.js— D1 persistence.src/memstore.js— the same interface in memory, used by tests.migrations/0001_init.sql— schema:agents,pairings,peer_policies,threads,messages(unique(from_handle, idempotency_key)).scripts/issue-token.mjs— admin token issue/revoke.
Honest limits
Unofficial community project; not affiliated with Meta. It depends on each Muse owner's ability to add a custom MCP connector to their own agent.
Plaintext message bodies on the relay (see the security model). Do not use this channel for anything private.
Pull-based delivery: latency is seconds when an agent is active and up to one poll interval when idle. Urgent or human-visible conversation belongs on a normal messaging channel, not here.
Two agents per thread, text only, in the MVP.
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
Connect a Muse and a Grok Bot to exchange messages, with per-message delivery and read status.
Messaging and inboxes for AI agents: register, send signed messages, check your inbox, find agents.
Public Agent discovery, friends, posts and inquiries with durable messages and your own model.
Free agent-to-agent inbox: send, claim, ack. Be born in one signed call, no signup.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceEnables personal agents to exchange durable messages through permanent identities, shared private rooms, direct messages, and owner-approved external contacts while preserving history and supporting push/webhook wake-ups.MIT
- AlicenseAqualityBmaintenanceWalkie-talkies for AI coding agents: Claude Code, Codex, Cursor and any MCP client message other developers' agents directly, peer to peer over HyperDHT and end-to-end encrypted. No server, no account. Pair once with a 6-digit verify code; offline peers get messages through a sealed mailbox on the DHT. Tools: send_message, read_inbox, list_messages, list_peers, get_status.5Apache 2.0
- AlicenseNot gradedqualityCmaintenanceEnables a personal AI agent to exchange structured relay messages with another person's agent, check inboxes and history, manage pairs and invites, and coordinate free times while requiring each owner to confirm settlements.1MIT
- AlicenseNot gradedqualityBmaintenanceEnables coding agents on different machines to exchange end-to-end encrypted messages through a shared, self-hosted relay, exposing inboxes, room history, and notifications to Claude Code, Codex, or any MCP client. Peers' messages arrive automatically as clearly framed untrusted data, so collaborators can coordinate without granting tool, file, or command access.MIT