RepoRead — AI Repository Analysis
RepoRead is an AI-powered platform that analyzes GitHub repositories and generates documentation, technical architecture breakdowns, security audits, visual diagrams, and LLM-optimized summaries. Connect via the MCP server (preferred) or REST API to analyze any public GitHub repository.
Quick Start
1. Get an API Key
Sign up at reporead.com and create an API key at reporead.com/settings. Keys use the rrk_ prefix.
2. Set the Environment Variable
CODEBLOCK0
Add to your shell profile (~/.zshrc, ~/.bashrc) to persist across sessions.
3. Verify Connection
CODEBLOCK1
This confirms your API key is valid and shows your current token balance.
4. Connect the MCP Server (Recommended)
Add to your MCP configuration (e.g. claude_desktop_config.json, .mcp.json):
CODEBLOCK2
Replace rrk_your_api_key_here with your actual API key.
MCP Tools
When the MCP server is connected, these tools are available:
| Tool | Description |
|---|
| INLINECODE6 | Import a GitHub repo by URL |
| INLINECODE7 |
List imported repos |
|
get_repository(repository_id) | Get repo details by ID |
|
start_analysis(repository_id, analysis_type, branch?) | Queue an analysis job |
|
list_analyses(page?, per_page?, repository_id?, status?, analysis_type?) | List jobs with filters |
|
get_analysis(analysis_id) | Get full analysis results |
|
get_analysis_status(analysis_id) | Lightweight status poll |
|
get_token_balance() | Check available tokens and tier |
REST API Fallback
If the MCP server is not configured, use the REST API helper script:
CODEBLOCK3
Or call the REST API directly:
Base URL: https://api.reporead.com/public/v1
Auth: Authorization: Bearer $REPOREAD_API_KEY
| Endpoint | Method | Description |
|---|
| INLINECODE16 | INLINECODE17 | Import repo INLINECODE18 |
| INLINECODE19 |
GET | List repos
?page=1&per_page=20 |
|
/repositories/{id} |
GET | Get repo details |
|
/analyses |
POST | Start analysis
{"repository_id": "...", "analysis_type": "..."} |
|
/analyses |
GET | List analyses
?repository_id=...&status=... |
|
/analyses/{id} |
GET | Get full results |
|
/analyses/{id}/status |
GET | Lightweight status check |
|
/tokens/balance |
GET | Check token balance |
Choosing an Analysis Type
| Context | Type | What You Get |
|---|
| New to a codebase, need orientation | INLINECODE36 | Architecture, patterns, key components |
| Need to create or update documentation |
readme | Full README documentation |
| Pre-deploy, PR review, or security audit |
security | Vulnerability analysis, risk assessment |
| Need visual architecture diagrams |
mermaid | Workflow and system diagrams |
| Building AI tools that consume repo context |
llmstxt | LLM-optimized summary |
Default: Use technical if unsure.
Full docs: Combine readme + mermaid.
Free tier: readme and llmstxt only. Paid tiers unlock all types.
Workflow
- 1. Check balance —
get_token_balance() to verify sufficient tokens - Check if already imported —
list_repositories() to avoid duplicates - Import the repo —
import_repository(github_url) — save the returned INLINECODE49 - Start analysis —
start_analysis(repository_id, analysis_type) — save the returned INLINECODE51 - Poll for completion —
get_analysis_status(analysis_id) every 10 seconds until status is completed or INLINECODE55 - Fetch results —
get_analysis(analysis_id) — the results field contains the full output - Use the results as context for the user's task
Common Patterns
Understand a Codebase Before Working on It
When the user says "explain this repo" or you need context before coding:
- 1. Import the repo
- Run INLINECODE58
- Poll until completed
- Use the architecture breakdown, key patterns, and component descriptions as working context
Generate Documentation
When the user wants a README, docs, or visual diagrams:
- 1. Import the repo
- Run both in parallel:
-
start_analysis(repo_id, "readme")
-
start_analysis(repo_id, "mermaid")
- 3. Poll both until completed
- Combine the README content with the visual diagrams
Security Check Before Deploy
When reviewing a repo for vulnerabilities or doing a PR audit:
- 1. Import the repo
- Run INLINECODE61
- Poll until completed
- Review findings and flag critical issues to the user
Token Awareness
- - Always call
get_token_balance() before starting an analysis - If
available_tokens is low, tell the user — they can purchase more at reporead.com/settings - Monthly allowances: Free 100K, Starter 500K, Growth 1M
- Larger repos consume more tokens
- INLINECODE64 shows tokens held for in-progress analyses
Tips
- - Poll
get_analysis_status, not get_analysis — much lighter payload - Poll every 10 seconds. Analysis takes 1-5 minutes depending on repo size
- Status values:
queued → processing → completed or INLINECODE70 - If status is
failed, show the error field to the user — do not retry automatically - Use
list_repositories before import_repository to avoid "already imported" errors - The
branch parameter is optional — defaults to the repo's default branch - Rate limit: 60 requests/minute burst
- INLINECODE76 must be one of:
readme, technical, security, mermaid, INLINECODE81
RepoRead — AI仓库分析
RepoRead是一个AI驱动的平台,可分析GitHub仓库并生成文档、技术架构分解、安全审计、可视化图表和LLM优化摘要。通过MCP服务器(推荐)或REST API连接,即可分析任何公开的GitHub仓库。
快速开始
1. 获取API密钥
在reporead.com注册,并在reporead.com/settings创建API密钥。密钥使用rrk_前缀。
2. 设置环境变量
bash
export REPOREADAPIKEY=rrkyourapikeyhere
添加到您的shell配置文件(~/.zshrc、~/.bashrc)中以跨会话持久化。
3. 验证连接
bash
bash {baseDir}/scripts/check-connection.sh
这将确认您的API密钥有效,并显示当前的令牌余额。
4. 连接MCP服务器(推荐)
添加到您的MCP配置中(例如claudedesktopconfig.json、.mcp.json):
json
{
mcpServers: {
reporead: {
type: streamable-http,
url: https://api.reporead.com/mcp,
headers: {
Authorization: Bearer rrkyourapikeyhere
}
}
}
}
将rrkyourapikeyhere替换为您的实际API密钥。
MCP工具
当MCP服务器连接后,以下工具可用:
| 工具 | 描述 |
|---|
| importrepository(githuburl) | 通过URL导入GitHub仓库 |
| listrepositories(page?, perpage?) |
列出已导入的仓库 |
| get
repository(repositoryid) | 通过ID获取仓库详情 |
| start
analysis(repositoryid, analysis_type, branch?) | 排队分析任务 |
| list
analyses(page?, perpage?, repository
id?, status?, analysistype?) | 带筛选条件列出任务 |
| get
analysis(analysisid) | 获取完整分析结果 |
| get
analysisstatus(analysis_id) | 轻量级状态轮询 |
| get
tokenbalance() | 检查可用令牌和层级 |
REST API备用方案
如果未配置MCP服务器,请使用REST API辅助脚本:
bash
检查令牌余额
bash {baseDir}/scripts/reporead-api.sh balance
导入仓库
bash {baseDir}/scripts/reporead-api.sh import https://github.com/owner/repo
开始分析
bash {baseDir}/scripts/reporead-api.sh analyze
technical
检查分析状态
bash {baseDir}/scripts/reporead-api.sh status
获取完整分析结果
bash {baseDir}/scripts/reporead-api.sh results
列出仓库
bash {baseDir}/scripts/reporead-api.sh repos
或直接调用REST API:
基础URL: https://api.reporead.com/public/v1
认证: Authorization: Bearer $REPOREADAPIKEY
| 端点 | 方法 | 描述 |
|---|
| /repositories | POST | 导入仓库 {githuburl: ...} |
| /repositories |
GET | 列出仓库 ?page=1&perpage=20 |
| /repositories/{id} | GET | 获取仓库详情 |
| /analyses | POST | 开始分析 {repositoryid: ..., analysistype: ...} |
| /analyses | GET | 列出分析 ?repository_id=...&status=... |
| /analyses/{id} | GET | 获取完整结果 |
| /analyses/{id}/status | GET | 轻量级状态检查 |
| /tokens/balance | GET | 检查令牌余额 |
选择分析类型
| 场景 | 类型 | 获取内容 |
|---|
| 初次接触代码库,需要了解方向 | technical | 架构、模式、关键组件 |
| 需要创建或更新文档 |
readme | 完整的README文档 |
| 部署前、PR审查或安全审计 | security | 漏洞分析、风险评估 |
| 需要可视化架构图 | mermaid | 工作流和系统图 |
| 构建使用仓库上下文的AI工具 | llmstxt | LLM优化摘要 |
默认: 如果不确定,使用technical。
完整文档: 结合readme + mermaid。
免费层级: 仅支持readme和llmstxt。付费层级解锁所有类型。
工作流程
- 1. 检查余额 — gettokenbalance() 验证是否有足够令牌
- 检查是否已导入 — listrepositories() 避免重复
- 导入仓库 — importrepository(githuburl) — 保存返回的id
- 开始分析 — startanalysis(repositoryid, analysistype) — 保存返回的id
- 轮询完成状态 — 每10秒调用getanalysisstatus(analysisid),直到status变为completed或failed
- 获取结果 — getanalysis(analysis_id) — results字段包含完整输出
- 使用结果作为用户任务的上下文
常见模式
在开始工作前理解代码库
当用户说解释这个仓库或您需要在编码前了解上下文时:
- 1. 导入仓库
- 运行startanalysis(repoid, technical)
- 轮询直到完成
- 使用架构分解、关键模式和组件描述作为工作上下文
生成文档
当用户需要README、文档或可视化图表时:
- 1. 导入仓库
- 并行运行两者:
- startanalysis(repoid, readme)
- startanalysis(repoid, mermaid)
- 3. 轮询两者直到完成
- 将README内容与可视化图表结合
部署前的安全检查
当审查仓库漏洞或进行PR审计时:
- 1. 导入仓库
- 运行startanalysis(repoid, security)
- 轮询直到完成
- 审查发现的问题并向用户标记关键问题
令牌意识
- - 始终在开始分析前调用gettokenbalance()
- 如果availabletokens不足,告知用户——他们可以在reporead.com/settings购买更多
- 月度配额:免费100K,入门500K,成长1M
- 较大的仓库消耗更多令牌
- reserved_tokens显示正在进行中的分析所保留的令牌
提示
- - 轮询getanalysisstatus,而不是getanalysis——负载轻得多
- 每10秒轮询一次。 分析需要1-5分钟,取决于仓库大小
- 状态值: queued → processing → completed或failed
- 如果状态为failed,向用户显示error字段——不要自动重试
- 在importrepository之前使用listrepositories以避免已导入错误
- branch参数是可选的——默认为仓库的默认分支
- 速率限制:每分钟60次请求突发
- analysistype必须是以下之一:readme、technical、security、mermaid、llmstxt