Skip to main content
Glama
UtakataKyosui

PR Review MCP Server

PR Review MCP Server

CI/CD License: MIT

GitHub PR レビューコメントを取得・応答・解決するためのMCPサーバーです。

機能

このMCPサーバーは以下の4つのツールを提供します:

  1. list_review_threads - PRのレビュースレッド一覧を取得

  2. reply_to_review_thread - レビュースレッドに返信

  3. resolve_review_thread - レビュースレッドを解決

  4. reply_and_resolve - 返信と解決を一度に実行

Related MCP server: GitHub PR Reviewer

前提条件

  • GitHub CLI (gh) がインストールされ、認証済みであること

    gh auth login
  • uv (Python 3.10以上)

インストール

uvを使用する方法(推奨)

# uvのインストール(まだの場合)
curl -LsSf https://astral.sh/uv/install.sh | sh

# プロジェクトディレクトリに移動
cd /path/to/CodeReviewResolvedMcp

# 依存関係のインストール
uv sync

# 開発用依存関係も含める場合
uv sync --dev

従来のpipを使用する方法

# プロジェクトディレクトリに移動
cd /path/to/CodeReviewResolvedMcp

# インストール
pip install -e .

# 開発用の依存関係も含める場合
pip install -e ".[dev]"

MCPクライアントでの使用

Claude Desktopの設定

uvを使用する場合(推奨)

~/.config/Claude/claude_desktop_config.json (Linux):

{
  "mcpServers": {
    "pr-review": {
      "command": "uv",
      "args": ["run", "pr-review-mcp"],
      "cwd": "/path/to/CodeReviewResolvedMcp"
    }
  }
}

python3を使用する場合

{
  "mcpServers": {
    "pr-review": {
      "command": "python3",
      "args": ["-m", "pr_review_mcp.server"],
      "cwd": "/path/to/CodeReviewResolvedMcp"
    }
  }
}

使用例

1. レビュースレッド一覧の取得

未解決のレビューコメントを確認したいので、owner/repo の PR #123 のレビュースレッドを表示してください

2. レビューコメントに返信

thread_id: PRRT_xxx のスレッドに "修正しました。ご確認ください。" と返信してください

3. レビュースレッドの解決

thread_id: PRRT_xxx のスレッドを解決済みにしてください  

4. 返信と解決を一度に実行

thread_id: PRRT_xxx のスレッドに "対応完了しました" と返信し、解決してください

ツールの詳細

list_review_threads

PRのレビュースレッド一覧を取得します。

パラメータ:

  • owner (string, 必須): リポジトリオーナー

  • repo (string, 必須): リポジトリ名

  • pull_number (integer, 必須): PR番号

  • unresolved_only (boolean, オプション): 未解決のみ取得 (デフォルト: true)

出力例:

{
  "pull_request": "owner/repo#123",
  "thread_count": 2,
  "threads": [
    {
      "id": "PRRT_kwDOABC...",
      "is_resolved": false,
      "file": "src/main.py",
      "line": 42,
      "first_comment": {
        "author": "reviewer",
        "body": "このロジックを改善できますか?",
        "created_at": "2025-12-10T12:00:00Z"
      }
    }
  ]
}

reply_to_review_thread

レビュースレッドに返信を追加します。

パラメータ:

  • owner (string, 必須): リポジトリオーナー

  • repo (string, 必須): リポジトリ名

  • pull_number (integer, 必須): PR番号

  • thread_id (string, 必須): スレッドID

  • body (string, 必須): 返信内容(Markdownサポート)

resolve_review_thread

レビュースレッドを解決済みとしてマークします。

パラメータ:

  • thread_id (string, 必須): スレッドID

reply_and_resolve

レビュースレッドに返信し、即座に解決します。

パラメータ:

  • owner (string, 必須): リポジトリオーナー

  • repo (string, 必須): リポジトリ名

  • pull_number (integer, 必須): PR番号

  • thread_id (string, 必須): スレッドID

  • body (string, 必須): 返信内容(Markdownサポート)

技術詳細

このMCPサーバーは以下の技術を使用しています:

  • GitHub GraphQL API: レビュースレッドの取得と操作

  • gh CLI: GitHub APIへのアクセス(認証を含む)

  • MCP (Model Context Protocol): AIアシスタントとの統合

GraphQL APIの使用

このサーバーは主に以下のGraphQL操作を使用します:

  • クエリ: repository.pullRequest.reviewThreads - レビュースレッド取得

  • ミューテーション: addPullRequestReviewThreadReply - 返信追加

  • ミューテーション: resolveReviewThread - スレッド解決

トラブルシューティング

gh command failed エラー

gh CLIが正しくインストール・認証されているか確認してください:

gh auth status

認証されていない場合:

gh auth login

Pull request not found エラー

  • リポジトリ名、オーナー、PR番号が正しいか確認

  • PRが実際に存在するか確認

  • ghコマンドで該当リポジトリにアクセス権限があるか確認

GraphQL errors エラー

  • thread_idが正しいか確認(list_review_threadsで取得したIDを使用)

  • PR番号が正しいか確認

  • リポジトリへの書き込み権限があるか確認

ライセンス

このプロジェクトはMITライセンスの下で公開されています。

開発

依存関係の管理

# 依存関係の追加
uv add <package-name>

# 開発用依存関係の追加
uv add --dev <package-name>

# 依存関係の同期
uv sync

コード品質チェック

# Ruffでリント
uv run ruff check .

# Ruffでフォーマット
uv run ruff format .

# 型チェック(追加予定)
# uv run mypy src/

テストの実行

# すべてのテストを実行
uv run pytest

# 詳細表示で実行
uv run pytest -v

# 特定のテストファイルを実行
uv run pytest tests/test_gh_api.py

# カバレッジ付きで実行(pytest-covが必要)
# uv add --dev pytest-cov
# uv run pytest --cov=pr_review_mcp

CI/CD

このプロジェクトはGitHub Actionsを使用した自動CI/CDパイプラインを備えています。

ワークフロー

CI/CD(.github/workflows/ci.yml

プッシュとプルリクエストで自動実行されます:

  • Lint: Ruffによるコードのリント

  • Format Check: Ruffによるフォーマットチェック

  • Test: Python 3.10、3.11、3.12での自動テスト

# 実行タイミング
- main ブランチへのプッシュ
- develop ブランチへのプッシュ  
- main/develop ブランチへのプルリクエスト

Release(.github/workflows/release.yml

バージョンタグがプッシュされた時に自動実行されます:

# リリース方法
git tag v0.1.0
git push origin v0.1.0

このワークフローは:

  1. パッケージをビルド

  2. GitHub Releaseを作成

  3. (オプション)PyPIに公開

Dependabot(.github/dependabot.yml

依存関係の自動更新:

  • GitHub Actionsの更新(週次)

  • Python依存関係の更新(週次)

ローカルでCI/CDと同じチェックを実行

# リント
uv run ruff check .

# フォーマットチェック
uv run ruff format --check .

# テスト
uv run pytest -v

Available Tools

4 tools
list_review_threadsB

List review threads for a GitHub pull request

ParametersJSON Schema
NameRequiredDescriptionDefault
repoYesRepository name
ownerYesRepository owner (username or organization)
pull_numberYesPull request number
unresolved_onlyNoOnly return unresolved threads (default: true)

TDQS

B3.3/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are present, so the description must convey behavioral traits. It only states the action without mentioning that it is a read-only operation, or any details on filtering (e.g., unresolved_only default) or pagination. The description is too minimal for a tool with no annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, clear sentence with no waste. However, it could be slightly expanded to include key behavioral details without losing conciseness. It is appropriately front-loaded but leans toward under-specification.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

There is no output schema, so the description should explain what the tool returns (e.g., thread details, line numbers, comments). It does not, leaving the agent uninformed about the output structure. For a listing tool, this is a significant gap.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% with descriptions for all 4 parameters. The description adds no additional meaning beyond confirming the action. Baseline 3 is appropriate as the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'List' and the resource 'review threads' scoped to a GitHub pull request. It distinguishes from sibling tools (reply_to_review_thread, resolve_review_thread) which focus on actions on threads, making the purpose unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No explicit when-to-use or when-not-to-use guidance is provided. The description implies usage when needing to see existing review threads, but it does not mention alternatives or context compared to sibling tools. Basic implied usage exists.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

reply_and_resolveA

Reply to a review thread and immediately resolve it

ParametersJSON Schema
NameRequiredDescriptionDefault
bodyYesReply content (Markdown supported)
repoYesRepository name
ownerYesRepository owner (username or organization)
thread_idYesReview thread ID (from list_review_threads)
pull_numberYesPull request number

TDQS

A3.5/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It discloses the combined behavior (reply and resolve) but does not mention any side effects, such as whether the thread must be unresolved, what happens on failure, or any atomicity guarantees. More behavioral context would be helpful.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, front-loaded sentence that clearly states the tool's purpose without unnecessary words. It is concise and understandable, though it could be slightly more structured with bullet points or additional context for completeness.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given that there are 5 required parameters and no output schema or annotations, the description is insufficiently complete. It does not explain the resolve aspect in detail, such as whether the session's reviewer is the one who resolves, or any preconditions. For a combined operation, more context is needed.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema covers all 5 parameters with descriptions, so schema coverage is 100%. The description adds no extra meaning to the parameters beyond what is in the schema. Baseline score of 3 is appropriate as the description does not enhance parameter understanding.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool does two things: reply to a review thread and resolve it. The verb 'Reply and resolve' combined with the resource 'review thread' makes the purpose unambiguous. It distinguishes itself from sibling tools like 'reply_to_review_thread' and 'resolve_review_thread' by offering a combined action.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies when to use this tool: when you want to both reply and resolve in one step. However, it does not explicitly state when NOT to use it, nor does it compare with the separate reply or resolve tools. No guidance on prerequisites or context is provided.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

reply_to_review_threadC

Add a reply to a review thread

ParametersJSON Schema
NameRequiredDescriptionDefault
bodyYesReply content (Markdown supported)
repoYesRepository name
ownerYesRepository owner (username or organization)
thread_idYesReview thread ID (from list_review_threads)
pull_numberYesPull request number

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden of behavioral disclosure, but it only repeats the action. It does not mention prerequisites (e.g., thread must be active), side effects, or response behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence with no redundant content. It is as concise as possible for the core purpose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (5 required params, no output schema, no annotations), the description is too sparse. It lacks context on return values, error handling, or how to obtain the thread_id (though it references sibling).

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema fully describes all 5 parameters with clear descriptions, so the description adds no extra meaning. Baseline score of 3 is appropriate as schema carries the load.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Add a reply') and the resource ('review thread'), making the purpose immediately understandable. However, it does not differentiate from the sibling tool 'reply_and_resolve', which also adds a reply.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus its siblings, such as 'reply_and_resolve' or 'resolve_review_thread'. The agent lacks context for appropriate selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

resolve_review_threadB

Mark a review thread as resolved

ParametersJSON Schema
NameRequiredDescriptionDefault
thread_idYesReview thread ID (from list_review_threads)

TDQS

B3.2/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries full burden. It only states the action without disclosing behavioral traits: whether it's reversible, if permissions are needed, or what happens to the thread (e.g., collapsed, status change). This is insufficient for an agent to understand consequences.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single concise sentence, front-loading the action. However, it is too brief and could benefit from slight expansion without losing conciseness.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (1 param, no output schema), the description is minimally adequate. However, it lacks behavioral context (e.g., effects, permissions) that would help an agent use it correctly, especially with no annotations.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% with thread_id clearly described. The description adds no extra meaning beyond the schema, so baseline score of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Mark a review thread as resolved' clearly states the action (resolve) and resource (review thread). It distinguishes from sibling tools: list_review_threads lists threads, reply_and_resolve both replies and resolves, and reply_to_review_thread only replies.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No usage guidance is provided. The description does not indicate when to use this tool vs alternatives, nor does it mention any prerequisites or conditions like requiring ownership or resolved state.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 4 tool updates
    • First observedlist_review_threads
    • First observedreply_and_resolve
    • First observedreply_to_review_thread
    • First observedresolve_review_thread

TDQS

B3.3/5.0
Disambiguation3/5

The tools have overlapping purposes that could cause confusion. 'reply_and_resolve' combines the functionality of 'reply_to_review_thread' and 'resolve_review_thread', making it ambiguous when to use the combined tool versus the individual ones. However, the descriptions clarify the distinctions, so agents can differentiate with careful reading.

Naming Consistency5/5

All tool names follow a consistent snake_case pattern with clear verb_noun structure (e.g., list_review_threads, reply_to_review_thread). The naming is predictable and readable throughout the set, with no deviations in style or convention.

Tool Count4/5

With 4 tools, the count is reasonable for a focused PR review server. It covers core operations like listing, replying, and resolving threads. However, it feels slightly thin, as it lacks tools for creating review threads or handling other review aspects like approvals, which might be expected in this domain.

Completeness3/5

The server covers basic operations for managing review threads but has notable gaps. There is no tool to create a new review thread, which is a core function in PR reviews. Additionally, it lacks coverage for other review actions like submitting reviews, approving, or requesting changes, limiting its completeness for the stated purpose.

Maintenance

ActivityInactive
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/UtakataKyosui/PR-Review-Resolve-MCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server