PR Viewer MCP Server

PR Viewer MCP Server

Enables PR review workflows by launching a diff visualizer against a git repo and returning 'accepted' or 'rejected' based on user decision.

Category
Visit Server

README

PR Viewer MCP Server

MCP server for PR review workflows. Launches a diff visualizer against a git repo and returns "accepted" or "rejected" when the user is done.

Setup

uv sync --group dev

Tools

Tool Description
health_check Confirms the server is reachable.
open_review Starts the configured visualizer and blocks until the user accepts or rejects.

open_review parameters:

Parameter Default Description
repo_path Absolute path to a git repo.
base_ref main The base git ref (e.g. main, origin/main).
head_ref HEAD The head ref to diff against base (branch name, commit SHA, etc.).

Returns "accepted" or "rejected" as a string.

Wiring in a visualizer

Create a shell script that receives the repo context via env vars and writes the review decision to $RESULT_PATH when the user is done:

#!/usr/bin/env bash
# Env vars provided by the server:
#   REPO_PATH   – absolute path to the git repo
#   BASE_REF    – base ref (e.g. main)
#   HEAD_REF    – head ref (e.g. feature/add-greet)
#   RESULT_PATH – path this script must write "accepted" or "rejected" to

# launch your visualizer here, then write the result
echo "accepted" > "$RESULT_PATH"

The default visualizer (scripts/launch-octorus.sh) opens octorus in a new Terminal.app window and prompts accept/reject after the user quits.

Connecting Claude Code

Add to ~/.claude/mcp.json (global, available in every repo):

{
  "mcpServers": {
    "pr-viewer": {
      "command": "uv",
      "args": ["run", "--directory", "/path/to/pr-viewer", "pr-viewer-mcp"]
    }
  }
}

Or scope it to one repo by placing the same block in .mcp.json at the project root.

Because open_review blocks until you finish reviewing, Claude can act on the result in the same turn. Useful prompts:

Open a review of feature/add-greet in /path/to/repo against main.
If it's accepted, merge it with `gh pr merge --merge`.
If it's rejected, post a comment explaining what needs to change.
Review the diff between main and HEAD in the current repo.
Summarize what changed and wait for my decision before doing anything.

Manual end-to-end test with a toy repo

1. Create the toy repo

./scripts/setup-toy-repo.sh

Creates ./toy-repo/ with a main branch and a feature/add-greet branch. To remove it when done:

./scripts/teardown-toy-repo.sh

2. Start the MCP inspector

uv run mcp dev src/pr_viewer_mcp/server.py

Open the inspector URL printed in the terminal (default: http://localhost:5173).

3. Call open_review

In the MCP inspector, select the open_review tool and fill in:

{
  "repo_path": "<absolute-path-to-project>/toy-repo",
  "base_ref": "main",
  "head_ref": "feature/add-greet"
}

The tool blocks — the inspector shows a spinner until the result file is written.

4. Complete the review

Either review in octorus (a Terminal.app window opens) and answer the accept/reject prompt, or write the result directly from another terminal:

# find the path in the server logs, then:
echo "accepted" > /tmp/tmp<hash>.review_result

The tool returns "accepted" or "rejected" and the inspector shows the result.

Programmatic use

For pipelines that don't use Claude, open_review is still a regular blocking MCP tool call:

import asyncio
from mcp.client.stdio import stdio_client, StdioServerParameters
from mcp.client.session import ClientSession

async def main() -> None:
    server = StdioServerParameters(
        command="uv",
        args=["run", "--directory", "/path/to/pr-viewer", "pr-viewer-mcp"],
    )
    async with stdio_client(server) as (read, write):
        async with ClientSession(read, write) as session:
            await session.initialize()
            result = await session.call_tool("open_review", {
                "repo_path": "/path/to/repo",
                "base_ref": "main",
                "head_ref": "feature/my-branch",
            })
            decision = result.content[0].text  # "accepted" or "rejected"
            print(decision)

asyncio.run(main())

Tests

uv run pytest

The integration tests (tests/test_integration.py) run the server in-process via mcp.shared.memory with a FakeVisualizer that writes the result immediately, confirming that open_review returns the correct string.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured