cc-agent
Allows cloning GitHub repositories, creating branches, and managing workflows with multi-step plans and dependency enforcement.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@cc-agent Spawn agent to add error handling to API endpoints in https://github.com/example/repo"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
cc-agent
Distill and delegate.
MCP server for spawning Claude Code agents in GitHub repos. Give Claude Code the ability to branch itself — clone a repo and kick off a sub-agent to work on it autonomously, with persistent state across MCP restarts.
Built by @Gonzih.
Quickstart
claude mcp add cc-agent -- npx @gonzih/cc-agentSet one of:
CLAUDE_CODE_OAUTH_TOKEN=sk-ant-oat01-... # OAuth token (recommended)
ANTHROPIC_API_KEY=sk-ant-api03-... # API keyRestart Claude Code. You now have 13 new MCP tools.
Related MCP server: claude-mcp-bridge
MCP Tools
Tool | Description |
| Clone a repo, optionally create a branch, run Claude Code on a task |
| Check status of a specific job |
| Stream output lines from a job (supports offset for tailing) |
| List all jobs with status, recent tool calls, and exit info |
| Kill a running job |
| Write a message to a running agent's stdin mid-task |
| Total USD cost across all jobs, broken down by repo |
| Return the running cc-agent version |
| Spawn a dependency graph of agent jobs in one call |
| Auto-decompose a natural language goal into ordered stages and spawn all agents with stage-based dependency enforcement |
| Poll the status of a workflow created by |
| Return all wiki pages for a repo — structured knowledge auto-injected into every spawn_agent call |
| Return a single wiki page by name for a repo |
| Create or update a wiki page (markdown) for a repo |
| Delete a single wiki page for a repo |
| List all wiki page names for a repo |
| Save a named spawn config for repeated use with |
| List all saved profiles |
| Delete a named profile |
| Spawn a job from a saved profile with variable interpolation |
spawn_agent parameters
Parameter | Type | Required | Description |
| string | yes | Git repo to clone (HTTPS or SSH) |
| string | yes | Task prompt for Claude Code |
| string | no | Existing branch to check out after clone |
| string | no | New branch to create (e.g. |
| string | no | Per-job token override |
| boolean | no | Pass |
| number | no | Spend cap in USD (default: 20) |
| string | no | Session ID from a prior job's |
| string[] | no | Job IDs that must be |
| string | no | Token spend strategy: |
| boolean | no | If |
create_plan parameters
Parameter | Type | Required | Description |
| string | yes | High-level description of what this plan achieves |
| array | yes | Ordered list of steps to execute |
Each step in steps:
Field | Type | Required | Description |
| string | yes | Logical step ID (used for |
| string | yes | Git repo to clone |
| string | yes | Task prompt for Claude Code |
| string | no | New branch to create before running |
| string[] | no | Step IDs from this plan that must complete first |
| string | no | Token spend strategy for this step ( |
| boolean | no | If |
create_profile parameters
Parameter | Type | Required | Description |
| string | yes | Profile name (alphanumeric, dashes, underscores) |
| string | yes | Git repo to clone |
| string | yes | Task template — use |
| number | no | Default USD budget for jobs from this profile |
| string | no | Branch to check out after cloning |
| string | no | Human-readable profile description |
| string | no | Default effort level for all jobs spawned from this profile. |
| boolean | no | If |
spawn_from_profile parameters
Parameter | Type | Required | Description |
| string | yes | Name of the saved profile to use |
| object | no | Variables to interpolate into the task template |
| string | no | Use this task instead of the profile template |
| string | no | Override the profile's branch |
| number | no | Override the profile's default budget |
| string | no | Override the profile's default effort level for this spawn. |
| boolean | no | Override the profile's fast mode setting for this spawn. |
Usage examples
Basic agent
spawn_agent({
repo_url: "https://github.com/yourorg/yourrepo",
task: "Add error handling to all API endpoints. Open a PR when done.",
create_branch: "feat/error-handling",
max_budget_usd: 5
})
// → { job_id: "abc-123", status: "started" }
list_jobs()
// → [{ id: "abc-123", status: "running", recentTools: ["Read", "Edit", "Bash", ...] }]
get_job_output({ job_id: "abc-123", offset: 0 })
// → { lines: ["[cc-agent] Cloning...", "Reading src/api.ts...", ...], done: false }
send_message({ job_id: "abc-123", message: "Also update the tests." })
// → { sent: true }
cost_summary()
// → { totalJobs: 1, totalCostUsd: 1.23, byRepo: { "https://github.com/...": 1.23 } }Multi-step plan with dependencies
create_plan({
goal: "Refactor auth and update docs",
steps: [
{
id: "refactor",
repo_url: "https://github.com/yourorg/app",
task: "Refactor auth middleware to use JWT. Open a PR.",
create_branch: "feat/jwt-auth"
},
{
id: "docs",
repo_url: "https://github.com/yourorg/app",
task: "Update README to document the new JWT auth flow.",
create_branch: "docs/jwt-auth",
depends_on: ["refactor"]
}
]
})
// → { goal: "...", totalSteps: 2, steps: [{ stepId: "refactor", jobId: "abc-1", status: "cloning" }, { stepId: "docs", jobId: "abc-2", status: "pending" }] }Profiles for repeated tasks
// Save once:
create_profile({
name: "fix-issue",
repo_url: "https://github.com/yourorg/app",
task_template: "Fix issue #{{issue}}: {{title}}. Open a PR when done.",
default_budget_usd: 5
})
// Use many times:
spawn_from_profile({
profile_name: "fix-issue",
vars: { issue: "42", title: "Login broken on mobile" }
})Resume a prior session
// Get session ID from a completed job:
get_job_status({ job_id: "abc-123" })
// → { ..., session_id_after: "ses_xyz" }
// Resume it:
spawn_agent({
repo_url: "https://github.com/yourorg/app",
task: "Continue where you left off — finish the tests.",
session_id: "ses_xyz"
})Persistence
cc-agent v0.3.0+ stores all job state in Redis, which is auto-provisioned on startup — zero configuration needed.
Auto-provisioning
On startup, cc-agent tries to connect to Redis at localhost:6379. If unavailable:
Docker — runs
docker run -d --name cc-agent-redis -p 6379:6379 --restart=unless-stopped redis:alpineredis-server — if
redis-serveris on PATH, spawns it as a daemonIn-memory fallback — logs a warning and continues; jobs are not persisted across restarts
Once Redis is available, all job state, output, profiles, and plans survive MCP server restarts and are shared across all Claude Code sessions pointing at the same Redis instance.
Key schema
Key | Type | TTL | Contents |
| String (JSON) | 7 days | Full job record |
| List | — | Job IDs, newest first (capped at 500) |
| List | 7 days | Output lines (one entry per line) |
| String (JSON) | 30 days | Plan record with step→job mapping |
| String (JSON) | permanent | Profile config |
| Set | permanent | All profile names |
Disk fallback
When Redis is unavailable, cc-agent falls back to the original disk-based storage:
.cc-agent/jobs.json— job metadata.cc-agent/jobs/<id>.log— per-job output log~/.cc-agent/profiles.json— profiles
Existing disk profiles are automatically migrated to Redis on first startup with Redis available.
Job statuses
Status | Meaning |
| Waiting for |
| Cloning the repo |
| Claude Code is running |
| Completed successfully |
| Exited with an error (check |
| Cancelled by |
Tool call visibility
list_jobs returns recentTools — the last 10 tool names Claude called per job (e.g. ["Read", "Edit", "Bash", "Glob"]). get_job_output returns the full tool_calls array. This gives insight into what agents are actually doing during silent periods.
Budget control
Set max_budget_usd per job to cap spend. Default is $20. Claude Code is killed with SIGTERM when the budget is exhausted (exit code 143).
spawn_agent({ ..., max_budget_usd: 10 }) // up to $10 for this task
spawn_agent({ ..., max_budget_usd: 2 }) // quick/cheap taskAgent delegation pattern
The recommended mental model: you are the tech lead, agents are your team.
Spawn agents for any task touching a codebase (multiple files, running tests, opening PRs)
Do research, quick edits, and orchestration yourself
Always end agent prompts with the terminal steps:
gh pr create → gh pr merge → npm publish(or whatever ships the work)Monitor with
list_jobs+get_job_output, respawn if budget runs out
# Standard agent task prompt ending:
gh pr create --title "feat: ..." --body "..." --base main
gh pr merge --squash --auto
npm version patch && npm publish # if it's a libraryMCP config (claude.json)
{
"cc-agent": {
"command": "npx",
"args": ["@gonzih/cc-agent"],
"env": {
"CLAUDE_CODE_OAUTH_TOKEN": "sk-ant-oat01-..."
}
}
}How it works
spawn_agentcreates a job record (persisted to disk) and returns immediately with a job IDIn background:
git clone --depth 1 <repo>into a temp dirOptionally checks out an existing branch or creates a new one
Runs
claude --print --output-format stream-json --verbose --dangerously-skip-permissions --max-budget-usd <N> <task>Streams stdout/stderr into the job's output log (in memory + disk)
Tool calls are captured from the stream-JSON and stored in
tool_calls[]On exit: job marked done/failed, workdir cleaned up after 10 minutes
Jobs expire from memory after 1 hour (log file remains on disk)
Pending jobs are promoted automatically every 3 seconds when their dependencies complete
Environment variables
Variable | Description |
| Claude OAuth token or Anthropic API key |
| Claude OAuth token (alternative) |
| Anthropic API key (alternative) |
Requirements
Node.js 18+
claudeCLI:npm install -g @anthropic-ai/claude-codeGit
Related
Available Tools
47 toolsapprove_jobA
Approve a job that is pending approval due to an untrusted repo owner. Transitions the job from pending_approval to running.
Inputs: job_id (required).
cancel_jobC
Cancel a running agent job.
Inputs: job_id (required).
clear_learningsB
Clear all stored learnings for a namespace. Useful when starting fresh on a refactored codebase.
Inputs: namespace.
close_issueC
Close a GitHub issue, optionally posting a comment.
Inputs: repo (required), issue_number (required), comment.
comment_on_issueB
Post a comment on a GitHub issue.
Inputs: body (required), repo (required), issue_number (required).
cost_summaryB
Returns total USD cost across all jobs, broken down by repo.
Inputs: no named parameters.
create_cronB
Create a new cron job that fires on a recurring interval and spawns an agent.
Inputs: prompt (required), schedule (required), interval_ms (required), chat_id, +2 more.
create_planB
Spawn a full dependency graph of agent jobs in one call. Each step can declare depends_on referencing other step IDs in this plan. Returns a summary with actual job IDs mapped to step IDs.
Inputs: goal (required), steps (required).
create_profileA
Save a named spawn config (profile) for repeated use. Task templates support {{variable}} substitution.
// Create once: // create_profile('fix-bugs', 'https://github.com/me/app', 'Fix {{issue}}: {{title}}', 5) // Use many times: // spawn_from_profile('fix-bugs', { issue: '42', title: 'Login broken' })
Inputs: name (required), repo_url (required), task_template (required), branch, +5 more.
delete_cronB
Delete a cron job by ID.
Inputs: cron_id (required).
delete_profileB
Delete a named job profile.
Inputs: name (required).
delete_wiki_pageB
Delete a single wiki page for a repo.
Inputs: page (required), repo_url (required).
docker_psA
List currently running cc-agent Docker containers. Shows container name, status, and uptime.
Inputs: no named parameters.
export_jobsA
Export all job records as JSONL or JSON for statistical analysis. Each record includes id, status, repo_url, task (truncated to 500 chars), started_at, finished_at, exit_code, output_lines count, score, and duration_seconds. Use this to pull job traces, compute success rates, and study failure modes.
Inputs: days, format, status.
generate_workflowA
Auto-decompose a high-level goal into an ordered sequence of stages, then spawn all jobs with stage-based dependency enforcement. Returns immediately with workflow_id, job_ids, and the stage breakdown. Use get_workflow_status to poll progress. Each stage only starts after ALL jobs in the prior stage complete — guaranteeing ordered execution even across 100s of agents.
Inputs: goal (required), repo_url (required), max_stages, agent_model, +3 more.
get_cost_reportA
Longitudinal cost breakdown for research budget tracking. Returns grouped cost summary with total USD spent, job count, avg cost per job, and avg score. Useful for tracking spending by repo, day, or outcome.
Inputs: days, group_by.
get_job_outputA
Get output lines from a running or finished job. Use offset to paginate.
Inputs: job_id (required), offset.
get_job_statusA
Get the current status of a spawned agent job. For waiting until completion, prefer wait_for_job (zero-poll) or subscribe to the Redis pub/sub channel cca:job:done:{job_id} for instant notification.
Inputs: job_id (required).
get_learningsA
Return accumulated learnings for a repo or namespace. Learnings are written by agents at the end of each job. Use this to understand what prior agents have discovered.
Inputs: repo, limit, namespace.
get_logsA
Return the last N lines of the cc-agent log file (~/.cc-agent/logs/cc-agent.log). Default 100, max 500.
Inputs: lines.
get_pubsub_statusA
Debug: show all active Redis pub/sub channels and subscriber counts. Use to diagnose chat sync issues.
Inputs: no named parameters.
get_swarm_statusA
Poll the status of a swarm created by swarm_task. Returns goal, status (running_subs | synthesizing | done | failed), sub_job counts, and synthesis_job_id once spawned.
Inputs: swarm_id (required).
get_versionA
Returns the running cc-agent MCP server version.
Inputs: no named parameters.
get_wikiA
Return all wiki pages for a repo. Wiki pages are structured knowledge injected automatically into every spawn_agent call for the repo. Use this to inspect what knowledge is stored.
Inputs: repo_url (required).
get_wiki_pageA
Return a single wiki page by name for a repo.
Inputs: page (required), repo_url (required).
get_workflow_statusA
Poll the status of a workflow created by generate_workflow. Returns goal, stage breakdown, per-step job IDs and statuses.
Inputs: workflow_id (required).
list_active_reposA
List all active namespaces/repos with job counts and recent activity. Each namespace = one project column in the UI.
Inputs: no named parameters.
list_cronsA
List all scheduled cron jobs for the current namespace.
Inputs: no named parameters.
list_driversA
List all available agent drivers and their status (binary found / API key configured). Use this to check which drivers are ready to use before calling spawn_agent with agent_driver.
Inputs: no named parameters.
list_jobsA
List all agent jobs (running, done, failed, cancelled). To wait for a specific job, use wait_for_job or subscribe to cca:job:done:{job_id} on Redis.
Inputs: min_score.
list_model_ratingsA
Returns the content of ~/.cc-agent/model-ratings.jsonl as a structured JSON array. Used to monitor which open models (routed via Ollama) are performing well. Rating and notes fields are null until filled in by the operator.
Inputs: no named parameters.
list_notificationsA
Return the last 20 notification messages sent by the coordinator for the current namespace.
Inputs: no named parameters.
list_profilesA
List all saved named job profiles, including built-in profiles. Call this before spawn_from_profile to discover what profiles are available.
Inputs: no named parameters.
list_project_issuesC
List GitHub issues for a repository using the gh CLI.
Inputs: repo (required), state, labels, assignee.
list_token_statusA
List the status of all configured OAuth tokens (CLAUDE_TOKENS env var). Shows which token is currently active and how many are configured. Useful for diagnosing token rotation issues.
Inputs: no named parameters.
list_wiki_pagesB
List all wiki page names for a repo.
Inputs: repo_url (required).
search_jobsA
Find jobs by content of task prompt. Returns matching jobs with a task snippet showing match context. Useful for finding all jobs that involved a specific tool, repo, or task type.
Inputs: query (required), days, status.
send_messageA
Send a message to a running agent's stdin. Use this to give the agent corrections, new information, or updated instructions mid-task.
Inputs: job_id (required), message (required).
set_job_scoreA
Set a quality score (0.0–1.0) on a completed job. Used by evaluator agents in evolutionary branching plans to record how well each variant performed.
Inputs: score (required), job_id (required), reason.
spawn_agentA
Spawn a Claude Code agent on a GitHub repository.
WORKFLOW: agent clones repo → creates its own branch → implements → tests → commits → pushes → opens PR → merges PR → publishes.
IMPORTANT: Always set create_branch: false. The agent creates its own branch internally with git checkout -b. Setting create_branch: true will cause a clone failure because the branch doesn't exist on remote yet.
BRANCH PARAM WARNING: Only pass branch for already-existing remote branches (e.g. to resume work on a branch that was previously pushed). For new branches, omit branch entirely — include git checkout -b <name> in the task steps instead. Passing a branch that does not exist on the remote will cause an immediate clone failure ('fatal: Remote branch not found').
Parameters:
repo_url: GitHub repo URL (https://github.com/owner/repo)
task: Full task description. A workflow preamble is auto-injected before your task.
create_branch: ALWAYS false. The agent manages its own branch.
branch: Existing remote branch to checkout (see BRANCH PARAM WARNING above)
claude_token: Optional Claude API token override
Inputs: task (required), repo_url (required), goal, model, +26 more.
spawn_from_profileA
Spawn an agent job from a saved profile. Supports variable interpolation and per-call overrides. Call list_profiles first to see available profiles. Built-in profiles: coder, fix-issue, implement-feature, write-tests, security-audit, refactor, review-pr, bump-deps. Use the 'coder' profile for general coding tasks — it injects Karpathy discipline guidelines.
Inputs: profile_name (required), vars, fast_mode, effort_level, +4 more.
swarm_taskA
Auto-decompose a high-level goal into N parallel sub-tasks, fan out agents across all of them, then run a synthesis agent that produces one unified deliverable. Returns immediately with swarm_id and sub_job_ids. Use get_swarm_status to poll progress.
Inputs: goal (required), repo_url (required), max_agents, agent_model, +4 more.
update_cronB
Update fields on an existing cron job.
Inputs: cron_id (required), prompt, enabled, schedule, +1 more.
update_wiki_pageA
Create or update a wiki page for a repo. Content is markdown. Pages are auto-injected into spawn_agent calls for this repo.
Inputs: page (required), content (required), repo_url (required).
wait_for_jobA
Block until a job reaches a terminal state (done/failed/cancelled/rejected/interrupted) or the timeout expires. Returns the final status and score. Preferred over polling get_job_status in a loop. For non-MCP coordinators: subscribe to Redis pub/sub channel cca:job:done:{job_id} for instant zero-copy notification — the payload is JSON with fields: job_id, status, score, score_source, finished_at, exit_code.
Inputs: job_id (required), timeout_seconds.
wake_jobA
Manually wake a sleeping job immediately, bypassing its scheduled wake time.
Inputs: job_id (required).
work_on_issueB
Fetch a GitHub issue, post a pickup comment, and spawn a cc-agent to work on it.
Inputs: repo (required), issue_number (required), extra_context, max_budget_usd.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 47 tools
Most tools have clearly distinct purposes (e.g., cost_summary vs. list_model_ratings vs. spawn_agent). However, some overlap exists between spawn_agent and spawn_from_profile, and between get_job_status, wait_for_job, and list_jobs, which could cause mild confusion.
Naming uses a mix of verb_noun (e.g., spawn_agent, cancel_job), get_* (get_job_status, get_version), list_* (list_jobs, list_profiles), and a few irregular forms (comment_on_issue, close_issue). While mostly readable, the pattern is not fully consistent.
With 47 tools, the server is feature-rich but somewhat excessive for typical use. Many tools support auxiliary features (crons, profiles, wiki, etc.), justifying the count, but it exceeds the ideal 3-15 range and feels heavy.
The tool surface covers the full lifecycle: spawning, monitoring, canceling, profiles, cron scheduling, wiki management, cost tracking, log inspection, job search/export, swarms, and workflows. No obvious gaps for the intended domain of agent orchestration.
Maintenance
Related MCP Connectors
An MCP server that gives your AI access to the source code and docs of all public github repos
Hosted Web Crawler MCP server for Claude, ChatGPT and Cursor, with each action switched per account.
Shared memory MCP server for Claude Code, Codex, Gemini CLI and Cursor. Cited, editable.
MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceMCP server that enables Claude Code to communicate with other Claude Code agents over HTTP, allowing users to ask questions about remote codebases or delegate coding tasks.MIT
- AlicenseAqualityDmaintenanceMCP server that lets any agent or MCP host delegate tasks to Claude Code running headless, with tools for review, validation, analysis, and autonomous work.4353 npm2MIT
- AlicenseAqualityDmaintenanceAn MCP server that enables Claude to orchestrate multiple autonomous Claude Code agents working in parallel across different projects, with tools to dispatch, monitor, and manage their progress.654 npm1MIT
- AlicenseNot gradedqualityCmaintenanceAn MCP server that lets any MCP-capable agent spawn and drive Claude Code sessions — effectively turning Claude Code into an orchestratable sub-agent fleet.71 npmMIT