Skip to main content

MCP server for the supervisor-squad workflow.

Project description

mcp-supervisor-squad

Python MCP server that implements a minimal “director + planner + coder” workflow with brief status.

Tools (public MCP API)

  • squad_start(cwd, query, options?) → creates a run, executes an internal planner pass to generate requirements + shared KB, enters a short (~15s) auto-review window (status includes a requirements summary), then dispatches 1–2 coder jobs in worktrees. Returns brief status (lines ≤ 3).
  • squad_status(run_id, options?) → returns brief status (lines ≤ 3) using cached state (no stdout tail by default).
  • squad_apply(run_id, options?) → applies the final patch with git apply (dry_run default true) and returns the same brief status fields plus apply result fields.

Important: for deterministic run lookup, pass options.cwd (any path inside the target repo) to squad_status and squad_apply. Authoritative machine-readable contract is written to <repo_root>/.codex/supervisor-squad/contract.json.

External directors should treat contract.json as the stable integration surface: inject optional kb/inbox/director_report.*, call squad_start, then poll squad_status and read persisted artifacts under .codex/supervisor-squad/ as needed. If you detect the plan is wrong (e.g., during the ~15s review window), cancel with squad_status(run_id, options={"cwd":"...","cancel":true}) and start a new run.

All tool responses include:

{
  "run_id": "ss-...",
  "next_action": "wait|apply",
  "recommended_poll_ms": 15000,
  "wait_reason": "agent_running|ready_to_apply|canceled|error",
  "lines": ["...<=3 lines..."]
}

squad_apply additionally includes:

{
  "applied": true,
  "dry_run": true,
  "summary": "files=3",
  "error": ""
}

Storage layout (repo-local)

Under <repo_root>/.codex/supervisor-squad/:

  • contract.json – authoritative machine-readable contract (paths/limits/schema/workflow)
  • config.json – repo-local defaults for execution (models/reasoning/sandbox)
  • kb/inbox/director_report.md|json – optional director “research injection”
  • kb/compact.md – compacted shared KB (kept small)
  • kb/archive/* – archived injections (pruned)
  • runs/<run_id>/state.json – run state and brief cache
  • runs/<run_id>/artifacts/requirements*.md – requirements docs written before dispatch
  • runs/<run_id>/artifacts/contract.json – dual-project contract (<=4KB)
  • runs/<run_id>/artifacts/patch.diff – final patch to apply
  • runs/<run_id>/jobs/<job_id>/* – codex exec stdout/stderr/meta
  • worktrees/<run_id>/<slug> – per-task git worktrees (best-effort cleanup)
  • kb/prune_meta.json – prune rate limit state
  • kb/repo_profile.json – best-effort repo scan cache (reused across runs)

Configuration

Create <repo_root>/.codex/supervisor-squad/config.json to set repo-local defaults. Call-time options overrides these values.

Example:

{
  "execution": {
    "sandbox": "workspace-write",
    "approval_policy": "never"
  },
  "planner": {
    "model": "gpt-5.1-codex-max",
    "reasoning_effort": "medium",
    "extra_config": []
  },
  "coder": {
    "model": "gpt-5.1-codex-max",
    "reasoning_effort": "medium",
    "extra_config": []
  },
  "read_limits": {
    "max_files": 30,
    "max_file_bytes": 65536,
    "max_total_bytes": 1000000
  },
  "polling": {
    "max_ms": 60000,
    "jitter_ratio": 0.1
  },
  "kb": {
    "inbox_max_kb": 20,
    "compact_max_kb": 10,
    "archive_keep": 5,
    "archive_max_kb": 200
  }
}

Director Injection (Optional)

External director (outside this MCP server) may write a short report to:

  • <repo_root>/.codex/supervisor-squad/kb/inbox/director_report.md (<=20KB), or
  • <repo_root>/.codex/supervisor-squad/kb/inbox/director_report.json (<=20KB)

On squad_start, the internal planner reads it, generates requirements + shared KB, then archives and clears the inbox.

Development

cd mcp-tools/mcp-supervisor-squad
poetry install

Running

poetry run mcp-supervisor-squad --transport stdio

Testing

python -m compileall src/mcp_supervisor_squad

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mcp_supervisor_squad-0.1.15.tar.gz (28.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcp_supervisor_squad-0.1.15-py3-none-any.whl (36.1 kB view details)

Uploaded Python 3

File details

Details for the file mcp_supervisor_squad-0.1.15.tar.gz.

File metadata

  • Download URL: mcp_supervisor_squad-0.1.15.tar.gz
  • Upload date:
  • Size: 28.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.14.2 Darwin/24.6.0

File hashes

Hashes for mcp_supervisor_squad-0.1.15.tar.gz
Algorithm Hash digest
SHA256 5eb2cfd43f3dce43160a85c7f2a7e57745b2626b9d6ba0c12740bcd497ef975f
MD5 c8eae8809efcd9a3a2f51b734ccc7a93
BLAKE2b-256 a75379dff7023c2f6b5757683cb66a3fd16bc765431f0ca4a2d06cdffdb8cff5

See more details on using hashes here.

File details

Details for the file mcp_supervisor_squad-0.1.15-py3-none-any.whl.

File metadata

File hashes

Hashes for mcp_supervisor_squad-0.1.15-py3-none-any.whl
Algorithm Hash digest
SHA256 5191c180e8e93ba4f5f8f3d9881c66ab9ea86e286880d026b11345bf0b93736a
MD5 245c3d8aceceae26e4fdd2820b965364
BLAKE2b-256 ed684d5e7dc0583088d652d8717b75e568ea46b6707fa4b1fcc72734b91dcf4b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page