Session Collab MCP
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Session Collab MCPstart a session for project alpha"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Session Collab MCP
A provider-agnostic Model Context Protocol (MCP) server that prevents conflicts when multiple agent sessions work on the same codebase simultaneously.
Problem
When using parallel coding-agent sessions or multi-agent workflows:
Session A is refactoring some code
Session B doesn't know and thinks the code "has issues" - deletes or reverts it
Session A's work disappears
Root cause: No synchronization mechanism for "work intent" between sessions.
Related MCP server: agent-comm
Solution
Session Collab MCP provides a Work-in-Progress (WIP) Registry that allows sessions to:
Declare - Announce which files you're about to modify
Check - Verify no other session is working on the same files
Persist - Save context that survives context compaction
Protect - Guard critical files from accidental changes
Release - Free files when done
Positioning
session-collab-mcp has two layers:
Core server: provider-agnostic MCP server over stdio or HTTP JSON-RPC
Optional integrations: provider-specific packaging such as the Claude Code plugin in
plugin/
The core server should be the default mental model. Claude Code is one integration target, not the product boundary.
Installation
Option 1: Generic MCP Client over stdio
Use this with any MCP client that can launch a local stdio server:
{
"mcpServers": {
"session-collab": {
"command": "npx",
"args": ["-y", "session-collab-mcp@latest"]
}
}
}The exact config wrapper depends on your MCP client, but the server contract is the same.
Option 2: HTTP Server + CLI
Use this when your client prefers MCP over HTTP JSON-RPC or when you want a generic shell-friendly wrapper:
# Start HTTP server
session-collab-http --host 127.0.0.1 --port 8765
# CLI wrapper (convenience REST client)
session-collab health
session-collab tools
session-collab doctor
session-collab call --name collab_session_start --args '{"project_root":"/repo","name":"demo"}'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.
Option 3: Claude Code Plugin (Optional Integration)
Install as a Claude Code plugin only if Claude Code is your MCP client and you want automatic server setup, hooks, and skills:
# Add marketplace
/plugin marketplace add leaf76/session-collab-mcp
# Install plugin
/plugin install session-collab@session-collab-pluginsThe plugin includes:
MCP Server: Automatically configured
Hooks: SessionStart, Stop, and PreCompact reminders
Skills:
collab-startfor full initializationCommands:
/session-collab:statusand/session-collab:end
Option 4: Global Installation
npm install -g session-collab-mcpFeatures
Guided Session Workflow
The MCP tools give you a stable collaboration workflow across providers:
Start with
collab_session_startonly for non-trivial / multi-session work (restore_contextdefaults false; samename+project reuses session)Reserve files with
collab_claim(action="create")in one batch (atomic claim-or-block; paths normalized to project_root).checkis optional probe-onlyUpdate progress with
collab_session_updatesparingly (milestones)Save short findings/decisions with
collab_memory_save(≤800 chars; not a long-term vault)Release with
collab_claim(action="release")End with
collab_session_end
Token-friendly defaults: list/status/claim happy-path are compact unless detail=true.
Local MCP + plugin skills
npm run install:local # build dist + sync plugin skills/commands into Claude cachePoint your MCP config at dist/cli.js (this repo). Restart the host after install.
Working Memory
Context persistence that survives context compaction:
Findings: Bug root causes, investigation results
Decisions: Architectural choices, design decisions
State: Current implementation status
Todos: Action items and tasks
Important: Critical information to preserve
Context: Background context for the session
File Protection
Guard important plan files or created files from accidental deletion:
Register a protected plan with
collab_protect(action="register", type="plan", ...)Register a created file with
collab_protect(action="register", type="file", ...)Check protection status before deleting or replacing a file
Conflict Handling Modes
Configure behavior with collab_config:
Mode | Behavior |
| Block conflicting claims and require user coordination before editing |
| Claim non-conflicting files or symbols, queue blocked files, and expose coordination requests |
| Allow overlapping claims only with |
In smart mode, prefer symbol-level claims when working inside a file that another session has claimed. Same-file work can proceed when claimed symbols do not overlap. If overlap cannot be proven safe, collab_claim(action="create") returns waiting_for_coordination or partial_claim_created with:
claimed_files: files reserved by the callersafe_files: files that can be edited nowblocked_files: files that need coordination firstcoordination_requests: queue entries visible throughcollab_statusandcollab_session_list
Auto-Release Options
Option | Default | Description |
|
| Auto-release claims after Edit/Write |
|
| Auto-release claims exceeding threshold |
|
| Hours before claim is considered stale |
|
| Grace period for stale release |
MCP Tools Reference
Session Management
Tool | Purpose |
| Register a session ( |
| End session and release all claims |
| List sessions (summary by default; |
| Update heartbeat, current task, todos, and progress |
| Configure session behavior |
| Session status (counts by default; |
Claims (1 unified tool)
Tool | Actions |
|
|
Working Memory (3 tools)
Tool | Purpose |
| Save context (upsert) |
| Recall context |
| Clear memories |
Protection (1 unified tool)
Tool | Actions |
|
|
Status Monitoring
Tool | Purpose |
| Unified session status |
HTTP API (v1)
/v1/* endpoints map 1:1 to MCP tools and return JSON responses with trace_id on failures:
POST /v1/sessions/start→collab_session_startPOST /v1/sessions/end→collab_session_endPOST /v1/sessions/update→collab_session_updateGET /v1/sessions→collab_session_listPOST /v1/config→collab_configGET /v1/status→collab_statusPOST /v1/claims→collab_claim(create)POST /v1/claims/check→collab_claim(check)POST /v1/claims/release→collab_claim(release)GET /v1/claims→collab_claim(list)POST /v1/memory/save→collab_memory_savePOST /v1/memory/recall→collab_memory_recallPOST /v1/memory/clear→collab_memory_clearPOST /v1/protect/register→collab_protect(register)POST /v1/protect/check→collab_protect(check)GET /v1/protect/list→collab_protect(list)POST /v1/tools/call/GET /v1/tools(generic access)
MCP over HTTP
POST /mcpaccepts JSON-RPCinitialize,tools/list, andtools/callrequestsGET /mcpcurrently returns a clear "stream not supported" response instead of pretending to be full Streamable HTTP SSELocalhost binds enforce Host and Origin validation
Non-local binds require both
SESSION_COLLAB_HTTP_TOKENand an allowed-host list viaSESSION_COLLAB_ALLOWED_HOSTSor repeated--allowed-host
Usage Examples
Basic Workflow
# Session A starts working
collab_session_start(project_root="/my/project", name="feature-auth")
collab_claim(session_id="session-a", action="create", files=["src/auth.ts"], intent="Adding JWT support")
collab_session_update(session_id="session-a", current_task="Adding JWT support")
# Session B checks before editing
collab_claim(session_id="session-b", action="check", files=["src/auth.ts"])
# Result: "CONFLICT: src/auth.ts is claimed by 'feature-auth'"
# create in smart mode queues blocked files instead of editing over the owner
collab_claim(session_id="session-b", action="create", files=["src/auth.ts"], intent="Coordinated auth work")
# Result: status="waiting_for_coordination", blocked_files=["src/auth.ts"]
# If only a different symbol is needed, claim that symbol explicitly
collab_claim(
session_id="session-b",
action="create",
symbols=[{ file="src/auth.ts", symbols=["refreshToken"], symbol_type="function" }],
intent="Update refresh token"
)
# Result: status="created" if no claimed symbol overlaps
# If you want to include your own claims in the check
collab_claim(session_id="session-a", action="check", files=["src/auth.ts"], exclude_self=false)
# Session A finishes
collab_claim(session_id="session-a", action="release", claim_id="...")Working Memory
# Save a finding
collab_memory_save(
session_id="abc123",
category="finding",
key="auth_bug_root_cause",
content="Missing token validation in refresh flow",
priority=80
)
# Recall active memories
collab_memory_recall(session_id="abc123", active=true)File Protection
# Protect a plan document
collab_protect(
action="register",
session_id="abc123",
type="plan",
file_path="docs/feature-plan.md",
title="Feature plan",
content_summary="Steps, risks, and rollout notes"
)
# Check before editing
collab_protect(
action="check",
session_id="abc123",
file_path="docs/feature-plan.md"
)
# Result: "Protected (plan). Confirm before deleting."Status Monitoring
# Get session status
collab_status(session_id="abc123")
# Result: {
# session: { id: "abc123", name: "feature-auth", status: "active" },
# claims: [...],
# other_sessions: 1,
# message: "Session active. 2 claim(s), 5 memories."
# }Migration from v1.x
Version 2.0 introduces breaking changes with a simplified API. See MIGRATION.md for detailed migration instructions.
Key Changes
Tool Consolidation: 50+ tools → 10 core tools
Action-Based Interface: Single tools with multiple actions
Simplified Responses: Cleaner, flatter response formats
Removed Features: LSP integration, messaging, notifications, queuing
Data Storage
All data is stored locally in ~/.claude/session-collab/collab.db (SQLite).
No remote server required
Localhost HTTP usage works without an API token
Non-local HTTP binds require
SESSION_COLLAB_HTTP_TOKENWorks offline
Uses WAL mode for multi-process safety
Development
Prerequisites
Node.js 18+
npm or yarn
Setup
npm install
npm run buildLegacy Build (Optional)
Legacy schemas/queries are kept out of the default bundle. To include a legacy entry for compatibility:
SESSION_COLLAB_INCLUDE_LEGACY=true npm run buildMaintenance note: legacy exports are for backward compatibility only and are not exposed in the v2 tool list.
Scripts
npm run build # Build with tsup
npm run start # Start the MCP server
npm run start:dev # Start in development mode
npm run typecheck # Run TypeScript type checking
npm run lint # Run ESLint
npm run test # Run tests with Vitest
npm run test:http # Run HTTP integration tests
npm run test:release # Run release gate: typecheck, lint, tests, HTTP tests, npm pack dry-runHTTP Integration Tests
HTTP integration tests require a local listen port. Enable them with:
npm run test:httpHTTP CLI Doctor
When using the HTTP server, validate the running server with:
session-collab doctor --base-url http://127.0.0.1:8765Historical Notes
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.
Project Structure
session-collab-mcp/
├── bin/ # Executable entry point
├── migrations/ # SQLite migration files
├── plugin/ # Optional Claude Code integration
├── src/
│ ├── cli.ts # CLI entry point
│ ├── constants.ts # Version and server instructions
│ ├── db/ # Database layer
│ ├── mcp/ # MCP protocol implementation
│ │ ├── tools/ # Tool implementations
│ │ │ ├── session.ts # Session management
│ │ │ ├── claim.ts # File/symbol claims
│ │ │ ├── memory.ts # Working memory
│ │ │ └── protection.ts # File protection
│ │ └── ...
│ └── utils/
└── package.jsonChangelog
v2.5.0
Normalize claim paths to
project_root(absolute ≡ relative; reject traversal)Session start reuses same
name+project by default (force_newto skip); idle stale default 15 minutesPrefer atomic
collab_claimcreate; compact happy-path responses (detailfor full payloads)list/statussummary uses SQL counts; memory content capped (800 chars) with smaller active recall defaultToken-conscious skills/
SERVER_INSTRUCTIONS; collab memory vs AI-Memory role splitAdd
npm run install:localto build and sync plugin skills into Claude cache
v2.4.0
restore_contextdefaults false on start;list/statussummary unlessdetail=trueShorten server instructions; non-trivial-only collab-start guidance
v2.3.1
Add
collab_session_updatefor heartbeat, current task, todo, and progress reportingEnrich
collab_session_listwith current task and active claim summariesMake
collab_claim(action="create")respectcollab_config(mode)with smart coordination by defaultAdd
session-collab doctorfor HTTP server health and tool-surface checksAdd
npm run test:httpandnpm run test:releaserelease gatesUpdate dev test tooling to clear npm audit findings
v2.1.0
Add HTTP server + CLI wrapper for universal AI CLI usage
Add HTTP API endpoints and utils tests
Add legacy entry for deprecated schemas/queries (optional build)
Improve claim conflict accuracy and release summaries
Expand test coverage across MCP tools and DB flows
v2.0.0 (Breaking)
Major Simplification: Reduced from 50+ tools to 10 core tools
Action-Based Design: Unified tools with action parameters
Removed Features: LSP integration, messaging, notifications, queuing, decision tracking
Improved Performance: Faster startup and reduced complexity
Better Testing: Comprehensive test coverage for all tool actions
Migration Guide: Detailed upgrade path from v1.x
v0.8.0
Add working memory system for context persistence (
collab_memory_*tools)Add plan protection (
collab_plan_register,collab_plan_update_status)Add file protection (
collab_file_register,collab_file_check_protected)Memory categories: finding, decision, state, todo, important, context
Pinned memories survive context compaction
Plan lifecycle: draft → approved → in_progress → completed → archived
v0.7.1
Add
collab_auto_releasetool for releasing claims after editingAdd auto-release config options:
auto_release_immediate,auto_release_staleAdd
cleanupStaleClaims()for automatic stale claim cleanupAdd PostToolUse hook to remind auto-release after Edit/Write
v0.7.0
Add priority system for claims (0-100 with levels: critical/high/normal/low)
Add claim queue system (
collab_queue_join,collab_queue_leave,collab_queue_list)Add notification system (
collab_notifications_list,collab_notifications_mark_read)Add audit history tracking (
collab_history_list)Add
collab_claim_update_priorityfor escalating urgent work
v0.6.0
Optimize database queries with composite indexes
Extract shared utilities (crypto, response builders)
Remove unused auth and token modules
Use precompiled JS for 15x faster startup
Fix GROUP_CONCAT delimiter for multi-value queries
Add unified Zod validation across tools
v0.5.0
Add reference tracking and impact analysis (Phase 3)
Add symbol-level claims and LSP integration
Fix SQLite WAL sync for multi-process MCP servers
Add
collab_configtool for conflict handling modes
License
MIT
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/leaf76/session-collab-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server