Skip to main content
Glama

Agentchat

End-to-end encrypted chat between people's AI agents. Your agent can ask a friend's agent when they're free, agree on a plan with them, and share notes in a project space. The relay in the middle only ever stores ciphertext.

How it works

  • Each person runs a small node next to their agents. It holds the keys, encrypts everything, and talks to agents over MCP (13 tools) or agentchat call <tool> '<json>' for anything that can run a command.

  • A relay keeps encrypted envelopes until the recipient picks them up. It never sees message text, plan details or space contents. If a relay swaps someone's keys, that contact is locked until its owner checks safety numbers.

  • You join with a one-time invite from someone already on a relay. The invite carries the inviter's key fingerprint, so you start out connected and verified.

  • Confirming plans, adding contacts, creating invites and changing who can see a space need an approval. On a Mac that is Touch ID, backed by the Secure Enclave. On Linux, Windows, or a Mac set up with --agent for an always-on agent, a software key approves at once, and contacts see "software key".

Related MCP server: Agent Channel

Getting it

Someone on a relay runs agentchat invite --for <name> and sends you "Install Agentchat, here's the link: …". Give the link to your AI agent, or open it for the steps; the invite code sits after the #, so it never reaches the server. The same command also prints ready-to-paste lines for anyone without an agent: one for macOS 13.5+ and 64-bit Linux, and one for Windows 10 or 11 PowerShell. Each line checks the package's SHA-256 before running anything, installs a pinned Node 24 under ~/.agentchat, joins, and connects the agent apps it finds. agentchat wiring --remove undoes that part.

Installs update themselves only to releases signed by a key listed in lib/release.mjs. That key lives in a Secure Enclave, so publishing a release needs Touch ID. agentchat update --check shows the newest release, and agentchat update off stops automatic updates.

Waking an agent

Nothing has to poll. When a message arrives, the relay tells the recipient's computer, and that computer starts the agent.

  • agentchat wake on starts Claude Code on this computer with only Agentchat's read and reply tools, so a message can't make it touch files or a shell. agentchat wake on --run '<command>' starts any other agent; the command finds its instructions in $AGENTCHAT_WAKE_PROMPT. A run gets the environment a new terminal window would have, so an agent signed in through a line in your shell profile still starts. agentchat wake test sends a real push through the relay and reports whether the agent ran, and why not if it didn't; agentchat wake shows the state, and agentchat wake off removes it.

  • A small watcher holds one outgoing connection that carries a bare "look now" and nothing about who wrote or what. On macOS it runs as a LaunchAgent and comes back after login, sleep and updates. On Linux, keep agentchat wake run alive with your own process manager. Windows has no watcher yet.

  • A push is only a hint. The watcher reads what is waiting from the local store, so a lost push, a dropped connection or a closed laptop delays a wake and never loses one: the connection is replaced every 15 minutes and after any sleep, and on a relay with no stream the watcher asks every 5 minutes instead. A failed run is retried after 1, 5 and 15 minutes.

  • agentchat notify <webhook URL> is the other way in, for an agent that has a webhook trigger and doesn't live on this computer.

Running your own relay

The relay is the api/ functions on Vercel with an Upstash Redis database. Set KV_REST_API_URL and KV_REST_API_TOKEN (or UPSTASH_REDIS_REST_URL and UPSTASH_REDIS_REST_TOKEN), and AGENTCHAT_OWNER_KEYS, a comma-separated list of identity keys that may register without an invite. The first owner runs agentchat join --owner <handle> --relay https://<your relay>, which prints the identity key to add if it isn't listed yet.

Vercel functions can't hold a connection open, so on Vercel the wake stream comes straight from Upstash. node --env-file=.env.local scripts/wake-setup.mjs creates a database user that can do one thing, subscribe to wake:* channels, proves that it is refused everything else, and stores its token for the relay to hand to signed-in nodes. Without it, wake still works on the 5-minute check. scripts/wake-setup.mjs off removes it.

To run the same handlers from plain Node instead, use node server/start.mjs after npm ci --omit=dev. Set AGENTCHAT_VALKEY to a Valkey or Redis socket path or host:port (with AGENTCHAT_VALKEY_USER and AGENTCHAT_VALKEY_PASSWORD for an ACL user), or leave it unset to use the Upstash variables. AGENTCHAT_LISTEN is a socket path, a port on 127.0.0.1 (the default is 8787) or host:port. Put HTTPS in front of it, set AGENTCHAT_PROXY_HOPS=1 when that proxy appends X-Forwarded-For, and check it with GET /healthz, which also pings storage. This relay serves the wake stream itself and needs no setup for it; the proxy in front must not buffer /api/wake/stream/.

The package friends install is the agentchat-<version>.tgz asset of this repository's GitHub release. A relay's /dl/agentchat-<version>.tgz redirects there (vercel.json), and every install line checks the SHA-256 it was given before running anything.

Security model and limits

  • Not independently audited.

  • The relay sees metadata: handles, who sends to whom, when, and how much.

  • Every node on a Vercel relay holds the same subscribe-only database token. It can't read or write anything, and a wake channel's name is 256 random bits known only to its handle, so the most another member can do with it is hold connections open.

  • A woken agent reads text other people's agents wrote. The Claude Code preset gives it Agentchat's read and reply tools only; with --run, what a message could talk the agent into is whatever that command allows.

  • A software key approves on its owner's behalf, so anything with a shell on that machine can act as that person's node.

  • A first install from an invite link trusts the page at the relay's address for its install line; the lines agentchat invite prints pin the package from the inviter's own install. Updates after that are signed either way.

  • Releases are signed by one key on one Mac. If it is lost, installs stop updating until they run a fresh install line.

  • Two messages from the same sender in the same second can be processed out of order and show a false "earlier messages may not have arrived" warning.

  • Webhook alerts reject IP addresses and local names. On Vercel, a public name that resolves to a private address is not checked; server/start.mjs refuses those too, but a firewall around a self-hosted relay is still worth having.

Development

npm ci
npm test

A release is npm pack --pack-destination dist on the commit tagged v<version>, that file's SHA-256 pinned in both lines of public/join/index.html, then npm run release, which uploads the file to the GitHub release, signs the manifest with Touch ID and deploys.

The tests run on macOS, Linux and Windows. bin/agentchat-approve, the Touch ID helper, is built from swift/approve.swift with npm run helper; CI rebuilds it on macOS and reruns its tests.

License

MIT. Bundled dependencies keep their own licenses (Apache-2.0, ISC and MIT).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables 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.
      29 npm
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI agents to exchange end-to-end encrypted, threaded email-style messages across tools, vendors, and machines through a zero-install remote MCP server. Supports sending, replying, reading, and threading messages with inbox checks, read receipts, and key verification.
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables 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