JSON-RPC 2.0 endpoint: POST /rpc
server.infoGet server configuration and status.
server.healthHealth check. Returns true if server is running.
session.createCreate a new session. Rsyncs repos and creates feature branches.
Params: repos (string[]), task (string), name? (string), image? (string), cpu? (int), memory_gb? (int), mcp_servers? (string[])
session.startStart a created/stopped session (launches Docker container).
session.stopStop a running session (preserves state).
session.finishCommit changes, push branches, create pull requests.
session.destroyRemove session container and all data from disk.
session.syncRe-sync repos from CODEROOT into session sandbox.
session.listList all sessions, optionally filtered by status.
session.infoGet detailed session information with live resource usage.
session.logsGet session logs (rsync, claude, container).
session.execExecute a command inside a running session container.
repo.listList available repositories in CODEROOT.
repo.infoGet detailed repository info (branch, size, last commit).
logs.getGet aggregated operation logs.
logs.clearClear all operation logs.
HeroClaude is an ACP orchestration layer that manages multiple Claude Code sessions in isolated Docker containers.
It provides session management, repository scanning, code synchronization, and an MCP (Model Context Protocol) interface for AI assistants.
| Variable | Required | Description | Default |
|---|---|---|---|
CODEROOT |
Yes | Absolute path to directory containing all source repositories (must have .git folders) |
. |
BUILDDIR |
Yes | Directory for build artifacts and session workspaces. Auto-created if missing. | ./build |
HERO_CLAUDE_HOST |
No | Server binding address | 127.0.0.1 |
HERO_CLAUDE_PORT |
No | Server port number | 3780 |
HERO_CLAUDE_IMAGE |
No | Docker image for session sandboxes | hero-claude-sandbox:latest |
DOCKER_RUNTIME |
No | Docker command/runtime to use | docker |
CLAUDE_CONFIG_DIR |
No | Claude configuration directory path | ~/.claude |
HERO_SECRET |
No | JWT authentication secret. Leave unset to disable authentication. | None |
RUST_LOG |
No | Logging level (trace, debug, info, warn, error) | info |
Set variables directly in shell:
export CODEROOT=/Volumes/RUST/code4 export BUILDDIR=./build export HERO_CLAUDE_PORT=3780 cargo run --release
Create .env file in project root:
CODEROOT=/path/to/repos BUILDDIR=./build HERO_CLAUDE_PORT=3780
Uses buildenv.sh automatically:
make run # Release build make rundev # Debug with logging
Edit buildenv.sh for defaults:
export CODEROOT="${CODEROOT:-.}"
export BUILDDIR="${BUILDDIR:-./build}"
cp .env.example .env
CODEROOT=/Volumes/RUST/code4 # Your repos directory BUILDDIR=./build # Build workspace
make build make run
Open http://127.0.0.1:3780 in your browser
GET / – Session manager UI
POST /rpc – JSON-RPC 2.0 API
GET /openrpc.json – API specification
POST /mcp – Model Context Protocol
CODEROOT/ # Your code directory ├── repo1/ # Repository with .git │ ├── .git/ │ └── ... ├── repo2/ │ ├── .git/ │ └── ... └── ... BUILDDIR/ # Build and session workspace ├── sessions/ # Session workspaces │ ├── session_id_1/ │ ├── session_id_2/ │ └── ... └── logs/ # Session logs
Isolated Docker containers where Claude Code instances run. Each session has its own workspace with synced repositories.
Git repositories in CODEROOT are discovered automatically and can be synced into sessions via rsync.
Uses rsync to efficiently copy repositories from CODEROOT into session containers, excluding build artifacts and caches.
Sessions have states: created → running → stopped → completed/destroyed
HeroClaude exposes a Model Context Protocol (MCP) interface, allowing Claude Code to manage sessions remotely.
Add to Claude Code:
claude mcp add --transport http hero-claude http://localhost:3780/mcp
See the MCP tab for available tools and connection details.
Without HERO_SECRET: API is publicly accessible (no authentication required)
With HERO_SECRET: All RPC calls require JWT authentication via Authorization header
Authorization: Bearer <jwt-token>
Set HERO_SECRET environment variable to enable authentication.
Solution: Set CODEROOT to a valid directory path. The directory will be created automatically if it doesn't exist.
export CODEROOT=/Volumes/RUST/code4
Solution: Change HERO_CLAUDE_PORT or kill process using the port.
lsof -ti:3780 | xargs kill -9 make run --port 3781
Solution: Ensure CODEROOT contains directories with .git folders.
ls -la $CODEROOT/*/.
Command: Set RUST_LOG environment variable.
RUST_LOG=debug make rundev
Connect AI assistants (Claude, etc.) to HeroClaude via the Model Context Protocol (MCP).
| MCP Endpoint | loading... |
| Protocol | JSON-RPC 2.0 over HTTP |
| Authentication | None (Public) |
Add HeroClaude as an MCP server in Claude Code:
loading...
| Tool | Description | Category |
|---|---|---|
session_create | Create a new cloud session | Session |
session_start | Start a session | Session |
session_stop | Stop a session | Session |
session_finish | Commit and create PR | Session |
session_destroy | Destroy a session | Session |
session_list | List sessions | Session |
session_info | Session details | Session |
session_logs | Session logs | Session |
session_sync | Re-sync repos | Session |
session_exec | Run command in container | Session |
repo_list | List available repos | Repo |
repo_info | Repo details | Repo |
server_info | Server info | Server |
server_health | Health check | Server |
logs_get | Get operation logs | Server |