Skip to main content
The Claude Octopus MCP server exposes workflows as tools that any MCP-compatible client can consume. This enables integration with OpenClaw, Claude Desktop, Cursor, and other MCP clients.

Model Context Protocol overview

The Model Context Protocol (MCP) is an open protocol for connecting AI assistants to external tools and data sources. It provides:
  • Standardized tool interface — Uniform tool registration and invocation
  • Transport-agnostic — Works over stdio, HTTP, WebSocket
  • Security model — Sandboxed execution, permission controls
  • Type safety — JSON Schema validation for parameters
Claud Octopus implements an MCP server that delegates to orchestrate.sh, preserving exact behavioral parity with the Claude Code plugin.

Server architecture

Component diagram

Startup sequence

  1. Claude Code reads .mcp.json on plugin load
  2. Spawns MCP server: node mcp-server/dist/index.js
  3. Server initializes stdio transport
  4. Registers 11 tools with MCP SDK
  5. Loads skill metadata from .claude/skills/*.md
  6. Sends server/initialized message to client
  7. Client can now invoke tools

Configuration via .mcp.json

The .mcp.json file tells Claude Code how to launch the server:
Key points:
  • Server name: octo-claw (arbitrary identifier)
  • Command: node with path to compiled TypeScript
  • Environment: CLAUDE_OCTOPUS_MCP_MODE=true signals MCP execution context
  • Transport: stdio (stdin/stdout) — no network ports required

11 exposed tools

The MCP server registers these tools (see full API in OpenClaw integration):

Workflow tools (8)

Introspection tools (2)

IDE integration tool (1)

Connecting MCP clients

Claude Desktop

Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or equivalent:
Restart Claude Desktop. The tools appear in the tool palette.

OpenClaw

Install the OpenClaw extension (see OpenClaw integration):
The extension auto-connects to the MCP server.

Cursor

Cursor supports MCP via its settings:

Custom MCP client

Use the MCP SDK:

Tool execution flow

Example: octopus_develop

  1. Client invokes tool:
  2. Server validates parameters (Zod schema):
  3. Server builds environment:
  4. Server executes orchestrate.sh:
  5. orchestrate.sh runs workflow:
    • Detects available providers (Codex, Gemini, Claude)
    • Routes to appropriate agents
    • Runs quality gates
    • Returns synthesis file
  6. Server returns result:

Security model

Environment variable isolation

Only allowed environment variables are forwarded to orchestrate.sh:
See source code:~/workspace/source/mcp-server/src/index.ts:53-96

API key sanitization

Error messages sanitize leaked API keys:

Path validation

IDE context paths reject traversal attempts:

Selection size limit

Editor selections are truncated to 50KB:

Transport security

stdio transport (default) is scoped to the spawning process — no network exposure.
If switching to HTTP/SSE/WebSocket transport, add bearer token authentication.

Skill metadata

The server loads skill metadata from frontmatter:
See source code:~/workspace/source/mcp-server/src/index.ts:121-152

Debugging the MCP server

Enable debug logs

Test with MCP Inspector

Use the MCP Inspector to test the server:
This opens a web UI for invoking tools and inspecting responses.

Check server logs

Server logs are written to:
  • Claude Code: ~/.claude/logs/mcp-server.log
  • OpenClaw: ~/.openclaw/logs/mcp-server.log

Common issues

Symptoms: Client reports “MCP server not available”Causes:
  • Missing dependencies: Run npm install in mcp-server/
  • TypeScript not compiled: Run npm run build in mcp-server/
  • Wrong Node.js version: Requires Node.js ≥18
Fix:
Symptoms: Client times out waiting for responseCauses:
  • orchestrate.sh hung on provider call
  • Quality gate blocked execution
  • Large synthesis file being generated
Fix:
  • Check ~/.claude-octopus/logs/orchestrate.log
  • Increase timeout in client config
  • Enable debug mode: OCTOPUS_DEBUG=true
Symptoms: orchestrate.sh can’t find API keysCauses:
  • Env vars not set in MCP server environment
  • Blocked by security filter
Fix:
  • Set env vars in .mcp.json:
  • Check blocked vars list in mcp-server/src/index.ts:53

Source code reference

  • MCP server: mcp-server/src/index.ts in source code:~/workspace/source/mcp-server/src/index.ts
  • MCP config: .mcp.json in source code:~/workspace/source/.mcp.json
  • Skill schema: mcp-server/src/schema/skill-schema.json
  • Package config: mcp-server/package.json