hierarchical-codex
This server is a deterministic MCP control plane that manages durable, policy-enforced missions and tasks for Codex subagents.
Create, read, and close missions with locked strategies, budgets, risks, and success criteria.
Allocate policy-checked tasks with roles, models, reasoning effort, dependencies, budgets, and parent-child hierarchy.
Claim, start, heartbeat, release, block, fail, cancel, and supersede tasks using leases and optimistic versioning.
Store and retrieve bounded, content-addressed artifacts.
Submit, check, verify, and commit results through producer/reviewer separation and evidence gates.
Enforce hierarchical token, cost, wall-time, tool-call, and child-count budgets.
Report usage atomically against missions and tasks with hard limit enforcement.
Recover durable mission state and audit events after interruptions or context compaction.
Support idempotent mutations and append-only audit logging for reliable workflow control.
Click on "Install 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., "@hierarchical-codexStart a Sol/Terra/Luna mission to fix login bugs with a 20-minute budget."
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.
Mission Ledger for Codex
codex-mission-ledger is a deterministic MCP control plane for native Codex
subagents. Codex still creates UI-visible Sol → Terra → Luna threads with
spawn_agent; this project supplies the durable state, policy gates, budgets,
artifacts, evidence workflow, and recovery protocol around those threads.
Status: engineering MVP. The control plane, Codex project integration, hooks, tests, and operating documentation are implemented. Validate model availability and the exact Codex core version on every target App/IDE deployment.
Design choice
The project follows one explicit route:
Model-driven spawning; code-enforced constraints.
Codex native execution plane
spawn_agent / wait_agent / Subagents UI
|
| task_id in TaskEnvelope
v
TypeScript MCP control plane
SQLite task ledger / leases / budgets / artifacts / evidence / audit
^
|
Codex Skills + Profiles + Hooks
orchestration policy / model-effort routing / spawn veto / stop checksMCP and hooks do not create native threads. The Sol or Terra model calls native
spawn_agent; code validates and records the surrounding workflow.
Related MCP server: dingdawg-governance
Implemented capabilities
Mission and task ledgers with optimistic versions.
Locked mission strategy (
direct/fanout/director_plan/pipeline).Direct-parent role policy: Sol director → Terra coordinator → Luna leaf, with
directallowing one root Luna.Model/effort matrix (coordinators cheap, Luna expensive):
Sol:
high,xhigh,max(do not raise the parent chat for orchestration)Terra:
highdefault;xhigh,maxallowedLuna:
high,xhigh,max
Dependency-aware readiness and bounded child allocation.
Expiring worker leases, heartbeats, release, and safe reclamation.
Hierarchical token, cost, wall-time, tool-call, and child-count budgets.
Content-addressed artifact storage with bounded reads.
Candidate → checked → verified → committed evidence gates.
Producer/reviewer separation.
Request-hashed idempotent mutations and append-only audit events.
Recovery snapshots after restart or context compaction.
Parked long jobs (
task_blockclears the lease) so GPU/remote work outlives the Codex thread.Project-scoped Codex Skill, Agent profiles, MCP configuration, and hooks.
Requirements
Node.js 22.5 or newer. Node 26 is used in development.
Python 3.10 or newer for Codex lifecycle hooks (
python3, Windowspy -3, orpython).Codex 0.148.0 or newer is the recommended production baseline, with native multi-agent tools, custom agents, MCP, and hooks.
A trusted Codex project so
.codex/config.tomland project hooks are loaded. Windows is a first-class install target (VS Code Codex + CLI).
Quick start
cd "/mnt/tools/others/codes/web project/hierarchical-codex"
npm install
npm run check
npm run doctorThen:
Open this repository root in Codex App, Codex CLI, or the Codex VS Code extension.
npm run doctordoes not install the skill into ChatGPT; the App must use this folder as its workspace.Trust the project when prompted. Untrusted projects hide
.codexskills.Start a new root conversation with
gpt-5.6-sol(skills load at startup).Type
$and selectagent-trio, or invoke$agent-trio <mission>. If the picker is empty,AGENTS.mdstill instructs the root Sol.Inspect native child activity in the Subagents UI and durable state through the MCP tools.
To use the full stack from other folders in the VS Code Codex extension or
CLI, run npm run install:user after npm run build. See
docs/USER_INSTALL.md. Do not copy this repo's
.codex/config.toml into ~/.codex; that would pin Sol as the default model
and block ordinary subagents.
The project MCP configuration launches node dist/cli.js with the repository
root as its working directory. Run npm run build after source changes.
Development commands
npm run dev # Run the stdio MCP server from TypeScript
npm run doctor # Validate runtime and Codex integration files
npm run test # Unit and integration tests
npm run typecheck # Strict TypeScript checks
npm run lint # ESLint
npm run format # Prettier
npm run build # Compile dist/
npm run check # Full local quality gate
npm run install:user # Install skill, agents, hooks, and MCP into ~/.codex
# (Windows: %USERPROFILE%\.codex)
npm run doctor:user # Verify the user-global install
npm run uninstall:user # Remove the managed user-global filesThe MCP server writes protocol messages to stdout. Application logging must use stderr; stdout logging corrupts stdio MCP transport.
Runtime state
By default, state is project-local and ignored by Git:
.codex-mission-ledger/
├── control-plane.sqlite
└── artifacts/
└── <sha-prefix>/<sha256>User-global install (npm run install:user) stores the ledger at
~/.local/share/codex-mission-ledger/ on POSIX and
%LOCALAPPDATA%\codex-mission-ledger\ on Windows so Codex MCP sandboxes can
write it.
If that directory is not writable, the server falls back to a temp path and
logs the chosen home on stderr.
Configuration environment variables:
CODEX_MISSION_LEDGER_HOMECODEX_MISSION_LEDGER_DBCODEX_MISSION_LEDGER_ARTIFACTSCODEX_MISSION_LEDGER_MAX_ARTIFACT_BYTESCODEX_MISSION_LEDGER_DEFAULT_LEASE_SECONDSCODEX_MISSION_LEDGER_MAX_LEASE_SECONDSCODEX_MISSION_LEDGER_EVENT_PAGE_SIZE
Legacy HIERARCHICAL_CODEX_* variables and .hierarchical-codex state paths
remain accepted while existing installations migrate.
MCP tools
Mission:
mission_createmission_getmission_close
Task and lease:
task_allocatetask_getchildren_statustask_claimtask_starttask_heartbeattask_releasetask_blocktask_failtask_canceltask_supersedetask_set_efforttask_commitresults_gate_and_commit
Artifacts and evidence:
artifact_putartifact_getresult_submit_candidateresult_checkresult_verify
Accounting and recovery:
budget_reportrecovery_snapshot
See docs/API.md for contracts and docs/PROTOCOL.md for the orchestration sequence.
Repository structure
.agents/skills/ Codex orchestration Skill
.codex/agents/ Sol/Terra/Luna custom profiles
.codex/hooks/ Python policy gates
.codex/config.toml MCP and native agent configuration
src/domain/ State and policy definitions
src/infra/ SQLite repository and artifact storage
src/mcp/ MCP tool registration
tests/ Control-plane, policy, and hook tests
docs/ Architecture, protocol, operations, ADRs, recordsImportant boundaries
External MCP code cannot call the internal native
spawn_agentregistry.Hooks can deny, rewrite, or add context, but
SubagentStartcannot prevent a subagent after creation.Native UI state is observational; SQLite is the durable workflow source.
This MVP is single-host. SQLite serializes mutations but is not a distributed consensus system.
Token usage is reported by agents/hosts; the MCP server cannot independently meter model tokens.
The repository is currently
UNLICENSED; add an explicit license before external distribution.
Documentation
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- FlicenseAqualityAmaintenanceGovernance/control plane for MCP-enabled coding-agent workflows with validation, findings, approvals, budgets, and proof bundles.5511
- AlicenseAqualityBmaintenanceUniversal governance layer for AI agents — MCP-native, fail-closed, LNN interpretability. Governed receipts, IPFS audit proofs, and rollback for any agent in any framework.382Apache 2.0
- AlicenseAqualityAmaintenanceGoverned agent execution gateway for LLM workflows, providing deterministic FSM-based execution, audit trails, and idempotency guarantees via MCP.5MIT
- AlicenseAqualityAmaintenanceLocal-first multi-agent delegation and approval control for Codex via MCP, with persistent task DAG, isolated worktrees, and a web console.141MIT
Related MCP Connectors
Control plane for autonomous software labor. Agents claim objectives over MCP with audit trail.
A paid remote MCP for OpenAI Codex agent coordination MCP, built to return verdicts, receipts, usage
Private-by-default, local-first memory/context/task orchestrator for MCP apps and agents.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/IrisRainbowNeko/codex-mission-ledger'
If you have feedback or need assistance with the MCP directory API, please join our Discord server