scap-coordination
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
SCAP Coordination (scap-coordination)
Drop-in MCP server & automatic hook guardrails that catch same-signature Silent Behavioral Drift and agent sycophancy mid-flight across Python, TypeScript, JSON Schema, and Terraform.
Why this matters now: A November 2026 study by Harvard and Anthropic ("Aligning AI Teams") found that teams of AI agents act less safely than a single agent alone — even with frontier models — because each agent sticks to its own lane and assumes someone else is checking the whole system. Group chats and peer reviews didn't fix it. What worked: one shared, strict rulebook plus a dedicated, independent safety referee.
SCAP is the open-source engineering layer that enforces exactly that.
Most "multi-agent frameworks" are just parallel processing with a group chat. They work fine on separate chores, then silently break the moment two agents touch shared code: every agent's own tests pass, and the merged branch ships a broken contract or a flipped billing rule.
Why Static Locks & Type Checkers Aren't Enough (The $2.00 vs $8.00 Bug)
Suppose 3 parallel coding agents work on a billing service (pricing.py, checkout.py, invoice.py):
calculate_discount(price_cents: int, tier: str) -> intstarts returning the discount amount (200for a $10.00 VIP order).checkoutwritessubtotal_cents - calculate_discount(...).Mid-flight,
pricingchangescalculate_discountto return the final discounted price (800), keeping the exact same function name, arguments, and types(price_cents: int, tier: str) -> int.Every compiler,
mypy,tsc, file lock, and AST diff says 0 errors. Yet customers on a $10.00 VIP order are silently charged $2.00 instead of $8.00 (1000 - 800 = 200).
How SCAP stops it automatically:
On
post-edit, SCAP runs pinned behavioral probes in an isolated subprocess (auto-discovered from docstrings or auto-synthesized for pure functions with zero docstrings).It catches
SILENT_BEHAVIORAL_DRIFT(200 -> 800) even though the signature never changed.It automatically blocks
checkout(direct import) andinvoice(transitive import) atpre-completewith the exact behavioral diff until both update cleanly.
Related MCP server: Hoplon
What SCAP Gives Your Agent Team
Shared Live Truth Store (SQLite WAL): Versioned contracts with atomic Compare-And-Swap (CAS) and exclusive/read resource leases — no external database needed.
Zero-Ceremony Multi-Language Tracking: Automatically parses Python AST, TypeScript/JS, JSON Schema, and Terraform
.tfmodules and traces cross-file dependencies across multiple hops.Same-Signature Behavioral Probes: Catches silent logic flips on both documented and undocumented pure Python functions (with a built-in AST safety filter that refuses to auto-probe I/O, disk, network, or subprocess code).
Evidence-Hashed Facts & Context-Isolated Referee: Rejects unverified prose claims, shares dead ends so agents don't repeat failed work, and settles disputes strictly on hashed test outputs (blocking persuasive wrong teammates).
Built-In Layer-2 Training Pipeline: Records every conflict and recovery as
(chosen, rejected)DPO preference pairs (dpo_pairs.jsonl) + ships a ready-to-run LoRA/DPO training script (coordination_lab/training/train_dpo.py).
30-Second Quickstart
Zero external dependencies required for core runtime, CLI, MCP server, and hooks (Python 3.10+).
pip install -e ".[dev]"
# 1. Watch both live demos ($2 vs $8 Silent Behavioral Drift + Zero-Docstring Auth Bypass)
scap-demo
# 2. Run all unit & integration tests
python -W error::ResourceWarning -m unittest discover -s tests -v
# 3. Preview the 20-task live API benchmark cost before spending $0.01
scap-live-bench --dry-run --max-tasks 5Drop Into Your Repo (Claude Code / Antigravity / Cursor / Gemini CLI)
# 1. Index your repo safely (100% static read-only, zero code execution)
scap-hook --no-probes --db .scap/state.db --workspace . bootstrap
# 2. Generate ready-to-paste Claude Code hooks + MCP server config
scap-install --workspace . --write
# 3. Watch live team state in a second terminal
scap-watch --db .scap/state.db --watchMCP Server Config (Any MCP-Compatible Agent)
{
"mcpServers": {
"scap-coordination": {
"command": "scap-mcp",
"args": ["--db", ".scap/state.db", "--workspace", "."]
}
}
}Architecture
flowchart TD
A1["Worker Agent A"] <--> HOOK["Automatic Middleware Hooks (PreToolUse / PostToolUse / Stop)"]
A2["Worker Agent B"] <--> HOOK
HOOK --> EXT["Multi-Language Extractors (Python AST, TS/JS, JSON Schema, Terraform)"]
HOOK --> PROBE["Behavioral Probe Fingerprinter (Docstring + Auto-Synthesized Pure Probes)"]
EXT --> SG["Layer 1: SQLite WAL StateGraph (CAS Contracts, Leases, Invalidation Bus)"]
PROBE --> SG
SG -->|"Deterministic Block + Exact Diff"| HOOK
SG --> BUS["Layer 3: Typed DiffBus (VerifiedFacts + DeadEnds)"]
BUS --> ARB["Layer 4: Tier-A Test Gate + Context-Isolated Tier-B Arbiter"]
SG --> DPO["Layer 2: Trajectory Logger -> DPO Training Pairs"]Verified Empirical Results
Live Real-Agent Experiments (Hidden pytest Integration Graders)
Real-Codebase Experiment | Setup | Hidden | What Happened |
| 3 Naive Parallel Agents | FAILED (1/3) | All 3 passed local checks; crashed with |
| 3 SCAP CLI Agents | PASSED (3/3) | Exclusive lease + CAS v2 + |
| 3 Auto-Hook Agents (zero manual | PASSED (3/3) | Transitive AST tracking blocked |
| 3 Naive Parallel Agents | FAILED (1/3) | Every type check green; silently charged $2.00 instead of $8.00. |
| 3 Behavioral-SCAP Agents | PASSED (3/3) | Probe caught |
| 3 Adversarial SCAP Agents | PASSED (3/3) | Auto-synthesized probes caught |
Simulated CoupledBench-Mini (realistic_frontier, 50 trials / archetype)
System | Pass % | Silent Conflict % | Wasted Work % | Sycophancy % | Wall vs B0 | Tokens vs B0 |
| 95.3% | 1.3% | 0.0% | 0.0% | 1.00x | 1.00x |
| 0.0% | 81.3% | 42.2% | 18.0% | 0.60x | 0.79x |
| 42.7% | 43.3% | 19.8% | 20.0% | 0.64x | 1.04x |
| 98.7% | 1.3% | 11.7% | 0.0% | 0.61x | 0.85x |
Honest Failure Boundaries — When NOT to Use SCAP
Uncoupled / embarrassingly parallel tasks: Plain parallel fan-out (
B1) wins — SCAP adds ~29% extra token overhead for zero accuracy gain when contracts never change.Small sequential searches: A single strong agent (
B0) beats every multi-agent setup on speed and cost (Brooks's Law).Use SCAP when concurrent agents share mutable contracts, schemas, Terraform modules, or business logic where silent drift is expensive.
Docs & Guides
Launch & Demo Notes: docs/LAUNCH_POSTS.md
Layer-2 Open-Model Fine-Tuning (LoRA/DPO): docs/LAYER2_TRAINING_GUIDE.md
Layer-3 Shared KV-Cache Pool Blueprint: docs/deep_layer3_kv_architecture.md
Security Policy: SECURITY.md
License
MIT — see LICENSE.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Team memory for AI coding agents and code reviews, reviewed by humans and served over MCP.
Control plane for autonomous software labor. Agents claim objectives over MCP with audit trail.
shared AI-context layer for teams — persistent memory your agents search and update over MCP
Governed AI agent skills — one library, distributed to devs and exposed to remote agents over MCP.
Related MCP Servers
- AlicenseAqualityDmaintenanceMulti-agent orchestration MCP server that lets Claude Code delegate backend, frontend, and tooling tasks to specialized AI agents (Codex, Kimi, Grok) with contract-first sequencing and workspace mutation guards.48MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI coding agents and hosts to enforce deterministic repository boundaries via MCP, providing structured reads, supervised edits, snapshots, audits, and recovery with machine-readable evidence.MIT

STMAofficial
AlicenseNot gradedqualityBmaintenanceAn MCP server that enables AI coding agents to coordinate by sharing environment snapshots and diffs, surfacing overlapping work, exchanging debug-session messages, handing off tasks, and enforcing policy preflight checks.Elastic 2.0- AlicenseNot gradedqualityBmaintenanceEnables teams of AI coding agents (Claude Code, Cursor, Codex) to share persistent, time-aware graph memory and coordinate their work via MCP, so agents recall verified fixes at the moment of failure, learn procedures automatically, avoid file conflicts, claim tasks race-free, and hand off facts and decisions between sessions.2MIT