Skip to main content
Glama

CodeTour

アニメーションによる、LLM駆動の**「5歳児に説明するように」GitHub PR ツアー**。

CodeTour は、ローカルブラウザビューアと組み合わせた MCP サーバーです。 Claude(または MCP を駆動する任意の LLM)が CodeTour のツールを段階的に呼び出します。ビューアは プルリクエスト — ファイルツリー、差分、点滅する行ハイライト — をアニメーション表示し、 ナレーションはキャプションとして表示され、ブラウザの組み込みテキスト読み上げ機能によって読み上げられます。 各ストップは GitHub へのリンクになっているので、閲覧者は自分で詳細を掘り下げられます。

仕組み

Claude ──(MCP stdio)──▶ codetour ──(WebSocket)──▶ your browser
                          │
                          └──(REST)──▶ GitHub API
  1. LLM が get_pr_info / get_file_diff を呼び出して CodeTour を通じて PR を読み取るので、その ナレーションは表示されている内容と正確に一致します。

  2. start_tour はブラウザでビューアを開き、開始 をクリックするまで待機します (クリックでオーディオも有効になります)。

  3. show_overview と一連の show_step 呼び出しが変更をアニメーション表示します。各 呼び出しはナレーションの読み上げが終わるまでブロックされるため、ツアーは自然に進行します。

  4. end_tour は、GitHub 上の PR へのリンク付きのクロージングサマリーを表示します。

Related MCP server: Code Review MCP Server

インストール

Python 3.11+ と uv が必要です。

git clone <this repo> && cd CodeTour
uv sync

Claude Code にユーザースコープで登録すると、すべてのリポジトリでツールが利用できるようになります:

claude mcp add --scope user codetour -- uv --directory /path/to/CodeTour run codetour

あとは、次のように尋ねるだけです:

https://github.com/owner/repo/pull/123 のエグゼクティブツアーを見せてください

codetour スキル

このリポジトリには、Claude Code スキル(skills/codetour/SKILL.md)が同梱されており、 Claude に良いツアーの作法を教えます:現在のブランチの PR を gh で自動検出し、ビューアを開く前に 3〜7 のストップを計画し、ELI5 ナレーションのスタイルルール、そしてビューアが閉じられたときの 復旧方法を学びます。リンク(またはコピー)して 個人のスキルディレクトリにインストールしてください:

ln -s /path/to/CodeTour/skills/codetour ~/.claude/skills/codetour

スキルをインストールすると、どのリポジトリでも「この PR のツアー」という簡単な指示で正しく動作します。 MCP サーバーまたはスキルをインストールした後は、Claude Code セッションを再起動してください。

GitHub 認証

公開 PR は認証なしで動作します(レート制限は低めです)。プライベートリポジトリや、より高い制限が必要な場合は、 CodeTour は次のうち最初に見つかったものを使います:GITHUB_TOKEN、GH_TOKEN、または gh CLI の保存済みトークン (gh auth login)。

設定

環境変数

デフォルト

意味

CODETOUR_PORT

8765

ビューアのポート(ビジーの場合は上に向かって試行)

CODETOUR_NO_BROWSER

未設定

1 に設定するとブラウザを自動で開かない

CODETOUR_MAX_FILES

300

PR ごとに取得する変更ファイルの最大数

CODETOUR_MAX_PATCH_BYTES

100000

切り詰め前のファイルごとの diff 上限

開発

uv run pytest                 # unit tests
uv run ruff check .           # lint
uv run codetour --demo        # web viewer only, replays a canned tour on a loop

デモモードはフロントエンドを反復する最も手っ取り早い方法です:MCP クライアントも GitHub アクセスも不要で、 表示された URL を開いて「開始」をクリックし、あらかじめ用意されたツアーを確認できます。

MCP ツール

ツール

目的

get_pr_info(pr_url)

PR メタデータ + ファイルごとのハンク行範囲(最初に呼び出してください)

get_file_diff(pr_url, path)

1 つのファイルの完全なパース済み diff

start_tour(pr_url, tour_title?)

ビューアを開き、「開始」を待つ

show_overview(narration, key_points?)

PR サマリーカード(読み上げ付き)

show_step(file, narration, line_start?, line_end?, side?, style?)

ファイル/行に対するアニメーション付きストップ

end_tour(summary)

GitHub リンク付きのクロージングカード

tour_status()

診断情報

Available Tools

7 tools
end_tourA

Finish the tour: shows a closing summary card with a 'View on GitHub' button and speaks the summary. Blocks until spoken.

Inputs: summary (required).

get_file_diffA

Return the full parsed diff for one changed file in the PR: every hunk with every line (kind add/del/ctx, old/new line numbers, text). Use this to read the actual code changes so your show_step narration is accurate.

Inputs: path (required), pr_url (required).

get_pr_infoA

Fetch a GitHub pull request's metadata and a compact summary of every changed file. Call this FIRST, before start_tour, so your narration matches what will be displayed.

Each file includes its diff hunk ranges: {old_start, old_end, new_start, new_end}. Those are the line numbers you pass to show_step (side="new" uses new_start/new_end). Use get_file_diff to read the actual changed lines of a specific file.

Inputs: pr_url (required).

show_overviewA

Show the PR overview card (title, author, +/- stats, file count) with your narration as a spoken caption, plus optional short bullet key_points. Blocks until the narration finishes speaking. Keep narration to 1-3 short, plain-language sentences.

Inputs: narration (required), key_points.

show_stepA

Show one tour step: selects file in the file tree, animates its diff into view, scrolls to line_start..line_end (line numbers on the side version, as returned by get_pr_info/get_file_diff), and pulses a highlight ("highlight") or dims everything else ("spotlight"). The narration appears as a caption and is spoken aloud; the call BLOCKS until speech completes, so call show_step sequentially to pace the tour. Omit line_start/line_end to frame the whole file. Out-of-range lines are snapped to the nearest hunk and reported in warnings.

Inputs: file (required), narration (required), side, style, +2 more.

start_tourA

Start an animated tour of the pull request. Fetches the PR, opens the viewer in the user's browser, and shows a title/start screen. Blocks up to ~30s waiting for the viewer to connect and the user to click Start (which also enables audio). Replaces any previous tour. Call get_pr_info first so you can plan your steps.

Inputs: pr_url (required), tour_title.

tour_statusA

Diagnostics: whether a tour is active, whether a browser viewer is connected, audio state, steps shown, and the viewer URL. Use this if a call timed out or you suspect the viewer window was closed.

Inputs: no named parameters.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A4.2/5.0

    Scored across 7 tools

    Disambiguation5/5

    Each tool has a distinctly different role: fetching PR metadata, fetching file diffs, starting the tour, showing overview/step/end screens, and checking diagnostics. No two tools overlap in purpose, making selection unambiguous.

    Naming Consistency4/5

    Most tools follow a clear verb_noun pattern (get_pr_info, get_file_diff, start_tour, show_overview, show_step, end_tour). 'tour_status' is the one outlier, reading as a noun phrase rather than a verb-driven action.

    Tool Count5/5

    Seven tools is well-scoped for a PR tour workflow: two for data retrieval, four for tour progression, and one for diagnostics. Each tool serves a necessary function without redundancy.

    Completeness5/5

    The tool surface covers the full tour lifecycle: retrieving PR context, reading diffs, starting the tour, showing overview and steps, ending cleanly, and diagnosing state. No obvious dead ends or missing operations for the stated purpose.

    Maintenance

    ActivitySlowing
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers