@sym-bot/mesh-channel 0.1.20 → 0.1.22

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/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for describing the origin of the Work and
141
+ reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Support. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or support.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2026 SYM.BOT Ltd
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
200
+ implied. See the License for the specific language governing
201
+ permissions and limitations under the License.
package/README.md CHANGED
@@ -1,183 +1,209 @@
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 → Node: claude-yourhostname, Peers: 1
57
- sym_peers → 1 peer(s): claude-theirhostname via bonjour
58
- sym_send "reviewing the auth module found a race condition"
59
- ```
60
-
61
- 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.
62
-
63
- For cross-network setup (different offices, remote team), see [Cross-network setup](#cross-network-setup-optional) below.
64
-
65
- ### Advanced: per-project node identity
66
-
67
- 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:
68
-
69
- ```bash
70
- cd path/to/your/project
71
- SYM_NODE_NAME=claude-myproject-win sym-mesh-channel init --project
72
- ```
73
-
74
- 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.
75
-
76
- Normal one-machine-one-peer usage does **not** need `--project` — the default global install is correct for most users.
77
-
78
- ## Requirements
79
-
80
- | | macOS | Linux | Windows |
81
- |---|---|---|---|
82
- | Node.js ≥ 18 | ✓ | ✓ | ✓ |
83
- | Claude Code 2.1.97 (Channels feature) | ✓ | ✓ | ✓ |
84
- | Bonjour / mDNS for LAN discovery | built-in | install `avahi-daemon` | built-in (Windows 10+) |
85
-
86
- 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.
87
-
88
- ## What you get
89
-
90
- Five MCP tools exposed to Claude Code, namespaced under `mcp__claude-sym-mesh__`:
91
-
92
- | Tool | What it does |
93
- |---|---|
94
- | `sym_send` | Broadcast a free-text message to all mesh peers. Arrives in receivers' contexts as a `<channel>` notification. |
95
- | `sym_observe` | Share a structured CAT7 observation: focus, issue, intent, motivation, commitment, perspective, mood. SVAF-gated on the receiving side. |
96
- | `sym_recall` | Search mesh memory for past CMBs. |
97
- | `sym_peers` | List discovered peers (via bonjour or relay). |
98
- | `sym_status` | Node identity, relay state, peer count, memory count. |
99
-
100
- 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."
101
-
102
- ## How it works
103
-
104
- ```
105
- Claude Code A Claude Code B
106
- (stdio + MCP) ↕
107
- sym-mesh-channel (SymNode) ←— Bonjour mDNS —→ sym-mesh-channel (SymNode)
108
- ↕ (LAN discovery) ↕
109
- └──────────── optional WebSocket relay ────────────────┘
110
- (cross-network, see below)
111
- ```
112
-
113
- - **Stdio half**: Claude Code spawns the MCP server as a child process. MCP tool calls flow over stdio.
114
- - **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.
115
- - **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.
116
- - **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.
117
-
118
- For the full architecture, see MMP spec sections 4-6.
119
-
120
- ## Cross-network setup (optional)
121
-
122
- 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:
123
-
124
- ```bash
125
- # Run your own relay (Render-friendly Dockerfile included)
126
- git clone https://github.com/sym-bot/sym-relay
127
- cd sym-relay && npm install && npm start
128
- # or deploy the Dockerfile to Render / Fly / Railway / etc
129
- ```
130
-
131
- Then add the relay env vars to your `claude-sym-mesh` entry in `~/.claude.json`:
132
-
133
- ```json
134
- "env": {
135
- "SYM_NODE_NAME": "claude-mac",
136
- "SYM_RELAY_URL": "wss://your-relay.example.com",
137
- "SYM_RELAY_TOKEN": "your-shared-token"
138
- }
139
- ```
140
-
141
- 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.
142
-
143
- ## Troubleshooting
144
-
145
- **Peers don't see each other on the same wifi.** Check Bonjour is running:
146
- - macOS: `dns-sd -B _sym._tcp` (built-in)
147
- - Linux: `avahi-browse -r _sym._tcp` (needs `avahi-daemon` running)
148
- - Windows 10+: mDNS is built-in. If discovery fails, check Windows Firewall allows mDNS (port 5353 UDP).
149
-
150
- Some corporate networks block mDNS multicast — try a hotspot or home wifi to verify. If LAN is blocked, fall back to a relay.
151
-
152
- **`<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.
153
-
154
- **`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.
155
-
156
- **`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.
157
-
158
- **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.
159
-
160
- ## Security
161
-
162
- Defense in depth three layers, all must pass before a mesh signal reaches Claude's context:
163
-
164
- 1. **Transport**: Ed25519 peer identity (LAN) + relay token auth (cross-network). Unauthenticated sources cannot reach `pushChannel()`.
165
- 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.
166
- 3. **Application**: text-only context injection, no code execution, no permission relay (`claude/channel/permission` is explicitly not declared).
167
-
168
- **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.
169
-
170
- See [SECURITY.md](SECURITY.md) for the full security model.
171
-
172
- ## References
173
-
174
- - [SVAF paper (arXiv:2604.03955)](https://arxiv.org/abs/2604.03955) — Xu, 2026. Symbolic-Vector Attention Fusion for Collective Intelligence.
175
- - [MMP spec v0.2.2](https://sym.bot/spec/mmp) — Mesh Memory Protocol specification.
176
- - [sym-swift](https://github.com/sym-bot/sym-swift) — iOS/macOS SDK implementing the same protocol.
177
- - [sym-relay](https://github.com/sym-bot/sym-relay) — WebSocket relay for cross-network mesh.
178
-
179
- **Verified cross-platform:** Mac ↔ Windows on the same wifi (April 2026).
180
-
181
- ## License
182
-
183
- 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
+ ### Advanced: per-project node identity
84
+
85
+ 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:
86
+
87
+ ```bash
88
+ cd path/to/your/project
89
+ SYM_NODE_NAME=claude-myproject-win sym-mesh-channel init --project
90
+ ```
91
+
92
+ 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.
93
+
94
+ Normal one-machine-one-peer usage does **not** need `--project` the default global install is correct for most users.
95
+
96
+ ## Requirements
97
+
98
+ | | macOS | Linux | Windows |
99
+ |---|---|---|---|
100
+ | Node.js 18 | | | |
101
+ | Claude Code ≥ 2.1.97 (Channels feature) | ✓ | ✓ | ✓ |
102
+ | Bonjour / mDNS for LAN discovery | built-in | install `avahi-daemon` | built-in (Windows 10+) |
103
+
104
+ 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.
105
+
106
+ ## What you get
107
+
108
+ Eight MCP tools exposed to Claude Code, namespaced under `mcp__claude-sym-mesh__`:
109
+
110
+ | Tool | What it does |
111
+ |---|---|
112
+ | `sym_send` | Broadcast a free-text message to all mesh peers. Arrives in receivers' contexts as a `<channel>` notification. |
113
+ | `sym_observe` | Share a structured CAT7 observation: focus, issue, intent, motivation, commitment, perspective, mood. SVAF-gated on the receiving side. |
114
+ | `sym_recall` | Search mesh memory for past CMBs. |
115
+ | `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. |
116
+ | `sym_peers` | List discovered peers (via bonjour or relay). |
117
+ | `sym_status` | Node identity, relay state, peer count, memory count. Includes current mesh group (MMP §5.8). |
118
+ | `sym_group_info` | Report the mesh group this node is in, with service type + group name + peer roster scoped to the group. |
119
+ | `sym_invite_info` | Parse an app-specific mesh invite URL (e.g. `melotune://room/{id}/{name}`) and return service type + group + optional relay token. Read-only; does not switch groups. |
120
+
121
+ 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."
122
+
123
+ ## How it works
124
+
125
+ ```
126
+ Claude Code A Claude Code B
127
+ (stdio + MCP) ↕
128
+ sym-mesh-channel (SymNode) ←— Bonjour mDNS —→ sym-mesh-channel (SymNode)
129
+ ↕ (LAN discovery) ↕
130
+ └──────────── optional WebSocket relay ────────────────┘
131
+ (cross-network, see below)
132
+ ```
133
+
134
+ - **Stdio half**: Claude Code spawns the MCP server as a child process. MCP tool calls flow over stdio.
135
+ - **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.
136
+ - **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.
137
+ - **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.
138
+
139
+ For the full architecture, see MMP spec sections 4-6.
140
+
141
+ ## Cross-network setup (optional)
142
+
143
+ 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:
144
+
145
+ ```bash
146
+ # Run your own relay (Render-friendly Dockerfile included)
147
+ git clone https://github.com/sym-bot/sym-relay
148
+ cd sym-relay && npm install && npm start
149
+ # or deploy the Dockerfile to Render / Fly / Railway / etc
150
+ ```
151
+
152
+ Then add the relay env vars to your `claude-sym-mesh` entry in `~/.claude.json`:
153
+
154
+ ```json
155
+ "env": {
156
+ "SYM_NODE_NAME": "claude-mac",
157
+ "SYM_RELAY_URL": "wss://your-relay.example.com",
158
+ "SYM_RELAY_TOKEN": "your-shared-token"
159
+ }
160
+ ```
161
+
162
+ 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.
163
+
164
+ ## Troubleshooting
165
+
166
+ **Peers don't see each other on the same wifi.** Check Bonjour is running:
167
+ - macOS: `dns-sd -B _sym._tcp` (built-in)
168
+ - Linux: `avahi-browse -r _sym._tcp` (needs `avahi-daemon` running)
169
+ - Windows 10+: mDNS is built-in. If discovery fails, check Windows Firewall allows mDNS (port 5353 UDP).
170
+
171
+ Some corporate networks block mDNS multicast — try a hotspot or home wifi to verify. If LAN is blocked, fall back to a relay.
172
+
173
+ **`<channel>` notifications never arrive even though peers are connected.** Verify Claude Code was launched with the development-channels flag matching your install path:
174
+
175
+ * plugin install: `--dangerously-load-development-channels plugin:sym-mesh-channel@sym-mesh-channel`
176
+ * npm install: `--dangerously-load-development-channels server:claude-sym-mesh`
177
+
178
+ Without the exact flag for your install path, MCP push notifications are silently dropped.
179
+
180
+ **`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.
181
+
182
+ **`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.
183
+
184
+ **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.
185
+
186
+ ## Security
187
+
188
+ Defense in depth — three layers, all must pass before a mesh signal reaches Claude's context:
189
+
190
+ 1. **Transport**: Ed25519 peer identity (LAN) + relay token auth (cross-network). Unauthenticated sources cannot reach `pushChannel()`.
191
+ 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.
192
+ 3. **Application**: text-only context injection, no code execution, no permission relay (`claude/channel/permission` is explicitly not declared).
193
+
194
+ **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.
195
+
196
+ See [SECURITY.md](SECURITY.md) for the full security model.
197
+
198
+ ## References
199
+
200
+ - [SVAF paper (arXiv:2604.03955)](https://arxiv.org/abs/2604.03955) — Xu, 2026. Symbolic-Vector Attention Fusion for Collective Intelligence.
201
+ - [MMP spec v0.2.3](https://sym.bot/spec/mmp) — Mesh Memory Protocol specification.
202
+ - [sym-swift](https://github.com/sym-bot/sym-swift) — iOS/macOS SDK implementing the same protocol.
203
+ - [sym-relay](https://github.com/sym-bot/sym-relay) — WebSocket relay for cross-network mesh.
204
+
205
+ **Verified cross-platform:** Mac ↔ Windows on the same wifi (April 2026).
206
+
207
+ ## License
208
+
209
+ Apache 2.0 — SYM.BOT Ltd