headlesscode MCP server
2026년 11월 2일 커밋태스크를 실행하고 병렬 Git worktree 워커를 관리하며, 샌드박스 세션을 통한 재귀적 자기 개선을 지원하는 코딩 에이전트 하네스입니다.
다른 이름 Capsize-Games/headlesscode
- 스타
- 2
- Tools
- —
- 다운로드, 30일
- —
- 최신 버전
- —
- 마지막 커밋
- 2026년 11월 2일
- 라이선스
- Apache-2.0
headlesscode MCP란?
headlesscode은(는) MCP server입니다. 태스크를 실행하고 병렬 Git worktree 워커를 관리하며, 샌드박스 세션을 통한 재귀적 자기 개선을 지원하는 코딩 에이전트 하네스입니다.
프로젝트 README에서 생성된 요약
headlesscode MCP server 정보
headlesscode는 코딩 에이전트 하네스를 통해 복잡한 소프트웨어 엔지니어링 작업을 자동화할 수 있도록 개발자에게 지원합니다. 이 시스템은 명령줄 인터페이스 및 HTTP 기반 시스템으로 작동하며, 단일 저장소 태스크 실행, Git worktree를 사용한 병렬 워커 관리, 또는 GitHub label 모니터링을 통한 작업 수급 자동화가 가능합니다. 또한 에이전트가 독립적인 평가 루프를 통해 자신의 코드베이스나 대상 프로젝트를 직접 점검하고 수정할 수 있도록 하여 재귀적 자기 개선을 지원합니다.
사용자는 로컬에서 세션을 실행하거나, 실행 격리를 위해 일회성 Git 클론을 사용하는 NVIDIA OpenShell 프로바이더를 통해 샌드박스 환경에서 실행할 수 있습니다. 하네스를 작동하려면 Node.js 환경과 OpenRouter 또는 Meta Model API의 API 키가 필요합니다. 또한 사용자 설정 파일에 정의된 로컬 stdio 또는 HTTP MCP server에 연결할 수 있습니다. 리소스 예산 및 권한 설정과 같은 보안 제어 기능을 제공하지만, 기본적으로는 사용자의 기존 권한으로 셸 명령을 실행합니다.
활용 사례
- 1자동화된 이슈 해결개발자는 GitHub 이슈를 별도의 Git worktree로 분할하여 변경 사항을 모니터링하고 검토하는 병렬 워커를 실행할 수 있습니다.
- 2샌드박스 코드 실행호스트 시스템을 격리된 상태로 유지하기 위해 일회성 클론에서 워커 및 리뷰 세션을 실행할 수 있습니다.
- 3재귀적 자기 개선 루프에이전트가 자신의 코드를 개선하도록 시도하는 제한된 실험을 실행하는 데 하네스를 사용할 수 있습니다.
- 4대화형 코딩 세션개발자는 터미널 채팅을 시작하여 특정 워크스페이스에 대해 에이전트와 대화형으로 논의할 수 있습니다.
프로젝트의 README를 바탕으로 작성되었습니다. 모든 활용 사례는 해당 내용의 인용문과 대조하여 확인합니다.
구성
GH_TOKENHEADLESSCODE_LLM_PROVIDERHEADLESSCODE_MUSE_API_KEYHEADLESSCODE_OPENROUTER_API_KEYHEADLESSCODE_OPENSHELL_POLICY
| 이름 | 설명 | 유형 |
|---|---|---|
| GH_TOKEN | — | |
| HEADLESSCODE_LLM_PROVIDER | — | |
| HEADLESSCODE_MUSE_API_KEY | — | |
| HEADLESSCODE_OPENROUTER_API_KEY | — | |
| HEADLESSCODE_OPENSHELL_POLICY | — |
자동 검사
2026년 11월 14일에 실행됨전체 보고서 →아직 인증되지 않았습니다. 서버는 80점 이상의 점수, 심각한 결함 없음, 그리고 검사에 충분한 데이터를 갖추어야 합니다. 검사 방식 · 점수를 높이기 위해 수정할 항목
- 소스 저장소 연결 및 접근 가능capsize-games/headlesscode is public and reachablegithub.com/capsize-games/headlesscode ↗통과
- 패키지가 이 저장소를 소스로 명시검사되지 않음
- 빌드 출처(Sigstore 증명)검사되지 않음
- 오픈 소스 라이선스 (OSI)Apache-2.0spdx.org/licenses/Apache-2.0.html ↗통과
- 최근 1년 내 커밋 또는 릴리스Last commit or release 2026-11-02github.com/capsize-games/headlesscode ↗통과
- OpenSSF Scorecard검사되지 않음
- 패키지 이름이 인기 패키지와 유사하지 않음검사되지 않음
- 패키지 및 해당 종속성에 중요한 보안 권고 없음검사되지 않음
- 모델에 대한 숨겨진 지침 없음0 tool descriptions and the README read; no override phrases, credential paths or hidden characters통과
- 파괴적인 도구에 라벨 표시됨검사되지 않음
- 원격 엔드포인트가 MCP 핸드셰이크에 응답검사되지 않음
README
GitHub에서 보기headlesscode
HeadlessCode is a coding-agent harness with a CLI, HTTP interfaces, and recursive self-improvement (RSI). Run one task directly, launch parallel workers in Git worktrees, or use the NVIDIA OpenShell provider for sandboxed sessions. The bounded RSI harness can inspect and improve a target project, including HeadlessCode itself, with independent evaluation of candidate changes.
Security controls
HeadlessCode's controls map to the seven principles in Satya Nadella's Models as Insider Risks in the Super Intelligence Era.
| Principle | HeadlessCode implementation |
|---|---|
| Model diversity | Operators assign models by mode and RSI role, including review and adversarial roles. Programmatic gates determine candidate eligibility. See model assignment and RSI roles. |
| Observe everything | Evidence-required sessions wait for an external collector's authenticated acknowledgement before model calls and tool actions. The collector signs a hash-linked journal and session head; an offline verifier produces a readable history and distinguishes worker reports from supervisor observations. See evidence journal. |
| Verifiability | CI runs typechecking, the full automated suite, and mock workflows. Tests exercise missing evidence acknowledgements, tampering, replay, stop races, and cleanup failures. RSI applies regression and frozen proof gates; configured hidden verification checks bounded function cases against supervisor-held answers. See CI and hidden verification. |
| Independent controls | Operators configure command and file permissions, resource and inference budgets, and a contained profile that pins the OpenShell policy, image, gateway, evidence key, and emergency controller. Launch preflight checks those identities and the sandbox's effective policy. See permissions and security profiles. |
| Independent auditability | The external collector owns evidence signing keys and storage. The hidden verifier keeps expected answers and signing keys in the supervisor, binds reports to the candidate source, session, job, limits, and one-time nonce, and compares outputs outside the candidate guest. See evidence boundaries and hidden verification. |
| Containment | OpenShell runs sessions in disposable independent clones. The host emergency controller can pause or stop active work, abort model calls, terminate scoped command groups, and delete sandboxes. Result import requires confirmed sandbox deletion. See emergency controls and OpenShell lifecycle. |
| Incident disclosure | GitHub private vulnerability reporting provides confidential intake. The incident procedure covers containment, evidence preservation, fixes, affected-user notification, coordinated advisories, and review of failed controls and runtime configuration changes. See incident response, report a vulnerability, and advisories. |
| Use it for | What it does |
|---|---|
| One repository task | Reads project modes and instructions, edits files, runs commands, and reports a result. |
| Parallel issue work | Splits GitHub issues into Git worktrees, runs workers, monitors completion, and reviews changes. |
| Intake automation | Watches a GitHub label and starts bounded batches of work. |
| OpenShell sessions | Runs worker and review sessions in disposable clones, then validates and imports results after sandbox deletion. |
| Harness experiments | Runs a bounded recursive self-improvement loop against an external evaluator. |
| Project work with harness repair | A host work loop runs tasks, independently checks observed harness problems, and retries with verified repairs. |
Security
Default-allow arbitrary command execution. By default,
headlesscoderuns shell commands with the invoking user's privileges. It can read and modify files, including credentials such as~/.sshand~/.aws, without approval prompts. Use it only with trusted tasks and isolate it with a container, VM, or dedicated user when untrusted content is involved. The optional permissions layer is defense in depth, not a security boundary. SeeSECURITY.md.
OpenShell runs each session in a disposable Git clone mounted at /workspace;
the host worktree and harness control files are not mounted. After the sandbox
is deleted, HeadlessCode validates a Git bundle and imports the result into the
host worktree. The gateway must support Docker bind mounts and must see the
configured scratch root at the same absolute path as the host. See the
OpenShell guide for setup and security
details. This integration does not configure NVIDIA Sentry or hardware
monitoring.
Quick start
Requires Node.js 22.19 or newer. Install globally or run with npx:
npm install -g headlesscode
# or
npx headlesscode --task "Fix the bug in src/index.ts" --workspace /path/to/repo
For a real model call, set the OpenRouter key. --dry-run does not need a key.
| Variable | Required | Purpose |
|---|---|---|
HEADLESSCODE_OPENROUTER_API_KEY |
For OpenRouter calls | OpenRouter API key. |
OPENROUTER_MODEL |
No | Default model; meta/muse-spark-1.3-contributor. --model overrides it. |
OPENROUTER_HTTP_REFERER |
No | OpenRouter application referer header. |
OPENROUTER_APP_TITLE |
No | OpenRouter application title header. |
HEADLESSCODE_WORKSPACE_ROOT |
No | Default workspace; otherwise the current directory. |
export HEADLESSCODE_OPENROUTER_API_KEY=sk-or-...
headlesscode --task "Fix the bug in src/index.ts" --workspace /path/to/repo
The default model is Muse Spark 1.3 Contributor through OpenRouter. OpenRouter lists it at $0.10/M input tokens, $0.20/M output tokens, and $0.002/M cached
input tokens. OpenRouter notes that prompts and outputs sent to this Contributor
model may be used to improve Meta's products. Use OPENROUTER_MODEL or
--model to select another OpenRouter model.
Using Meta's Model API (Muse) instead
Set HEADLESSCODE_LLM_PROVIDER=muse to run sessions against Meta's Model
API (https://api.meta.ai/v1, OpenAI-compatible) with the Muse Spark
family instead of OpenRouter. Get a key from the
Model API dashboard. The default model is
muse-spark-1.3 (1M context); --model and mode-models.json entries
work the same as on the OpenRouter path. orchestrate preflight,
per-session cost budgets, and the local Ollama backend all apply unchanged.
| Variable | Required | Purpose |
|---|---|---|
HEADLESSCODE_LLM_PROVIDER |
No | "openrouter" (default) or "muse". |
HEADLESSCODE_MUSE_API_KEY |
For Muse calls | Meta Model API key (MODEL_API_KEY also works). |
HEADLESSCODE_MUSE_MODEL |
No | Default model; muse-spark-1.3. Shadows OPENROUTER_MODEL. |
HEADLESSCODE_MUSE_BASE_URL |
No | API base URL; https://api.meta.ai/v1. |
export HEADLESSCODE_LLM_PROVIDER=muse
export HEADLESSCODE_MUSE_API_KEY='LLM|...'
headlesscode --task "Fix the bug in src/index.ts" --workspace /path/to/repo
Notes: the -contributor model variants (muse-spark-1.3-contributor,
muse-spark-1.2-contributor) use the Contributor pricing tier
and permit Meta to train on the traffic. Select them explicitly when using the
direct Meta API; its default is the Standard model. Vision
captioning (describe_image, screenshots) and OpenShell sandboxed
execution still use OpenRouter regardless of this setting.
For a source checkout:
git clone https://github.com/Capsize-Games/headlesscode.git
cd headlesscode
npm install
node bin/headlesscode.mjs --task "Fix the bug in src/index.ts" --workspace /path/to/repo
To install a headlesscode wrapper on your PATH, run scripts/install-cli.sh.
It writes to ~/.local/bin by default (override with HEADLESSCODE_BIN_DIR)
and runs this checkout's local tsx. Re-run it if you move the checkout.
Terminal chat, skills, and saved sessions
headlesscode chat starts an interactive conversation. Each turn uses the
existing runner and saves its messages for resume or fork. /help lists the
session, model, mode, skill, and import controls.
headlesscode chat --workspace /path/to/repo
headlesscode skills import /path/to/my-skill
headlesscode sessions import --from codex --file /path/to/rollout.jsonl --workspace /path/to/repo
headlesscode chat --resume <session-id> --workspace /path/to/repo
Skills use SKILL.md instructions and captured text references. Session
imports support Claude Code, Codex, and Muse history, with provenance and
warnings. Imported tool calls stay historical context. See terminal chat,
skills, and sessions for formats,
discovery, and security behavior.
Coding sessions can also create and use reusable skills, Node tools, and local
stdio MCP servers through extension_manage and extension_call. Each call
pins an immutable revision and uses the session's existing permissions. The
fixed interfaces keep extension contents out of the system prompt and tool
catalog. See workspace extensions for the bundle format
and runtime limits.
Check project instructions without calling a model
--dry-run builds the system prompt and validates project configuration. It
prints the prompt and a summary of loaded modes, tools, and prompt size. A
successful exit means prompt building and mode/rules loading succeeded.
headlesscode --dry-run --mode code --workspace /path/to/repo
Project .roomodes, .roo/rules-<slug>/, and AGENTS.md instructions are
loaded by the prompt builder when applicable. The selected mode controls which
tools are exposed. See Architecture for the relevant code.
Local MCP services
HeadlessCode can connect to user-configured stdio and Streamable HTTP MCP
servers. It reads ~/.config/capsize-agent/mcp.json by default; set
HEADLESSCODE_MCP_CONFIG to use another trusted, user-owned manifest. It does
not execute MCP commands from a workspace .mcp.json. Connected server tools
are exposed to modes that allow the mcp tool group. Offline servers are
reported in the session prompt/log while other servers continue to work.
The MCP client does not add an approval layer around server tools. Treat each configured server's capabilities as available to the agent, and use HeadlessCode only for trusted tasks. See MCP servers for configuration, limits, and local setup details.
OpenShell
Build the worker image and import the OpenRouter provider profile once. Configure a Docker-backed OpenShell gateway with driver-config and bind-mount support; keep that gateway restricted to trusted operators.
# Run these commands from a HeadlessCode source checkout.
docker build -f docker/OpenShell.Dockerfile -t headlesscode-openshell:local .
openshell profile import -f shared/openshell/headlesscode-openrouter.yaml
export HEADLESSCODE_OPENROUTER_API_KEY=sk-or-...
export HEADLESSCODE_OPENSHELL_POLICY="$PWD/shared/openshell/headlesscode-policy.yaml"
headlesscode orchestrate --repo /path/to/repo --issue 42 \
--execution-provider openshell
Each worker gets an independent clone and a temporary result directory. Neither
bind source is the host worktree. After the sandbox is deleted, HeadlessCode
imports a verified Git bundle into the host branch. The default scratch root is
~/.local/share/headlesscode/openshell-sessions; create it before starting the
gateway and bind-mount it into the gateway container at the same absolute path.
If you choose another root, set HEADLESSCODE_OPENSHELL_SCRATCH_ROOT and mount
that host directory into the gateway container at the same path. Project data and shared instructions
are copied into the scratch tree and mounted separately. The writable scratch
checkpoint store supports checkpoints during a session and is discarded at
teardown. Opt-in memory uses a scratch snapshot and merges validated JSONL
records after sandbox deletion. No OpenRouter key is passed as a normal sandbox
environment argument; OpenShell injects the imported provider credential.
headlesscode watch accepts the same --execution-provider openshell option.
OpenShell applies to worker, plan-first, continuation, reviewer, QA, and rework
sessions. The one-off headlesscode openshell-session command runs a single
task and keeps its host worktree for review. Set up a gateway callback address
that the sandbox's Docker bridge can reach; keep the client endpoint loopback
only when possible. Read the OpenShell guide
before adapting the sample gateway or filesystem policy.
| Setting | Default | Meaning |
|---|---|---|
--execution-provider |
local |
orchestrate/watch runtime: local or openshell. Also settable with HEADLESSCODE_EXECUTION_PROVIDER. |
HEADLESSCODE_OPENSHELL_POLICY |
No default | Base OpenShell policy YAML; required for OpenShell sessions. |
HEADLESSCODE_OPENSHELL_IMAGE |
headlesscode-openshell:local |
Sandbox image. |
HEADLESSCODE_OPENSHELL_PROVIDERS |
headlesscode-openrouter |
Comma-separated credential profile names. |
HEADLESSCODE_OPENSHELL_CPU / HEADLESSCODE_OPENSHELL_MEMORY |
2 / 4Gi |
Per-sandbox resource requests. |
HEADLESSCODE_OPENSHELL_NAME_PREFIX |
hcls |
Prefix for deterministic sandbox names. |
HEADLESSCODE_OPENSHELL_SCRATCH_ROOT |
~/.local/share/headlesscode/openshell-sessions |
Host scratch directory that the gateway container must see at the same path. |
The headlesscode openshell-session command provides a single-session live
entry point; run headlesscode openshell-session --help for options.
Parallel work and GitHub intake
orchestrate runs a parallel round from GitHub issue numbers or a JSON file.
It splits work, creates a worktree per group, starts workers, watches for
completion, and reviews results. QA and deployment approval are optional.
headlesscode orchestrate --repo /path/to/repo --issue 42 --issue 43 --qa
headlesscode orchestrate status --repo /path/to/repo --wait --timeout-ms 7200000
watch polls GitHub for issues with a chosen label and starts bounded batches.
It requires GH_TOKEN or GITHUB_TOKEN; it performs intake only. Use a later
orchestrate run to monitor, review, QA, or deploy a batch.
GH_TOKEN=... headlesscode watch \
--owner my-org --repo /path/to/repo --label needs-agent --run-once
| Command | Important options | Behavior and limits |
|---|---|---|
headlesscode orchestrate --repo <path> |
Repeat --issue <n> or use --issues-json <file>; `--execution-provider local |
openshell, --qa, --deploy, --no-review, --dry-run, --max-iterations , --max-rework-cycles , --max-continuations ` |
headlesscode orchestrate status --repo <path> |
--wait, --timeout-ms <n>, --json |
Reads durable round state; --wait blocks until terminal state or timeout. |
headlesscode orchestrate stop --repo <path> |
Repeat --group <name> |
Stops selected groups' worker process trees. |
headlesscode watch --owner <o> --repo <path> --label <name> |
`--execution-provider local | openshell, --run-once, --dry-run, --max-per-sweep , --max-concurrent-sessions , --retry-failed` |
Both orchestration and watcher enforce a shared concurrency cap, defaulting to
3 (HEADLESSCODE_MAX_CONCURRENT_SESSIONS). Orchestration aborts when the cap
is full; the watcher leaves excess issues pending. The watcher records
idempotency state under <repo>/.worktrees/.watcher-state.json by default.
Use --help on a command for its complete options. Detailed guides:
orchestration,
issue watcher,
QA implementation, and
deployment gate.
Project registration and search
Registering a project detects its stack, ensures .gitignore excludes
.headlesscode/, and builds a code-search index and codemap. Indexing calls an
embedding API and can incur charges unless skipped or configured for Ollama.
headlesscode init --workspace ~/Projects/your-project
headlesscode init --workspace ~/Projects/your-project --skip-index
See headlesscode init --help for --skip-codemap and embedding-backend
options. The CLI also provides index, codemap, project-store, GitHub App,
and decision-proxy commands; run headlesscode --help for the command list
and each subcommand's --help for complete usage.
Recursive self-improvement
headlesscode improve --dry-run resolves the base commit and prints planned
candidate worktrees. A real run requires PostgreSQL, a shared S3-compatible
artifact store, and at least one registered headlesscode rsi-worker. The
coordinator queues sanitized mutation snapshots and visible evaluation jobs;
workers run each in a fresh OpenShell guest. Fitness, paired baseline
comparison, archives, and selection stay in the coordinator. Hidden evaluation
remains disabled. A 2026-09-29 bounded run used two workers on the same local
OpenShell gateway; both candidate evaluation jobs were leased concurrently.
The run used a temporary clamp.js fixture and does not establish general
headlesscode improvement or multi-gateway operation. An earlier bounded run
passed visible checks but made no source change and was rejected.
npx tsx src/cli.ts improve --repo . --dry-run
npx tsx src/cli.ts improve --repo . --population 2 --generations 1
Before starting workers, build the standard and RSI guest images on each OpenShell gateway host that will run RSI jobs. Build the larger training image only on gateways whose workers will accept model-training or paired model-evaluation jobs:
docker build -f docker/OpenShell.Dockerfile -t headlesscode-openshell:local .
docker build -f docker/OpenShell-RSI.Dockerfile -t headlesscode-openshell-rsi:local .
docker build -f docker/OpenShell-RSI-Training.Dockerfile -t headlesscode-openshell-rsi-training:local .
The RSI Dockerfile extends headlesscode-openshell:local and removes the RSI
source, test files, and hidden evaluation suite from the guest image. See the RSI design
for worker and queue configuration.
The queue stores job state, worker registrations, leases, retries, and admission policy in PostgreSQL; artifact bytes remain in object storage. Local integration tests used 12 simulated workers and 100 queued jobs, including a 20 MiB artifact. Each worker process currently runs one guest at a time and must be configured with a unique worker ID and OpenShell gateway ID. The two-worker run observed 4.008 seconds of concurrent evaluation leases on one gateway. A local PostgreSQL/ RustFS test drained the remaining 96 jobs with 12 simulated workers in 446 ms (215.2 jobs/s), after the initial four jobs were claimed and completed to verify admission limits; claims still serialize on a queue-policy row, and neither result qualifies a multi-host deployment. Remaining work is:
| Issue | Work |
|---|---|
| #3 | OpenShell candidate isolation is implemented; live multi-gateway qualification remains. |
| #4 | Content-addressed artifacts are implemented; signed evaluator provenance and hidden evaluation remain. |
| #5 | PostgreSQL queue, leases, retries, admission, and configured workers are implemented; live fleet qualification remains. |
| #6 | Bounded adaptive independent search supports an initial population plus one evidence-driven follow-up; repeated stages remain out of scope. |
| #7 | Fixture-backed curriculum replay and explicit promotion are implemented; wording-to-capability measurement remains unproven. |
| #8 | Adversarial review and bounded OpenShell break tests are implemented; live provider-backed review is unvalidated. |
| #9 | An OpenShell QLoRA prototype is covered by mocked job tests; the supplied GGUF is rejected before enqueue, and no live training is validated. |
See the RSI design and run progress.
headlesscode MCP 질문
headlesscode의 기본 보안 설정은 무엇인가요?
기본적으로 호출한 사용자의 권한으로 임의의 명령 실행을 허용하며, 여기에는 SSH나 AWS 자격 증명과 같은 민감한 파일을 읽거나 수정하는 작업이 포함됩니다.
LLM API 키 없이 headlesscode를 실행할 수 있나요?
모델 호출 없이 시스템 프롬프트를 생성하고 설정을 검증하는 --dry-run 플래그를 사용할 수 있습니다.
headlesscode는 MCP server를 지원하나요?
네, 설정 파일을 통해 사용자가 구성한 stdio 및 streamable HTTP MCP server에 연결할 수 있습니다.
OpenShell은 무엇에 사용되나요?
OpenShell은 격리된 환경을 제공하기 위해 일회성 샌드박스 Git 클론에서 워커 및 리뷰 세션을 실행합니다.