Skip to main content
Glama

CodeTour

Анимированные, управляемые LLM "объясни, как пятилетнему" туры по pull request'ам GitHub.

CodeTour — это MCP сервер в паре с локальным браузерным просмотрщиком. Клод (или любая LLM, управляющая MCP) вызывает инструменты CodeTour шаг за шагом; просмотрщик анимирует проход по pull request — дерево файлов, диффы, пульсирующие подсветки строк — пока повествование показывается в виде подписей и озвучивается через встроенный синтез речи браузера. Каждая остановка ссылается обратно на GitHub, чтобы зрители могли сами углубиться в детали.

Как это работает

Claude ──(MCP stdio)──▶ codetour ──(WebSocket)──▶ your browser
                          │
                          └──(REST)──▶ GitHub API
  1. LLM вызывает get_pr_info / get_file_diff, чтобы прочитать PR через CodeTour, поэтому его повествование точно соответствует тому, что отображается.

  2. start_tour открывает просмотрщик в вашем браузере и ждет, когда вы нажмете Start (клик также включает звук).

  3. show_overview и серия вызовов show_step анимируют изменения. Каждый вызов блокируется до окончания озвучивания повествования, поэтому тур идет в естественном темпе.

  4. end_tour показывает итоговое резюме со ссылкой на PR на GitHub.

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) который обучает Клода мастерству хорошего тура: автоматическое определение PR текущей ветки через gh, планирование 3–7 остановок перед открытием просмотрщика, правила стиля повествования ELI5 и как восстановиться, когда просмотрщик закрыт. Установите его, создав ссылку (или скопировав) в ваш личный каталог навыков:

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

С установленным навыком простая команда "tour this PR" в любом репозитории делает то, что нужно. Перезапустите сессию Claude Code после установки MCP-сервера или навыка.

Аутентификация GitHub

Публичные PR работают без аутентификации (низкий лимит запросов). Для приватных репозиториев или более высокого лимита, CodeTour использует первый из: GITHUB_TOKEN, GH_TOKEN или сохраненный токен CLI gh (gh auth login).

Конфигурация

Переменная окружения

По умолчанию

Значение

CODETOUR_PORT

8765

Порт просмотрщика (подбирает следующий, если занят)

CODETOUR_NO_BROWSER

не задано

Установите 1, чтобы никогда не открывать браузер автоматически

CODETOUR_MAX_FILES

300

Максимум измененных файлов, получаемых на PR

CODETOUR_MAX_PATCH_BYTES

100000

Максимальный размер патча на файл до усечения

Разработка

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, нажмите Start и смотрите готовый тур.

Инструменты MCP

Инструмент

Назначение

get_pr_info(pr_url)

Метаданные PR + диапазоны строк ханков по файлам (вызывать первым)

get_file_diff(pr_url, path)

Полный разобранный дифф для одного файла

start_tour(pr_url, tour_title?)

Открыть просмотрщик, ждать нажатия Start

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