Skip to content

MCP Connector

repo-harness ships an MCP server that exposes only your workflow artifacts — plans, sprints, contracts, checks, handoffs — to ChatGPT and Codex. ChatGPT connects over HTTP with OAuth through a public /mcp endpoint; Codex connects locally over stdio with no tunnel. The sidecar is not a remote coding agent — it prepares workflow artifacts for the local agent host.

An adopted repo

Run from a repository that has already run repo-harness adopt. See Setup.

repo-harness on PATH

The repo-harness CLI must be installed and resolvable on your shell PATH.

ChatGPT Developer Mode

A ChatGPT workspace with access to Developer Mode and custom MCP Connectors.

A public /mcp endpoint

A stable public HTTPS /mcp URL for recurring ChatGPT use. Local Codex uses stdio with no tunnel.

  1. Launch the planner-profile server over HTTP on localhost:

    Terminal window
    repo-harness mcp serve --repo . --transport http --host 127.0.0.1 --port 8765 --profile planner
  2. Confirm it’s healthy:

    Terminal window
    curl http://127.0.0.1:8765/health
  3. Read the local OAuth passphrase — ChatGPT will ask for it during authorization:

    Terminal window
    jq -r .passphrase .repo-harness/mcp.oauth.json
  4. Smoke-test OAuth discovery:

    Terminal window
    curl http://127.0.0.1:8765/.well-known/oauth-protected-resource/mcp

ChatGPT needs a public HTTPS URL ending in /mcp. Prefer a stable hostname for recurring use — a quick tunnel’s URL changes, and ChatGPT treats each new URL as a different Connector app.

Terminal window
cloudflared tunnel login
cloudflared tunnel create repo-harness-mcp
cloudflared tunnel route dns repo-harness-mcp repo-harness-mcp.example.com
cloudflared tunnel run --url http://127.0.0.1:8765 repo-harness-mcp

Then record the stable endpoint in ignored local config:

Terminal window
repo-harness mcp setup chatgpt --repo . --endpoint <https-url>/mcp
  1. Open ChatGPT Settings.
  2. Enable Developer Mode if your workspace exposes it.
  3. Go to Connectors.
  4. Create a Connector named repo-harness.
  5. Paste the HTTPS Connector URL ending in /mcp.
  6. Configure Connector authentication as OAuth.
  7. Click Scan Tools.
  8. When the authorization page opens, enter the passphrase from .repo-harness/mcp.oauth.json.
  9. Wait for the tool scan to finish, then create the Connector.
  10. Keep write confirmations enabled.

Codex runs locally and needs no tunnel — it speaks stdio directly. Auto-generate the config:

Terminal window
repo-harness mcp setup codex --repo . --scope project

This writes .codex/config.toml with a stdio repo_harness server entry and the allowed tool list.

Terminal window
repo-harness mcp serve --repo . --transport http --host 127.0.0.1 --port 8765 \
--profile orchestrator --enable-dev-runner --dev-runner-agents codex

Or via environment override:

Terminal window
REPO_HARNESS_MCP_DEV_RUNNER=1 REPO_HARNESS_MCP_DEV_RUNNER_AGENTS=codex,claude \
repo-harness mcp serve --repo . --transport http --profile orchestrator

When enabled, the server exposes run_agent_goal. It reads only .ai/harness/handoff/codex-goal.md and runs that fixed handoff through the allowed local CLI. It is not arbitrary shell.

The planner profile is read-mostly. It can read workflow files and write planning artifacts only — never application source, manifests, lockfiles, CI config, secrets, or files outside the repo root.

  • Read-only: harness_status, harness_doctor, read_workflow_file, list_workflow_files, latest_handoff, latest_checks
  • Planning writes: write_prd_from_idea, write_checklist_sprint, prepare_codex_goal_from_sprint

The expected planning chain: idea → write_prd_from_ideawrite_checklist_sprintprepare_codex_goal_from_sprint → local Codex /goal execution.

  • If ChatGPT cannot connect, verify the tunnel URL is HTTPS and ends in /mcp.
  • If ChatGPT returns unauthorized, verify OAuth discovery works and re-run the passphrase flow.
  • If tools are missing, restart repo-harness mcp serve and rescan tools.
  • If writes fail, verify the target path is a PRD, sprint, plan, or approved handoff file.
  • If ChatGPT generated prose instead of checklist Sprint task cards, ask it to use write_checklist_sprint.
  • If Codex cannot see the server, run repo-harness mcp setup codex --repo . --scope project.