@dolusoft/claude-collab 1.4.3 → 1.5.0
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 +70 -156
- package/dist/cli.js +360 -319
- package/dist/cli.js.map +1 -1
- package/dist/mcp-main.js +369 -317
- package/dist/mcp-main.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,236 +1,150 @@
|
|
|
1
1
|
# Claude Collab
|
|
2
2
|
|
|
3
|
-
Real-time
|
|
3
|
+
Real-time P2P collaboration between Claude Code terminals via MCP (Model Context Protocol).
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/@dolusoft/claude-collab)
|
|
6
6
|
[](https://opensource.org/licenses/MIT)
|
|
7
7
|
|
|
8
8
|
## Overview
|
|
9
9
|
|
|
10
|
-
Claude Collab
|
|
10
|
+
Claude Collab lets multiple Claude Code terminals communicate with each other in real-time over a local network. Terminals **automatically discover each other** via UDP multicast — no IP addresses, no port numbers, no hub server required.
|
|
11
11
|
|
|
12
12
|
```
|
|
13
|
-
|
|
14
|
-
│
|
|
15
|
-
│ Claude Code
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
┌──────────────────┐ ┌──────────────────┐ ┌──────────────────┐
|
|
14
|
+
│ alice │◄──────►│ bob │◄──────►│ charlie │
|
|
15
|
+
│ Claude Code │ │ Claude Code │ │ Claude Code │
|
|
16
|
+
└──────────────────┘ └──────────────────┘ └──────────────────┘
|
|
17
|
+
auto-discovered via UDP multicast (239.255.42.42)
|
|
18
18
|
```
|
|
19
19
|
|
|
20
|
-
##
|
|
20
|
+
## How It Works
|
|
21
21
|
|
|
22
|
-
- **
|
|
23
|
-
-
|
|
24
|
-
-
|
|
25
|
-
-
|
|
26
|
-
- **Auto-Hub**: Hub server starts automatically when needed
|
|
27
|
-
- **Zero Config**: Works out of the box with sensible defaults
|
|
22
|
+
- Each terminal joins a shared **multicast group** on the LAN (like a meeting table)
|
|
23
|
+
- When a terminal comes online it announces itself; others discover it automatically
|
|
24
|
+
- Direct WebSocket connections are established between peers — no central server
|
|
25
|
+
- When a terminal goes offline, peers detect it and remove it from the list
|
|
28
26
|
|
|
29
27
|
## Installation
|
|
30
28
|
|
|
31
|
-
|
|
29
|
+
### Option 1 — Without global install (recommended)
|
|
32
30
|
|
|
33
31
|
```bash
|
|
34
|
-
|
|
35
|
-
npx @dolusoft/claude-collab hub start
|
|
36
|
-
|
|
37
|
-
# Or add to Claude Code with auto-hub
|
|
38
|
-
claude mcp add claude-collab -- npx @dolusoft/claude-collab client --team frontend --auto-hub
|
|
32
|
+
claude mcp add claude-collab -- npx -y @dolusoft/claude-collab --name alice
|
|
39
33
|
```
|
|
40
34
|
|
|
41
|
-
|
|
35
|
+
Replace `alice` with your chosen name. That's it — run this once per machine.
|
|
42
36
|
|
|
43
|
-
###
|
|
37
|
+
### Option 2 — With global install
|
|
44
38
|
|
|
45
39
|
```bash
|
|
46
|
-
|
|
40
|
+
npm install -g @dolusoft/claude-collab
|
|
41
|
+
claude mcp add claude-collab -- claude-collab --name alice
|
|
47
42
|
```
|
|
48
43
|
|
|
49
|
-
|
|
44
|
+
> **Your name is saved permanently** in Claude Code's MCP config. Every time Claude Code opens, it starts as `alice` automatically — you never need to set it again.
|
|
50
45
|
|
|
51
|
-
|
|
46
|
+
## Quick Start
|
|
52
47
|
|
|
53
|
-
**
|
|
48
|
+
**Machine 1 (Alice):**
|
|
54
49
|
```bash
|
|
55
|
-
claude mcp add claude-collab -- npx @dolusoft/claude-collab
|
|
50
|
+
claude mcp add claude-collab -- npx -y @dolusoft/claude-collab --name alice
|
|
56
51
|
```
|
|
57
52
|
|
|
58
|
-
**
|
|
53
|
+
**Machine 2 (Bob):**
|
|
59
54
|
```bash
|
|
60
|
-
claude mcp add claude-collab -- npx @dolusoft/claude-collab
|
|
55
|
+
claude mcp add claude-collab -- npx -y @dolusoft/claude-collab --name bob
|
|
61
56
|
```
|
|
62
57
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
In your Claude Code session, you can now use these tools:
|
|
58
|
+
Open Claude Code on both machines. Within ~30 seconds they find each other automatically. Then just use the tools:
|
|
66
59
|
|
|
67
60
|
```
|
|
68
|
-
#
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
# Ask a question to another team
|
|
72
|
-
> "Ask the backend team: What's the response format for the /users endpoint?"
|
|
61
|
+
# Ask bob a question (alice's terminal)
|
|
62
|
+
ask("bob", "What's the API response format for /users?")
|
|
73
63
|
|
|
74
|
-
# Check incoming questions
|
|
75
|
-
|
|
64
|
+
# Check inbox for incoming questions
|
|
65
|
+
inbox()
|
|
76
66
|
|
|
77
67
|
# Reply to a question
|
|
78
|
-
|
|
68
|
+
reply("q_abc123", "It returns JSON: {id, name, email}")
|
|
79
69
|
```
|
|
80
70
|
|
|
81
71
|
## MCP Tools
|
|
82
72
|
|
|
83
|
-
| Tool | Description |
|
|
84
|
-
|
|
85
|
-
| `
|
|
86
|
-
| `
|
|
87
|
-
| `
|
|
88
|
-
| `
|
|
73
|
+
| Tool | Description |
|
|
74
|
+
|------|-------------|
|
|
75
|
+
| `ask` | Ask a peer a question. Waits up to 5 minutes for a response. |
|
|
76
|
+
| `inbox` | List questions waiting for your reply. |
|
|
77
|
+
| `reply` | Reply to a question by its ID. |
|
|
78
|
+
| `check_answer` | Manually check if an answer arrived for a question ID. |
|
|
79
|
+
| `get_info` | Show your name, port, local IPs, and connected peers. |
|
|
89
80
|
|
|
90
81
|
## Use Cases
|
|
91
82
|
|
|
92
83
|
### Bug Coordination
|
|
93
84
|
|
|
94
85
|
```
|
|
95
|
-
|
|
96
|
-
|
|
86
|
+
alice: ask("bob", "We're seeing duplicate SignalR messages — can you check if
|
|
87
|
+
OnConnectedAsync is being called multiple times on your side?")
|
|
97
88
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
conn_xyz789 - 10:00:01
|
|
101
|
-
Looks like React StrictMode is causing double connections."
|
|
89
|
+
bob: reply("q_abc", "Found it. Logs show 2 connection IDs for the same user —
|
|
90
|
+
React StrictMode is causing double connections.")
|
|
102
91
|
```
|
|
103
92
|
|
|
104
93
|
### API Design Sync
|
|
105
94
|
|
|
106
95
|
```
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
Backend: "Here's the schema:
|
|
110
|
-
```json
|
|
111
|
-
{
|
|
112
|
-
\"items\": [{\"id\": string, \"quantity\": number}],
|
|
113
|
-
\"paymentMethod\": \"card\" | \"paypal\"
|
|
114
|
-
}
|
|
115
|
-
```"
|
|
116
|
-
```
|
|
96
|
+
alice: ask("bob", "What should the request payload look like for checkout?")
|
|
117
97
|
|
|
118
|
-
|
|
98
|
+
bob: reply("q_xyz", "Here's the schema:
|
|
99
|
+
{ items: [{id: string, quantity: number}], paymentMethod: 'card' | 'paypal' }")
|
|
100
|
+
```
|
|
119
101
|
|
|
120
|
-
|
|
102
|
+
## Network Requirements
|
|
121
103
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
| `CLAUDE_COLLAB_HOST` | `localhost` | Hub server host |
|
|
104
|
+
- All machines must be on the **same local network** (LAN, office Wi-Fi, home network, or VPN)
|
|
105
|
+
- UDP multicast port `11776` must be reachable within the subnet (not blocked between peers)
|
|
106
|
+
- WebSocket port (auto-selected in range `11700–11750`) needs to be accessible on the local network
|
|
126
107
|
|
|
127
|
-
|
|
108
|
+
On first run, Windows will ask "Allow this app on the network?" — click **Allow**. This is a one-time prompt per machine.
|
|
128
109
|
|
|
129
|
-
|
|
130
|
-
# Hub server
|
|
131
|
-
npx @dolusoft/claude-collab hub start --port 9999 --host localhost
|
|
110
|
+
## Configuration
|
|
132
111
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
112
|
+
| Env variable | Default | Description |
|
|
113
|
+
|---|---|---|
|
|
114
|
+
| `CLAUDE_COLLAB_PORT_MIN` | `11700` | WS port range start |
|
|
115
|
+
| `CLAUDE_COLLAB_PORT_MAX` | `11750` | WS port range end |
|
|
136
116
|
|
|
137
117
|
## Architecture
|
|
138
118
|
|
|
139
|
-
Claude Collab uses a hub-and-spoke architecture:
|
|
140
|
-
|
|
141
|
-
```
|
|
142
|
-
┌─────────────────────────────────┐
|
|
143
|
-
│ HUB SERVER │
|
|
144
|
-
│ (WebSocket, port 9999) │
|
|
145
|
-
│ │
|
|
146
|
-
│ ┌─────────┐ ┌─────────────┐ │
|
|
147
|
-
│ │ Teams │ │ Questions │ │
|
|
148
|
-
│ │ Members │ │ Answers │ │
|
|
149
|
-
│ └─────────┘ └─────────────┘ │
|
|
150
|
-
└──────────┬──────────────────────┘
|
|
151
|
-
│
|
|
152
|
-
┌────────────────┼────────────────┐
|
|
153
|
-
│ │ │
|
|
154
|
-
▼ ▼ ▼
|
|
155
|
-
┌──────────┐ ┌──────────┐ ┌──────────┐
|
|
156
|
-
│ MCP │ │ MCP │ │ MCP │
|
|
157
|
-
│ Client 1 │ │ Client 2 │ │ Client N │
|
|
158
|
-
│(frontend)│ │(backend) │ │ (devops) │
|
|
159
|
-
└──────────┘ └──────────┘ └──────────┘
|
|
160
|
-
│ │ │
|
|
161
|
-
▼ ▼ ▼
|
|
162
|
-
┌──────────┐ ┌──────────┐ ┌──────────┐
|
|
163
|
-
│ Claude │ │ Claude │ │ Claude │
|
|
164
|
-
│ Code │ │ Code │ │ Code │
|
|
165
|
-
│Terminal 1│ │Terminal 2│ │Terminal N│
|
|
166
|
-
└──────────┘ └──────────┘ └──────────┘
|
|
167
|
-
```
|
|
168
|
-
|
|
169
|
-
### Domain-Driven Design
|
|
170
|
-
|
|
171
|
-
The codebase follows DDD principles with 4 layers:
|
|
172
|
-
|
|
173
119
|
```
|
|
174
120
|
src/
|
|
175
|
-
├── domain/
|
|
176
|
-
├── application/
|
|
177
|
-
├── infrastructure/
|
|
178
|
-
|
|
121
|
+
├── domain/ # Entities, Value Objects, Domain Events
|
|
122
|
+
├── application/ # Use Cases, DTOs
|
|
123
|
+
├── infrastructure/
|
|
124
|
+
│ ├── p2p/
|
|
125
|
+
│ │ ├── multicast-discovery.ts # UDP multicast peer discovery
|
|
126
|
+
│ │ ├── p2p-node.ts # WebSocket P2P node + ICollabClient
|
|
127
|
+
│ │ └── p2p-message-protocol.ts # Wire protocol types
|
|
128
|
+
│ └── terminal-injector/ # Injects questions into Claude Code terminal
|
|
129
|
+
└── presentation/
|
|
130
|
+
└── mcp/ # MCP server + tools
|
|
179
131
|
```
|
|
180
132
|
|
|
181
133
|
## Development
|
|
182
134
|
|
|
183
|
-
### Prerequisites
|
|
184
|
-
|
|
185
|
-
- Node.js 20+
|
|
186
|
-
- pnpm (recommended) or npm
|
|
187
|
-
|
|
188
|
-
### Setup
|
|
189
|
-
|
|
190
135
|
```bash
|
|
191
136
|
git clone https://github.com/dolusoft/claude-collab.git
|
|
192
137
|
cd claude-collab
|
|
193
138
|
pnpm install
|
|
139
|
+
pnpm build # build
|
|
140
|
+
pnpm test # run tests
|
|
141
|
+
pnpm dev # watch mode
|
|
194
142
|
```
|
|
195
143
|
|
|
196
|
-
### Commands
|
|
197
|
-
|
|
198
|
-
```bash
|
|
199
|
-
pnpm build # Build the project
|
|
200
|
-
pnpm dev # Watch mode
|
|
201
|
-
pnpm test # Run tests
|
|
202
|
-
pnpm lint # Lint code
|
|
203
|
-
pnpm format # Format code
|
|
204
|
-
```
|
|
205
|
-
|
|
206
|
-
### Testing
|
|
207
|
-
|
|
208
|
-
```bash
|
|
209
|
-
pnpm test # Run all tests
|
|
210
|
-
pnpm test:watch # Watch mode
|
|
211
|
-
pnpm test:coverage # With coverage
|
|
212
|
-
```
|
|
213
|
-
|
|
214
|
-
## Contributing
|
|
215
|
-
|
|
216
|
-
Contributions are welcome! Please read our [Contributing Guide](CONTRIBUTING.md) first.
|
|
217
|
-
|
|
218
|
-
1. Fork the repository
|
|
219
|
-
2. Create a feature branch (`git checkout -b feature/amazing-feature`)
|
|
220
|
-
3. Commit your changes (`git commit -m 'Add amazing feature'`)
|
|
221
|
-
4. Push to the branch (`git push origin feature/amazing-feature`)
|
|
222
|
-
5. Open a Pull Request
|
|
223
|
-
|
|
224
144
|
## License
|
|
225
145
|
|
|
226
|
-
MIT
|
|
227
|
-
|
|
228
|
-
## Acknowledgments
|
|
229
|
-
|
|
230
|
-
- Built with [Model Context Protocol (MCP)](https://modelcontextprotocol.io)
|
|
231
|
-
- Inspired by the need for better AI-assisted team collaboration
|
|
232
|
-
- Created by [Dolusoft](https://github.com/dolusoft)
|
|
146
|
+
MIT — see [LICENSE](LICENSE) for details.
|
|
233
147
|
|
|
234
148
|
---
|
|
235
149
|
|
|
236
|
-
|
|
150
|
+
Created by [Dolusoft](https://github.com/dolusoft) · Built with [Model Context Protocol](https://modelcontextprotocol.io)
|