Logo van Claude Octopus

Claude Octopus

Community
xiaolai

One brain, many arms — spawn multiple specialized Claude Code agents as MCP servers

Uitgeverxiaolai
Repositoryclaude-octopus
TaalTypeScript
Forks
7
Sterren
21
Beschikbare tools
2
Transporttypestdio
Categorieën
LicentieISC
Links
  • Koppel tools aan AI-workflows

    Claude Octopus biedt MCP-functionaliteit die compatibele AI-clients en agenten kunnen gebruiken.

  • 2 beschikbare tools

    Bekijk hieronder de aanroepbare acties, inclusief namen en beschrijvingen als de server die beschikbaar stelt.

  • Configuratie om direct te kopiëren

    Gebruik de installatievoorbeelden om deze server in je favoriete MCP-client te configureren.

  • Indicatoren van opensource-interesse

    21 sterren en 7 forks in de gekoppelde repository.

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)

bash
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:

bash
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:

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

This gives you six tools:

ToolPurpose
claude_codeSend a task, get a result
claude_code_replyContinue a conversation
claude_code_timelineQuery the workflow timeline
claude_code_transcriptRead full session transcripts
claude_code_sessionsList Claude Code session history (this project, or all)
claude_code_reportGenerate 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:

json
{
  "mcpServers": {
    "code-reviewer": {
      "command": "npx",
      "args": ["claude-octopus@latest"],
      "env": {
        "CLAUDE_TOOL_NAME": "code_reviewer",
        "CLAUDE_SERVER_NAME": "code-reviewer",
        "CLAUDE_DESCRIPTION": "Strict code reviewer. Finds bugs and security issues. Read-only.",
        "CLAUDE_MODEL": "opus",
        "CLAUDE_ALLOWED_TOOLS": "Read,Grep,Glob",
        "CLAUDE_APPEND_PROMPT": "You are a strict code reviewer. Report real bugs, not style preferences.",
        "CLAUDE_EFFORT": "high"
      }
    },
    "test-writer": {
      "command": "npx",
      "args": ["claude-octopus@latest"],
      "env": {
        "CLAUDE_TOOL_NAME": "test_writer",
        "CLAUDE_SERVER_NAME": "test-writer",
        "CLAUDE_DESCRIPTION": "Writes thorough tests with edge case coverage.",
        "CLAUDE_MODEL": "sonnet",
        "CLAUDE_APPEND_PROMPT": "Write tests first. Cover edge cases. TDD."
      }
    },
    "quick-qa": {
      "command": "npx",
      "args": ["claude-octopus@latest"],
      "env": {
        "CLAUDE_TOOL_NAME": "quick_qa",
        "CLAUDE_SERVER_NAME": "quick-qa",
        "CLAUDE_DESCRIPTION": "Fast answers to quick coding questions.",
        "CLAUDE_MODEL": "haiku",
        "CLAUDE_MAX_BUDGET_USD": "0.02",
        "CLAUDE_EFFORT": "low"
      }
    }
  }
}

Your MCP client now sees distinct tools for each agent — code_reviewer, test_writer, quick_qa — each purpose-built.

Multi-Agent Orchestration

Agents can coordinate through a coordinator pattern: one agent has the others as inner MCP tools via CLAUDE_MCP_SERVERS, and its system prompt drives the pipeline.

json
{
  "mcpServers": {
    "publishing-house": {
      "command": "npx",
      "args": ["claude-octopus@latest"],
      "env": {
        "CLAUDE_TOOL_NAME": "publishing_house",
        "CLAUDE_SERVER_NAME": "publishing-house",
        "CLAUDE_MODEL": "opus",
        "CLAUDE_PERMISSION_MODE": "bypassPermissions",
        "CLAUDE_APPEND_PROMPT": "You are a publishing house coordinator. Dispatch tasks to your specialist agents and drive the pipeline to completion.",
        "CLAUDE_MCP_SERVERS": "{\"researcher\":{\"command\":\"npx\",\"args\":[\"claude-octopus@latest\"],\"env\":{\"CLAUDE_TOOL_NAME\":\"researcher\",\"CLAUDE_SERVER_NAME\":\"researcher\",\"CLAUDE_MODEL\":\"sonnet\",\"CLAUDE_PERMISSION_MODE\":\"bypassPermissions\"}},\"architect\":{\"command\":\"npx\",\"args\":[\"claude-octopus@latest\"],\"env\":{\"CLAUDE_TOOL_NAME\":\"architect\",\"CLAUDE_SERVER_NAME\":\"architect\",\"CLAUDE_MODEL\":\"opus\",\"CLAUDE_PERMISSION_MODE\":\"bypassPermissions\"}}}"
      }
    }
  }
}

The coordinator agent autonomously calls researcher, architect, etc. as MCP tools — fully autonomous, no human in the loop until it finishes. Every invocation is tracked in the shared timeline.

Agent Factory

Don't want to write configs by hand? Add a factory instance:

json
{
  "mcpServers": {
    "agent-factory": {
      "command": "npx",
      "args": ["claude-octopus@latest"],
      "env": {
        "CLAUDE_FACTORY_ONLY": "true",
        "CLAUDE_SERVER_NAME": "agent-factory"
      }
    }
  }
}

This exposes a single create_claude_code_mcp tool — an interactive wizard. Tell it what you want ("a strict code reviewer that only reads files") and it generates the .mcp.json entry for you, listing all available options you can customize.

In factory-only mode, no query tools are registered — just the wizard. This keeps routing clean: the factory creates agents, the agents do work.

Init Wizard

Don't want to edit JSON by hand? The init wizard gets you from zero to working in 30 seconds:

bash
npx claude-octopus init
  Claude Octopus — init wizard

  One brain, many arms. Let's set up your agents.

Pick a template (or build your own):

  1. Code Review Team — Reviewer + test writer + security auditor
  2. Publishing House — Researcher + architect + editor + proofreader
  3. Tiered Models — Haiku for quick Q&A, Sonnet for coding, Opus for hard problems
  4. Solo Agent — Single Claude Code agent with sensible defaults
  5. Agent Factory — Interactive wizard that generates agent configs on demand
  6. Custom — describe your own agent(s)

Choice [1-6]:

It auto-detects installed MCP clients (Claude Desktop, Claude Code, Cursor, Windsurf), merges with existing config, and warns before overwriting.

Skip the menu

bash
npx claude-octopus init --template code-review-team
npx claude-octopus init --template tiered-models
npx claude-octopus init --template publishing-house

Templates

Five built-in templates, battle-tested and ready to use:

TemplateAgentsPurpose
code-review-teamcode-reviewer (opus), test-writer (sonnet), security-auditor (opus)Thorough code review pipeline
publishing-houseresearcher (sonnet), architect (opus), editor (sonnet), proofreader (haiku)Multi-stage content/code pipeline
tiered-modelsquick-qa (haiku), coder (sonnet), deep-thinker (opus)Right model for the job
solo-agentclaude (default)Single agent, quick setup
factoryagent-factoryGenerates configs on demand

Each agent comes pre-tuned with appropriate model, tools, effort level, and system prompt.

Dashboard

Monitor your agents in real time:

bash
npx claude-octopus dashboard

Opens a local web dashboard at http://localhost:3456 with:

  • Live stats — total runs, invocations, cost, SDK turns, responses, errors
  • Recent activity — agent cards for the latest run
  • Run table — all runs with cost, duration, and status
  • Auto-refresh — SSE connection pushes updates as agents run
bash
# Custom port
npx claude-octopus dashboard --port 8080

The dashboard reads the same timeline index used by the _timeline and _report tools. No additional configuration needed.

Tools

Each non-factory instance exposes:

ToolPurpose
<name>Send a task to the agent, get a response + session_id + run_id
<name>_replyContinue a previous conversation by session_id
<name>_timelineQuery the cross-agent workflow timeline
<name>_transcriptRetrieve full session transcript from Claude Code's storage
<name>_sessionsList Claude Code session history — this project by default, or all projects with all_projects: true
<name>_reportGenerate a self-contained HTML report for a run or all runs

Query and reply parameters

ParameterDescription
promptThe task or question (required)
run_idWorkflow run ID — groups related agent calls into one timeline. Auto-generated if omitted; returned in every response for propagation.
cwdWorking directory override
modelModel override (sonnet, opus, haiku, or full ID)
toolsRestrict available tools (intersects with server restriction)
disallowedToolsBlock additional tools (unions with server blacklist)
additionalDirsExtra directories the agent can access
pluginsAdditional plugin paths to load
effortThinking effort (low, medium, high, max)
permissionModePermission mode (can only tighten, never loosen)
maxTurnsMax agent-loop round trips (see effort counters)
maxBudgetUsdMax spend in USD
systemPromptAdditional prompt (appended to server default)

Timeline

Every agent invocation is recorded in a lightweight JSONL index at ~/.claude-octopus/timelines/timeline.jsonl. This solves the multi-agent correlation problem: when several agents participate in a workflow, the timeline tracks which sessions belong to the same run, in what order they executed, and what role each played.

Full session transcripts stay in Claude Code's own storage (~/.claude/projects/). The timeline is just the table of contents — ~200 bytes per entry — that cross-references via session_id.

How it works

  1. Every <name> and <name>_reply call appends one line to the timeline
  2. If you pass run_id, all agents sharing the same run_id are grouped into one run
  3. If you omit run_id, one is auto-generated and returned in the response — pass it to subsequent agents to keep them grouped

Querying the timeline

# List all runs
<name>_timeline({})

# Show one run's agent sequence
<name>_timeline({ run_id: "abc-123" })

# Look up a specific session
<name>_timeline({ session_id: "ses-xyz" })

# Retrieve full transcript (separate tool)
<name>_transcript({ session_id: "ses-xyz" })

Multi-agent workflow example

Host:  researcher({ prompt: "Research X", run_id: "pub-001" })
       → { run_id: "pub-001", session_id: "ses-aaa", result: "..." }

Host:  architect({ prompt: "Structure based on...", run_id: "pub-001" })
       → { run_id: "pub-001", session_id: "ses-bbb", result: "..." }

Host:  verifier({ prompt: "Check this plan", run_id: "pub-001" })
       → { run_id: "pub-001", session_id: "ses-ccc", result: "..." }

Later: researcher_timeline({ run_id: "pub-001" })
       → [
           { agent: "researcher", session_id: "ses-aaa", cost: 0.05, turns: 4, tool_calls: 3, response_groups: 2 },
           { agent: "architect",  session_id: "ses-bbb", cost: 0.08, turns: 6, tool_calls: 5, response_groups: 3 },
           { agent: "verifier",   session_id: "ses-ccc", cost: 0.03, turns: 3, tool_calls: 2, response_groups: 2 },
         ]

Later: researcher_transcript({ session_id: "ses-aaa" })
       → full conversation transcript from Claude Code's storage

HTML Reports

Generate self-contained HTML reports with agent sequence visualization, cost breakdown, and collapsible transcripts. Dark theme, no external dependencies — one file, open in any browser.

Via MCP tool

<name>_report({})                        # index of all runs
<name>_report({ run_id: "pub-001" })     # detailed report for one run

Via CLI

bash
# Index of all runs
npx claude-octopus report --out index.html

# Detailed report for one run
npx claude-octopus report pub-001 --out report.html
open report.html

# Without transcripts (faster, smaller file)
npx claude-octopus report pub-001 --no-transcripts --out report.html

# To stdout (pipe-friendly)
npx claude-octopus report pub-001 > report.html

What's in the report

  • Run summary — agent count, total cost, duration, SDK turns, responses, tool calls
  • Timeline bar — numbered dots for each agent (green = success, red = error)
  • Agent cards — timing, cost, effort counters, session ID, prompt excerpt
  • Collapsible transcripts — full tool calls, reasoning, and results per agent

Reading the effort counters

Three numbers describe how much work an invocation took. They are not interchangeable, and the first one is the one that surprises people:

MetricWhat it counts
num_turns (shown as SDK turns)Raw value from the Agent SDK. Measured against the runtime it tracks tool_use blocks plus the final response — not API round trips.
response_groups (responses)Distinct assistant responses in the main agent loop — one per API round trip, no matter how many tools that response called in parallel.
tool_calls (tool calls)tool_use blocks issued across the main agent loop.

When an agent calls several tools in parallel, num_turns climbs faster than the number of visible responses. A run with 3 assistant responses issuing 4 tool calls reports num_turns: 5, response_groups: 3, tool_calls: 4. maxTurns, meanwhile, is enforced against round trips: that same run completes under maxTurns: 3 and aborts under maxTurns: 2. So size maxTurns against responses, not against SDK turns.

Both new counters cover the main agent loop only — work inside a sub-agent (Task) belongs to its own loop and is excluded. Timeline entries written by older versions have neither, and render as — rather than as a false zero.

Configuration

All configuration is via environment variables in .mcp.json. Every env var is optional.

Identity

Env VarDescriptionDefault
CLAUDE_TOOL_NAMETool name prefix (generates <name>, <name>_reply, <name>_timeline, <name>_transcript, <name>_report)claude_code
CLAUDE_DESCRIPTIONTool description shown to the host AIgeneric
CLAUDE_SERVER_NAMEMCP server name in protocol handshakeclaude-octopus
CLAUDE_FACTORY_ONLYOnly expose the factory wizard toolfalse

Agent

Env VarDescriptionDefault
CLAUDE_MODELModel (sonnet, opus, haiku, or full ID)SDK default
CLAUDE_CWDWorking directoryprocess.cwd()
CLAUDE_PERMISSION_MODEdefault, acceptEdits, bypassPermissions, plandefault
CLAUDE_ALLOWED_TOOLSComma-separated tool restriction (available tools)all
CLAUDE_DISALLOWED_TOOLSComma-separated tool blacklistnone
CLAUDE_MAX_TURNSMax agent-loop round trips per invocationunlimited
CLAUDE_MAX_BUDGET_USDMax spend per invocationunlimited
CLAUDE_EFFORTlow, medium, high, maxSDK default

Prompts

Env VarDescription
CLAUDE_SYSTEM_PROMPTReplaces the default Claude Code system prompt
CLAUDE_APPEND_PROMPTAppended to the default prompt (usually what you want)

Advanced

Env VarDescription
CLAUDE_ADDITIONAL_DIRSExtra directories to grant access (comma-separated)
CLAUDE_PLUGINSLocal plugin paths (comma-separated)
CLAUDE_MCP_SERVERSMCP servers for the inner agent (JSON)
CLAUDE_PERSIST_SESSIONtrue/false — enable session resume (default: true)
CLAUDE_SETTING_SOURCESSettings to load: user, project, local
CLAUDE_SETTINGSPath to settings JSON or inline JSON
CLAUDE_BETASBeta features (comma-separated)

Timeline

Env VarDescriptionDefault
CLAUDE_TIMELINE_DIRDirectory for the cross-agent timeline index~/.claude-octopus/timelines

Authentication

Env VarDescriptionDefault
ANTHROPIC_API_KEYAnthropic API key for this agentinherited from parent
CLAUDE_CODE_OAUTH_TOKENClaude Code OAuth token for this agentinherited from parent

Leave both unset to inherit auth from the parent process. Set one per agent to use a different account or billing source.

Lists accept JSON arrays when values contain commas: ["path,with,comma", "/normal"]

Security

  • Permission mode defaults to default — tool executions prompt for approval unless you explicitly set bypassPermissions.
  • cwd overrides preserve agent knowledge — when the host overrides cwd, the agent's configured base directory is automatically added to additionalDirectories so it retains access to its own context.
  • Tool restrictions narrow, never widen — per-invocation tools intersects with the server restriction (can only remove tools, not add). disallowedTools unions (can only block more).
  • _reply and _transcript tools respect persistence — not registered when CLAUDE_PERSIST_SESSION=false.
  • Timeline writes are best-effort — a failed timeline append never blocks or fails the primary query.

Architecture

How It Compares

FeatureBuilt-in claudeclaude-code-mcpClaude Octopus
ApproachBuilt-inCLI wrappingAgent SDK
Tools per instance16 raw tools1 prompt tool5 (prompt, reply, timeline, transcript, report)
Multi-instanceNoNoYes
Per-instance configNoNoYes (20 env vars)
Init wizardNoNoYes (init + 5 templates)
Factory wizardNoNoYes
Session continuityNoNoYes
Cross-agent timelineNoNoYes
Web dashboardNoNoYes (live, SSE)
HTML reportsNoNoYes

Development

bash
pnpm install
pnpm build       # compile TypeScript
pnpm test        # run tests (vitest)
pnpm test:coverage  # coverage report

License

ISC - Xiaolai Li

Installatie

TypingMind
{
  "mcpServers": {
    "claude-octopus": {
      "command": "npx",
      "args": [
        "claude-octopus"
      ],
      "env": {
        "ANTHROPIC_API_KEY": "<ANTHROPIC_API_KEY>"
      }
    }
  }
}

Beschikbare tools

  • claude_code

    Send a task to an autonomous Claude Code agent. It reads/writes files, runs shell commands, searches codebases, and handles complex software engineering tasks end-to-end. Returns the result text plus a session_id for follow-ups via claude_code_reply.

  • claude_code_reply

    Continue a previous claude_code conversation by session ID. Use this for follow-up questions, iterative refinement, or multi-step workflows that build on prior context.

Gebruik Claude Octopus MCP met meerdere AI-modellen

TypingMind koppelt MCP-tools aan de werkruimte. Zodra Claude Octopus is verbonden, kun je deze dus met verschillende AI-modellen in TypingMind gebruiken, zonder de verbinding voor elk model apart in te stellen. Deze MCP-integratie draait lokaal via de TypingMind MCP-connector op je apparaat.

Installatiehandleiding voor de lokale connector

Gebruik dit als de MCP-server toegang nodig heeft tot lokale bestanden, apps of privébronnen op je computer.

1

Open de MCP-instellingen

Ga in TypingMind naar Instellingen, Geavanceerde instellingen en vervolgens Model Context Protocol. Kies daar Connector instellen.

  1. Open TypingMind in je browser.
  2. Klik op het pictogram Instellingen.
  3. Ga naar Geavanceerde instellingen.
  4. Open het gedeelte Model Context Protocol.
  5. Klik op Connector instellen en kies Dit apparaat.
Instelscherm voor de TypingMind MCP-connector met Dit apparaat geselecteerd
2

Voer de connectoropdracht uit

Kies Dit apparaat, kopieer de opdracht uit TypingMind en voer deze uit in Terminal. Laat het proces draaien zolang je MCP gebruikt.

  1. Kopieer de installatieopdracht die TypingMind toont.
  2. Open Terminal op macOS of Windows Terminal op Windows.
  3. Plak de opdracht en voer deze uit.
  4. Keur de pakketinstallatie goed als Terminal vraagt of je wilt doorgaan.
  5. Laat het proces in het Terminal-venster draaien zolang je MCP-tools gebruikt.
3

Voeg Claude Octopus toe als server

Klik op Servers bewerken zodra de connectorstatus Gereed is en plak de MCP-serverconfiguratie.

  1. Wacht tot de connectorstatus Gereed aangeeft.
  2. Klik op Servers bewerken.
  3. Plak de MCP-serverconfiguratie van Claude Octopus.
  4. Sla de serverlijst op.
  5. Vernieuw om te controleren of de connector nog steeds klaar is voor gebruik.
MCP-instellingen van TypingMind met een actieve server en de knop Servers bewerken
{
  "mcpServers": {
    "claude-octopus": {
      "command": "npx",
      "args": [
        "-y",
        "claude-octopus"
      ]
    }
  }
}
4

Gebruik de verbinding met verschillende modellen

Sla de serverlijst op, open Plug-ins en schakel de MCP-tools van Claude Octopus in. Selecteer vervolgens een ondersteund AI-model in TypingMind en gebruik de tools in de chat of wijs ze toe aan een AI-agent.

  1. Open de pagina Plug-ins in TypingMind.
  2. Schakel de MCP-tools van Claude Octopus in.
  3. Start een chat en kies het AI-model dat je wilt gebruiken.
  4. Gebruik de MCP-tools in een chat of wijs ze toe aan een AI-agent.
  5. Schakel wanneer nodig over naar een ander AI-model zonder opnieuw verbinding te maken met MCP.
TypingMind-chat met ingeschakelde MCP-tools en een geselecteerd AI-model
Kun je Claude Octopus gebruiken om me hiermee te helpen?
Claude Octopus
Zeker. Ik heb het gelezen.
Dit vond ik met Claude Octopus.

Veelgestelde vragen

Waarvoor wordt de MCP-server Claude Octopus gebruikt?

Claude Octopus is een MCP-server waarmee compatibele AI-clients verbinding kunnen maken met externe tools en context. In TypingMind hoef je deze MCP-server maar één keer toe te voegen om de tools beschikbaar te maken in je AI-werkruimte.

Kan ik Claude Octopus MCP met meerdere AI-modellen in TypingMind gebruiken?

Ja. TypingMind verbindt MCP-tools op werkruimteniveau. Daardoor kun je Claude Octopus gebruiken met verschillende AI-modellen, zoals Claude, ChatGPT, Gemini of andere modellen die je in TypingMind hebt ingesteld, zonder de MCP-server voor elk model afzonderlijk in te stellen.

Waarom Claude Octopus MCP gebruiken met TypingMind?

TypingMind is een van de beste interfaces voor chats met LLM's, omdat het meerdere AI-modellen, prompts, plug-ins, AI-agenten, API-sleutels en MCP-tools samenbrengt in één werkruimte. Als Claude Octopus verbonden is, kun je de MCP-tools ervan gebruiken met je favoriete modellen en je chatworkflow overzichtelijk houden in TypingMind.

Hoe verbind ik Claude Octopus MCP met TypingMind?

Claude Octopus werkt via de lokale MCP-connector van TypingMind. Dit is de beste optie als de MCP-server toegang nodig heeft tot lokale bestanden, desktopapps, opdrachtregeltools of privébronnen op je computer.

Welke tools biedt Claude Octopus MCP in TypingMind?

Claude Octopus biedt 2 MCP-tools die je kunt inschakelen via de pagina Plug-ins in TypingMind. Je kunt ze gebruiken in chats of toewijzen aan AI-agenten.

Moet ik mijn API-sleutels delen met TypingMind om Claude Octopus MCP te gebruiken?

Nee. TypingMind werkt in de eerste plaats lokaal en laat je de controle houden over je modelaanbieders, API-sleutels, prompts en MCP-configuratie. Als Claude Octopus authenticatie vereist, voeg je bij het maken van de verbinding de vereiste headers, OAuth-instellingen of lokale configuratie voor die MCP-server toe.

Gerelateerde MCP-servers

Toon alles

Maak nu je eigen AI-werkruimte

Schrijf je in voor onze nieuwsbrief en blijf op de hoogte van nieuwe functies en toekomstige weggeefacties 👇