Skip to content

MCP setup

MCP is the tool layer. It lets Codex call the orchestrator without copying shell commands by hand.

Codex config

Add this to Codex config.toml:

toml
[mcp_servers.claude-code-orchestrator]
command = "python"
args = [
  "-c",
  "import os,sys,runpy; home=os.environ.get('CODEX_HOME') or os.path.join(os.environ.get('USERPROFILE') or os.path.expanduser('~'), '.codex'); root=os.environ.get('CC_ORCHESTRATOR_HOME') or os.path.join(home, 'skills', 'claude-code-orchestrator', 'scripts', 'cc-orchestrator'); sys.path.insert(0, root); runpy.run_path(os.path.join(root, 'server.py'), run_name='__main__')"
]

[mcp_servers.claude-code-orchestrator.env]
PYTHONIOENCODING = "utf-8"
PYTHONUTF8 = "1"

On Windows, the safe installer can write Codex and Claude MCP config after making backups:

powershell
powershell -ExecutionPolicy Bypass -File .\install\install-mcp.ps1

The same example lives in:

text
docs/mcp.codex.example.toml

Tools

ToolWhat it does
cc_healthcheckChecks Claude Code, CCSwitch, Python, and config
cc_list_profilesLists CCSwitch profiles with secrets redacted
cc_pick_profileShows which profile and model a role would use
cc_run_agentRuns one Claude Code worker
cc_run_streaming_agentStarts a background worker with live events.ndjson
cc_poll_runPolls compact controller progress by default
cc_summarize_runWrites and returns controller artifacts plus rolling checkpoints
cc_compact_eventsCompacts raw events into a timeline and deduplicated tool summary
cc_run_statusLists active workers or inspects one run
cc_stop_runStops one worker by run id
cc_send_instructionRestarts a run with recovered context and a new instruction
cc_spawn_role_teamStarts several role workers
cc_collect_team_resultsSummarizes team output
cc_cross_reviewStarts second-round reviewer workers
cc_preflight_write_scopeWrites allowed/denied path rules
cc_check_write_scopeBlocks acceptance when writes cross the scope
cc_diff_summarySummarizes changed files and risk
cc_secret_scan_runScans run logs and diff for secrets
cc_verify_runRuns diff, scope, secret scan, tests, and report
cc_rollback_runConservatively rolls back a safe run diff
cc_benchmark_modelPlans or runs one benchmark task
cc_benchmark_suitePlans or runs fixed benchmark tasks
cc_calibrate_policySaves local model preference notes
cc_model_registryBuilds the local model capability database
cc_local_policyReads or writes user-owned routing overrides
cc_score_workerGrades a worker run and updates quality history
cc_prompt_packLists or renders reusable worker prompts
cc_cost_guardSets concurrency and timeout guardrails
cc_usage_summaryEstimates daily usage from logs
cc_queue_submitSubmits a queued worker job
cc_queue_tickStarts queued jobs up to a limit
cc_queue_statusReads queued, running, done, failed, timed_out, and cancelled state
cc_queue_cancelCancels a queue job
cc_queue_policyReads or writes queue concurrency, retry, and timeout policy
cc_upgrade_checkPreserves local preferences across upgrades
cc_mock_stream_testTests streaming without spending model quota
cc_dashboardGenerates a local HTML dashboard
cc_open_run_folderOpens a run folder
cc_export_reportExports a run or team report
cc_run_visible_agentOpens a visible Claude Code worker window
cc_last_runReads the latest run metadata and output tails
cc_git_diffReturns a capped git diff for review
cc_workflow_planBuilds the configured multi-agent workflow plan
cc_write_claude_mdWrites project instructions for Claude Code workers
cc_score_modelsScores models discovered from CCSwitch
cc_write_strategy_reportsWrites model score and strategy reports

Safe defaults

By default, worker runs use plan mode.

Pass allow_write=true only after Codex has decided that file edits are needed and the write scope is clear.

Secrets are redacted from tool output and persisted logs, but prompts should still avoid asking for raw secrets.

Smoke test

After restarting Codex, call:

text
cc_healthcheck
cc_list_profiles
cc_score_models

If these work, Codex can route workers through MCP.

MIT licensed. Not affiliated with OpenAI, Anthropic, Claude, Claude Code, or CCSwitch.