# ado-pr-review
[](https://github.com/kienbui1995/ado-pr-review/actions/workflows/ci.yml)
[](LICENSE)
Azure DevOps pull-request code review for **any MCP-capable AI coding agent** โ Claude Code, Codex,
OpenCode, Gemini CLI, Cline, Kiro, and friends.
```bash
git clone https://github.com/kienbui1995/ado-pr-review
cd ado-pr-review
python3 install.py --org https://dev.azure.com/your-org --project "Your Project"
```
## Architecture โ one core, many wrappers
```
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ server/ado_mcp_server.py โ โ the portable core (stdlib only, shells to `az`)
โ MCP tools: ado_pr_show, โฆ โ works in EVERY MCP client
โโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโ
โ registered into each tool's config (install.py)
โโโโโโโโโโโฌโโโโโโโโโโฌโโโโดโโโโโโฌโโโโโโโโโโฌโโโโโโโโโโ
Claude Codex OpenCode Gemini Cline Kiro
(plugin) (config.toml)(opencode.json)(settings.json)(mcp_settings)(.kiro/settings)
โ
โโโ playbook/REVIEW-PLAYBOOK.md โ the shared review procedure every wrapper points to
```
- **MCP server** (`server/ado_mcp_server.py`) is the capability layer. It exposes:
`ado_pr_show`, `ado_pr_list_active`, `ado_pr_changed_files`, `ado_pr_threads_list`,
`ado_pr_thread_post`. No PAT, no pip installs โ it reuses your authenticated `az` CLI.
- **Playbook** (`playbook/REVIEW-PLAYBOOK.md` + `review-lenses.md` + `ado-commands.md`) is the
tool-agnostic review procedure: multi-lens review โ adversarial 0-100 scoring โ keep โฅ80 โ
verify โ post. Dry-run by default.
- **Per-tool wrappers** register the server and add a `review-pr-ado` command/skill.
## Prerequisites
- `az` CLI + the `azure-devops` extension, authenticated (`az devops login`).
- `python3` (โฅ3.8; the server is stdlib-only โ system python is fine).
## Quick install (all detected tools)
```bash
python3 install.py --org https://dev.azure.com/<org> --project "<project>"
```
It detects which agents are installed, registers the MCP server in each (merge-safe, backed up to
`<config>.ado-bak`, idempotent), and drops a `review-pr-ado` command where the tool supports one.
Preview without writing:
```bash
python3 install.py --print # show every snippet, change nothing
python3 install.py --only codex,gemini
python3 install.py --force # install even for undetected tools
```
Restart each tool afterwards so it loads the server.
## Per-tool manual setup
If you'd rather wire it by hand, point `command` at `server/ado_mcp_server.py`.
**Claude Code** โ install the bundled plugin (richest: skill + lens agents + command + MCP):
```
/plugin marketplace add /path/to/ado-pr-review/packaging/claude-code
/plugin install ado-pr-review@ado-pr-review
```
โฆor just the server: `claude mcp add-json -s user ado-pr-review '{"command":"python3","args":["<repo>/server/ado_mcp_server.py"]}'`
**Codex** โ `~/.codex/config.toml`:
```toml
[mcp_servers.ado-pr-review]
command = "python3"
args = ["<repo>/server/ado_mcp_server.py"]
env = { ADO_ORG = "https://dev.azure.com/<org>", ADO_PROJECT = "<project>" }
```
**OpenCode** โ `~/.config/opencode/opencode.json`:
```json
{ "$schema": "https://opencode.ai/config.json",
"mcp": { "ado-pr-review": {
"type": "local",
"command": ["python3", "<repo>/server/ado_mcp_server.py"],
"enabled": true,
"environment": { "ADO_ORG": "https://dev.azure.com/<org>" } } } }
```
**Gemini CLI** โ `~/.gemini/settings.json`:
```json
{ "mcpServers": { "ado-pr-review": {
"command": "python3", "args": ["<repo>/server/ado_mcp_server.py"],
"env": { "ADO_ORG": "https://dev.azure.com/<org>" } } } }
```
**Cline** (VS Code) โ `cline_mcp_settings.json`, and **Kiro** โ `~/.kiro/settings/mcp.json`: both use
the standard `{"mcpServers": { "ado-pr-review": { "command": "python3", "args": ["โฆ"] } }}` shape.
## Usage
In any wired tool: `review-pr-ado 1234` (or invoke the skill / `/review-pr-ado 1234`). It reviews
the PR and **prints findings only** โ add `--post` to publish the comment to the PR. The agent uses
the `ado_pr_*` tools to read the PR and (only on `--post`) to comment.
## Config (env)
- `ADO_ORG` โ default organization URL (the server also accepts a per-call `org`).
- `ADO_PROJECT` โ default project (for `ado_pr_list_active`).
- `AZ_BIN` โ path to `az` if not on PATH.
## Uninstall
Each edited config has a `<config>.ado-bak` backup. For Claude: `claude mcp remove -s user ado-pr-review`.
Remove the `[mcp_servers.ado-pr-review]` / `ado-pr-review` block from a tool's config to disable it.
## Notes / scope
- Live-tested here: the MCP server (all 5 tools) and the Claude Code packaging. The other tools'
configs follow each project's documented MCP format โ verify against your installed version.
- For diff **bodies**, the review uses local `git` in your repo clone; the MCP server returns
changed-file *lists* (git is faster and exact for diffs).
## Contributing
Issues and PRs welcome โ see [CONTRIBUTING.md](CONTRIBUTING.md). The server and installer are pure
Python stdlib (no runtime dependencies); please keep it that way and run `python3 tests/test_server_smoke.py`
before opening a PR.
## License
[MIT](LICENSE) ยฉ Kien Bui