opencode-swarm

testing MCP Server

Architect-centric agentic swarm plugin for OpenCode. Hub-and-spoke orchestration with SME consultation, code generation, and QA review.

VerifiedInstall Ready
testingtesting
8 views352 stars35 forksv7.11.0MIT

Why This Matters

Discovered via github-topic:mcp and last synced 3mo ago.

VerifiedInstall Ready
Source
github-topic:mcp
Stars
352
Last synced
3mo ago
Install
Instructions detected

Install

1. Install the package

npx opencode-swarm

2. Add to claude_desktop_config.json

{
  "mcpServers": {
    "opencode-swarm": {
      "command": "npx",
      "args": [
        "opencode-swarm"
      ]
    }
  }
}

Config file location: ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) / %APPDATA%\Claude\claude_desktop_config.json (Windows)

103
Tools
0
Resources
0
Prompts
Standard I/O
Transport

Available Tools (103)

Fast

Unattended multi-interaction runs

Value

Effect

test_engineer

minimax-coding-plan/MiniMax-M2.5

CONSULT

SME agents provide domain guidance

retrospective

Phase metrics, lessons learned, error taxonomy classification (injected into next phase)

High

Medium

MiniMax

`minimax-coding-plan/<model>`

Medium

Fast

Duration

30 min

Mode

What It Means

Google

`google/<model>`

Type

Description

Provider

Format

qa

reviewer, critic, critic_sounding_board, critic_drift_verifier

EXECUTE

Tasks are implemented one at a time through the QA pipeline

drift-verifier

Phase-close drift gate: `critic_drift_verifier` verdict (APPROVED/NEEDS_REVISION) and summary (written by architect via `write_drift_evidence`; required before `phase_complete`)

gate_failed

Gate check blocked task completion

boolean

`false`

record

`{ default: 128000 }`

Scaffold

C A -->

session_started

New agent session created

budget_updated

Context budget crossed warning/critical threshold

Test

T T -->

Guidance

A A -->

Signal

Default Limit

Conditional

Legend: Core = always available, Optional = available by default (can be disabled), Conditional = requires specific feature config (ui_review or council) Run `/swarm status` and `/swarm agents` to see what's active. ```mermaid graph TB subgraph Orchestration A[Architect] end subgraph Discovery E[Explorer] end subgraph Execution C[Coder] T[Test Engineer] D[Designer] end subgraph Quality R[Reviewer] CR[Critic] CO[Critic Oversight] CSB[Critic Sounding Board] CDV[Critic Drift Verifier] CHV[Critic Hallucination Verifier] end subgraph Support S[SME] DOC[Docs] CI[Curator Init] CP[Curator Phase] end subgraph Council CM[Council Member] CMO[Council Moderator] end A -->

RESUME

Existing `.swarm/` state was found, so Swarm continues where it left off

review

Verdict, risk level, specific issues

session_ended

Session ends (reason: normal, timeout, error)

strict

Maximum safety — adds slop-detector and incremental-verify hooks

Deliberate

CM CM -->

heartbeat

30-second throttled keep-alive signal

reviewer

`.swarm/evidence/`, `.swarm/outputs/`

blockedPrefix

string[]

build_check

Runs your project's native build/typecheck

update_task_status

`plan.json`

Review

R R -->

explorer

google/gemini-2.5-flash

orchestrator

architect

PLAN

Architect writes or updates the phased plan (includes CODEBASE REALITY CHECK on brownfield projects)

secretscan

Secret scan results: findings count, files scanned, skipped files (v6.33)

task_state_changed

Task workflow state transitions

qa_skip_violation

QA gate skipped without valid reason

Agent

Can Write

blockedExact

string[]

number

`100`

sast_scan

Offline security analysis, 63+ rules, 9 languages

write_mutation_evidence

Architect-only: writes mutation gate results atomically to `.swarm/evidence/{phase}/mutation-gate.json`; accepts verdict (PASS/WARN/FAIL/SKIP), kill rate metrics, and optional survived mutant details; normalizes uppercase-to-lowercase before persisting

Context

A A -->

coder

minimax-coding-plan/MiniMax-M2.5

Kimi

`kimi-for-coding/<model>`

CLARIFY

Swarm asks for missing information it cannot infer

test

Pass/fail counts, coverage %, failure messages

agent_activated

Agent identity confirmed via chat.message

revision_limit_hit

Coder revision limit exceeded

fast

Skips compaction service — for short sessions under context pressure

Feature

Swarm

Anthropic

`anthropic/<model>`

support

sme, docs, designer

PHASE-WRAP

A phase closes out, including: explorer rescan, docs update, `context.md` update, `write_retro`, evidence check, `sbom_generate`, **`@critic_drift_verifier` delegation** (drift check — blocking gate), `write_drift_evidence` call with verdict, mandatory gate evidence verification (`completion-verify.json` + `drift-verifier.json` both required), then `phase_complete`

Event

When Emitted

phase_changed

Phase completed and new phase started

Condition

Behavior

Read-only

Everything

5

Agent is stopped

delegation_end

Sub-agent returns (success, rejected, error)

scope_violation

Architect wrote outside declared scope

readOnly

boolean

placeholder_scan

Catches TODOs, FIXMEs, stubs, placeholder text

generate_mutants

Architect-only: generates LLM-based mutation patches (5–10 per function across 6 types: off-by-one, null substitution, operator swap, guard removal, branch swap, side-effect deletion) for direct consumption by the mutation_test tool; returns SKIP verdict on LLM failure rather than throwing

pipeline

explorer, coder, test_engineer

CRITIC-GATE

Critic reviews the plan before execution

completion-verify

Deterministic gate: verifies plan task identifiers exist in source files (written automatically by `completion-verify` tool; required before `phase_complete`)

gate_passed

Evidence written to `.swarm/evidence/{taskId}.json`

model_fallback

Transient error triggered model fallback

architect

Everything (except plan files)

allowedExact

string[]

sbom_generate

CycloneDX dependency tracking, 8 ecosystems

File

Tool

DISCOVER

Explorer scans the codebase; co-change dark matter analysis runs automatically to detect hidden file couplings (v6.41)

diff

Files changed, additions/deletions

delegation_begin

Task dispatched to a sub-agent

loop_detected

Repetitive tool call pattern detected

10x

Agent is warned, then stopped

Key

Type

syntax_check

Tree-sitter validation across 12 languages

mutation_test

Applies LLM-generated mutation patches to source files and runs tests to measure kill rate; verdict is pass/warn/fail based on configurable thresholds; used by the mutation_test gate (opt-in, off by default)

hard_limit_hit

Tool call/duration/repetition limit reached

200

Agent is stopped

docs

`docs/`, `.swarm/outputs/`

allowedGlobs

string[]

pre_check_batch

Runs lint, secretscan, SAST, and quality budget in parallel (~15s vs ~60s sequential)

sme

Read-only

blockedGlobs

string[]

quality_budget

Enforces complexity, duplication, and test ratio limits

Command

Description

generated

### Prefixed Agents Prefixed agents (e.g., `paid_coder`, `mega_reviewer`, `local_architect`) inherit defaults from their canonical base agent via `stripKnownSwarmPrefix`. The lookup order is: 1. Exact match for the prefixed name (if explicitly defined in user config) 2. Fall back to the canonical agent's defaults (e.g., `paid_coder` → `coder`) ```json { "authority": { "rules": { "coder": { "allowedPrefix": ["src/", "lib/"] }, "paid_coder": { "allowedPrefix": ["vendor/", "plugins/"] } } } } ``` In this example, `paid_coder` gets its own explicit rule, while other prefixed coders (e.g., `mega_coder`) fall back to `coder`. #### Selecting the primary agent in multi-swarm configs (`default_agent`) The top-level `default_agent` field controls which generated agents OpenCode treats as primary. **It is optional.** Behavior: - **Omitted** — every architect-role agent is primary. In a multi-swarm config that means each swarm exposes its own architect (`local_architect`, `mega_architect`, `paid_architect`, `modelrelay_architect`, …) as a selectable session default. This is the v7.0.0-compatible behavior and the recommended setup. - **Base role** (e.g. `"coder"`) — every generated agent whose canonical base role matches becomes primary (`local_coder`, `mega_coder`, …). - **Exact generated name** (e.g. `"local_architect"`) — only that agent is primary. - **Unknown / invalid value** — a one-time warning is logged and the resolver falls back to architect-role primaries (or the first generated agent if architects are disabled). The plugin never produces zero primaries when at least one agent exists. See [`docs/configuration.md`](docs/configuration.md) for the full table. ### Runtime Enforcement Architect direct writes are enforced at runtime via `toolBefore` hook. This tracks writes to source code paths outside `.swarm/` and protects `.swarm/plan.md` and `.swarm/plan.json` from direct modification. ### Configuration Override default rules in `.opencode/opencode-swarm.json`: ```json { "authority": { "enabled": true, "rules": { "coder": { "allowedPrefix": ["src/", "lib/", "scripts/"], "blockedPrefix": [".swarm/"], "blockedZones": ["generated"] }, "explorer": { "readOnly": false, "allowedPrefix": ["notes/", "scratch/"] } } } } ``` ### Rule Fields

allowedPrefix

string[]

object

`{ prose: 0.25, code: 0.4, ... }`

incremental_verify

Post-coder typecheck for TS/JS, Go, Rust, C# (v6.29.2)

blockedZones

string[]

Tool

What It Does

phase_complete

`events.jsonl`