Claude Swarm 标志

Claude Swarm

社区
cj-vana

MCP server for orchestrating parallel Claude Code worker swarms with protocol-based behavioral governance, persistent state, and real-time monitoring dashboard

发布者cj-vana
代码仓库claude-swarm
语言TypeScript
复刻数
10
星标数
117
可用工具
0
传输类型stdio
许可协议MIT
链接
  • 将工具接入 AI 工作流

    Claude Swarm 提供 MCP 功能,可供兼容的 AI 客户端和智能体使用。

  • 0 个可用工具

    浏览下方可调用的操作;如果服务器提供了名称和描述,也会一并显示。

  • 可直接复制的配置

    使用安装配置片段,在您首选的 MCP 客户端中配置此服务器。

  • 开源社区热度

    关联的代码仓库有 117 个星标和 10 个复刻。


Features

Worker Orchestration

  • Persistent State - Session state survives context compaction via MCP server
  • Parallel Workers - Run multiple Claude Code workers simultaneously via tmux
  • Git Worktree Isolation - Workers run in isolated git worktrees for safe parallel modification
  • Worker Plan Mode - Workers analyze codebases and produce plans before implementing (auto-approved)
  • Competitive Planning - Complex features get two competing implementation plans
  • Confidence Monitoring - Multi-signal scoring detects struggling workers
  • Enforced Verification - Test-as-supervisor pattern with configurable verification commands
  • Auto-retry - Failed features automatically retry with configurable limits
  • Feature Dependencies - Define execution order between features
  • File-Based Task Locking - Atomic mutual exclusion prevents workers from conflicting
  • Post-Completion Reviews - Automated code and architecture reviews with actionable findings

Long-Running Autonomy

  • Ralph Loop - Fresh Claude context per iteration eliminates context rot for long sessions
  • Days-Long Sessions - Supports hours/days of autonomous execution with checkpointing
  • Crash Recovery - Automatic session resumption after crashes or machine restarts
  • Failure Pattern Learning - Records what works/fails for future worker prompts

Protocol-Based Governance

  • Behavioral Protocols - Define constraints on what workers can/cannot do
  • Pre-spawn Validation - Verify protocols allow task before worker starts
  • Continuous Monitoring - Track constraint violations during execution
  • LLM-Generated Protocols - Workers can propose new protocols (validated against base constraints)
  • Cross-instance Sync - Share protocols across MCP instances

Monitoring & Dashboard

  • Real-time Web Dashboard - Live UI at http://localhost:3456 with Server-Sent Events
  • Live Terminal Streaming - Watch worker output with ANSI color support
  • Review Worker Visibility - Code and architecture review progress in dashboard
  • Violation Tracking - Audit log of all protocol violations
  • Git Checkpoints - Commit progress after each feature

Repository Setup

  • Auto-Configuration - Set up CI/CD, issue templates, and documentation in parallel
  • Platform Detection - GitHub, GitLab, Gitea, Bitbucket, Azure DevOps support
  • Project Analysis - Detects languages, frameworks, and adapts configuration
  • Merge Mode - Preserves existing configs by default, with optional force overwrite

How It Works

The orchestrator pattern separates concerns for reliable long-running sessions:

  • Orchestrator (Claude Code): Plans work, monitors progress, makes decisions
  • MCP Server: Maintains persistent state that survives context compaction
  • Workers: Isolated Claude Code sessions in git worktrees via tmux that implement individual features
  • Protocols: Behavioral constraints governing what workers can/cannot do
  • Ralph Loop: External bash loop that launches fresh Claude sessions per iteration, with state persisted to the filesystem (progress files, git history)

Worker Lifecycle

Workers follow a two-phase lifecycle when plan mode is enabled (complexity >= 30):

  1. Plan Phase - Worker runs with read-only tools (Read, Glob, Grep, Write), analyzes the codebase, and produces a structured plan
  2. Auto-Review - Orchestrator scores the plan on test strategy, risk assessment, file specificity, and step count
  3. Implement Phase - Worker runs with full tools, following the approved plan step by step

Ralph Loop (Long-Running Autonomy)

For long-running features, the Ralph Loop replaces single long-lived sessions:

  1. Each iteration launches a fresh Claude session (no context rot)
  2. State persists via filesystem: progress.md, git history, .done files
  3. Prompt re-reads current state each iteration (self-reloading context)
  4. Configurable stopping conditions: completion marker, time limit, max iterations
  5. Git diff injected into prompt so worker sees what changed

Session Resilience

Sessions survive crashes and machine restarts:

  • Checkpointing - State snapshots every ~15 minutes while workers are running
  • Heartbeat Detection - PID-based liveness detection identifies stale sessions
  • Crash Recovery - resume_session detects crashes, loads checkpoints, restarts dead workers
  • Graceful Shutdown - shutdown_session creates checkpoint and stops workers cleanly

This separation enables:

  • Parallel execution: Multiple workers implement features simultaneously
  • State persistence: Session state survives context compaction via the MCP server
  • Failure recovery: Workers can retry, rollback, or be guided when stuck
  • Behavioral governance: Protocols enforce constraints on worker actions

Quick Start

Prerequisites

  • Node.js 18+
  • tmux (brew install tmux on macOS)
  • Claude Code CLI

Installation

One-liner install (recommended):

bash
curl -fsSL https://raw.githubusercontent.com/cj-vana/claude-swarm/main/install.sh | bash

This will clone the repo, build, register the MCP server, and install the /swarm skill.

bash
git clone https://github.com/cj-vana/claude-swarm.git
cd claude-swarm
npm install
npm run build

# Add to Claude Code
claude mcp add claude-swarm --scope user -- node $(pwd)/dist/index.js

# Install the skill (optional but recommended)
mkdir -p ~/.claude/skills/swarm && cp skill/SKILL.md ~/.claude/skills/swarm/

Basic Usage

Tell Claude to use the swarm:

Use /swarm to build a REST API with authentication, user management, and tests

Or follow the workflow phases manually:

Phase 1: Setup
  → orchestrator_init - Initialize session with features
  → configure_verification - Set up test/build commands
  → set_dependencies - Define feature order

Phase 2: Pre-Work (per feature)
  → get_feature_complexity - Check if competitive planning needed
  → enrich_feature - Add relevant context

Phase 3: Execute
  → start_worker or start_parallel_workers

Phase 4: Monitor
  → sleep 180 - Wait before checking
  → check_worker (heartbeat: true) - Lightweight status
  → send_worker_message - Guide if stuck

Phase 5: Complete
  → run_verification - Run tests
  → mark_complete - Record success/failure
  → commit_progress - Git checkpoint

Phase 6: Review
  → check_reviews - Monitor automated reviews
  → get_review_results - See findings

The /swarm Skill

The /swarm skill provides guided orchestration with a complete workflow:

Use /swarm to build a REST API with authentication, user management, and tests

The skill automates:

  • Phase 0: Repository readiness check (runs setup_analyze)
  • Phase 1: Session setup with feature decomposition
  • Phase 2: Pre-work preparation (complexity analysis, context enrichment)
  • Phase 3: Execution (manual or auto-orchestration)
  • Phase 4: Monitoring loop with confidence tracking
  • Phase 5: Completion verification and git checkpoints
  • Phase 6: Post-completion reviews

Installing the skill:

bash
mkdir -p ~/.claude/skills/swarm && cp skill/SKILL.md ~/.claude/skills/swarm/

See skill/SKILL.md for the complete workflow reference.

Protocol System

Protocols define behavioral constraints that govern worker actions, enabling safe autonomous operation with clear boundaries.

Constraint Types

TypeDescriptionExample
tool_restrictionAllow/deny specific toolsOnly allow Read, Glob, Grep
file_accessControl file system accessBlock access to .env files
output_formatRequire specific output patternsMust include test coverage report
behavioralHigh-level behavior rulesRequire confirmation before destructive actions
temporalTime-based constraintsMax 30 minutes per feature
resourceResource usage limitsMax 100 file operations
side_effectControl external effectsNo network requests, no git push

Example Protocol

json
{
  "id": "safe-refactoring-v1",
  "name": "Safe Refactoring Protocol",
  "version": "1.0.0",
  "priority": 100,
  "constraints": [
    {
      "id": "no-secrets",
      "type": "file_access",
      "rule": {
        "type": "file_access",
        "deniedPaths": ["**/.env", "**/secrets.*", "**/credentials.json"]
      },
      "severity": "error",
      "message": "Cannot access files that may contain secrets"
    }
  ],
  "enforcement": {
    "mode": "strict",
    "preExecution": true,
    "postExecution": true,
    "onViolation": "block"
  }
}

Protocol Workflow

1. protocol_register - Register a new protocol
2. protocol_activate - Activate for enforcement
3. start_worker - Workers are validated against active protocols
4. [worker runs with continuous monitoring]
5. get_violations - Review any constraint violations

LLM-Generated Protocols

Workers can propose new protocols validated against immutable base constraints:

1. get_base_constraints - View immutable security rules
2. propose_protocol - Worker submits proposal
3. review_proposals - See pending proposals with risk scores
4. approve_protocol / reject_protocol - Human review for high-risk

Base Constraints (cannot be overridden):

  • Certain tools always denied (e.g., dangerous system commands)
  • Critical paths always protected (e.g., /etc, system files)
  • Maximum privilege ceiling enforced

Competitive Planning

For complex features, spawn two planners with different approaches:

1. get_feature_complexity(featureId)     # Analyze complexity (0-100)
2. start_competitive_planning(featureId) # Spawn Planner A & B
3. [wait for planners to complete]
4. evaluate_plans(featureId)             # Compare and pick winner
5. start_worker(featureId)               # Implement with winning plan
  • Planner A: Incremental, safe approach
  • Planner B: Elegant, innovative approach
  • Threshold: Features scoring 60+ trigger competitive planning

Confidence Monitoring

Real-time confidence scoring detects struggling workers:

SignalWeightMeasures
Tool Activity35%Read->Edit->Test cycles, stuck loops
Self-Reported35%Worker writes to .confidence file
Output Analysis30%Error patterns, frustration language

Levels: High (80-100), Medium (50-79), Low (25-49), Critical (0-24)

set_confidence_threshold(35)       # Configure alert level
get_worker_confidence(featureId)   # Get detailed breakdown

Auto-Orchestration

For fully autonomous execution, use auto_orchestrate:

auto_orchestrate(projectDir, strategy: "adaptive", maxConcurrent: 5)

This handles Phases 3-5 automatically:

  • Schedules workers based on dependencies
  • Monitors progress and handles failures
  • Runs verification commands
  • Marks features complete
  • Commits progress at checkpoints

Scheduling Strategies

StrategyBehavior
breadth-firstMaximize parallel execution of independent features
depth-firstFocus on unblocking dependent feature chains
adaptiveSystem decides based on dependency graph (default)

When to Use

  • Auto-orchestration: Large feature sets, hands-off execution
  • Manual orchestration: Fine-grained control, complex dependencies, debugging

Post-Completion Reviews

Automated code and architecture reviews run after all workers complete:

1. All features complete -> session status changes to "reviewing"
2. Code review worker analyzes: bugs, security, style, test coverage
3. Architecture review worker analyzes: coupling, patterns, scalability
4. Findings aggregated into progress log
5. Session completes with review summary

Review workers output structured JSON findings:

  • .claude/orchestrator/workers/code-review.findings.json
  • .claude/orchestrator/workers/architecture-review.findings.json

Severity levels: clean, minor, moderate, major, critical

Acting on Review Findings

Convert review findings into actionable features:

# View available issues from reviews
implement_review_suggestions(projectDir)

# Create features from specific issues
implement_review_suggestions(projectDir, issueIndices: [0, 2, 5])

# Auto-select warnings and errors
implement_review_suggestions(projectDir, autoSelect: true, minSeverity: "warning")

Configure or trigger manually:

configure_reviews(enabled: true, skipOnFailure: false)
run_review(reviewTypes: ["code", "architecture"])
get_review_results(format: "detailed")

Repository Setup

Automatically configure repositories with development best practices:

# Analyze repository freshness and missing configs
setup_analyze(projectDir)

# Initialize setup with parallel workers
setup_init(projectDir)

# Check setup progress
setup_status(projectDir)

Configuration Types

TypeDescriptionFiles Created
CLAUDE.mdProject guidance for Claude CodeCLAUDE.md
GitHub CIBuild, test, lint workflows.github/workflows/ci.yml
DependabotAutomated dependency updates.github/dependabot.yml
Release PleaseAutomated version bumps and changelogs.github/workflows/release-please.yml
Issue TemplatesStructured bug/feature reporting.github/ISSUE_TEMPLATE/*.yml
PR TemplateConsistent pull request descriptions.github/PULL_REQUEST_TEMPLATE.md
CONTRIBUTING.mdContribution guidelinesCONTRIBUTING.md
SECURITY.mdSecurity policy and vulnerability reportingSECURITY.md

Customization

bash
# Skip specific config types
setup_init(projectDir, skipConfigs: ["dependabot", "release-please"])

# Force overwrite existing files
setup_init(projectDir, force: true)

# Override platform detection
setup_init(projectDir, platform: "gitlab")

Feature Rollback

The orchestrator creates git snapshot branches before each worker starts, enabling safe rollback of failed features.

How Rollback Works

  1. Snapshot Creation: start_worker creates swarm/{featureId} branch at current HEAD
  2. Worker Execution: Worker makes changes to working directory
  3. On Failure: Use rollback_feature to restore pre-worker state

Rollback Tools

ToolDescription
rollback_featureRestore files changed by a worker
check_rollback_conflictsCheck for conflicts with other workers

Usage

# Rollback all files changed by feature
rollback_feature(projectDir, featureId: "feature-1")

# Rollback specific files only
rollback_feature(projectDir, featureId: "feature-1", files: ["src/component.ts"])

Warning: When rolling back in parallel worker environments, other workers' changes to the same files will also be reverted.

Web Dashboard

Claude Swarm Dashboard

Active Workers Panel

A real-time web dashboard is available at http://localhost:3456:

  • Session Overview - Progress bar, feature counts, session statistics
  • Feature Cards - Status, dependencies, worker assignment
  • Live Terminal Output - Real-time streaming with ANSI color support
  • Review Worker Progress - Code and architecture review visibility
  • Dark Mode - Automatic theme detection

Dashboard API

The dashboard exposes a REST API for programmatic access:

EndpointMethodDescription
/api/statusGETSession overview with elapsed time and progress summary
/api/featuresGETFeature list with details (supports ?status= filter)
/api/workersGETAll worker statuses with summary counts
/api/workers/:featureId/outputGET (SSE)Stream worker terminal output in real-time
/api/review-workersGETReview worker statuses and findings summary
/api/review-workers/:type/outputGET (SSE)Stream review worker output
/api/logsGETProgress log entries (supports ?limit=N)
/api/statsGETSession statistics (completion times, success rates)
/api/eventsGET (SSE)Real-time updates for all session changes
/healthGETHealth check endpoint

Server-Sent Events (/api/events):

  • status - Session status changes
  • feature - Feature status updates
  • worker - Active worker count changes
  • reviewWorker - Review worker status updates
  • log - New progress log entries
  • heartbeat - Keep-alive (every 15s)

Architecture

Claude Swarm Architecture

Claude Code orchestrates workers through the MCP Server. Workers run in isolated tmux sessions and share access to the project codebase. The dashboard provides real-time monitoring via SSE.

MCP Tools Reference

Core Orchestration (3 tools)

ToolDescription
orchestrator_initStart session with task and features
orchestrator_statusGet current state (use after compaction)
orchestrator_resetClear state and kill all workers

Worker Management (9 tools)

ToolDescription
start_workerLaunch worker for a feature
start_parallel_workersLaunch multiple workers simultaneously
start_ralph_loopLaunch worker with Ralph Loop (fresh context per iteration)
validate_workersPre-flight validation before parallel execution
check_workerGet worker output (supports heartbeat mode)
check_all_workersCheck all active workers at once
send_worker_messageSend instructions to running worker
configure_plan_modeEnable/configure worker plan-before-implement mode
configure_ralph_loopEnable/configure Ralph Loop execution defaults

Competitive Planning (3 tools)

ToolDescription
get_feature_complexityAnalyze complexity score
start_competitive_planningSpawn 2 planners with different approaches
evaluate_plansCompare plans and select winner

Confidence Monitoring (2 tools)

ToolDescription
get_worker_confidenceGet detailed confidence breakdown
set_confidence_thresholdConfigure alert threshold

Feature Management (6 tools)

ToolDescription
mark_completeMark feature done/failed (auto-retry)
retry_featureReset failed feature for retry
run_verificationRun tests/build commands
add_featureAdd discovered work
set_dependenciesDefine feature dependencies
configure_verificationSet pre-completion verification commands

Pre-Completion Verification

Configure commands that workers must run before marking features complete:

configure_verification(projectDir, commands: ["npm test", "npx tsc --noEmit"])

Workers will run these commands and fix any errors before completion. Allowed commands include:

  • npm test, npm run test, yarn test, pnpm test
  • npx tsc --noEmit, npx vitest, npx jest
  • pytest, python -m pytest
  • cargo test, cargo check
  • go test, make test

Session & Progress (7 tools)

ToolDescription
get_progress_logView history (paginated)
get_session_statsSuccess rates and timing
pause_sessionPause and stop all workers
resume_sessionResume paused session (supports crash recovery)
shutdown_sessionGraceful shutdown with checkpoint
commit_progressCreate git checkpoint
auto_orchestrateHands-free orchestration until completion

Feature Rollback (2 tools)

ToolDescription
rollback_featureRestore files changed by a worker
check_rollback_conflictsCheck for conflicts with other workers

Post-Completion Reviews (5 tools)

ToolDescription
run_reviewManually trigger code/architecture reviews
check_reviewsMonitor review worker status
get_review_resultsGet aggregated findings (summary/detailed/json)
configure_reviewsSet auto-review preferences
implement_review_suggestionsConvert review findings into features

Repository Setup (3 tools)

ToolDescription
setup_analyzeAnalyze repo freshness and missing configs
setup_initInitialize repo configuration with parallel workers
setup_statusCheck setup progress

Protocol Management (5 tools)

ToolDescription
protocol_registerRegister a new protocol
protocol_activateActivate protocol for enforcement
protocol_deactivateDeactivate protocol
protocol_listList all registered protocols
protocol_statusGet protocol details and violations

Protocol Enforcement (4 tools)

ToolDescription
validate_feature_protocolsCheck if feature can run under active protocols
get_violationsGet recorded violations (paginated)
resolve_violationMark violation as resolved
get_audit_logGet protocol audit history

LLM Protocol Generation (5 tools)

ToolDescription
get_base_constraintsView immutable base constraints
propose_protocolSubmit a protocol proposal
review_proposalsList pending proposals with risk scores
approve_protocolApprove a protocol proposal
reject_protocolReject a protocol proposal

Protocol Networking (4 tools)

ToolDescription
export_protocolsExport protocols to shareable bundle
import_protocolsImport protocols from bundle
sync_protocolsSync with peer instances
discover_protocolsDiscover peer MCP instances

Context Management (4 tools)

ToolDescription
enrich_featureAuto-enrich feature with relevant docs and code
set_feature_contextManually set feature context
get_feature_graphView feature dependency graph with context
route_featureConfigure worker routing preferences

Files Created

your-project/
├── .claude/orchestrator/
│   ├── state.json              # Session state
│   ├── feature_list.json       # Feature status
│   ├── protocols/
│   │   ├── registry.json       # Protocol definitions
│   │   ├── active.json         # Active protocols
│   │   ├── violations.json     # Violation records
│   │   ├── audit.json          # Audit log
│   │   └── proposals/          # Pending proposals
│   ├── sync/                   # Cross-instance sync
│   ├── checkpoints/            # Session checkpoints for crash recovery
│   │   └── *.json              # Timestamped state snapshots
│   ├── heartbeat.json          # Orchestrator liveness detection
│   ├── learnings.json          # Failure pattern learning
│   ├── locks/                  # File-based mutual exclusion
│   │   └── *.lock              # Per-file lock files
│   ├── worktrees/              # Git worktree directories
│   └── workers/
│       ├── *.prompt            # Worker prompts
│       ├── *.log               # Worker output logs
│       ├── *.done              # Completion markers
│       ├── *.status            # Worker status
│       ├── *.plan.json         # Competitive plans
│       ├── *.confidence        # Self-reported confidence
│       ├── *.worker-plan.json  # Worker plan-phase output
│       ├── *.plan-done         # Plan phase completion markers
│       ├── *.progress.md       # Ralph Loop progress files
│       ├── code-review.findings.json        # Code review results
│       └── architecture-review.findings.json # Architecture review results
├── claude-progress.txt         # Human-readable log
└── init.sh                     # Environment setup

Configuration

VariableDefaultDescription
DASHBOARD_PORT3456Dashboard HTTP port
ENABLE_DASHBOARDtrueSet to false to disable

Security

Input Validation

  • Path traversal protection - All file paths validated against project directory
  • Cryptographically secure IDs - Uses crypto.randomUUID()
  • Symlink escape prevention - Real paths validated before file operations
  • Input validation - All inputs validated with Zod schemas

Regex Safety (ReDoS Protection)

  • Pattern validation - isDangerousRegexPattern() detects catastrophic backtracking
  • Safe regex testing - safeRegexTest() falls back to literal matching for dangerous patterns
  • Glob-to-regex conversion - Proper metacharacter escaping prevents injection

Memory Safety

  • Bounded collections - Operation counts, alerts, and observed patterns have maximum limits
  • LRU eviction - Least-recently-used entries removed when limits reached (max 50 cached managers)
  • Timestamp truncation - Historical data pruned to prevent unbounded growth

Network Safety

  • Localhost-only CORS - Dashboard only accepts requests from localhost origins
  • No external network access - Workers operate in isolated tmux sessions

Execution Safety

  • Fail-closed enforcement - Unknown constraint types block by default
  • Command allowlist - Only safe verification commands allowed
  • No shell injection - Uses execFile with arguments, prompts via files
  • Circuit breaker pattern - Monitor auto-stops after repeated failures
  • Review worker isolation - Read-only tools (no Bash access)

Protocol Security

  • Base constraints - Immutable security rules cannot be overridden
  • Proposal validation - LLM-generated protocols checked against security boundaries
  • Token-based matching - Tool prohibition uses exact token matching, not substring

Inspiration

Troubleshooting

"No active session"

Run orchestrator_status to check state, or orchestrator_init to start fresh.

Worker seems stuck

  1. check_worker(featureId) to see current output
  2. get_worker_confidence(featureId) to check confidence score
  3. send_worker_message(featureId, "guidance") to provide direction
  4. If truly stuck, mark_complete(featureId, success: false) triggers auto-retry

Lost context after compaction

Call orchestrator_status(projectDir) - the MCP server maintains all state externally.

Feature has unmet dependencies

  1. Check dependencies with orchestrator_status
  2. Complete dependency features first
  3. Or use set_dependencies to modify the chain

Protocol violations blocking work

  1. get_violations() to see what was violated
  2. resolve_violation(violationId, resolution) if false positive
  3. Adjust protocol constraints if too restrictive

Debugging tmux sessions

bash
# List all worker sessions
tmux list-sessions | grep cc-worker

# Attach to a worker session
tmux attach -t cc-worker-feature-1-abc123

# Capture recent output
tmux capture-pane -t <session-name> -p -S -100

Session crashed, how to recover

Use resume_session(projectDir) - it automatically detects crashes via stale heartbeat, loads the latest checkpoint, and restarts dead workers. Set restartDeadWorkers: true (default) to auto-restart Ralph Loop workers that were running.

Worker keeps failing verification

Check the Ralph Loop progress file (.claude/orchestrator/workers/{featureId}.progress.md) for error patterns across iterations. The progress file records issues encountered in each iteration, helping identify systematic problems.

Plan mode is too slow

Lower the complexity threshold (default: 30) via configure_plan_mode(projectDir, { complexityThreshold: 50 }) so only higher-complexity features trigger planning. Or disable per-feature by setting planMode: false on the feature.

Monitor stops unexpectedly

The monitor auto-stops after 5 consecutive errors (circuit breaker). Check MCP server logs and restart if needed.

Limitations

  • Requires tmux (WSL on Windows)
  • Workers use your Claude Code subscription
  • Protocol enforcement is observational (monitors but doesn't intercept tool calls)
  • Complex feature detection is heuristic-based

Contributing

Contributions welcome! See CONTRIBUTING.md for guidelines.

License

MIT

将 Claude Swarm MCP 与多个 AI 模型配合使用

TypingMind 在工作区级别连接 MCP 工具,因此连接 Claude Swarm 后,您就可以在 TypingMind 中搭配不同的 AI 模型使用,无需为每个模型单独设置。 此 MCP 通过您设备上的 TypingMind MCP 连接器在本地运行。

本地连接器设置指南

如果 MCP 服务器需要访问您电脑上的本地文件、应用或私有资源,请选择此方式。

1

打开 MCP 设置

在 TypingMind 中,依次前往“设置”、“高级设置”和“模型上下文协议”,然后选择“设置连接器”。

  1. 在您的浏览器中打开 TypingMind。
  2. 点击“设置”图标。
  3. 进入“高级设置”。
  4. 打开“模型上下文协议”部分。
  5. 点击“设置连接器”,然后选择“此设备”。
TypingMind MCP 连接器设置界面,已选择“此设备”
2

运行连接器命令

选择“此设备”,从 TypingMind 复制命令并在终端中运行。使用 MCP 时,请保持该进程运行。

  1. 复制 TypingMind 显示的设置命令。
  2. 在 macOS 上打开“终端”,或在 Windows 上打开 Windows Terminal。
  3. 粘贴并运行命令。
  4. 如果终端询问您是否继续,请确认安装软件包。
  5. 使用 MCP 工具时,请勿关闭终端窗口或停止其中的连接器进程。
3

将 Claude Swarm 添加为服务器

当连接器状态为“就绪”时,点击“编辑服务器”,然后粘贴 MCP 服务器配置。

  1. 等待连接器状态显示为“就绪”。
  2. 点击“编辑服务器”。
  3. 粘贴 Claude Swarm MCP 服务器配置。
  4. 保存服务器列表。
  5. 如需确认连接器是否仍处于就绪状态,请刷新。
TypingMind MCP 设置界面,显示正在运行的服务器和“编辑服务器”按钮
{
  "mcpServers": {
    "claude-swarm": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

在不同模型中使用同一连接

保存服务器列表,打开“插件”,启用 Claude Swarm MCP 工具,然后在 TypingMind 中选择任意受支持的 AI 模型,即可在聊天中使用这些工具,或将其分配给智能体。

  1. 在 TypingMind 中打开“插件”页面。
  2. 启用 Claude Swarm MCP 工具。
  3. 开始聊天并选择您想使用的 AI 模型。
  4. 在聊天中使用 MCP 工具,或将其分配给 AI 智能体。
  5. 根据需要随时切换到其他 AI 模型,无需重新连接 MCP。
在 TypingMind 聊天中使用已启用的 MCP 工具和选定的 AI 模型
您能使用 Claude Swarm 帮我完成这项任务吗?
Claude Swarm
当然,我看过了。
以下是我使用 Claude Swarm 得到的结果。

常见问题

Claude Swarm MCP 服务器有什么用途?

Claude Swarm 是一个 MCP 服务器,可让兼容的 AI 客户端连接外部工具并获取上下文。在 TypingMind 中,只需添加一次此 MCP 服务器,即可在您的 AI 工作区中使用其工具。

可以在 TypingMind 中让多个 AI 模型使用 Claude Swarm MCP 吗?

可以。TypingMind 在工作区层面连接 MCP 工具,因此您无需为每个模型单独配置 MCP 服务器,就能在 Claude、ChatGPT、Gemini 或您在 TypingMind 中配置的其他 AI 模型中使用 Claude Swarm。

为什么在 TypingMind 中使用 Claude Swarm MCP?

TypingMind 将多个 AI 模型、提示词、插件、AI 智能体、API 密钥和 MCP 工具整合到同一个工作区中,是最出色的大语言模型聊天前端之一。连接 Claude Swarm 后,您可以在偏好的不同模型中使用其 MCP 工具,同时在 TypingMind 中井然有序地管理聊天工作流程。

如何将 Claude Swarm MCP 连接到 TypingMind?

Claude Swarm 通过 TypingMind 本地 MCP 连接器运行。当 MCP 服务器需要访问您计算机上的本地文件、桌面应用、命令行工具或私有资源时,这种方式最合适。

Claude Swarm MCP 在 TypingMind 中提供哪些工具?

Claude Swarm 提供 MCP 功能,您可以在 TypingMind 的插件页面启用这些功能,然后在聊天中使用,或将其分配给 AI 智能体。

使用 Claude Swarm MCP 需要向 TypingMind 提供我的 API 密钥吗?

不需要。TypingMind 采用本地优先的设计,让您自行选择模型提供商,并自行管理 API 密钥、提示词和 MCP 配置。如果 Claude Swarm 需要身份验证,请在创建连接时,为该 MCP 服务器添加所需的请求头、OAuth 设置或本地配置。

相关 MCP 服务器

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇