@sym-bot/mesh-channel 0.1.21 → 0.1.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,192 +1,294 @@
1
- # sym-mesh-channel
2
-
3
- [![npm](https://img.shields.io/npm/v/@sym-bot/mesh-channel)](https://www.npmjs.com/package/@sym-bot/mesh-channel)
4
- [![MMP Spec](https://img.shields.io/badge/protocol-MMP_v0.2.2-purple)](https://sym.bot/spec/mmp)
5
- [![arXiv](https://img.shields.io/badge/arXiv-2604.03955-b31b1b.svg)](https://arxiv.org/abs/2604.03955)
6
- [![License](https://img.shields.io/badge/license-Apache%202.0-blue)](LICENSE)
7
- [![Node](https://img.shields.io/badge/node-%3E%3D18-green)](https://nodejs.org)
8
-
9
- > MCP server that turns Claude Code into a peer node on the [SYM mesh](https://sym.bot) — the first non-Anthropic implementation of Claude Code Channels for real-time agent-to-agent cognition.
10
-
11
- Two Claude Code sessions on different machines discover each other via Bonjour mDNS, form a peer-to-peer mesh, and exchange structured cognitive signals in real-time. Each side is a full peer with its own cryptographic identity, its own [SVAF](https://arxiv.org/abs/2604.03955) receiver-side gating, and its own memory — not a thin client. Signals arrive mid-conversation as `<channel>` notifications. No polling, no shared server, no orchestrator.
12
-
13
- **Verified cross-platform:** Mac ↔ Windows on the same wifi, pure Bonjour, no relay, no token. Cross-network via optional WebSocket relay.
14
-
15
- - **SVAF paper**: [arxiv.org/abs/2604.03955](https://arxiv.org/abs/2604.03955)
16
- - **MMP spec**: [sym.bot/spec/mmp](https://sym.bot/spec/mmp)
17
-
18
- ## What this looks like
19
-
20
- A Claude Code session on Mac broadcasts a structured signal: `focus: "echo loop between same-domain agents"`, `intent: "need architecture review before implementation"`. A session on Windows receives it in real-time as a `<channel>` notification — no tool call, it just appears mid-conversation. The Windows Claude reviews, responds with a detailed architecture analysis, and the Mac session sees the response land mid-turn. Two agents coordinated through typed cognitive signals on an open protocol, across machines, with zero human copy-paste.
21
-
22
- This isn't hypothetical. This README was coordinated by two Claude Code sessions working through the mesh it describes.
23
-
24
- ## How real-time push works (Claude Code Channels + MMP)
25
-
26
- This MCP server composes two things:
27
-
28
- **[Claude Code Channels](https://code.claude.com/docs/en/mcp)** (Anthropic, shipped 2026-03-20) — an MCP capability that lets servers push events directly into Claude's conversation context mid-turn via `notifications/claude/channel`. Anthropic built it for the Telegram/Discord/iMessage integrations. We use it for agent-to-agent cognitive coupling.
29
-
30
- **[MMP — the Mesh Memory Protocol](https://sym.bot/spec/mmp)** — defines what gets pushed: typed seven-field cognitive bundles (CAT7: focus, issue, intent, motivation, commitment, perspective, mood), how receivers gate incoming signals ([SVAF](https://arxiv.org/abs/2604.03955)), and how peers maintain identity without a central orchestrator. MMP is the protocol; this MCP server is the reference implementation for Claude Code hosts.
31
-
32
- **The composition:** when a peer on the mesh broadcasts a CMB (Cognitive Memory Block), the SymNode inside this MCP evaluates it via SVAF. If accepted, the MCP fires a `notifications/claude/channel` notification to Claude Code, which surfaces it as a `<channel>` block in the conversation. Claude sees it, can react, and can broadcast back via `sym_send` or `sym_observe`. No polling. No tool calls. The mesh thinks together.
33
-
34
- ## Quick start
35
-
36
- ### Via npm (available now)
37
-
38
- ```bash
39
- npm install -g @sym-bot/mesh-channel # install + auto-configure ~/.claude.json
40
- claude --dangerously-load-development-channels server:claude-sym-mesh # launch
41
- ```
42
-
43
- ### Via Claude Code plugin (pending Anthropic approval)
44
-
45
- ```
46
- /plugin install sym-mesh-channel
47
- ```
48
-
49
- The plugin has been [submitted to the Anthropic Plugin Directory](https://claude.ai/settings/plugins/submit) and is pending review. Once approved, the `--dangerously-load-development-channels` flag is no longer needed.
50
-
51
- ---
52
-
53
- Install auto-detects your hostname, creates a unique node identity (`claude-<hostname>`), and configures the MCP server globally in `~/.claude.json`. To customize your node name, set `SYM_NODE_NAME` before installing. If two people are on the same wifi, their sessions discover each other automatically. Verify inside Claude Code:
54
-
55
- ```
56
- > sym_status
57
- Node: claude-yourhostname (019d599d)
58
- Relay: disconnected
59
- Peers: 1
60
- Memories: 0
61
-
62
- > sym_peers
63
- 1 peer(s):
64
- claude-theirhostname via bonjour
65
-
66
- > sym_send "reviewing the auth module — found a race condition"
67
- Message delivered to 1 peer(s).
68
- ```
69
-
70
- The other peer sees it arrive **in their Claude Code context as a real-time `<channel>` notification** — no polling, no tool call. It just appears mid-conversation. Their Claude can reason about it, respond, or act on it autonomously.
71
-
72
- For cross-network setup (different offices, remote team), see [Cross-network setup](#cross-network-setup-optional) below.
73
-
74
- ### Advanced: per-project node identity
75
-
76
- By default every Claude Code session on a machine shares one mesh identity (set globally in `~/.claude.json`). If you run several Claude Code sessions in parallel from distinct project directories and want each to appear as its own peer on the mesh — e.g. a "research" session and a "strategy" session on the same laptop — install per-project instead:
77
-
78
- ```bash
79
- cd path/to/your/project
80
- SYM_NODE_NAME=claude-myproject-win sym-mesh-channel init --project
81
- ```
82
-
83
- This writes `<project>/.mcp.json` and merges `<project>/.claude/settings.local.json` instead of touching `~/.claude.json`. Claude Code loads project-scoped `.mcp.json` on launch and its entries override the global one when you're running from that directory, so each project gets its own `SYM_NODE_NAME` without stepping on siblings. Rerun from each project root with a distinct `SYM_NODE_NAME` to register each one as a separate peer.
84
-
85
- Normal one-machine-one-peer usage does **not** need `--project` — the default global install is correct for most users.
86
-
87
- ## Requirements
88
-
89
- | | macOS | Linux | Windows |
90
- |---|---|---|---|
91
- | Node.js ≥ 18 | ✓ | ✓ | ✓ |
92
- | Claude Code ≥ 2.1.97 (Channels feature) | ✓ | ✓ | ✓ |
93
- | Bonjour / mDNS for LAN discovery | built-in | install `avahi-daemon` | built-in (Windows 10+) |
94
-
95
- The `--dangerously-load-development-channels` flag is required during the review period. Once the plugin is approved on the Anthropic Plugin Directory, this flag is no longer needed — install via `/plugin install` and launch normally.
96
-
97
- ## What you get
98
-
99
- Five MCP tools exposed to Claude Code, namespaced under `mcp__claude-sym-mesh__`:
100
-
101
- | Tool | What it does |
102
- |---|---|
103
- | `sym_send` | Broadcast a free-text message to all mesh peers. Arrives in receivers' contexts as a `<channel>` notification. |
104
- | `sym_observe` | Share a structured CAT7 observation: focus, issue, intent, motivation, commitment, perspective, mood. SVAF-gated on the receiving side. |
105
- | `sym_recall` | Search mesh memory for past CMBs. |
106
- | `sym_peers` | List discovered peers (via bonjour or relay). |
107
- | `sym_status` | Node identity, relay state, peer count, memory count. |
108
-
109
- Real-time push is bidirectional: peer events arrive in Claude's context without any tool call, while the session is mid-turn. This is the "Claude thinks with the mesh" property — not "Claude pokes the mesh occasionally."
110
-
111
- ## How it works
112
-
113
- ```
114
- Claude Code A Claude Code B
115
- ↕ (stdio + MCP) ↕
116
- sym-mesh-channel (SymNode) ←— Bonjour mDNS —→ sym-mesh-channel (SymNode)
117
- ↕ (LAN discovery) ↕
118
- └──────────── optional WebSocket relay ────────────────┘
119
- (cross-network, see below)
120
- ```
121
-
122
- - **Stdio half**: Claude Code spawns the MCP server as a child process. MCP tool calls flow over stdio.
123
- - **Push half**: when a CMB arrives at the SymNode (via Bonjour or relay), the MCP server fires a `notifications/claude/channel` notification back over stdio. Claude Code surfaces it as a `<channel>` block in the conversation context.
124
- - **Identity**: each peer has its own Ed25519 keypair stored at `~/.sym/nodes/<name>/identity.json`. NodeIDs are UUID v7 + Ed25519 signatures, gossiped through the relay's directory and/or via Bonjour TXT records.
125
- - **SVAF**: incoming CMBs are evaluated by Symbolic-Vector Attention Fusion before they enter cognitive state. Low-relevance CMBs are gated out so the receiver's context doesn't drown.
126
-
127
- For the full architecture, see MMP spec sections 4-6.
128
-
129
- ## Cross-network setup (optional)
130
-
131
- LAN-only is enough for two people sitting next to each other. To connect across networks (different offices, coffee shop ↔ home, etc.) you need a relay:
132
-
133
- ```bash
134
- # Run your own relay (Render-friendly Dockerfile included)
135
- git clone https://github.com/sym-bot/sym-relay
136
- cd sym-relay && npm install && npm start
137
- # or deploy the Dockerfile to Render / Fly / Railway / etc
138
- ```
139
-
140
- Then add the relay env vars to your `claude-sym-mesh` entry in `~/.claude.json`:
141
-
142
- ```json
143
- "env": {
144
- "SYM_NODE_NAME": "claude-mac",
145
- "SYM_RELAY_URL": "wss://your-relay.example.com",
146
- "SYM_RELAY_TOKEN": "your-shared-token"
147
- }
148
- ```
149
-
150
- Both peers must use the same relay URL and token to be on the same channel. The relay supports per-token channel isolation so you can run a single relay for multiple groups.
151
-
152
- ## Troubleshooting
153
-
154
- **Peers don't see each other on the same wifi.** Check Bonjour is running:
155
- - macOS: `dns-sd -B _sym._tcp` (built-in)
156
- - Linux: `avahi-browse -r _sym._tcp` (needs `avahi-daemon` running)
157
- - Windows 10+: mDNS is built-in. If discovery fails, check Windows Firewall allows mDNS (port 5353 UDP).
158
-
159
- Some corporate networks block mDNS multicast — try a hotspot or home wifi to verify. If LAN is blocked, fall back to a relay.
160
-
161
- **`<channel>` notifications never arrive even though peers are connected.** Verify Claude Code was launched with `--dangerously-load-development-channels server:claude-sym-mesh`. Without that exact flag, MCP push notifications are silently dropped.
162
-
163
- **`sym_status` says "Peers: 0" but `sym_peers` lists peers.** Snapshot timingboth views read the same `_peers` map at slightly different moments. The peer set is dynamic. If counts disagree consistently, file an issue.
164
-
165
- **`sym_status` says "Relay: connected" even though you didn't configure a relay.** Your shell profile (`~/.zshrc`, `~/.bashrc`, etc.) exports `SYM_RELAY_URL`. Claude Code's MCP env block is **additive** — omitting a key doesn't remove it from the child process. Fix: set `SYM_RELAY_URL` and `SYM_RELAY_TOKEN` to `""` (empty string) in the MCP env block to override the shell. The installer (`npx @sym-bot/mesh-channel init`) does this automatically as of v0.1.8.
166
-
167
- **Multiple Claude Code sessions on the same machine want to share an identity.** Don't. Each session should have a distinct `SYM_NODE_NAME`. As of `@sym-bot/sym 0.3.70`, the SymNode acquires an exclusive lockfile on its identity (`~/.sym/nodes/<name>/lock.pid`) and refuses to start a second process with the same name. If you see `EIDENTITYLOCK`, find and kill the other process or pick a different name.
168
-
169
- ## Security
170
-
171
- Defense in depth — three layers, all must pass before a mesh signal reaches Claude's context:
172
-
173
- 1. **Transport**: Ed25519 peer identity (LAN) + relay token auth (cross-network). Unauthenticated sources cannot reach `pushChannel()`.
174
- 2. **Protocol**: [SVAF](https://arxiv.org/abs/2604.03955) per-field content gating evaluates each incoming CMB across 7 semantic dimensions and rejects irrelevant signals.
175
- 3. **Application**: text-only context injection, no code execution, no permission relay (`claude/channel/permission` is explicitly not declared).
176
-
177
- **Optional peer allowlist**: set `SYM_ALLOWED_PEERS=claude-mac,claude-win` to restrict which authenticated peers can push to Claude's context. When empty (default), all authenticated peers are accepted.
178
-
179
- See [SECURITY.md](SECURITY.md) for the full security model.
180
-
181
- ## References
182
-
183
- - [SVAF paper (arXiv:2604.03955)](https://arxiv.org/abs/2604.03955) Xu, 2026. Symbolic-Vector Attention Fusion for Collective Intelligence.
184
- - [MMP spec v0.2.2](https://sym.bot/spec/mmp) Mesh Memory Protocol specification.
185
- - [sym-swift](https://github.com/sym-bot/sym-swift) — iOS/macOS SDK implementing the same protocol.
186
- - [sym-relay](https://github.com/sym-bot/sym-relay) WebSocket relay for cross-network mesh.
187
-
188
- **Verified cross-platform:** Mac ↔ Windows on the same wifi (April 2026).
189
-
190
- ## License
191
-
192
- Apache 2.0 SYM.BOT Ltd
1
+ # sym-mesh-channel
2
+
3
+ [![npm](https://img.shields.io/npm/v/@sym-bot/mesh-channel)](https://www.npmjs.com/package/@sym-bot/mesh-channel)
4
+ [![MMP Spec](https://img.shields.io/badge/protocol-MMP_v0.2.3-purple)](https://sym.bot/spec/mmp)
5
+ [![arXiv](https://img.shields.io/badge/arXiv-2604.03955-b31b1b.svg)](https://arxiv.org/abs/2604.03955)
6
+ [![License](https://img.shields.io/badge/license-Apache%202.0-blue)](LICENSE)
7
+ [![Node](https://img.shields.io/badge/node-%3E%3D18-green)](https://nodejs.org)
8
+
9
+ > MCP server that turns Claude Code into a peer node on the [SYM mesh](https://sym.bot) — the first non-Anthropic implementation of Claude Code Channels for real-time agent-to-agent cognition.
10
+
11
+ Two Claude Code sessions on different machines discover each other via Bonjour mDNS, form a peer-to-peer mesh, and exchange structured cognitive signals in real-time. Each side is a full peer with its own cryptographic identity, its own [SVAF](https://arxiv.org/abs/2604.03955) receiver-side gating, and its own memory — not a thin client. Signals arrive mid-conversation as `<channel>` notifications. No polling, no shared server, no orchestrator.
12
+
13
+ **Verified cross-platform:** Mac ↔ Windows on the same wifi, pure Bonjour, no relay, no token. Cross-network via optional WebSocket relay.
14
+
15
+ - **SVAF paper**: [arxiv.org/abs/2604.03955](https://arxiv.org/abs/2604.03955)
16
+ - **MMP spec**: [sym.bot/spec/mmp](https://sym.bot/spec/mmp)
17
+
18
+ ## What this looks like
19
+
20
+ A Claude Code session on Mac broadcasts a structured signal: `focus: "echo loop between same-domain agents"`, `intent: "need architecture review before implementation"`. A session on Windows receives it in real-time as a `<channel>` notification — no tool call, it just appears mid-conversation. The Windows Claude reviews, responds with a detailed architecture analysis, and the Mac session sees the response land mid-turn. Two agents coordinated through typed cognitive signals on an open protocol, across machines, with zero human copy-paste.
21
+
22
+ This isn't hypothetical. This README was coordinated by two Claude Code sessions working through the mesh it describes.
23
+
24
+ ## How real-time push works (Claude Code Channels + MMP)
25
+
26
+ This MCP server composes two things:
27
+
28
+ **[Claude Code Channels](https://code.claude.com/docs/en/mcp)** (Anthropic, shipped 2026-03-20) — an MCP capability that lets servers push events directly into Claude's conversation context mid-turn via `notifications/claude/channel`. Anthropic built it for the Telegram/Discord/iMessage integrations. We use it for agent-to-agent cognitive coupling.
29
+
30
+ **[MMP — the Mesh Memory Protocol](https://sym.bot/spec/mmp)** — defines what gets pushed: typed seven-field cognitive bundles (CAT7: focus, issue, intent, motivation, commitment, perspective, mood), how receivers gate incoming signals ([SVAF](https://arxiv.org/abs/2604.03955)), and how peers maintain identity without a central orchestrator. MMP is the protocol; this MCP server is the reference implementation for Claude Code hosts.
31
+
32
+ **The composition:** when a peer on the mesh broadcasts a CMB (Cognitive Memory Block), the SymNode inside this MCP evaluates it via SVAF. If accepted, the MCP fires a `notifications/claude/channel` notification to Claude Code, which surfaces it as a `<channel>` block in the conversation. Claude sees it, can react, and can broadcast back via `sym_send` or `sym_observe`. No polling. No tool calls. The mesh thinks together.
33
+
34
+ ## Quick start
35
+
36
+ ### Via Claude Code plugin marketplace (recommended)
37
+
38
+ Two commands, straight from this repo — no waiting on any external directory:
39
+
40
+ ```
41
+ /plugin marketplace add sym-bot/sym-mesh-channel
42
+ /plugin install sym-mesh-channel@sym-mesh-channel
43
+ ```
44
+
45
+ Claude Code clones the repo, reads `.claude-plugin/marketplace.json`, and installs the plugin into your user scope. Launch with:
46
+
47
+ ```bash
48
+ claude --dangerously-load-development-channels plugin:sym-mesh-channel@sym-mesh-channel
49
+ ```
50
+
51
+ ### Via npm
52
+
53
+ ```bash
54
+ npm install -g @sym-bot/mesh-channel # install + auto-configure ~/.claude.json
55
+ claude --dangerously-load-development-channels server:claude-sym-mesh # launch
56
+ ```
57
+
58
+ > **Why the dev flag?** Claude Code Channels are in [research preview](https://code.claude.com/docs/en/channels#research-preview) with an Anthropic-maintained allowlist that gates in-conversation `<channel>` push notifications. The MCP tools themselves (`sym_send`, `sym_peers`, `sym_status`, `sym_recall`, `sym_observe`, `sym_fetch`, `sym_group_info`, `sym_invite_info`) work immediately after install without any flag. The `--dangerously-load-development-channels` flag is only needed to enable the async-push behaviour (peer messages arriving mid-turn without a tool call). The plugin is approved on the [Anthropic Plugin Directory](https://claude.ai/settings/plugins/submit); plugin-directory approval and Channels-allowlist inclusion are independent gates.
59
+
60
+ ---
61
+
62
+ Install auto-detects your hostname, creates a unique node identity (`claude-<hostname>`), and configures the MCP server globally in `~/.claude.json`. To customize your node name, set `SYM_NODE_NAME` before installing. If two people are on the same wifi, their sessions discover each other automatically. Verify inside Claude Code:
63
+
64
+ ```
65
+ > sym_status
66
+ Node: claude-yourhostname (019d599d)
67
+ Relay: disconnected
68
+ Peers: 1
69
+ Memories: 0
70
+
71
+ > sym_peers
72
+ 1 peer(s):
73
+ claude-theirhostname via bonjour
74
+
75
+ > sym_send "reviewing the auth module — found a race condition"
76
+ Message delivered to 1 peer(s).
77
+ ```
78
+
79
+ The other peer sees it arrive **in their Claude Code context as a real-time `<channel>` notification** — no polling, no tool call. It just appears mid-conversation. Their Claude can reason about it, respond, or act on it autonomously.
80
+
81
+ For cross-network setup (different offices, remote team), see [Cross-network setup](#cross-network-setup-optional) below.
82
+
83
+ ## Dev-team groups
84
+
85
+ By default every sym-mesh-channel node joins the global `_sym._tcp` mesh every peer on the network sees every other peer. For a big company with multiple dev teams, this is too noisy. Mesh groups (MMP §5.8) isolate each team at the mDNS layer so `backend-team` and `frontend-team` can't see each other's CMBs at all.
86
+
87
+ ### LAN dev-team group (same office)
88
+
89
+ **Team lead creates the group:**
90
+
91
+ ```
92
+ # In Claude Code:
93
+ > sym_invite_create { "group": "backend-team" }
94
+
95
+ Invite URL (LAN-only (Bonjour)):
96
+
97
+ sym://group/backend-team
98
+
99
+ Share this URL with teammates...
100
+
101
+ > sym_join_group { "group": "backend-team" }
102
+
103
+ Hot-swapped from group "default" (_sym._tcp) to "backend-team" (_backend-team._tcp).
104
+ ```
105
+
106
+ **Team lead shares the URL** (Slack, email, however) with teammates.
107
+
108
+ **Each teammate pastes the URL into their Claude Code session:**
109
+
110
+ ```
111
+ > sym_invite_info { "url": "sym://group/backend-team" }
112
+
113
+ Parsed invite: sym://group/backend-team
114
+ { "app": "sym", "group": "backend-team", "service_type": "_backend-team._tcp" }
115
+
116
+ To join, call sym_join_group:
117
+ { "group": "backend-team" }
118
+
119
+ > sym_join_group { "group": "backend-team" }
120
+
121
+ Hot-swapped from group "default" to "backend-team".
122
+ ```
123
+
124
+ No restart, no `~/.claude.json` editing. Teammates on the same LAN now see each other via Bonjour. `backend-team` and `frontend-team` live in isolated mDNS spaces.
125
+
126
+ ### Cross-network team group (distributed team via relay)
127
+
128
+ Same story, but the team crosses network boundaries (home ↔ office, coffee shop ↔ client site). You need a relay so members can find each other over the internet. We host one at `wss://sym-relay.onrender.com`; you can run your own from the [sym-relay](https://github.com/sym-bot/sym-relay) repo.
129
+
130
+ **Team lead creates the relay-backed invite:**
131
+
132
+ ```
133
+ > sym_invite_create {
134
+ "group": "eng-team",
135
+ "relay_url": "wss://sym-relay.onrender.com",
136
+ "relay_token": "a-shared-secret-any-string-teammates-agree-on"
137
+ }
138
+
139
+ Invite URL (cross-network (relay)):
140
+
141
+ sym://team/eng-team?relay=wss%3A%2F%2Fsym-relay.onrender.com&token=a-shared-secret-...
142
+
143
+ > sym_join_group {
144
+ "group": "eng-team",
145
+ "relay_url": "wss://sym-relay.onrender.com",
146
+ "relay_token": "a-shared-secret-any-string-teammates-agree-on"
147
+ }
148
+ ```
149
+
150
+ Teammate pastes the URL, `sym_invite_info` extracts the relay + token from the query string, `sym_join_group` hot-swaps with the same args. All members with the same token share one relay channel different tokens = different channels on the same relay host.
151
+
152
+ ### Discovering what's out there
153
+
154
+ ```
155
+ > sym_groups_discover
156
+
157
+ SYM-mesh groups visible on LAN (3):
158
+ _sym._tcp group="sym"
159
+ _backend-team._tcp group="backend-team" (← your current group)
160
+ _frontend-team._tcp group="frontend-team"
161
+ ```
162
+
163
+ Only shows groups with at least one node online right now there's no central directory of offline-but-known groups (peer-to-peer architecture). For cross-network relay-backed groups, you must know the relay URL + token out of band (someone shares the invite URL).
164
+
165
+ ### Advanced: per-project node identity
166
+
167
+ By default every Claude Code session on a machine shares one mesh identity (set globally in `~/.claude.json`). If you run several Claude Code sessions in parallel from distinct project directories and want each to appear as its own peer on the mesh — e.g. a "research" session and a "strategy" session on the same laptop install per-project instead:
168
+
169
+ ```bash
170
+ cd path/to/your/project
171
+ SYM_NODE_NAME=claude-myproject-win sym-mesh-channel init --project
172
+ ```
173
+
174
+ This writes `<project>/.mcp.json` and merges `<project>/.claude/settings.local.json` instead of touching `~/.claude.json`. Claude Code loads project-scoped `.mcp.json` on launch and its entries override the global one when you're running from that directory, so each project gets its own `SYM_NODE_NAME` without stepping on siblings. Rerun from each project root with a distinct `SYM_NODE_NAME` to register each one as a separate peer.
175
+
176
+ Normal one-machine-one-peer usage does **not** need `--project` — the default global install is correct for most users.
177
+
178
+ ## Requirements
179
+
180
+ | | macOS | Linux | Windows |
181
+ |---|---|---|---|
182
+ | Node.js ≥ 18 | ✓ | ✓ | ✓ |
183
+ | Claude Code ≥ 2.1.97 (Channels feature) | | | |
184
+ | Bonjour / mDNS for LAN discovery | built-in | install `avahi-daemon` | built-in (Windows 10+) |
185
+
186
+ The plugin is approved on the Anthropic Plugin Directory. The `--dangerously-load-development-channels` flag remains necessary while Claude Code Channels are in research preview with a separate allowlist that gates the `<channel>` push-notification feature specifically; the MCP tools themselves do not require the flag.
187
+
188
+ ## What you get
189
+
190
+ Eleven MCP tools exposed to Claude Code, namespaced under `mcp__claude-sym-mesh__`:
191
+
192
+ | Tool | What it does |
193
+ |---|---|
194
+ | `sym_send` | Broadcast a free-text message to all mesh peers. Arrives in receivers' contexts as a `<channel>` notification. |
195
+ | `sym_observe` | Share a structured CAT7 observation: focus, issue, intent, motivation, commitment, perspective, mood. SVAF-gated on the receiving side. |
196
+ | `sym_recall` | Search mesh memory for past CMBs. |
197
+ | `sym_fetch` | Fetch the full content of a single CMB by its compact channel-header ID. Lets receivers pull deep context on demand rather than receiving every field on every push. |
198
+ | `sym_peers` | List discovered peers (via bonjour or relay). |
199
+ | `sym_status` | Node identity, relay state, peer count, memory count. Includes current mesh group (MMP §5.8). |
200
+ | `sym_group_info` | Report the mesh group this node is in, with service type + group name + peer roster scoped to the group. |
201
+ | `sym_invite_create` | Generate a shareable invite URL for a named group. LAN-only `sym://group/{name}` or cross-network `sym://team/{name}?relay=&token=` flavor. Team leads share this with teammates. |
202
+ | `sym_invite_info` | Parse a mesh invite URL and return group + service type + relay creds + a ready-to-use `sym_join_group` call. Read-only; does not switch groups. |
203
+ | `sym_join_group` | **Hot-swap** this node into a different mesh group at runtime — no Claude Code restart. Works for LAN groups and cross-network relay-backed teams. |
204
+ | `sym_groups_discover` | List SYM-mesh groups currently advertising on the local network via Bonjour / mDNS. Only shows groups with at least one node online right now. |
205
+
206
+ Real-time push is bidirectional: peer events arrive in Claude's context without any tool call, while the session is mid-turn. This is the "Claude thinks with the mesh" property — not "Claude pokes the mesh occasionally."
207
+
208
+ ## How it works
209
+
210
+ ```
211
+ Claude Code A Claude Code B
212
+ ↕ (stdio + MCP) ↕
213
+ sym-mesh-channel (SymNode) ←— Bonjour mDNS —→ sym-mesh-channel (SymNode)
214
+ ↕ (LAN discovery) ↕
215
+ └──────────── optional WebSocket relay ────────────────┘
216
+ (cross-network, see below)
217
+ ```
218
+
219
+ - **Stdio half**: Claude Code spawns the MCP server as a child process. MCP tool calls flow over stdio.
220
+ - **Push half**: when a CMB arrives at the SymNode (via Bonjour or relay), the MCP server fires a `notifications/claude/channel` notification back over stdio. Claude Code surfaces it as a `<channel>` block in the conversation context.
221
+ - **Identity**: each peer has its own Ed25519 keypair stored at `~/.sym/nodes/<name>/identity.json`. NodeIDs are UUID v7 + Ed25519 signatures, gossiped through the relay's directory and/or via Bonjour TXT records.
222
+ - **SVAF**: incoming CMBs are evaluated by Symbolic-Vector Attention Fusion before they enter cognitive state. Low-relevance CMBs are gated out so the receiver's context doesn't drown.
223
+
224
+ For the full architecture, see MMP spec sections 4-6.
225
+
226
+ ## Cross-network setup (optional)
227
+
228
+ LAN-only is enough for two people sitting next to each other. To connect across networks (different offices, coffee shop ↔ home, etc.) you need a relay:
229
+
230
+ ```bash
231
+ # Run your own relay (Render-friendly Dockerfile included)
232
+ git clone https://github.com/sym-bot/sym-relay
233
+ cd sym-relay && npm install && npm start
234
+ # or deploy the Dockerfile to Render / Fly / Railway / etc
235
+ ```
236
+
237
+ Then add the relay env vars to your `claude-sym-mesh` entry in `~/.claude.json`:
238
+
239
+ ```json
240
+ "env": {
241
+ "SYM_NODE_NAME": "claude-mac",
242
+ "SYM_RELAY_URL": "wss://your-relay.example.com",
243
+ "SYM_RELAY_TOKEN": "your-shared-token"
244
+ }
245
+ ```
246
+
247
+ Both peers must use the same relay URL and token to be on the same channel. The relay supports per-token channel isolation so you can run a single relay for multiple groups.
248
+
249
+ ## Troubleshooting
250
+
251
+ **Peers don't see each other on the same wifi.** Check Bonjour is running:
252
+ - macOS: `dns-sd -B _sym._tcp` (built-in)
253
+ - Linux: `avahi-browse -r _sym._tcp` (needs `avahi-daemon` running)
254
+ - Windows 10+: mDNS is built-in. If discovery fails, check Windows Firewall allows mDNS (port 5353 UDP).
255
+
256
+ Some corporate networks block mDNS multicast — try a hotspot or home wifi to verify. If LAN is blocked, fall back to a relay.
257
+
258
+ **`<channel>` notifications never arrive even though peers are connected.** Verify Claude Code was launched with the development-channels flag matching your install path:
259
+
260
+ * plugin install: `--dangerously-load-development-channels plugin:sym-mesh-channel@sym-mesh-channel`
261
+ * npm install: `--dangerously-load-development-channels server:claude-sym-mesh`
262
+
263
+ Without the exact flag for your install path, MCP push notifications are silently dropped.
264
+
265
+ **`sym_status` says "Peers: 0" but `sym_peers` lists peers.** Snapshot timing — both views read the same `_peers` map at slightly different moments. The peer set is dynamic. If counts disagree consistently, file an issue.
266
+
267
+ **`sym_status` says "Relay: connected" even though you didn't configure a relay.** Your shell profile (`~/.zshrc`, `~/.bashrc`, etc.) exports `SYM_RELAY_URL`. Claude Code's MCP env block is **additive** — omitting a key doesn't remove it from the child process. Fix: set `SYM_RELAY_URL` and `SYM_RELAY_TOKEN` to `""` (empty string) in the MCP env block to override the shell. The installer (`npx @sym-bot/mesh-channel init`) does this automatically as of v0.1.8.
268
+
269
+ **Multiple Claude Code sessions on the same machine want to share an identity.** Don't. Each session should have a distinct `SYM_NODE_NAME`. As of `@sym-bot/sym 0.3.70`, the SymNode acquires an exclusive lockfile on its identity (`~/.sym/nodes/<name>/lock.pid`) and refuses to start a second process with the same name. If you see `EIDENTITYLOCK`, find and kill the other process or pick a different name.
270
+
271
+ ## Security
272
+
273
+ Defense in depth — three layers, all must pass before a mesh signal reaches Claude's context:
274
+
275
+ 1. **Transport**: Ed25519 peer identity (LAN) + relay token auth (cross-network). Unauthenticated sources cannot reach `pushChannel()`.
276
+ 2. **Protocol**: [SVAF](https://arxiv.org/abs/2604.03955) per-field content gating — evaluates each incoming CMB across 7 semantic dimensions and rejects irrelevant signals.
277
+ 3. **Application**: text-only context injection, no code execution, no permission relay (`claude/channel/permission` is explicitly not declared).
278
+
279
+ **Optional peer allowlist**: set `SYM_ALLOWED_PEERS=claude-mac,claude-win` to restrict which authenticated peers can push to Claude's context. When empty (default), all authenticated peers are accepted.
280
+
281
+ See [SECURITY.md](SECURITY.md) for the full security model.
282
+
283
+ ## References
284
+
285
+ - [SVAF paper (arXiv:2604.03955)](https://arxiv.org/abs/2604.03955) — Xu, 2026. Symbolic-Vector Attention Fusion for Collective Intelligence.
286
+ - [MMP spec v0.2.3](https://sym.bot/spec/mmp) — Mesh Memory Protocol specification.
287
+ - [sym-swift](https://github.com/sym-bot/sym-swift) — iOS/macOS SDK implementing the same protocol.
288
+ - [sym-relay](https://github.com/sym-bot/sym-relay) — WebSocket relay for cross-network mesh.
289
+
290
+ **Verified cross-platform:** Mac ↔ Windows on the same wifi (April 2026).
291
+
292
+ ## License
293
+
294
+ Apache 2.0 — SYM.BOT Ltd