Repository navigation
[Phase 1] Surface the MCP knob to the review workflow without breaking template sync #679
Copy link
Copy link
Closed
Labels
dev-leadFor dev-lead agent pickupFor dev-lead agent pickupinitiativeEpic / initiative tracking issueEpic / initiative tracking issue
Description
Story
As a repo operator enabling MCP review on a repo,
I want provide a convention (a committed MCP config file plus the engine env knob) that turns MCP review on for a repo,
so that MCP can be enabled per-repo without editing org-template-synced workflow files in a way that a standards sync would clobber, and with no change to default behavior.
Acceptance Criteria
- engine.sh / the review scripts resolve REVIEW_MCP_CONFIG from the environment, defaulting to a conventional committed path only when that file exists; an absent file means MCP is off.
- Enabling MCP requires no change to default review behavior for repos that do not opt in.
- If pr-review.yml must pass the knob through, the change is limited to its env: block and recorded as a documented repo-specific exception per AGENTS.md; otherwise the knob is sourced entirely from the committed file with no workflow edit. The chosen approach is justified in the PR.
- A sample MCP config (Context7, no auth) is committed as documentation-only and is not active unless the file/knob convention selects it.
Tasks / Subtasks
- Resolve REVIEW_MCP_CONFIG: honor an explicit env value, else fall back to a conventional committed path only if it exists. (AC: test issue from agent #1)
- Verify the resolved knob is visible to the review subprocess (review-one-pr.sh / review-batch.sh source engine.sh). (AC: test issue from agent #1, Go-live improvements for PR review agent #2)
- Decide and implement the enablement path: committed-file-only (preferred, no workflow edit) vs. a documented env-passthrough exception in pr-review.yml + AGENTS.md. (AC: Add @claude delegation, auto-merge, and rebase handling #3)
- Commit a documentation-only sample MCP config (Context7, no auth) that is inert by default. (AC: Optimize review: small-PR and incremental fast paths #4)
Dev Notes
- CONSTRAINT: AGENTS.md 'Workflow Files' states all non-exempt workflow changes must use the org templates in standards/workflows verbatim; pr-review.yml is org-template-synced, so arbitrary edits risk being reverted by standards-sync. Prefer sourcing the knob from a committed config file the scripts discover (no workflow edit). If an env passthrough is unavoidable, add it as a documented exception alongside the existing token-report.yml / pr-review-sweep.yml exception entries.
- pr-review.yml's env: block is at ~lines 123-145 (CLAUDE_CODE_OAUTH_TOKEN, GH_TOKEN, etc.). Any MCP secret (e.g. a GitHub MCP token) would flow here — but Context7 needs none, so start auth-free to avoid touching the template at all.
- review-one-pr.sh:27 and review-batch.sh:66 both
source engine.sh; the resolved knob must be exported so the subprocess that actually runs the review sees it. - Keep no secrets in committed files (AGENTS.md Scripts) — the sample config must be no-auth (Context7).
Project Structure Notes
Adds a committed sample MCP config (documentation-only) plus small resolution logic in scripts. Touch pr-review.yml only if strictly necessary and only as a documented exception.
References
- AGENTS.md#workflow-files (template-sync constraint + exception precedent)
- .github/workflows/pr-review.yml:123 (env: block)
- scripts/review-one-pr.sh:27 (sources engine.sh)
- scripts/review-batch.sh:66 (sources engine.sh)
Likely target surface
scripts/engine.shscripts/review-one-pr.sh.github/workflows/pr-review.yml
Story prepared by the BMAD Scrum Master (Bob) for epic #676. Status: ready-for-dev.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
dev-leadFor dev-lead agent pickupFor dev-lead agent pickupinitiativeEpic / initiative tracking issueEpic / initiative tracking issue
Activity
don-petry commentedon Jun 14, 2026
Dev-Lead Implementation Plan
Issue: #679 — [Phase 1] Surface the MCP knob to the review workflow without breaking template sync
Scope
Resolve
REVIEW_MCP_CONFIGinengine.shto fall back to a conventional committed path (.github/review-mcp.json) only when that file exists, and commit an inert documentation-only Context7 sample — no edit to the org-template-syncedpr-review.yml.Chosen enablement path (AC #3)
Committed-file-only (no workflow edit).
pr-review.yml'senv:block (lines 123-145) is org-template-synced; editing it risks being clobbered by standards-sync. Instead,engine.shauto-discovers a committed config at the conventional path whenREVIEW_MCP_CONFIGis unset. No workflow change, so no AGENTS.md exception is required. To enable, an operator commits.github/review-mcp.json(e.g. by copying the sample). Context7 needs no auth, so no secret has to flow through the template.Implementation Checklist
scripts/engine.sh— resolveREVIEW_MCP_CONFIG: honor an explicit env value as-is; else fall back toREVIEW_MCP_CONFIG_DEFAULT_PATH(default.github/review-mcp.json) only if that file exists. Absent file ⇒ MCP off. (AC test issue from agent #1, Go-live improvements for PR review agent #2).github/review-mcp.json.sample— documentation-only Context7 (no-auth) sample, inert because the scripts only discover the suffix-less.github/review-mcp.json. (AC Optimize review: small-PR and incremental fast paths #4)docs/pr-review-agent/pr-review-agent.md— document the convention + how to enable.Tests to Write
Test Command
bats tests/dev-lead/unit/test_engine_mcp.bats(andbash .dev-lead/scripts/dev-lead-lint.sh)don-petry commentedon Jun 14, 2026
Dev-Lead: Implementation Complete
Plan Execution
REVIEW_MCP_CONFIGinengine.sh: honor explicit env value, else fall back to conventional committed path.github/review-mcp.jsononly when it exists (AC test issue from agent #1)pr-review.yml, so no AGENTS.md exception needed (AC Add @claude delegation, auto-merge, and rebase handling #3).github/review-mcp.json.sample(AC Optimize review: small-PR and incremental fast paths #4)docs/pr-review-agent/pr-review-agent.mdEnablement-path justification (AC #3)
pr-review.yml'senv:block is org-template-synced; arbitrary edits risk being clobbered by standards-sync. The knob is therefore sourced entirely from a committed config the scripts auto-discover — no workflow edit, so no documented exception is required. Context7 needs no auth, so no secret has to flow through the template. An MCP server requiring a secret would still need an env-passthrough exception, which is called out in the docs.Test Results
Files Changed
scripts/engine.sh: resolveREVIEW_MCP_CONFIGfrom env, else conventional path.github/review-mcp.json(via overridableREVIEW_MCP_CONFIG_DEFAULT_PATH) only if present; export the resolved knobs..github/review-mcp.json.sample: documentation-only, no-auth Context7 MCP config — inert because the scripts only discover the suffix-less path.docs/pr-review-agent/pr-review-agent.md: new "MCP review" tuning section (resolution order + how to enable).tests/dev-lead/unit/test_engine_mcp.bats: +5 tests (conventional-path present/absent/precedence; sample valid JSON; discovery path absent in-repo).Notes
dev-lead-lint.sh(shellcheck + agent frontmatter) and markdownlint on the changed doc both pass.prompts/._commentkey in the sample so a plaincp .github/review-mcp.json.sample .github/review-mcp.jsonyields a directly-usable config.feat: implement issue #679 — [Phase 1] Surface the MCP knob to the re…
feat: implement issue #679 — [Phase 1] Surface the MCP knob to the re…
feat: implement issue #679 — [Phase 1] Surface the MCP knob to the re…
feat: implement issue #679 — [Phase 1] Surface the MCP knob to the re…
feat: implement issue #679 — [Phase 1] Surface the MCP knob to the re…