CodeTour
CodeTour
动画化、由 LLM 驱动的 “用五岁小孩能懂的方式解释”GitHub 拉取请求导览。
CodeTour 是一个与本地浏览器查看器配套的 MCP 服务器。Claude(或任何由 MCP 驱动的 LLM)一步一步地调用 CodeTour 的工具;查看器会在拉取请求上动画展示——文件树、差异、脉动的行高亮——同时旁白以字幕形式显示,并通过浏览器内置的文本转语音功能朗读出来。每个站点都会链接回 GitHub,以便查看者自行深入查看细节。
工作原理
Claude ──(MCP stdio)──▶ codetour ──(WebSocket)──▶ your browser
│
└──(REST)──▶ GitHub APILLM 调用
get_pr_info/get_file_diff通过 CodeTour 读取 PR,因此其旁白与显示的内容完全匹配。start_tour会在你的浏览器中打开查看器,并等待你点击 开始(点击还会启用音频)。show_overview和一系列show_step调用会动画展示这些更改。每次调用都会阻塞,直到旁白播报结束,因此导览会自动调整节奏。end_tour显示带有 GitHub 上 PR 链接的结束摘要。
安装
需要 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 如何打造出色的导览:通过 gh 自动检测当前分支的 PR,在打开查看器之前规划 3–7 个站点,采用通俗易懂的讲解风格规则,以及如何在查看器关闭时恢复。通过将其链接(或复制)到你的个人技能目录来安装:
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)。
配置
环境变量 | 默认值 | 含义 |
|
| 查看器端口(若被占用则向上探测) |
| 未设置 | 设为 |
|
| 每个 PR 最多获取的更改文件数 |
|
| 截断前每个文件差异的上限字节数 |
开发
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 工具
工具 | 用途 |
| PR 元数据 + 每个文件的 hunk 行范围(首先调用) |
| 单个文件的完整解析差异 |
| 打开查看器,等待点击“开始” |
| PR 摘要卡片,语音播报 |
| 在文件/行上动画停留 |
| 带 GitHub 链接的结束卡片 |
| 诊断信息 |
This server cannot be installed
Maintenance
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
Connect AI assistants to GitHub - manage repos, issues, PRs, and workflows through natural language.
Screens public GitHub repos and PRs to generate risk maps, findings, and merge-readiness signals.
Browser-backed QA with evidence and fix-ready reports for coding agents.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/benstaniford/CodeTour'
If you have feedback or need assistance with the MCP directory API, please join our Discord server