CodeTour

CodeTour

Enables LLMs to create animated, narrated tours of GitHub pull requests, with a local browser viewer showing diffs and code highlights while speaking the narration aloud.

Category
访问服务器

README

CodeTour

Animated, LLM-driven "explain like I'm five" tours of GitHub pull requests.

CodeTour is an MCP server paired with a local browser viewer. Claude (or any MCP-driving LLM) calls CodeTour's tools step by step; the viewer animates through the pull request — file tree, diffs, pulsing line highlights — while the narration is shown as captions and spoken aloud via the browser's built-in text-to-speech. Every stop links back to GitHub so viewers can dig into the detail themselves.

How it works

Claude ──(MCP stdio)──▶ codetour ──(WebSocket)──▶ your browser
                          │
                          └──(REST)──▶ GitHub API
  1. The LLM calls get_pr_info / get_file_diff to read the PR through CodeTour, so its narration matches exactly what is displayed.
  2. start_tour opens the viewer in your browser and waits for you to click Start (the click also enables audio).
  3. show_overview and a series of show_step calls animate through the changes. Each call blocks until the narration finishes speaking, so the tour paces itself naturally.
  4. end_tour shows a closing summary with a link to the PR on GitHub.

Installation

Requires Python 3.11+ and uv.

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

Register with Claude Code at user scope, so the tools are available in every repo:

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

Then just ask:

Give me an executive tour of https://github.com/owner/repo/pull/123

The codetour skill

The repo ships a Claude Code skill (skills/codetour/SKILL.md) that teaches Claude the craft of a good tour: auto-detecting the current branch's PR via gh, planning 3–7 stops before opening the viewer, ELI5 narration style rules, and how to recover when the viewer is closed. Install it by linking (or copying) it into your personal skills directory:

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

With the skill installed, a plain "tour this PR" in any repo does the right thing. Restart your Claude Code session after installing the MCP server or the skill.

GitHub authentication

Public PRs work unauthenticated (low rate limit). For private repos or a higher limit, CodeTour uses the first of: GITHUB_TOKEN, GH_TOKEN, or the gh CLI's stored token (gh auth login).

Configuration

Env var Default Meaning
CODETOUR_PORT 8765 Viewer port (probes upward if busy)
CODETOUR_NO_BROWSER unset Set to 1 to never auto-open the browser
CODETOUR_MAX_FILES 300 Max changed files fetched per PR
CODETOUR_MAX_PATCH_BYTES 100000 Per-file diff cap before truncation

Viewer controls

The tour plays itself as the LLM narrates, but the viewer can take over at any point:

Control Action
⏸ / ▶, or space Pause or resume, mid-sentence
‹ / ›, or ← / → Previous / next stop, at your own pace
Progress dots Jump straight to a stop
↻ Replay the whole tour from the beginning
Voice menu Choose the narration voice (remembered next time)
🔊 Mute or unmute the narration

Navigating is local to the browser: it re-narrates the stop you land on and never disturbs the LLM. If you browse backwards or pause while the LLM is still adding stops, the view stays where you are and new stops simply extend the dots — the viewer keeps acknowledging them so the LLM is never left waiting. Step forward to the newest stop and the viewer follows along live again.

Development

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

tests/frontend/dom_harness.mjs runs app.js under Node against a stub DOM to test the viewer's navigation state machine without a browser (needs node; no npm packages). Run it directly for a readable pass/fail list:

node tests/frontend/dom_harness.mjs

Demo mode is the quickest way to iterate on the frontend: it needs no MCP client and no GitHub access — open the printed URL, click Start, and watch the canned tour.

MCP tools

Tool Purpose
get_pr_info(pr_url) PR metadata + per-file hunk line ranges (call first)
get_file_diff(pr_url, path) Full parsed diff for one file
start_tour(pr_url, tour_title?) Open the viewer, wait for Start
show_overview(narration, key_points?) PR summary card, spoken
show_step(file, narration, line_start?, line_end?, side?, style?) Animated stop on a file/lines
end_tour(summary) Closing card with GitHub link
tour_status() Diagnostics

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选