Skip to main content
Glama

AI PR Reviewer

English · Русский · Español · 中文

Review code in a real interface: a local page in the style of a GitHub Pull Request, where you leave comments and from which they go straight to an AI agent's chat.

Tired of reading git diff in a terminal and dictating fixes out loud? Open the page, drag over lines, write comments, paste screenshots, and press Request changes. The agent picks up your notes and starts fixing code. While it works, you don't keep a mental list of "what else needs fixing".

Review page

Why this exists

A plain diff in a terminal shows what changed and stops there. It is awkward for leaving notes, impossible to attach a screenshot to a line, and it can't hand anything on.

This tool serves an ordinary web page on your machine:

  • file tree, syntax highlighting, line numbers;

  • drag over a range of lines and comment on it;

  • paste a screenshot right into a comment with Ctrl+V;

  • click a name to jump to its definition, like in an IDE;

  • Viewed marks files so you don't get lost in a large branch;

  • press Request changes — the review goes to the agent, which starts fixing.

Related MCP server: PR Viewer MCP Server

What you can review

Mode

What it shows

uncommitted

what is not committed yet (new files included)

branch

the whole branch against its base — the default

range

a chosen range of commits

commits

specific commits as one change set

all

the full history of the branch

pr

a real pull request from GitHub

The pr mode goes through the GitHub CLI. It fetches the needed commits into a private ref, never touches your branch, and never changes working files.

Installation

Requires Node.js 20 or newer.

git clone https://github.com/StayNight-withMe/AI-PR-reviewer.git
cd AI-PR-reviewer
npm install

npm install also checks for gh — if it's missing, it tells you how to install it. Local reviews don't need it.

Running

# review the current branch
npm run review -- .

# uncommitted changes only
npm run review -- . --mode uncommitted

# a pull request from GitHub
npm run review -- . --mode pr --pr 42

# open the browser right away
npm run review -- . --open

The console prints an address; open it in your browser.

Which AI assistants work

There are two independent halves, and only the second one is agent-specific.

The review page works with any agent. The page is a local HTTP server, and it is started by the MCP server, by the pr-review CLI, or by any editor integration. Saving a review always writes review.json and review.md next to the artifacts — so Claude Code, Cursor, Gemini CLI, Copilot, Codex or a plain terminal all get the same result: the agent reads the review file and fixes accordingly. Use the "only give me the review path" option in the submit dialog and point the agent at that file.

Auto-dispatch is OpenCode-only. Pressing Request changes, then Send to the AI, hands the review straight into the running chat, with no copy-paste. That works by calling the OpenCode API with the session id of the conversation that opened the page. Other assistants have no equivalent session API, so for them the submit saves the files and reports "Review saved. Auto-fix not started" — the review is never lost, it just doesn't start the turn by itself.

Page, comments, artifacts

Auto-dispatch into the chat

OpenCode

yes

yes

Claude Code

yes

no — read review.md

Cursor, Gemini CLI, Copilot, Codex

yes

no — read review.md

Plain terminal / human review

yes

not applicable

So the integration list above is about the editor, not about the agent: the VS Code extension works with Claude Code just as well as with OpenCode.

How the AI uses this

If you work in a chat with an agent, you type nothing — just say:

Look at my uncommitted changes

or

Open PR #42 from owner/repo and review it

The agent calls the tools itself:

Tool

What it does

list_pull_requests

lists open PRs so you can pick one

start_review

opens the review page

await_review

waits for you to press Submit and collects the notes

get_review

reads an already saved review

list_review_scope

lists branches and commits

resolve_comments

marks notes as fixed

close_review

closes the page

Comments and their state

Every comment has a Resolve button — "this is fixed". Resolved comments stay in place but fade and get struck through, and the header counter shows only open ones. The agent can do the same thing itself: after a fix it marks the closed notes.

Settings

Theme, diff layout, tree width, line wrapping, indentation — everything is remembered on this machine and survives a new review and a restart.

Where artifacts live

A review writes review.json, review.md and images to the system temp directory, not into the project. The working copy stays clean and you don't need to touch .gitignore. Want another place — set PR_REVIEW_ARTIFACTS_DIR.

Editor integrations

Editor

How to connect

VS Code

extension in editors/vscode

Visual Studio 2022

plugin in editors/visualstudio

JetBrains

plugin in editors/jetbrains

Neovim

Lua module in editors/neovim

Sublime Text

plugin in editors/sublime

Emacs

package in editors/emacs

Zed

MCP server + task, editors/zed

Helix

pipe command + MCP, editors/helix

Details are in editors/README.md. Every integration is a thin wrapper over one engine, src/cli.js.

Development

npm test                 # unit tests
npm run test:pr          # PR mode offline, no network
npm run test:pr:ui       # PR page in a browser
npm run test:all         # everything

The PR-mode tests run against a fake gh and a local repository, so they need neither a network nor a GitHub account.

Project layout

src/
  config.js          every constant: routes, git arguments, UI sizes
  cli.js             launcher that editors run
  index.js           MCP server and its tools
  core.js            builds a review: scope -> diff -> page
  github.js          pull requests through gh
  git.js             git access
  diff.js            unified diff parser
  render.js          page HTML and Markdown export
  server.js          HTTP server for the page
  settings-store.js  UI settings
  artifacts.js       artifact paths
  assets/            client-side page code
  models/            data models: scope, tree, diffs, commits

Project rule: no magic literals in code — everything lives in config.js, with client copies in assets/constants.js.

License

MIT. Do what you want, just don't complain if something breaks.

Available Tools

7 tools
await_reviewWait for the submitted reviewA

Blocks until the review page submits a review, then returns every inline comment plus paths to review.json and review.md.

Inputs: reviewId (required), timeoutSeconds.

close_reviewClose a review pageC

Stops the local HTTP server for the given reviewId.

Inputs: reviewId (required).

get_reviewRead an exported reviewA

Reads a saved review (by reviewId or an explicit review.json path) and returns it as Markdown.

Inputs: path, reviewId.

list_pull_requestsList a repository's GitHub pull requestsA

Lists the pull requests of a repository through the GitHub CLI, newest first, so you can pick one to review with start_review(mode="pr", pr=NUMBER). Requires an authenticated gh.

Inputs: repo, limit, state, repoPath.

list_review_scopeInspect what can be reviewedA

Lists branches or commits so you can choose a scope for start_review.

Inputs: kind (required), limit, range, repoPath.

resolve_commentsResolve or reopen review commentsA

Marks review comments as resolved (fixed) or open again, in the saved review. Use it after fixing what a comment asked for, so the reviewer sees the state on the page and in review.md.

Inputs: resolved (required), reviewId (required), ids.

start_reviewOpen a pull request reviewB

Opens a GitHub-style review page in the browser for uncommitted changes, commits on a branch, specific commits, or a whole branch. Shows a syntax-highlighted diff with inline (multi-line) comments, pasted screenshots, go-to-definition links and a per-file viewer. Returns the URL and a reviewId.

Inputs: mode (required), pr, base, head, +11 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.7/5.0

    Scored across 7 tools

    Disambiguation4/5

    The tools mostly target distinct lifecycle stages: listing PRs/scopes, starting a review, awaiting submission, reading a saved review, resolving comments, and closing the server. The only mild overlap is between await_review and get_review, since both can return review content, but their blocking versus saved-read behavior is clearly described.

    Naming Consistency5/5

    All tool names use a consistent snake_case verb_noun pattern: await_review, close_review, get_review, list_pull_requests, list_review_scope, resolve_comments, start_review. The convention is predictable and easy to follow.

    Tool Count5/5

    Seven tools is well-scoped for an AI PR review workflow. Each tool maps to a necessary step without excessive surface area.

    Completeness5/5

    The set covers the full review lifecycle: discovering PRs and scopes, starting a review page, waiting for submitted feedback, retrieving saved reviews, resolving comments, and closing the server. No obvious workflow dead ends are present.

    Maintenance

    ActivityActive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      B
      maintenance
      A collaborative code and markdown review tool that bridges human reviewers and AI agents, enabling both to browse files, inspect git diffs, leave structured comments, and save a final review report from the same UI in real time.
      68 PyPI
      2
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Local code review for people and their coding agents: an agent opens a review of its changes and hands over a link, the person comments on lines, and the agent reads the threads, replies and resolves what it fixed. Reads the git worktree directly, uncommitted work included; nothing leaves the machine.
      17
      78 npm
      127
      GPL 3.0