@vdoninja/mcp 0.4.0 → 0.4.1

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.
@@ -0,0 +1,54 @@
1
+ VDO.Ninja MCP Unmodified Distribution Exception
2
+ ==============================================
3
+
4
+ This document grants an additional permission under Section 7 of the GNU Affero
5
+ General Public License version 3 (AGPL-3.0-only) for the VDO.Ninja MCP package.
6
+
7
+ 1. Covered MCP Files
8
+ --------------------
9
+ This exception applies only to files distributed as part of an official
10
+ `@vdoninja/mcp` package release (the "Covered MCP Files"), including files
11
+ listed in the package's published `files` allowlist.
12
+
13
+ 2. Official Distributions
14
+ -------------------------
15
+ An "Official Distribution" of Covered MCP Files means a copy distributed by
16
+ Steve Seguin as part of:
17
+
18
+ - the npm package `@vdoninja/mcp@X.Y.Z` (a specific published version), and/or
19
+ - a tagged release `vX.Y.Z` of:
20
+ - https://github.com/steveseguin/ninjasdk (directory `MCP/`), or
21
+ - https://github.com/steveseguin/ninjamcp
22
+
23
+ and any byte-for-byte identical mirror of that exact Official Distribution.
24
+
25
+ 3. Unmodified
26
+ -------------
27
+ "Unmodified" means byte-for-byte identical to an Official Distribution of the
28
+ same Covered MCP File, including preservation of any license notices.
29
+
30
+ 4. Additional Permission
31
+ ------------------------
32
+ Notwithstanding the other terms of the AGPL-3.0-only, you are granted permission
33
+ to use, copy, combine, bundle, link, and convey the Covered MCP Files in
34
+ Unmodified form as part of a larger work (a "Larger Work"), and to convey that
35
+ Larger Work under terms of your choice (including proprietary terms), without
36
+ requiring that the Larger Work as a whole be licensed under the AGPL.
37
+
38
+ 5. Conditions
39
+ -------------
40
+ This additional permission applies only if:
41
+
42
+ - the Covered MCP Files are Unmodified; and
43
+ - you comply with the AGPL-3.0-only requirements applicable to conveying verbatim
44
+ copies of the Covered MCP Files (including preserving notices and providing
45
+ recipients a copy of the AGPL license).
46
+
47
+ 6. Modified Versions
48
+ --------------------
49
+ If you modify any Covered MCP File, this additional permission does not apply to
50
+ that modified file or to any Larger Work that includes that modified file.
51
+
52
+ 7. No Other Permissions
53
+ -----------------------
54
+ This exception grants no rights beyond those stated above.
package/README.md ADDED
@@ -0,0 +1,324 @@
1
+ # VDO.Ninja MCP (`@vdoninja/mcp`)
2
+
3
+ ## TL;DR
4
+
5
+ This package gives an AI app a small set of tools for talking to another AI app. Two Codex, Claude, Cursor, or other MCP sessions can join the same VDO.Ninja room, send messages, exchange files, and keep shared task state without you building a new messaging server.
6
+
7
+ If your AI client supports MCP and you want **tools it can call**, use this package. If you want an **always-on agent room with a local inbox**, use [`ninja-p2p`](https://github.com/steveseguin/ninja-p2p) instead.
8
+
9
+ **Best for:** MCP-native agent handoffs, file delivery, and small shared-state workflows.
10
+
11
+ **Not for:** a general VPN, permanent storage, or a large public chat network.
12
+
13
+ Package: [`@vdoninja/mcp`](https://www.npmjs.com/package/@vdoninja/mcp) | [Quickstart](references/quickstart-and-compat.md) | [Client setup examples](references/client-config-examples.md) | [Support](https://discord.vdo.ninja)
14
+
15
+ ## What It Looks Like
16
+
17
+ One agent joins a room:
18
+
19
+ ```json
20
+ { "name": "vdo_connect", "arguments": { "room": "family_calendar", "stream_id": "planner" } }
21
+ ```
22
+
23
+ A second agent joins the same room, then sends it a message:
24
+
25
+ ```json
26
+ { "name": "vdo_connect", "arguments": { "room": "family_calendar", "stream_id": "reviewer", "target_stream_id": "planner" } }
27
+ { "name": "vdo_send", "arguments": { "session_id": "<reviewer-session>", "data": { "text": "I checked the plan. Tuesday has a conflict." } } }
28
+ ```
29
+
30
+ Those are normal MCP tool calls. This server translates them into VDO.Ninja SDK operations over WebRTC data channels.
31
+
32
+ ## Which VDO.Ninja Package Do I Need?
33
+
34
+ | Your goal | Use |
35
+ | --- | --- |
36
+ | Add connect/send/file/state tools to an MCP client | **`@vdoninja/mcp`** |
37
+ | Give agents a persistent room and local inbox | [`@vdoninja/ninja-p2p`](https://github.com/steveseguin/ninja-p2p) |
38
+ | Build directly with WebRTC media or data channels | [`@vdoninja/sdk`](https://github.com/steveseguin/ninjasdk) |
39
+
40
+ This package uses VDO.Ninja's existing room, discovery, and WebRTC behavior. It does not add signaling-server commands. `@vdoninja/sdk` and the Node WebRTC runtime install as package dependencies.
41
+
42
+ ## Why This MCP
43
+
44
+ - Open source (`AGPL-3.0-only` with additional unmodified-distribution exception) and free to use.
45
+ - Peer-to-peer first: no central relay required for normal data flow.
46
+ - End-to-end encrypted WebRTC data transport (DTLS + SCTP data channels).
47
+ - Reliable data channel mode available for ordered/loss-recovered delivery.
48
+ - Low infrastructure overhead for bot-to-bot messaging and file sync.
49
+ - Works for local LAN, remote internet peers, and hybrid topologies.
50
+ - TURN support improves connectivity when direct P2P is blocked.
51
+ - Good fit for multi-agent coordination without exposing plaintext payloads to a middlebox.
52
+
53
+ ## Common and Interesting Use Cases
54
+
55
+ - AI swarm coordination: multiple agents in a private room exchanging tasks, state, and results.
56
+ - Bot-to-bot handoff: one agent collects context, another executes, another validates, all over P2P.
57
+ - Private file exchange: send logs, artifacts, prompts, and generated outputs directly between agents.
58
+ - Human + AI war room: operator plus several bots sharing near-real-time status updates.
59
+ - Edge + cloud hybrid: local on-device agent syncs with remote agents without standing up a custom tunnel.
60
+ - Temporary secure collaboration spaces: ad-hoc rooms with join tokens and peer allowlists.
61
+ - Cross-tool interop: Codex and Claude instances sharing updates through the same bridge contract.
62
+
63
+ ## Fun Agent-to-Agent Rooms
64
+
65
+ These are real patterns teams are starting to use:
66
+
67
+ - Claude Code to Codex CLI pair mode where one agent asks for a second opinion and gets patch/test feedback.
68
+ - OpenClaw-to-OpenClaw specialist rooms where one local assistant asks another for tool-specific help.
69
+ - Small LLM idea circles (3-5 agents) sharing proposals, critiques, and final votes.
70
+ - Private "night shift" automation where bots sync status/events/files without broad network exposure.
71
+
72
+ OpenClaw project link:
73
+
74
+ - https://github.com/openclaw/openclaw
75
+
76
+ ## Quick Example: Claude + Codex Helper Loop
77
+
78
+ 1. Claude-side session:
79
+ ```json
80
+ {
81
+ "name": "vdo_connect",
82
+ "arguments": {
83
+ "room": "agent_help_room",
84
+ "stream_id": "claude_agent"
85
+ }
86
+ }
87
+ ```
88
+
89
+ 2. Codex-side session:
90
+ ```json
91
+ {
92
+ "name": "vdo_connect",
93
+ "arguments": {
94
+ "room": "agent_help_room",
95
+ "stream_id": "codex_agent",
96
+ "target_stream_id": "claude_agent"
97
+ }
98
+ }
99
+ ```
100
+
101
+ 3. Claude sends task:
102
+ ```json
103
+ {
104
+ "name": "vdo_send",
105
+ "arguments": {
106
+ "session_id": "<claude_session>",
107
+ "data": {
108
+ "type": "help.request",
109
+ "task": "review patch for race condition"
110
+ }
111
+ }
112
+ }
113
+ ```
114
+
115
+ 4. Codex replies:
116
+ ```json
117
+ {
118
+ "name": "vdo_send",
119
+ "arguments": {
120
+ "session_id": "<codex_session>",
121
+ "data": {
122
+ "type": "help.reply",
123
+ "summary": "found 2 edge cases",
124
+ "next_steps": ["add timeout guard", "add retry test"]
125
+ }
126
+ }
127
+ }
128
+ ```
129
+
130
+ ## High-Value AI Advantages
131
+
132
+ - Agents share messages/files/state directly, without opening broad machine-to-machine network access.
133
+ - You can limit tool access with profiles (`core|file|state|full`) so each agent only gets what it needs.
134
+ - Rooms can be short-lived: create for a task, then close when done.
135
+ - Easy to start: no private subnet setup, no custom tunnel setup.
136
+ - Works between browser peers and Node peers.
137
+ - Data channels can be reliable and ordered, which is good for control messages.
138
+ - Security options are built in: join tokens, stream allowlists, and session MAC checks.
139
+
140
+ ## Clever Real-World Patterns
141
+
142
+ - Reviewer team: one writer agent, several reviewer agents, and one decider agent sharing feedback in the same room.
143
+ - State recovery: agents can re-sync shared state with `vdo_state_sync` after reconnects.
144
+ - File pipeline: one agent sends artifacts, another indexes them, another summarizes them.
145
+ - Human override: a person can join the room to inspect progress and step in when needed.
146
+ - Local-first flow: keep sensitive work local and only send required outputs to remote agents.
147
+ - Burst jobs: create short-lived agent groups per task instead of running a permanent private network.
148
+
149
+ ## Compared with VPN Overlays (e.g., Tailscale)
150
+
151
+ Where this MCP is often better for AI workflows:
152
+
153
+ - You need agent-to-agent messaging/file/state, not full network access between hosts.
154
+ - You want tool-level permissions instead of giving every machine broad private-network reach.
155
+ - You want browser and Node agents working together quickly.
156
+ - You want temporary collaboration sessions without managing a permanent virtual network.
157
+
158
+ Where overlays are often better:
159
+
160
+ - You need always-on private IP connectivity across many services.
161
+ - You need many protocols (databases, SSH, internal web apps) over one virtual network.
162
+ - You need centralized network policy and audit at the infrastructure layer.
163
+
164
+ Practical framing:
165
+
166
+ - This MCP is not a full replacement for Tailscale.
167
+ - It is a strong complement for AI-native, data-channel-first collaboration.
168
+
169
+ ## Transport Truth
170
+
171
+ - This is **WebRTC data transport**, not a generic TCP/SSH tunnel.
172
+ - Data channels can run in reliable/ordered mode (SCTP over DTLS).
173
+ - Default behavior is direct P2P when possible (great for LAN/local-network speed and low latency).
174
+ - Privacy mode is opt-in via `force_turn=true`: this can reduce direct IP exposure between peers, but may reduce connection success in some environments.
175
+ - TURN improves success on restrictive networks, but it is not a guaranteed firewall bypass for every enterprise policy.
176
+
177
+ ## Quickstart (No Clone)
178
+
179
+ Install from a stable folder. The installer stores an absolute script path in Codex/Claude config.
180
+
181
+ ```bash
182
+ npm i @vdoninja/mcp
183
+ npx vdon-mcp-install
184
+ npx vdon-mcp-server
185
+ ```
186
+
187
+ When started directly in a terminal, `vdon-mcp-server` now prints a short "server running" banner and a first-call hint.
188
+
189
+ First MCP call (recommended):
190
+
191
+ ```json
192
+ { "name": "vdo_capabilities", "arguments": {} }
193
+ ```
194
+
195
+ Useful install variants:
196
+
197
+ - `npx vdon-mcp-install --codex-only`
198
+ - `npx vdon-mcp-install --claude-only`
199
+ - `npx vdon-mcp-install --preset core|file|state|secure-core|secure-full`
200
+ - `npx vdon-mcp-install --uninstall`
201
+
202
+ ## Onboarding Guides
203
+
204
+ - Operator quickstart: `references/quickstart-and-compat.md`
205
+ - Client setup examples (Cursor, Gemini CLI, OpenCode): `references/client-config-examples.md`
206
+ - First functional workflows (Codex-to-Codex and Claude-to-Claude): `references/client-config-examples.md`
207
+
208
+ ## Typical Workflows
209
+
210
+ Message demo:
211
+
212
+ ```bash
213
+ npx vdon-mcp-demo-message
214
+ ```
215
+
216
+ Purpose: prove end-to-end room connect + message send/receive over data channels.
217
+
218
+ File demo:
219
+
220
+ ```bash
221
+ npx vdon-mcp-demo-file
222
+ ```
223
+
224
+ Purpose: prove reliable chunked file transfer and receive path.
225
+
226
+ Live network mode (instead of local fake mode):
227
+
228
+ ```bash
229
+ MCP_DEMO_FAKE=0 npx vdon-mcp-demo-message
230
+ MCP_DEMO_FAKE=0 npx vdon-mcp-demo-file
231
+ ```
232
+
233
+ Privacy-first relay mode (opt-in):
234
+
235
+ ```bash
236
+ MCP_DEMO_FAKE=0 MCP_DEMO_FORCE_TURN=1 npx vdon-mcp-demo-message
237
+ MCP_DEMO_FAKE=0 MCP_DEMO_FORCE_TURN=1 npx vdon-mcp-demo-file
238
+ ```
239
+
240
+ ## Security and Least Privilege
241
+
242
+ Use secure controls where needed:
243
+
244
+ - `join_token` and `join_token_secret`
245
+ - `enforce_join_token: true`
246
+ - `allow_peer_stream_ids: [...]`
247
+ - `require_session_mac: true`
248
+
249
+ Server profile scoping:
250
+
251
+ ```bash
252
+ VDON_MCP_TOOL_PROFILE=core npx vdon-mcp-server
253
+ ```
254
+
255
+ Set `VDON_MCP_JOIN_TOKEN_SECRET` before secure preset installs/runtime.
256
+
257
+ ## Compatibility
258
+
259
+ - Codex MCP CLI
260
+ - Claude Code MCP CLI
261
+ - Other MCP clients that support stdio command servers
262
+
263
+ Manual command wiring example:
264
+
265
+ ```json
266
+ {
267
+ "name": "vdo-ninja-mcp",
268
+ "command": "node",
269
+ "args": ["node_modules/@vdoninja/mcp/scripts/vdo-mcp-server.js"]
270
+ }
271
+ ```
272
+
273
+ ## Local Development (This Repo)
274
+
275
+ Start server:
276
+
277
+ ```bash
278
+ node scripts/vdo-mcp-server.js
279
+ ```
280
+
281
+ Install registration from local checkout:
282
+
283
+ ```bash
284
+ node scripts/install-mcp.js
285
+ ```
286
+
287
+ ## Testing
288
+
289
+ Fast product-focused suite:
290
+
291
+ ```bash
292
+ node tests/run-mcp-tests-minimal.js
293
+ ```
294
+
295
+ Full suite:
296
+
297
+ ```bash
298
+ node tests/run-mcp-tests.js
299
+ ```
300
+
301
+ Live diagnostics:
302
+
303
+ ```bash
304
+ node tests/live-turn-smoke.js
305
+ node tests/live-turn-soak.js
306
+ node tests/live-turn-matrix.js
307
+ node tests/live-turn-preset-matrix.js
308
+ ```
309
+
310
+ ## Key Files
311
+
312
+ - `scripts/vdo-mcp-server.js` (stdio MCP server)
313
+ - `scripts/vdo-mcp-streamable-http.js` (streamable HTTP bridge)
314
+ - `scripts/install-mcp.js` (Codex/Claude installer automation)
315
+ - `references/quickstart-and-compat.md` (operator quickstart)
316
+ - `references/mcp-tool-contract.md` (tool semantics and contracts)
317
+ - `server.json` (MCP discovery manifest metadata)
318
+
319
+ ## License
320
+
321
+ AGPL-3.0-only with additional unmodified-distribution exception.
322
+
323
+ - Main license text: `LICENSE`
324
+ - Additional permission: `LICENSE-SDK-EXCEPTION`
package/SKILL.md CHANGED
@@ -27,13 +27,14 @@ Use this skill to run VDO.Ninja as an MCP data bridge in Codex, Claude Code, and
27
27
  ## Fast Path
28
28
 
29
29
  1. Install MCP registration:
30
- `npm i @vdoninja/mcp @roamhq/wrtc`
30
+ `npm i @vdoninja/mcp`
31
31
 
32
32
  2. Register for Codex/Claude:
33
33
  `npx vdon-mcp-install`
34
34
 
35
35
  3. Start server:
36
36
  `npx vdon-mcp-server`
37
+ If run directly in a terminal, it prints a short running banner and a first-call hint.
37
38
 
38
39
  4. Optional least-privilege tool profile:
39
40
  `VDON_MCP_TOOL_PROFILE=core|file|state|full npx vdon-mcp-server`
@@ -80,11 +81,12 @@ For secure presets, set `VDON_MCP_JOIN_TOKEN_SECRET` before install/runtime.
80
81
 
81
82
  - Product test bar: `npm run test:mcp`
82
83
  - Full engineering suite: `npm run test:mcp:all`
83
- - Live diagnostics (optional): `MCP/references/advanced-diagnostics.md`
84
+ - Live diagnostics (optional): `references/advanced-diagnostics.md`
84
85
 
85
86
  ## References
86
87
 
87
- - Operator quickstart: `MCP/references/quickstart-and-compat.md`
88
- - Tool contract: `MCP/references/mcp-tool-contract.md`
89
- - Transport notes: `MCP/references/vdo-ninja-p2p-data-notes.md`
90
- - Registry manifest: `MCP/server.json`
88
+ - Operator quickstart: `references/quickstart-and-compat.md`
89
+ - Client config examples: `references/client-config-examples.md`
90
+ - Tool contract: `references/mcp-tool-contract.md`
91
+ - Transport notes: `references/vdo-ninja-p2p-data-notes.md`
92
+ - Registry manifest: `server.json`
package/package.json CHANGED
@@ -1,16 +1,15 @@
1
1
  {
2
2
  "name": "@vdoninja/mcp",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "VDO.Ninja MCP bridge for WebRTC data-channel messaging, file transfer, and room sync.",
5
5
  "license": "AGPL-3.0-only",
6
- "homepage": "https://github.com/steveseguin/ninjasdk/tree/main/MCP",
6
+ "homepage": "https://github.com/steveseguin/ninjamcp",
7
7
  "repository": {
8
8
  "type": "git",
9
- "url": "git+https://github.com/steveseguin/ninjasdk.git",
10
- "directory": "MCP"
9
+ "url": "git+https://github.com/steveseguin/ninjamcp.git"
11
10
  },
12
11
  "bugs": {
13
- "url": "https://github.com/steveseguin/ninjasdk/issues"
12
+ "url": "https://github.com/steveseguin/ninjamcp/issues"
14
13
  },
15
14
  "keywords": [
16
15
  "mcp",
@@ -29,18 +28,32 @@
29
28
  "vdon-mcp-demo-file": "scripts/demo-file-workflow.js"
30
29
  },
31
30
  "scripts": {
31
+ "test": "node tests/run-mcp-tests-minimal.js",
32
+ "test:all": "node tests/run-mcp-tests.js",
33
+ "check": "npm run test:all",
34
+ "test:mcp": "node tests/run-mcp-tests-minimal.js",
35
+ "test:mcp:all": "node tests/run-mcp-tests.js",
36
+ "test:mcp:live": "node tests/live-turn-smoke.js",
37
+ "test:mcp:soak": "node tests/live-turn-soak.js",
38
+ "test:mcp:matrix": "node tests/live-turn-matrix.js",
39
+ "test:mcp:preset:matrix": "node tests/live-turn-preset-matrix.js",
40
+ "test:mcp:matrix:sweep": "node tests/live-turn-matrix-sweep.js",
32
41
  "mcp:install": "node scripts/install-mcp.js",
33
42
  "mcp:server": "node scripts/vdo-mcp-server.js",
34
43
  "mcp:http": "node scripts/vdo-mcp-streamable-http.js",
35
44
  "demo:message": "node scripts/demo-message-workflow.js",
36
- "demo:file": "node scripts/demo-file-workflow.js"
45
+ "demo:file": "node scripts/demo-file-workflow.js",
46
+ "prepublishOnly": "npm run test:all"
37
47
  },
38
48
  "files": [
49
+ "LICENSE",
50
+ "LICENSE-SDK-EXCEPTION",
39
51
  "SKILL.md",
40
52
  "server.json",
41
53
  "assets/cloudflare/worker-proxy.js",
42
54
  "assets/cloudflare/wrangler.toml.example",
43
55
  "references/advanced-diagnostics.md",
56
+ "references/client-config-examples.md",
44
57
  "references/mcp-tool-contract.md",
45
58
  "references/quickstart-and-compat.md",
46
59
  "references/vdo-ninja-p2p-data-notes.md",
@@ -61,6 +74,7 @@
61
74
  "node": ">=18"
62
75
  },
63
76
  "dependencies": {
64
- "@vdoninja/sdk": "^1.3.18"
77
+ "@roamhq/wrtc": "^0.9.1",
78
+ "@vdoninja/sdk": "^1.4.0"
65
79
  }
66
80
  }
@@ -27,10 +27,10 @@ LIVE_VDO_TEST=1 VDON_MCP_JOIN_TOKEN_SECRET=change_me npm run test:mcp:preset:mat
27
27
 
28
28
  Artifacts are written to:
29
29
 
30
- - `MCP/tests/artifacts/latest-preset-matrix-report.json`
31
- - `MCP/tests/artifacts/latest-preset-matrix-summary.txt`
32
- - `MCP/tests/artifacts/history/preset-matrix-*.json`
33
- - `MCP/tests/artifacts/history/preset-matrix-*.txt`
30
+ - `tests/artifacts/latest-preset-matrix-report.json`
31
+ - `tests/artifacts/latest-preset-matrix-summary.txt`
32
+ - `tests/artifacts/history/preset-matrix-*.json`
33
+ - `tests/artifacts/history/preset-matrix-*.txt`
34
34
 
35
35
  ## Soak / Matrix Knobs
36
36