能力标签
opencode-swarm MCP工具
🛠
AI工具

opencode-swarm MCP工具

基于 TypeScript · 开源 AI 工具,GitHub 社区精选
英文名:opencode-swarm
⭐ 324 Stars 🍴 32 Forks 💻 TypeScript 📄 MIT 🏷 AI 8.2分
8.2AI 综合评分
多智能体编排MCP协议代码自动化分布式框架TypeScript
✦ AI Skill Hub 推荐

经 AI Skill Hub 精选评估,opencode-swarm MCP工具 获评「强烈推荐」。这款AI工具在功能完整性、社区活跃度和易用性方面表现出色,AI 评分 8.2 分,适合有一定技术背景的用户使用。

📚 深度解析

opencode-swarm MCP工具 是一款基于 TypeScript 的开源工具,在 GitHub 上收获 0k+ Star,是多智能体编排、MCP协议、代码自动化、分布式框架领域中的优质开源项目。开源工具的最大优势在于代码完全透明,你可以审计每一行代码的安全性,也可以根据自身需求进行二次开发和定制。

**为什么要使用开源工具而非商业 SaaS?**
对于个人开发者和有隐私需求的用户,本地部署的开源工具意味着数据不离本机,不受第三方服务商的数据政策约束。同时,开源工具通常没有使用次数限制和月度费用,一次安装即可长期使用,对于高频使用场景的总拥有成本(TCO)远低于订阅制商业工具。

**安装与环境准备**
opencode-swarm MCP工具 依赖 TypeScript 运行环境。建议通过 pyenv(Python)或 nvm(Node.js)管理 TypeScript 版本,避免全局环境污染。对于新手用户,推荐先创建虚拟环境(python -m venv venv && source venv/bin/activate),再安装依赖,这样即使出现问题也可以随时删除虚拟环境重新开始,不影响系统稳定性。

**社区与维护**
GitHub Issue 和 Discussion 是获取帮助的最快渠道。在提问前建议先检查 Closed Issues(已关闭的问题),大多数常见问题都已有解答。遇到 Bug 时,提供 pip list 的输出、完整错误堆栈和最小可复现示例,能显著提高开发者响应速度。AI Skill Hub 将持续追踪 opencode-swarm MCP工具 的版本更新,及时通知重要功能变化。

📋 工具概览

基于MCP协议的开源多智能体编程工具,采用中心辐射型架构支持分布式任务编排。面向AI驱动的代码生成和自动化开发,适合需要构建复杂智能体工作流的开发者和研究者。

opencode-swarm MCP工具 是一款基于 TypeScript 开发的开源工具,专注于 多智能体编排、MCP协议、代码自动化 等核心功能。作为 GitHub 开源项目,它拥有活跃的社区支持和持续的版本迭代,代码完全透明可审计,支持本地部署以保护数据隐私。无论是个人使用还是集成到企业工作流,都能提供稳定可靠的解决方案。

GitHub Stars
⭐ 324
开发语言
TypeScript
支持平台
Windows / macOS / Linux
维护状态
轻量级项目,按需更新
开源协议
MIT
AI 综合评分
8.2 分
工具类型
AI工具
Forks
32

📖 中文文档

以下内容由 AI Skill Hub 根据项目信息自动整理,如需查看完整原始文档请访问底部「原始来源」。

基于MCP协议的开源多智能体编程工具,采用中心辐射型架构支持分布式任务编排。面向AI驱动的代码生成和自动化开发,适合需要构建复杂智能体工作流的开发者和研究者。

opencode-swarm MCP工具 是一款基于 TypeScript 开发的开源工具,专注于 多智能体编排、MCP协议、代码自动化 等核心功能。作为 GitHub 开源项目,它拥有活跃的社区支持和持续的版本迭代,代码完全透明可审计,支持本地部署以保护数据隐私。无论是个人使用还是集成到企业工作流,都能提供稳定可靠的解决方案。

📌 核心特色
  • 开源免费,支持本地部署,数据完全自主可控
  • 活跃的 GitHub 开源社区,持续迭代更新
  • 提供详细文档和使用示例,新手友好
  • 支持自定义配置,灵活适配不同使用环境
  • 可作为基础组件集成进现有技术栈或进行二次开发
🎯 主要使用场景
  • 本地部署运行,保护数据隐私,满足合规要求
  • 自定义集成到现有系统,扩展技术栈能力
  • 作为开源基础组件进行商业化二次开发
以下安装命令基于项目开发语言和类型自动生成,实际以官方 README 为准。
安装命令
# 方式一:npm 全局安装
npm install -g opencode-swarm

# 方式二:npx 直接运行(无需安装)
npx opencode-swarm --help

# 方式三:项目依赖安装
npm install opencode-swarm

# 方式四:从源码运行
git clone https://github.com/zaxbysauce/opencode-swarm
cd opencode-swarm
npm install
npm start
📋 安装步骤说明
  1. 访问 GitHub 仓库页面
  2. 按照 README 文档完成依赖安装
  3. 根据系统环境完成初始化配置
  4. 参考官方示例或文档开始使用
  5. 遇到问题可在 GitHub Issues 中查找解答
以下用法示例由 AI Skill Hub 整理,涵盖最常见的使用场景。
常用命令 / 代码示例
# 命令行使用
opencode-swarm --help

# 基本用法
opencode-swarm [options] <input>

# Node.js 代码中使用
const opencode_swarm = require('opencode-swarm');

const result = await opencode_swarm.run(options);
console.log(result);
以下配置示例基于典型使用场景生成,具体参数请参照官方文档调整。
配置示例
# opencode-swarm 配置说明
# 查看配置选项
opencode-swarm --config-example > config.yml

# 常见配置项
# output_dir: ./output
# log_level: info
# workers: 4

# 环境变量(覆盖配置文件)
export OPENCODE_SWARM_CONFIG="/path/to/config.yml"
📑 README 深度解析 真实文档 完整度 66/100 含工作流图 查看 GitHub 原文 →
以下内容由系统直接从 GitHub README 解析整理,保留代码块、表格与列表结构。

OpenCode Swarm

Key Features

  • 🏗️ Specialized core, optional, and conditional agents — architect, coder, reviewer, test_engineer, critic, explorer, sme, docs, designer, critic_oversight, critic_sounding_board, critic_drift_verifier, critic_hallucination_verifier, curator_init, curator_phase, council_generalist, council_skeptic, council_domain_expert. Run /swarm agents for the live roster — that is the source of truth, not this list.
  • 🔒 Gated pipeline — code never ships without reviewer + test engineer approval
  • 🔍 DEEP_DIVE Protocol — High-rigor, on-demand read-only codebase audit via specialized skills
  • 🔬 External Skill Curation Pipeline — Opt-in discovery, quarantine, evaluation, and promotion of external skill candidates from configured sources (disabled by default; enable via external_skills.curation_enabled: true in config). Includes 7 tools: external_skill_discover, external_skill_list, external_skill_inspect, external_skill_promote, external_skill_reject, external_skill_delete, external_skill_revoke. Candidates pass through a 3-gate validation pipeline before evaluation: prompt injection scan (12 regex patterns), unsafe instruction scan (25 patterns), and provenance integrity check (SHA-256, timestamp, URL, publisher, and hash verification).
  • 🔄 Phase completion gates — completion-verify and drift verifier gates enforced before phase completion
  • 🔁 Resumable sessions — all state saved to .swarm/; pick up any project any day
  • 🖥️ PR Monitor — GitHub PR subscription and background polling via gh CLI; delivers real-time CI, review, and merge status updates via the AutomationEventBus (FR-001, opt-in via pr_monitor.enabled: true). Subscribe with /swarm pr subscribe <pr-url|owner/repo#N|N>; unsubscribe with /swarm pr unsubscribe <pr-url|owner/repo#N|N>; check status with /swarm pr status. Enable auto_pr_feedback: true in pr_monitor config to inject [MODE: PR_FEEDBACK pr="URL"] on CI failures and merge conflicts automatically.
  • 🌐 12 full language profiles (TypeScript, Python, Go, Rust, Java, Kotlin, C/C++, C#, Ruby, Swift, Dart, PHP) with tree-sitter parse validation across 20 grammars (adds JavaScript, CSS, Bash, PowerShell, INI, Regex — and .tsx / .c aliases) — extending: see docs/adding-a-language.md
  • 🛡️ Built-in security — SAST, secrets scanning, dependency audit per task
  • 🔒 Scope enforcement — Validates write targets against declared scope with cross-process persistence, TTL expiry, and scope-aware destructive command blocking. Handles both single-string and array-based path arguments (files[], paths[], targetFiles[]) to prevent scope bypass via multi-file tool calls.
  • 📝 Shell write detection — Static analysis of POSIX/PowerShell/cmd commands to detect file writes (redirects, builtins, in-place editors, network downloads, archive extraction, git destructive ops) before execution
  • 🆓 Free tier — works with OpenCode Zen's free model roster
  • ⚙️ Fully configurable — override any agent's model, disable agents, tune guardrails
The Swarm architect coordinates all internal agents automatically. You never manually switch between internal roles. If the active OpenCode agent is not a Swarm architect, the plugin workflow is bypassed.

---

Shell Write Detection Features

  • POSIX shell detection — Parses commands with bash-parser AST for accurate detection of:
  • Redirect operators (>, >>, >|, <<, <<-)
  • Here-documents and here-strings
  • Write-effect builtins (cp, mv, install, ln, truncate, dd)
  • In-place editors (sed -i, perl -i, awk -i)
  • Interpreter eval (python -c, node -e, bun -e, ruby -e, php -r)
  • Network downloaders (curl -o, wget -O, scp)
  • Archive extraction (tar -x, unzip, gunzip)
  • Git destructive operations (git clean -fd, git reset --hard)
  • Windows shell detection — Uses regex heuristics for PowerShell and cmd.exe:
  • PowerShell cmdlets: Out-File, Set-Content, Add-Content, Copy-Item, Move-Item
  • cmd.exe builtins: copy, move, ren, del, rd, md
  • Redirect operators (>, >>)
  • Interactive session denial — Blocks commands that create persistent or open-ended sessions:
  • POSIX: watch, screen, tmux new-session
  • PowerShell: Start-Process
  • Cross-process scope enforcement — Declared scope is persisted to .swarm/scopes/scope-{taskId}.json with:
  • TTL expiry (default 24 hours)
  • Symlink guards (O_NOFOLLOW + realpath containment)
  • Schema versioning and fail-closed validation
  • Scope-aware destructive command blocking — Recursive delete patterns (rm -rf, rmdir /s, del /s, Remove-Item -Recurse, rsync --delete) are blocked unless ALL target paths are within the declared scope (coder agents only)

1. Install the plugin (5s)

bunx opencode-swarm install

Quick Start

→ For a complete first-run walkthrough, see Getting Started.

The 15-minute guide covers: - Installation (bunx opencode-swarm install) - First-run auto-configuration (architect selected automatically) - Running your first task - Troubleshooting common issues

The installer automatically: - Creates a project config at .opencode/opencode-swarm.json when missing so project-level overrides have a place to live - Adds opencode-swarm to the OpenCode plugin list - Disables the native explore and general agents to reduce routing conflicts

---

LLM Provider Guide

Swarm works with any provider supported by OpenCode.

Example Configurations

Minimal (disable):

{
  "context_budget": {
    "enabled": false
  }
}

Default (reference):

{
  "context_budget": {
    "enabled": true,
    "max_injection_tokens": 4000,
    "warn_threshold": 0.7,
    "critical_threshold": 0.9,
    "enforce": true,
    "prune_target": 0.7,
    "preserve_last_n_turns": 4,
    "recent_window": 10,
    "tracked_agents": ["architect"],
    "enforce_on_agent_switch": true,
    "model_limits": { "default": 128000 },
    "tool_output_mask_threshold": 2000,
    "scoring": {
      "enabled": false,
      "max_candidates": 100,
      "weights": { "recency": 0.3, "relevance": 0.4, "importance": 0.3 },
      "decision_decay": { "mode": "exponential", "half_life_hours": 24 },
      "token_ratios": { "prose": 0.25, "code": 0.4, "json": 0.6, "logs": 0.1 }
    }
  }
}

Aggressive (for long-running sessions):

{
  "context_budget": {
    "enabled": true,
    "max_injection_tokens": 2000,
    "warn_threshold": 0.5,
    "critical_threshold": 0.75,
    "enforce": true,
    "prune_target": 0.6,
    "preserve_last_n_turns": 2,
    "recent_window": 5,
    "tracked_agents": ["architect"],
    "enforce_on_agent_switch": true,
    "model_limits": { "default": 128000 },
    "tool_output_mask_threshold": 1500,
    "scoring": {
      "enabled": true,
      "max_candidates": 50,
      "weights": { "recency": 0.5, "relevance": 0.3, "importance": 0.2 },
      "decision_decay": { "mode": "linear", "half_life_hours": 12 },
      "token_ratios": { "prose": 0.2, "code": 0.35, "json": 0.5, "logs": 0.05 }
    }
  }
}

30-Second Demo

No animated GIF is shipped in the repo — instead, here is the exact terminal session you can record yourself with asciinema rec demo.cast (or any screen recorder). Every command below is real and runs against this repo as published.

Recording script (copy/paste-able, ~30 seconds):

```bash

Configuration Reference

KeyTypeDefaultDescription
context_budget.enabledbooleantrueEnable or disable the context budget guard entirely
context_budget.max_injection_tokensnumber4000Token budget for swarm-injected context per turn. This is NOT the model's context window — it's the swarm plugin's own contribution
context_budget.warn_thresholdnumber0.7Ratio (0.0-1.0) of max_injection_tokens that triggers a warning advisory
context_budget.critical_thresholdnumber0.9Ratio (0.0-1.0) of max_injection_tokens that triggers a critical alert with handoff recommendation
context_budget.enforcebooleantrueWhen true, enforces budget limits and may trigger handoffs
context_budget.prune_targetnumber0.7Ratio (0.0-1.0) of context to preserve when pruning occurs
context_budget.preserve_last_n_turnsnumber4Number of recent turns to preserve when pruning
context_budget.recent_windownumber10Number of turns to consider as "recent" for scoring
context_budget.tracked_agentsstring[]['architect']Agents to track for context budget warnings
context_budget.enforce_on_agent_switchbooleantrueEnforce budget limits when switching agents
context_budget.model_limitsrecord{ default: 128000 }Per-model token limits (model name -> max tokens)
context_budget.unified_injection_tokensnumberundefinedOpt-in unified ceiling (tokens) for combined system-enhancer + knowledge-injector injection per turn. When set, both hooks share this budget with proportional split
context_budget.tool_output_mask_thresholdnumber2000Threshold for masking tool outputs (chars)
skills.enabledbooleanfalseGates the 7 skill-management tools (skill_generate, skill_list, skill_apply, skill_inspect, skill_regenerate, skill_retire, skill_improve) behind an opt-in flag. When false (default), these tools are hidden from the architect's tool map.
context_budget.scoring.enabledbooleanfalseEnable context scoring/ranking
context_budget.scoring.max_candidatesnumber100Maximum items to score (10-500)
context_budget.scoring.weightsobject{ recency: 0.3, ... }Scoring weights for priority
context_budget.scoring.decision_decayobject{ mode: 'exponential', half_life_hours: 24 }Decision relevance decay
context_budget.scoring.token_ratiosobject{ prose: 0.25, code: 0.4, ... }Token cost multipliers

Gate Configuration

{
  "gates": {
    "syntax_check": { "enabled": true },
    "placeholder_scan": { "enabled": true },
    "sast_scan": { "enabled": true },
    "quality_budget": {
      "enabled": true,
      "max_complexity_delta": 5,
      "min_test_to_code_ratio": 0.3
    }
  }
}

</details>

<details> <summary><strong>File Locking for Concurrent Write Safety</strong></summary>

Swarm uses file locking to protect shared state files from concurrent write corruption. The locking strategy differs by file: plan.json uses hard locking (write blocked on contention), while events.jsonl uses advisory locking (write proceeds with a warning on contention).

Summarization Settings

Control how tool outputs are summarized for LLM context.

{
  "summaries": {
    "threshold_bytes": 102400,
    "exempt_tools": ["retrieve_summary", "task", "read"]
  }
}
  • threshold_bytes – Output size threshold in bytes before summarization is triggered (default 102400 = 100KB).
  • exempt_tools – Tools whose outputs are never summarized. Defaults to ["retrieve_summary", "task", "read"] to prevent re-summarization loops.
Note: The retrieve_summary tool supports paginated retrieval via offset and limit parameters to fetch large summarized outputs in chunks.

---

How It Compares

FeatureSwarmoh-my-opencodeget-shit-done
Multiple specialized agents✅ Core + optional + conditional roster (/swarm agents)
Plan reviewed before coding
Every task reviewed + tested
Different model for review vs. code
Shell write detection (POSIX/PowerShell/cmd)
Scope enforcement with cross-process persistence
Interactive session detection and blocking
Resumable sessions
Built-in security scanning
Learns from mistakes

---

🎯 aiskill88 AI 点评 A 级 2026-05-20

aiskill88点评:高成熟度的多智能体编程框架,MCP标准支持完善,架构设计先进。文档待完善,但代码质量优秀,324星评价认可度良好。

📚 实用指南(长尾问题)
适合谁
  • 需要让 Claude / Cursor 操作本地工具的 AI 工程师
  • 构建多智能体协作系统的 Agent 开发者
最佳实践
  • 配置 MCP 服务器时建议使用 stdio 传输 + JSON-RPC,避免暴露公网
  • 生产部署优先使用 Docker Compose 隔离依赖,并挂载 volume 持久化数据
  • Agent 任务先做 dry-run 验证工具调用链,再开启自主执行
常见错误
  • API key 直接提交到 git 仓库(请用 .env 并加入 .gitignore)
  • MCP 配置路径拼错或权限不足,重启 Claude Desktop 才生效
  • 容器内无法访问宿主机 localhost — 使用 host.docker.internal
部署方案
  • Docker:opencode-swarm 提供官方镜像,docker compose up 一键启动
  • CLI:直接 npm install -g / pip install,命令行调用
  • 云端托管:可放在 Vercel / Railway / Fly.io 等 PaaS 平台
相关搜索
opencode-swarm 中文教程opencode-swarm 安装报错怎么办opencode-swarm MCP 配置opencode-swarm Docker 部署opencode-swarm Agent 工作流opencode-swarm 与同类工具对比opencode-swarm 最佳实践opencode-swarm 适合谁用

⚡ 核心功能

👥 适合谁
  • 需要让 Claude / Cursor 操作本地工具的 AI 工程师
  • 构建多智能体协作系统的 Agent 开发者
⭐ 最佳实践
  • 配置 MCP 服务器时建议使用 stdio 传输 + JSON-RPC,避免暴露公网
  • 生产部署优先使用 Docker Compose 隔离依赖,并挂载 volume 持久化数据
  • Agent 任务先做 dry-run 验证工具调用链,再开启自主执行
⚠️ 常见错误
  • API key 直接提交到 git 仓库(请用 .env 并加入 .gitignore)
  • MCP 配置路径拼错或权限不足,重启 Claude Desktop 才生效
  • 容器内无法访问宿主机 localhost — 使用 host.docker.internal

👥 适合人群

AI 技术爱好者研究人员和学生开发者和工程师技术创业者

🎯 使用场景

  • 本地部署运行,保护数据隐私,满足合规要求
  • 自定义集成到现有系统,扩展技术栈能力
  • 作为开源基础组件进行商业化二次开发

⚖️ 优点与不足

✅ 优点
  • +MIT 协议,可免费商用
  • +完全开源免费,无授权费用
  • +本地部署,数据完全自主可控
  • +开发者社区支持,遇问题可查可问
⚠️ 不足
  • 安装和初始配置可能需要一定技术基础
  • 功能完整性通常不如成熟商业产品
  • 技术支持主要依赖开源社区,响应速度不稳定
⚠️ 使用须知

AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。

建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。

📄 License 说明

✅ MIT 协议 — 最宽松的开源协议之一,可自由商用、修改、分发,仅需保留版权声明。

🔗 相关工具推荐

📚 相关教程推荐
📰 相关 AI 新闻
🍿 AI 圈相关吃瓜
🗺️ 相关解决方案
🧩 你可能还需要
基于当前 Skill 的能力图谱,自动补全的工具组合

❓ 常见问题 FAQ

该项目采用中心辐射型多智能体架构,特别优化了代码生成场景下的智能体协调效率。
💡 AI Skill Hub 点评

AI Skill Hub 点评:opencode-swarm MCP工具 的核心功能完整,质量优秀。对于AI爱好者来说,这是一个值得纳入个人工具库的选择。建议先在非生产环境试用,再逐步推广。

📚 深入学习 opencode-swarm MCP工具
查看分步骤安装教程和完整使用指南,快速上手这款工具
🌐 原始信息
原始名称 opencode-swarm
原始描述 开源MCP工具: Architect-centric agentic swarm plugin for OpenCode. Hub-and-spoke orchestrati。⭐324 · TypeScript
Topics 多智能体编排MCP协议代码自动化分布式框架TypeScript
GitHub https://github.com/zaxbysauce/opencode-swarm
License MIT
语言 TypeScript
🔗 原始来源
🐙 GitHub 仓库  https://github.com/zaxbysauce/opencode-swarm

收录时间:2026-05-16 · 更新时间:2026-05-19 · License:MIT · AI Skill Hub 不对第三方内容的准确性作法律背书。

📺 订阅 AI Skill Hub Daily Telegram 频道
每天 8 条精选 AI Skill、MCP、Agent 与自动化工具推送
加入频道 →