XC

xiaolai/claude-octopus

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

21 stars 8 forks 质量 82 趋势 30ISC

一个大脑,多臂——生成多个专门的Claude代码代理作为MCP服务器

概览

一个封装 Claude Agent SDK 的 MCP 服务器,允许你从任何 MCP 客户端运行多个专用的 Claude Code 代理——每个代理都有自己的模型、工具、系统提示和个性。 Claude Code 很强大。但有一个实例所有操作都一样。有时候你想要一个只读取文件的 a。一个默认使用 TDD。A 用于 Haiku。A 用于 Opus。 Claude Octopus 允许你启动任意数量的这些工具。同样的二进制,但配置不同。每个工具都会作为独立工具出现在你的 MCP 客户端中。 - >= 18 - — Claude Agent SDK 作为依赖捆绑,但它会在底层生成 Claude Code,所以你需要一个可运行的 Claude CLI 安装(ANTHROPIC_API_KEY env var)或一个活跃的 Claude Code OAuth 会话 有三条路径,选择与你MCP客户端匹配的路径。 完全跳过安装——在.mcp.json中参考 claude-octopus@latest,客户端会自动按需取物(见下方快速启动)。 服务器以 . 的名称发布到 MCP 注册局。

概述(AI 翻译)

一个脑袋,多只手臂。

一个封装 Claude Agent SDK 的 MCP 服务器,允许你从任何 MCP 客户端运行多个专用的 Claude Code 代理——每个代理都有自己的模型、工具、系统提示和个性。

为什么

Claude Code 很强大。但有一个实例做所有事情都一样。有时候你想要一个严格的代码审查器,只读文件。一个默认使用 TDD 的测试写手。一个便宜的快速助手 在 Haiku 上。一个深度思考者在 Opus 上。

Claude Octopus 允许你启动任意数量的这些工具。同样的二进制,但配置不同。每个工具都会作为独立工具出现在你的 MCP 客户端中。

先修条件

  • Node.js >= 18
  • Claude Code — Claude Agent SDK 作为依赖捆绑,但它在底层生成 Claude Code,因此你需要一个可运行的 claude CLI 安装
  • Anthropic API 密钥(ANTHROPIC_API_KEY env var)或活跃的 Claude Code OAuth 会话

安装

有三条路径,选择与你MCP客户端匹配的路径。

NPM(最直接)

NPX(无需安装)

完全跳过安装过程——在你的 .mcp.json 中引用 claude-octopus@latest],客户端将按需获取(见下方快速启动)。

MCP注册处

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

Claude Octopus

One brain, many arms.

An MCP server that wraps the Claude Agent SDK, letting you run multiple specialized Claude Code agents — each with its own model, tools, system prompt, and personality — from any MCP client.

Why

Claude Code is powerful. But one instance does everything the same way. Sometimes you want a strict code reviewer that only reads files. A test writer that defaults to TDD. A cheap quick helper on Haiku. A deep thinker on Opus.

Claude Octopus lets you spin up as many of these as you need. Same binary, different configurations. Each one shows up as a separate tool in your MCP client.

Prerequisites

  • Node.js >= 18
  • Claude Code — the Claude Agent SDK is bundled as a dependency, but it spawns Claude Code under the hood, so you need a working claude CLI installation
  • Anthropic API key (ANTHROPIC_API_KEY env var) or an active Claude Code OAuth session

Install

Three paths, pick whichever matches your MCP client.

npm (most direct)

npm install claude-octopus

npx (no install needed)

Skip the install entirely — reference claude-octopus@latest in your .mcp.json and the client will fetch on demand (see Quick Start below).

MCP Registry

The server is published to the MCP Registry under the name io.github.xiaolai/claude-octopus. Registry-aware MCP clients can resolve and install it by that name without touching npm directly.

Quick Start

The fastest way to get started:

npx claude-octopus init

This interactive wizard lets you pick a template, detects your MCP client, and writes the config for you.

Or add to your .mcp.json manually:

{
  "mcpServers": {
    "claude": {
      "command": "npx",
      "args": ["claude-octopus@latest"],
      "env": {
        "CLAUDE_PERMISSION_MODE": "bypassPermissions"
      }
    }
  }
}

This gives you six tools:

Tool Purpose
claude_code Send a task, get a result
claude_code_reply Continue a conversation
claude_code_timeline Query the workflow timeline
claude_code_transcript Read full session transcripts
claude_code_sessions List Claude Code session history (this project, or all)
claude_code_report Generate HTML reports

That’s it — you have Claude Code as a tool, with full workflow observability built in.

Multiple Agents

The real power is running several instances with different configurations:

{
  "mcpServers": {
    "code-reviewer": {
      "command": "npx",
      "args": ["claude-octopus@latest"],
      "env": {
        "CLAUDE_TOOL_NAME": "code_reviewer",
在 GitHub 查看完整 README

安装

npx claude-octopus@latest
新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "claude": { "command": "npx", "args": ["claude-octopus@latest"], "env": { "CLAUDE_PERMISSION_MODE": "bypassPermissions" } } } }