Blackboard MCP
Cross-session coordination server for Claude Code that manages file claims, build locks, shared knowledge, and provides a real-time dashboard to prevent conflicts across multiple sessions.
README
Blackboard MCP
<p align="center"> <strong>Cross-session coordination server for <a href="https://code.claude.com">Claude Code</a></strong><br> File locks · Build locks · Knowledge sharing · Real-time dashboard </p>
<p align="center"> <a href="https://github.com/RD2100/blackboard-mcp/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="License"></a> <img src="https://img.shields.io/badge/python-3.10+-green.svg" alt="Python"> <img src="https://img.shields.io/badge/platform-Windows%20%7C%20macOS%20%7C%20Linux-lightgrey.svg" alt="Platform"> </p>
The Problem
You open 3 Claude Code windows to work on different tasks. Suddenly:
- File conflict — Two sessions edit the same file simultaneously, one overwrites the other
- Build collision — Two sessions run
./gradlewat the same time, Gradle daemons pile up, OOM - Duplicated work — One session fixes a bug that another session already fixed yesterday
- No visibility — You can't see what other sessions are doing
Blackboard solves this. It acts as a registry center where every session registers, claims files, acquires build locks, and shares knowledge.
Features
| Feature | Description |
|---|---|
| Session Registry | Auto-register via SessionStart hook, heartbeat monitoring, stale cleanup |
| File Conflict Detection | Claim files before editing, detect conflicts across sessions |
| Build Lock Coordination | Only one session compiles at a time, with 10min timeout |
| Shared Knowledge Base | Share decisions, bug patterns, and knowledge with confidence scoring + decay |
| Real-time Dashboard | tkinter GUI with session list, sorting, health checks, and knowledge viewer |
| Crash Recovery | 3-level state recovery: state.json → .bak → events.log replay |
| MCP Restart Resilient | Sessions survive MCP server restarts, no data loss |
Quick Start
1. Clone & Install
git clone https://github.com/RD2100/blackboard-mcp.git
cd blackboard-mcp
pip install mcp # only dependency
2. Register with Claude Code
claude mcp add -s user blackboard -- python "/path/to/blackboard-mcp/server.py"
3. Add SessionStart Hook
Add to ~/.claude/settings.json:
{
"hooks": {
"SessionStart": [
{
"hooks": [
{
"type": "command",
"command": "bash \"/path/to/blackboard-mcp/scripts/bb-hook-session-start.sh\""
}
]
}
]
}
}
4. Add Rules (Recommended)
Copy rules/blackboard-protocol.md to your project's .claude/rules/ or ~/.claude/rules/.
5. Open Dashboard (Optional)
Windows: Double-click scripts/bb-monitor.bat
macOS/Linux:
python scripts/bb-monitor-gui.py /path/to/your/project
MCP Tools
Session Management
| Tool | Description |
|---|---|
bb_register(name, task, session_id) |
Register/update session |
bb_deregister(session_id) |
Unregister session, release all files |
bb_heartbeat(session_id) |
Refresh session heartbeat |
bb_status() |
View full system status with health checks |
bb_session_files(session_id) |
List files claimed by a session |
File Coordination
| Tool | Description |
|---|---|
bb_claim_file(session_id, file_path) |
Claim file ownership (returns CONFLICT/CLAIMED/OWN) |
bb_release_file(session_id, file_path) |
Release file ownership |
bb_check_conflicts(file_paths) |
Check if files are claimed by others |
Build Coordination
| Tool | Description |
|---|---|
bb_acquire_build_lock(session_id, project_dir) |
Acquire build lock (returns ACQUIRED/CONFLICT) |
bb_release_build_lock(session_id, project_dir) |
Release build lock |
Knowledge Management
| Tool | Description |
|---|---|
bb_share_knowledge(session_id, fingerprint, category, text) |
Share knowledge entry (deduped by fingerprint) |
bb_search_knowledge(query, category?) |
Search knowledge base |
bb_validate_knowledge(session_id, fingerprint, verdict) |
Validate/refute knowledge (affects confidence) |
bb_get_recent_knowledge(hours?) |
Get recent knowledge, decisions, and bug patterns |
bb_share_decision(session_id, decision, rationale?) |
Record architecture/design decision |
bb_report_bug_pattern(session_id, pattern, root_cause, fix) |
Report bug pattern / pitfall |
bb_event(session_id, event_type, details?) |
Log custom event |
Architecture
Session A ──┐
├──▶ MCP Server (blackboard) ──▶ state.json (disk)
Session B ──┤ │
│ ┌────┴────┐
Session C ──┘ │ Cleanup │ 60s stale cleanup thread
│ Decay │ hourly knowledge confidence decay
│ Reload │ detect hook-written state changes
└─────────┘
Dashboard ──▶ reads state.json directly (2s refresh)
Knowledge Lifecycle
Share (conf=0.5) → Validate confirmed (+0.2) → ... → conf ≥ 0.8 → ★ HIGH CONFIDENCE
→ Validate refuted (-0.5) → ... → conf ≤ 0.2 → archived
→ 30 days no reference → confidence decays (half-life)
→ 60 days no reference → archived
Configuration
| Parameter | Default | Description |
|---|---|---|
STALE_TIMEOUT_MINUTES |
30 | Minutes before inactive session is marked stale |
BUILD_LOCK_TIMEOUT_MINUTES |
10 | Minutes before build lock auto-releases |
KNOWLEDGE_HALF_LIFE_DAYS |
30 | Days before knowledge confidence decays by half |
KNOWLEDGE_ARCHIVE_DAYS |
60 | Days before knowledge is archived |
Privacy
All data is stored locally in .claude/blackboard/ within your project directory. No data is sent externally. The following files should NOT be committed to version control:
state.json/state.json.bak— runtime session stateevents.log— event history
Comparison with Alternatives
| Feature | Blackboard | ccsession | claude-presence |
|---|---|---|---|
| Session registry | ✅ | ✅ | ✅ |
| File conflict detection | ✅ | ❌ | ❌ |
| Build lock coordination | ✅ | ❌ | ❌ |
| Shared knowledge base | ✅ | ❌ | ❌ |
| Confidence scoring + decay | ✅ | ❌ | ❌ |
| Real-time dashboard | ✅ | ❌ | ❌ |
| Crash recovery | ✅ | ❌ | ❌ |
| MCP restart resilient | ✅ | ❌ | ❌ |
Related
- anthropics/claude-code#24798 — Inter-session communication for multi-Claude workflows
- anthropics/claude-code#47997 — Multi-session coordination feature request
- Claude Code Agent Teams — Official in-process multi-agent (single session)
License
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。