Skip to main content
Glama

cc-mcp

Run Claude Code as an async task runner for remote MCP clients, from a machine you own.

Cloud assistants can't reach your Pi, and your Pi has a Claude subscription doing nothing. cc-mcp is a small MCP server that closes the gap: the assistant calls start_task, goes away, and comes back for the result while Claude Code works on your hardware.

MCP client ──HTTPS──▶ Cloudflare Tunnel ──▶ cc-mcp (127.0.0.1) ──▶ detached runner ──▶ claude -p
 Bearer token or OAuth                       auth · limits · audit     one per task      stream-json

Why

  • Tasks outlive requests. Each task runs in its own detached process. Restart the server, lose the connection, close the laptop: the task keeps going, and wait_task never blocks longer than a tunnel tolerates.

  • Research first. A task with no repository runs in a fresh scratch directory with web search and file tools and no shell. The last message is the result.

  • Safe to leave on the internet. Per-client hashed tokens, optional OAuth 2.1 approved from your own shell, per-IP lockout, host and origin checks, an audit log, and a locked-down child environment. Threat model.

  • Plain Node. Node 22, no native modules, no database; state is files in one directory.

Related MCP server: muster

Quickstart

You need Node 22+, Claude Code signed in as the user that will run the server, and a hostname on Cloudflare. The Pi deployment guide covers systemd and the tunnel in full.

git clone https://github.com/aravhawk/cc-mcp && cd cc-mcp
npm ci && npm run build && npm link      # provides the cc-mcp command

claude login                              # or set CLAUDE_CODE_OAUTH_TOKEN from "claude setup-token"
cc-mcp doctor                             # checks Node, claude, auth, directories, exposure
cc-mcp token create --label hark --expires 90d     # printed once; save it

export CC_MCP_PUBLIC_URL=https://cc.example.com
export CC_MCP_TRUST_PROXY=true            # required behind a tunnel, see below
cc-mcp serve                              # listens on 127.0.0.1:8787

Point cloudflared at http://127.0.0.1:8787 (example config), then add this to your MCP client:

URL

https://cc.example.com/mcp (Streamable HTTP)

Header

Authorization: Bearer <token>

Behind a tunnel, set CC_MCP_TRUST_PROXY=true. cloudflared connects from loopback, so without it every visitor on the internet shares the address 127.0.0.1 and five failed attempts lock out your own client. cc-mcp doctor warns when it sees a tunnel without it, and so does the server log.

Check it end to end:

curl -s https://cc.example.com/healthz
# {"status":"ok"}

Tools

Tool

Purpose

start_task

Start a task and get its id back at once. No path means research mode.

wait_task / get_task

Block up to 90 s, or check without blocking. Finished tasks return their result text.

get_events

Page through the transcript: assistant text, tool calls, results.

send_message

Join a running task, interrupt it, or resume a finished one in the same Claude Code session.

cancel_task

Stop a task; it can be resumed later.

list_tasks / search_tasks / update_task

Browse, full-text search, rename and tag.

ask

Start a research task and wait for the answer in one call.

Arguments, states and examples are in docs/tools.md.

Working in a repository

Off by default. Set CC_MCP_ALLOWED_ROOTS and clients can pass a path inside those directories, optionally with isolation: "worktree" to work in a throwaway git worktree. Set CC_MCP_REPO_URL_HOSTS=github.com to let tasks clone https repositories from those hosts. Tasks get Read, Glob, Grep, Edit and Write and nothing else unless you widen CC_MCP_REPO_TOOLS.

Configuration

Everything is an CC_MCP_* environment variable, and invalid values stop startup with a message naming the variable. A typical env file:

CC_MCP_PUBLIC_URL=https://cc.example.com
CC_MCP_TRUST_PROXY=true
CC_MCP_MAX_CONCURRENT=2                   # tasks at once; the rest queue
CC_MCP_ALLOWED_ROOTS=/home/pi/projects    # optional: enables path tasks
CC_MCP_DEFAULT_MODEL=opus
CC_MCP_MAX_EFFORT=high

The full list is in docs/configuration.md. OAuth for clients that require it is covered in docs/oauth.md, and the moving parts in docs/architecture.md.

Status

Pre-1.0. The suite (npm test) runs against a fake claude binary, and CI covers Node 22 and 24. What has not been exercised yet: an authenticated Claude Code run through cc-mcp, a real Raspberry Pi behind a live Cloudflare Tunnel, and any particular MCP client (including Hark). Expect rough edges there and please open an issue.

Contributing and security

See CONTRIBUTING.md. Report vulnerabilities privately as described in SECURITY.md.

License

MIT © Arav Jain

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables MCP clients to spawn and control Codex CLI and Claude Code sessions on the host machine, with session management and filesystem access.
      4
      MIT
    • A
      license
      B
      quality
      B
      maintenance
      Enables launching and supervising local Codex and Claude Code agent sessions and one-shot tasks, exposing run, list, stop, and output operations over MCP with session-scoped permissions and sandbox controls.
      2
      190 npm
      1
      MIT
    • A
      license
      Not graded
      quality
      A
      maintenance
      Enables MCP clients such as Claude, Cursor, and VS Code to delegate coding tasks to an OpenCode server, including asking questions, running background jobs, monitoring progress, responding to input/permissions, and reviewing changes across projects.
      22,709 npm
      MIT