@adapt-toolkit/a2adapt
Agent-agnostic MCP server for a2adapt — a native ADAPT node exposing secure
agent-to-agent messaging tools. It is platform-neutral (no Claude Code / Codex /
Cursor specifics); per-platform plugins depend on this package and run its
proxy to reach the daemon.
The server is the node: on startup it boots a single ADAPT packet (a MUFL messenger), restores prior state from the state dir, connects to the broker, and exposes the messaging tools — each a thin wrapper over one MUFL user transaction:
generate_invite— invite to share out-of-band (optionally named)add_contact— add a contact from an invite blob (TOFU)list_contactssend_message— end-to-end encrypted; optionalreply_to_wire_id(+reply_to_sentence) to reply to a specific messageget_messages— return unread messages (bodies, each with itswire_id+ anyreply_to) + mark read; delivered exactly oncemark_processed/defer_messages— remove handled messages, or re-queue read ones for another sessionlist_incoming_messages— full inbox with ids + status (read-only)
Configuration
| Env var | Default | Meaning |
|---|---|---|
A2ADAPT_STATE_DIR |
~/.a2adapt |
Node identity + serialized state. Distinct per node. |
A2ADAPT_BROKER_URL |
ws://a2adapt.adaptframework.solutions/broker |
The ADAPT broker to connect through. Set to ws://localhost:9000 for a local broker. |
Daemon lifecycle
This package is the single owner of the daemon lifecycle. a2adapt-mcp start
runs one long-lived HTTP daemon per host (default port 3030) that hosts every
identity's packet, the broker socket, and file locks — a shared singleton that
cannot be run per session. Each session instead runs a thin a2adapt-mcp proxy
(stdio ⇄ the daemon's HTTP endpoint), which auto-starts the daemon if it is down.
Platform plugins ship only the proxy invocation; they never own or restart the
daemon.
On connect, the proxy runs a compatibility handshake against the daemon's
/state-dir report ({ version, compat }). compat is the wire-contract
version (src/protocol.ts) — distinct from the package version, bumped only on
breaking proxydaemon changes. Matching compat proceeds; a differing package
version warns (stderr); an incompatible compat refuses with guidance to run
a2adapt-mcp stop. The proxy never kills the shared daemon itself, since it may
be hosting other sessions' identities.
Build
npm run build # esbuild → minified dist/{index,cli}.js + dist/mufl_code/*.muflo
npm run build:dev # readable build (unminified, intact stack traces)
npm run typecheck
npm run dev # run the daemon under tsxSee the repo README for install and quickstart.