session-collab-mcp 2.1.0 → 2.3.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 +123 -54
- package/dist/{chunk-V4APNPXF.js → chunk-TFGXE3EI.js} +261 -17
- package/dist/chunk-TFGXE3EI.js.map +1 -0
- package/dist/cli.js +4 -11
- package/dist/cli.js.map +1 -1
- package/dist/http/cli.js +272 -84
- package/dist/http/cli.js.map +1 -1
- package/dist/http/client-cli.js +80 -6
- package/dist/http/client-cli.js.map +1 -1
- package/package.json +15 -8
- package/dist/chunk-V4APNPXF.js.map +0 -1
package/README.md
CHANGED
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
[](https://www.npmjs.com/package/session-collab-mcp)
|
|
4
4
|
[](https://opensource.org/licenses/MIT)
|
|
5
5
|
|
|
6
|
-
A Model Context Protocol (MCP) server
|
|
6
|
+
A provider-agnostic Model Context Protocol (MCP) server that prevents conflicts when multiple agent sessions work on the same codebase simultaneously.
|
|
7
7
|
|
|
8
8
|
## Problem
|
|
9
9
|
|
|
10
|
-
When using parallel
|
|
10
|
+
When using parallel coding-agent sessions or multi-agent workflows:
|
|
11
11
|
|
|
12
12
|
- Session A is refactoring some code
|
|
13
13
|
- Session B doesn't know and thinks the code "has issues" - deletes or reverts it
|
|
@@ -25,29 +25,20 @@ Session Collab MCP provides a **Work-in-Progress (WIP) Registry** that allows se
|
|
|
25
25
|
4. **Protect** - Guard critical files from accidental changes
|
|
26
26
|
5. **Release** - Free files when done
|
|
27
27
|
|
|
28
|
-
##
|
|
28
|
+
## Positioning
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
`session-collab-mcp` has two layers:
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
- **Core server**: provider-agnostic MCP server over stdio or HTTP JSON-RPC
|
|
33
|
+
- **Optional integrations**: provider-specific packaging such as the Claude Code plugin in [`plugin/`](plugin/)
|
|
33
34
|
|
|
34
|
-
|
|
35
|
-
# Add marketplace
|
|
36
|
-
/plugin marketplace add leaf76/session-collab-mcp
|
|
35
|
+
The core server should be the default mental model. Claude Code is one integration target, not the product boundary.
|
|
37
36
|
|
|
38
|
-
|
|
39
|
-
/plugin install session-collab@session-collab-plugins
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
The plugin includes:
|
|
43
|
-
- **MCP Server**: Automatically configured
|
|
44
|
-
- **Hooks**: SessionStart and PreToolUse reminders
|
|
45
|
-
- **Skills**: `collab-start` for full initialization
|
|
46
|
-
- **Commands**: `/session-collab:status` and `/session-collab:end`
|
|
37
|
+
## Installation
|
|
47
38
|
|
|
48
|
-
### Option
|
|
39
|
+
### Option 1: Generic MCP Client over stdio
|
|
49
40
|
|
|
50
|
-
|
|
41
|
+
Use this with any MCP client that can launch a local stdio server:
|
|
51
42
|
|
|
52
43
|
```json
|
|
53
44
|
{
|
|
@@ -60,34 +51,62 @@ Add to your `~/.claude.json`:
|
|
|
60
51
|
}
|
|
61
52
|
```
|
|
62
53
|
|
|
63
|
-
|
|
54
|
+
The exact config wrapper depends on your MCP client, but the server contract is the same.
|
|
64
55
|
|
|
65
|
-
|
|
66
|
-
npm install -g session-collab-mcp
|
|
67
|
-
```
|
|
56
|
+
### Option 2: HTTP Server + CLI
|
|
68
57
|
|
|
69
|
-
|
|
58
|
+
Use this when your client prefers MCP over HTTP JSON-RPC or when you want a generic shell-friendly wrapper:
|
|
70
59
|
|
|
71
60
|
```bash
|
|
72
61
|
# Start HTTP server
|
|
73
62
|
session-collab-http --host 127.0.0.1 --port 8765
|
|
74
63
|
|
|
75
|
-
# CLI wrapper (
|
|
64
|
+
# CLI wrapper (convenience REST client)
|
|
76
65
|
session-collab health
|
|
77
66
|
session-collab tools
|
|
67
|
+
session-collab doctor
|
|
78
68
|
session-collab call --name collab_session_start --args '{"project_root":"/repo","name":"demo"}'
|
|
79
69
|
```
|
|
80
70
|
|
|
71
|
+
For MCP-over-HTTP clients, use `POST /mcp` with JSON-RPC requests. The `/v1/*` endpoints are a convenience REST facade for lightweight automation and shell usage.
|
|
72
|
+
|
|
73
|
+
### Option 3: Claude Code Plugin (Optional Integration)
|
|
74
|
+
|
|
75
|
+
Install as a Claude Code plugin only if Claude Code is your MCP client and you want automatic server setup, hooks, and skills:
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
# Add marketplace
|
|
79
|
+
/plugin marketplace add leaf76/session-collab-mcp
|
|
80
|
+
|
|
81
|
+
# Install plugin
|
|
82
|
+
/plugin install session-collab@session-collab-plugins
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
The plugin includes:
|
|
86
|
+
- **MCP Server**: Automatically configured
|
|
87
|
+
- **Hooks**: SessionStart, Stop, and PreCompact reminders
|
|
88
|
+
- **Skills**: `collab-start` for full initialization
|
|
89
|
+
- **Commands**: `/session-collab:status` and `/session-collab:end`
|
|
90
|
+
|
|
91
|
+
### Option 4: Global Installation
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
npm install -g session-collab-mcp
|
|
95
|
+
```
|
|
96
|
+
|
|
81
97
|
## Features
|
|
82
98
|
|
|
83
|
-
###
|
|
99
|
+
### Guided Session Workflow
|
|
84
100
|
|
|
85
|
-
|
|
101
|
+
The MCP tools give you a stable collaboration workflow across providers:
|
|
86
102
|
|
|
87
|
-
1.
|
|
88
|
-
2. Check
|
|
89
|
-
3.
|
|
90
|
-
4.
|
|
103
|
+
1. Start a session with `collab_session_start`
|
|
104
|
+
2. Check files with `collab_claim(action="check")`
|
|
105
|
+
3. Reserve files with `collab_claim(action="create")`; conflicting claims are blocked by default
|
|
106
|
+
4. Update visible progress with `collab_session_update`
|
|
107
|
+
5. Save important context with `collab_memory_save`
|
|
108
|
+
6. Release claims with `collab_claim(action="release")`
|
|
109
|
+
7. End the session with `collab_session_end`
|
|
91
110
|
|
|
92
111
|
### Working Memory
|
|
93
112
|
|
|
@@ -102,11 +121,11 @@ Context persistence that survives context compaction:
|
|
|
102
121
|
|
|
103
122
|
### File Protection
|
|
104
123
|
|
|
105
|
-
Guard
|
|
124
|
+
Guard important plan files or created files from accidental deletion:
|
|
106
125
|
|
|
107
|
-
- Register protected
|
|
108
|
-
-
|
|
109
|
-
-
|
|
126
|
+
- Register a protected plan with `collab_protect(action="register", type="plan", ...)`
|
|
127
|
+
- Register a created file with `collab_protect(action="register", type="file", ...)`
|
|
128
|
+
- Check protection status before deleting or replacing a file
|
|
110
129
|
|
|
111
130
|
### Conflict Handling Modes
|
|
112
131
|
|
|
@@ -129,13 +148,14 @@ Configure behavior with `collab_config`:
|
|
|
129
148
|
|
|
130
149
|
## MCP Tools Reference
|
|
131
150
|
|
|
132
|
-
### Session Management
|
|
151
|
+
### Session Management
|
|
133
152
|
|
|
134
153
|
| Tool | Purpose |
|
|
135
154
|
|------|---------|
|
|
136
155
|
| `collab_session_start` | Register a new session |
|
|
137
156
|
| `collab_session_end` | End session and release all claims |
|
|
138
|
-
| `collab_session_list` | List active sessions |
|
|
157
|
+
| `collab_session_list` | List active sessions with current task and active claim summaries |
|
|
158
|
+
| `collab_session_update` | Update heartbeat, current task, todos, and progress |
|
|
139
159
|
| `collab_config` | Configure session behavior |
|
|
140
160
|
| `collab_status` | Get session status summary |
|
|
141
161
|
|
|
@@ -143,7 +163,7 @@ Configure behavior with `collab_config`:
|
|
|
143
163
|
|
|
144
164
|
| Tool | Actions |
|
|
145
165
|
|------|---------|
|
|
146
|
-
| `collab_claim` | `create`, `check`, `release`, `list` (check: `exclude_self` defaults to true) |
|
|
166
|
+
| `collab_claim` | `create`, `check`, `release`, `list` (check: `exclude_self` defaults to true; create blocks conflicts unless `allow_conflicts=true`) |
|
|
147
167
|
|
|
148
168
|
### Working Memory (3 tools)
|
|
149
169
|
|
|
@@ -167,10 +187,11 @@ Configure behavior with `collab_config`:
|
|
|
167
187
|
|
|
168
188
|
### HTTP API (v1)
|
|
169
189
|
|
|
170
|
-
|
|
190
|
+
`/v1/*` endpoints map 1:1 to MCP tools and return JSON responses with `trace_id` on failures:
|
|
171
191
|
|
|
172
192
|
- `POST /v1/sessions/start` → `collab_session_start`
|
|
173
193
|
- `POST /v1/sessions/end` → `collab_session_end`
|
|
194
|
+
- `POST /v1/sessions/update` → `collab_session_update`
|
|
174
195
|
- `GET /v1/sessions` → `collab_session_list`
|
|
175
196
|
- `POST /v1/config` → `collab_config`
|
|
176
197
|
- `GET /v1/status` → `collab_status`
|
|
@@ -186,6 +207,13 @@ Core endpoints map 1:1 to MCP tools:
|
|
|
186
207
|
- `GET /v1/protect/list` → `collab_protect` (list)
|
|
187
208
|
- `POST /v1/tools/call` / `GET /v1/tools` (generic access)
|
|
188
209
|
|
|
210
|
+
### MCP over HTTP
|
|
211
|
+
|
|
212
|
+
- `POST /mcp` accepts JSON-RPC `initialize`, `tools/list`, and `tools/call` requests
|
|
213
|
+
- `GET /mcp` currently returns a clear "stream not supported" response instead of pretending to be full Streamable HTTP SSE
|
|
214
|
+
- Localhost binds enforce Host and Origin validation
|
|
215
|
+
- Non-local binds require both `SESSION_COLLAB_HTTP_TOKEN` and an allowed-host list via `SESSION_COLLAB_ALLOWED_HOSTS` or repeated `--allowed-host`
|
|
216
|
+
|
|
189
217
|
## Usage Examples
|
|
190
218
|
|
|
191
219
|
### Basic Workflow
|
|
@@ -193,17 +221,22 @@ Core endpoints map 1:1 to MCP tools:
|
|
|
193
221
|
```bash
|
|
194
222
|
# Session A starts working
|
|
195
223
|
collab_session_start(project_root="/my/project", name="feature-auth")
|
|
196
|
-
collab_claim(action="create", files=["src/auth.ts"], intent="Adding JWT support")
|
|
224
|
+
collab_claim(session_id="session-a", action="create", files=["src/auth.ts"], intent="Adding JWT support")
|
|
225
|
+
collab_session_update(session_id="session-a", current_task="Adding JWT support")
|
|
197
226
|
|
|
198
227
|
# Session B checks before editing
|
|
199
|
-
collab_claim(action="check", files=["src/auth.ts"])
|
|
228
|
+
collab_claim(session_id="session-b", action="check", files=["src/auth.ts"])
|
|
200
229
|
# Result: "CONFLICT: src/auth.ts is claimed by 'feature-auth'"
|
|
201
230
|
|
|
231
|
+
# create is also safe by default; use allow_conflicts=true only after coordination
|
|
232
|
+
collab_claim(session_id="session-b", action="create", files=["src/auth.ts"], intent="Coordinated auth work")
|
|
233
|
+
# Result: "Claim not created. 1 conflict(s) detected."
|
|
234
|
+
|
|
202
235
|
# If you want to include your own claims in the check
|
|
203
|
-
collab_claim(action="check", files=["src/auth.ts"], exclude_self=false)
|
|
236
|
+
collab_claim(session_id="session-a", action="check", files=["src/auth.ts"], exclude_self=false)
|
|
204
237
|
|
|
205
238
|
# Session A finishes
|
|
206
|
-
collab_claim(action="release", claim_id="...")
|
|
239
|
+
collab_claim(session_id="session-a", action="release", claim_id="...")
|
|
207
240
|
```
|
|
208
241
|
|
|
209
242
|
### Working Memory
|
|
@@ -211,6 +244,7 @@ collab_claim(action="release", claim_id="...")
|
|
|
211
244
|
```bash
|
|
212
245
|
# Save a finding
|
|
213
246
|
collab_memory_save(
|
|
247
|
+
session_id="abc123",
|
|
214
248
|
category="finding",
|
|
215
249
|
key="auth_bug_root_cause",
|
|
216
250
|
content="Missing token validation in refresh flow",
|
|
@@ -218,26 +252,29 @@ collab_memory_save(
|
|
|
218
252
|
)
|
|
219
253
|
|
|
220
254
|
# Recall active memories
|
|
221
|
-
collab_memory_recall(
|
|
255
|
+
collab_memory_recall(session_id="abc123", active=true)
|
|
222
256
|
```
|
|
223
257
|
|
|
224
258
|
### File Protection
|
|
225
259
|
|
|
226
260
|
```bash
|
|
227
|
-
# Protect
|
|
261
|
+
# Protect a plan document
|
|
228
262
|
collab_protect(
|
|
229
263
|
action="register",
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
264
|
+
session_id="abc123",
|
|
265
|
+
type="plan",
|
|
266
|
+
file_path="docs/feature-plan.md",
|
|
267
|
+
title="Feature plan",
|
|
268
|
+
content_summary="Steps, risks, and rollout notes"
|
|
233
269
|
)
|
|
234
270
|
|
|
235
271
|
# Check before editing
|
|
236
272
|
collab_protect(
|
|
237
273
|
action="check",
|
|
238
|
-
|
|
274
|
+
session_id="abc123",
|
|
275
|
+
file_path="docs/feature-plan.md"
|
|
239
276
|
)
|
|
240
|
-
# Result: "
|
|
277
|
+
# Result: "Protected (plan). Confirm before deleting."
|
|
241
278
|
```
|
|
242
279
|
|
|
243
280
|
### Status Monitoring
|
|
@@ -248,7 +285,7 @@ collab_status(session_id="abc123")
|
|
|
248
285
|
# Result: {
|
|
249
286
|
# session: { id: "abc123", name: "feature-auth", status: "active" },
|
|
250
287
|
# claims: [...],
|
|
251
|
-
#
|
|
288
|
+
# other_sessions: 1,
|
|
252
289
|
# message: "Session active. 2 claim(s), 5 memories."
|
|
253
290
|
# }
|
|
254
291
|
```
|
|
@@ -269,7 +306,8 @@ Version 2.0 introduces breaking changes with a simplified API. See [MIGRATION.md
|
|
|
269
306
|
All data is stored locally in `~/.claude/session-collab/collab.db` (SQLite).
|
|
270
307
|
|
|
271
308
|
- No remote server required
|
|
272
|
-
-
|
|
309
|
+
- Localhost HTTP usage works without an API token
|
|
310
|
+
- Non-local HTTP binds require `SESSION_COLLAB_HTTP_TOKEN`
|
|
273
311
|
- Works offline
|
|
274
312
|
- Uses WAL mode for multi-process safety
|
|
275
313
|
|
|
@@ -306,6 +344,8 @@ npm run start:dev # Start in development mode
|
|
|
306
344
|
npm run typecheck # Run TypeScript type checking
|
|
307
345
|
npm run lint # Run ESLint
|
|
308
346
|
npm run test # Run tests with Vitest
|
|
347
|
+
npm run test:http # Run HTTP integration tests
|
|
348
|
+
npm run test:release # Run release gate: typecheck, lint, tests, HTTP tests, npm pack dry-run
|
|
309
349
|
```
|
|
310
350
|
|
|
311
351
|
### HTTP Integration Tests
|
|
@@ -313,16 +353,28 @@ npm run test # Run tests with Vitest
|
|
|
313
353
|
HTTP integration tests require a local listen port. Enable them with:
|
|
314
354
|
|
|
315
355
|
```bash
|
|
316
|
-
|
|
356
|
+
npm run test:http
|
|
357
|
+
```
|
|
358
|
+
|
|
359
|
+
### HTTP CLI Doctor
|
|
360
|
+
|
|
361
|
+
When using the HTTP server, validate the running server with:
|
|
362
|
+
|
|
363
|
+
```bash
|
|
364
|
+
session-collab doctor --base-url http://127.0.0.1:8765
|
|
317
365
|
```
|
|
318
366
|
|
|
367
|
+
### Historical Notes
|
|
368
|
+
|
|
369
|
+
The changelog entries below document historical milestones, including tools and workflows that were removed before the current v2 API. Treat the tool tables and examples above as the source of truth for the current public surface.
|
|
370
|
+
|
|
319
371
|
### Project Structure
|
|
320
372
|
|
|
321
373
|
```
|
|
322
374
|
session-collab-mcp/
|
|
323
375
|
├── bin/ # Executable entry point
|
|
324
376
|
├── migrations/ # SQLite migration files
|
|
325
|
-
├── plugin/ # Claude Code
|
|
377
|
+
├── plugin/ # Optional Claude Code integration
|
|
326
378
|
├── src/
|
|
327
379
|
│ ├── cli.ts # CLI entry point
|
|
328
380
|
│ ├── constants.ts # Version and server instructions
|
|
@@ -340,6 +392,23 @@ session-collab-mcp/
|
|
|
340
392
|
|
|
341
393
|
## Changelog
|
|
342
394
|
|
|
395
|
+
### v2.3.0
|
|
396
|
+
|
|
397
|
+
- Add `collab_session_update` for heartbeat, current task, todo, and progress reporting
|
|
398
|
+
- Enrich `collab_session_list` with current task and active claim summaries
|
|
399
|
+
- Make `collab_claim(action="create")` block conflicts by default; use `allow_conflicts=true` only after coordination
|
|
400
|
+
- Add `session-collab doctor` for HTTP server health and tool-surface checks
|
|
401
|
+
- Add `npm run test:http` and `npm run test:release` release gates
|
|
402
|
+
- Update dev test tooling to clear npm audit findings
|
|
403
|
+
|
|
404
|
+
### v2.1.0
|
|
405
|
+
|
|
406
|
+
- Add HTTP server + CLI wrapper for universal AI CLI usage
|
|
407
|
+
- Add HTTP API endpoints and utils tests
|
|
408
|
+
- Add legacy entry for deprecated schemas/queries (optional build)
|
|
409
|
+
- Improve claim conflict accuracy and release summaries
|
|
410
|
+
- Expand test coverage across MCP tools and DB flows
|
|
411
|
+
|
|
343
412
|
### v2.0.0 (Breaking)
|
|
344
413
|
|
|
345
414
|
- **Major Simplification**: Reduced from 50+ tools to 10 core tools
|