一个已采用的仓库
在一个已经运行过 repo-harness adopt 的仓库中运行。见 安装。
repo-harness 自带一个 MCP server,向 ChatGPT 和 Codex 只暴露你的工作流产物——计划、sprint、契约、检查、handoff。ChatGPT 通过一个公开的 /mcp 端点经由 HTTP 加 OAuth 连接;Codex 在本地通过 stdio 连接,无需隧道。这个 sidecar 不是远程编码 agent——它为本地 agent 宿主准备工作流产物。
一个已采用的仓库
在一个已经运行过 repo-harness adopt 的仓库中运行。见 安装。
PATH 上有 repo-harness
repo-harness CLI 必须已安装,并能在你的 shell PATH 上解析到。
ChatGPT Developer Mode
一个能访问 Developer Mode 和自定义 MCP Connector 的 ChatGPT workspace。
一个公开的 /mcp 端点
用于 ChatGPT 长期使用的稳定公开 HTTPS /mcp URL。本地 Codex 使用 stdio,无需隧道。
在 localhost 上以 planner profile 通过 HTTP 启动 server:
repo-harness mcp serve --repo . --transport http --host 127.0.0.1 --port 8765 --profile planner确认它健康:
curl http://127.0.0.1:8765/health读取本地 OAuth 口令——ChatGPT 在授权时会问你要:
jq -r .passphrase .repo-harness/mcp.oauth.json冒烟测试 OAuth 发现:
curl http://127.0.0.1:8765/.well-known/oauth-protected-resource/mcpChatGPT 需要一个以 /mcp 结尾的公开 HTTPS URL。长期使用时优先用稳定的主机名——quick tunnel 的 URL 会变,而 ChatGPT 会把每个新 URL 当成不同的 Connector 应用。
cloudflared tunnel logincloudflared tunnel create repo-harness-mcpcloudflared tunnel route dns repo-harness-mcp repo-harness-mcp.example.comcloudflared tunnel run --url http://127.0.0.1:8765 repo-harness-mcp然后把稳定端点记录到被忽略的本地配置里:
repo-harness mcp setup chatgpt --repo . --endpoint <https-url>/mcpcloudflared tunnel --url http://127.0.0.1:8765把打印出的 HTTPS URL 追加 /mcp 后作为你的 Connector URL:
<https-tunnel-url>/mcprepo-harness 的 Connector。/mcp 结尾的 HTTPS Connector URL。.repo-harness/mcp.oauth.json 中的口令。Codex 在本地运行,不需要隧道——它直接讲 stdio。自动生成配置:
repo-harness mcp setup codex --repo . --scope project这会写出 .codex/config.toml,其中含一个 stdio 的 repo_harness server 条目和允许的工具列表。
repo-harness mcp serve --repo . --transport http --host 127.0.0.1 --port 8765 \ --profile orchestrator --enable-dev-runner --dev-runner-agents codex或者通过环境变量覆盖:
REPO_HARNESS_MCP_DEV_RUNNER=1 REPO_HARNESS_MCP_DEV_RUNNER_AGENTS=codex,claude \ repo-harness mcp serve --repo . --transport http --profile orchestrator启用后,server 会暴露 run_agent_goal。它只读取 .ai/harness/handoff/codex-goal.md,并通过允许的本地 CLI 运行那个固定的 handoff。它不是任意 shell。
planner profile 以读为主。它只能读取工作流文件、写入规划产物——绝不会碰应用源码、manifest、lockfile、CI 配置、密钥,或仓库根目录之外的文件。
harness_status、harness_doctor、read_workflow_file、list_workflow_files、latest_handoff、latest_checkswrite_prd_from_idea、write_checklist_sprint、prepare_codex_goal_from_sprint预期的规划链路:idea → write_prd_from_idea → write_checklist_sprint → prepare_codex_goal_from_sprint → 本地 Codex /goal 执行。
/mcp 结尾。repo-harness mcp serve 并重新扫描工具。write_checklist_sprint。repo-harness mcp setup codex --repo . --scope project。