Code review of a PR
Review a PR with Git, the GitHub MCP, and the agent tying everything together.
Code review of a PR
Workspace for reviewing PRs without opening a browser. The agent fetches the PR via the GitHub MCP, reads diffs, runs local checks, and hands you an analysis.
Prerequisite
Add the GitHub MCP in Settings → MCP with the GITHUB_TOKEN env (token with repo scope). Details in MCP servers.
Nodes on the canvas
| Node | Role |
|---|---|
| Code | To open PR files locally. |
| Git | To check out the PR branch. |
| Terminal | Run linter, formatter, tests. |
| Agent Terminal | Coordinates everything. |
| Text (named "Review") | Where the agent writes the final analysis. |
Connections
| From → To | Kind | What it does |
|---|---|---|
| Agent Terminal → Code | permission code-read |
Agent reads files. |
| Agent Terminal → Git | permission git-full-access |
Agent checks out, reads history. |
| Agent Terminal → Terminal | permission execute |
Agent runs npm test, eslint. |
| Agent Terminal → Text | permission summary |
Agent writes the formatted review. |
| Code → Git | port ports:savedAt->refresh |
Git refresh when a file is saved. |
The Agent Terminal is also using the GitHub MCP — no visual connection needed, the server just has to be active in Settings. The riggr_mcp_github_* tools show up in the auto list.
Prompt
Review PR #347 in `org/repo`. Plan:
1. Use the GitHub MCP to fetch title, description, and the list of
changed files.
2. Check out the PR branch (`git fetch origin pull/347/head:pr-347 && git checkout pr-347`).
3. For each changed file, open it in Code and tell me:
- What changed (one sentence).
- Any visible risk (race, leak, null deref, query without index).
- Whether the change seems covered by existing tests.
4. Run `npm test` and tell me if it passes.
5. Run `npm run lint` and report errors.
Compile everything into a structured review in the "Review" text node,
in three blocks: APPROVE / REQUEST CHANGES / QUESTIONS. Use GitHub
markdown review conventions (`>` for quotes, ```suggestion blocks).
Why this setup works
- GitHub MCP kills the browser step — the agent pulls PR metadata straight from the API.
- Git with
git-full-accesslets the agent switch branches without you remembering the syntax. - Terminal with
executeruns tests locally — you confirm what CI will say before CI says it. - The "Review" text is durable and stays in the workspace. Close it, open tomorrow, the review is there to paste into the PR.
Variations
- Conservative mode: replace
git-full-accesswithgit-log(no checkout). The agent only reads the diff via MCP. - Multiple PRs: duplicate the Text per open PR. The agent opens each one and generates a separate review.
- Team: save the workspace as a template, version it in the repo (
templates/review.riggr).