Allows for the analysis of GitHub repositories to extract code structure, statistics, and full file contents, supporting both public and private repositories through personal access tokens.
Enables the generation of structured, Chinese-language study notes from code analysis results for use within an Obsidian knowledge base.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@gitingest-mcpanalyze https://github.com/fastapi/fastapi and summarize the project structure"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
gitingest-mcp
[!tip] MCP HTTP 服务器,封装 gitingest,让 Claude Code 能够分析 GitHub 仓库并生成 Obsidian 中文学习笔记。
✨ 功能特性
GitHub 仓库分析 - 通过 MCP 协议获取仓库摘要和完整内容
智能文件过滤 - 默认分析文档文件(md, json, toml, yaml 等)
256k Token 自动降级 - 超过限制时自动切换到 README-only 模式
私有仓库支持 - 通过 GitHub token 访问私有仓库
子目录分析 - 支持分析仓库的特定子目录
Obsidian 集成 - 自动调用 Obsidian 相关 skill 生成结构化学习笔记
📦 快速开始
1. 部署服务器
Docker Compose 部署(推荐)
Docker 部署
其他部署方式
添加内容:
启动服务:
Railway:
Render:
在 Render Dashboard 创建新的 Web Service
连接 GitHub 仓库
tunanet/gitingest-mcp设置构建命令:
pip install -e . && uvicorn server.main:app --host 0.0.0.0 --port $PORT
2. 在 Claude Code 中注册 MCP 服务器
3. 验证安装
🚀 在 Claude Code 中使用
基本用法
部署完成后,在 Claude Code 中直接与 AI 对话即可:
高级用法
指定子目录
使用全文件模式
强制只分析 README
工作流程
⚙️ 配置
环境变量
变量 | 说明 | 默认值 |
| 服务器端口 |
|
| GitHub token(私有仓库需要) | - |
GitHub Token 获取
生成新 token(需要
repo权限)设置环境变量或启动时传入
🛠️ MCP 工具参数
analyze_repo 工具支持以下参数:
参数 | 类型 | 必填 | 说明 |
| string | ✅ | GitHub 仓库 URL |
| string | ❌ | 只分析指定子目录 |
| string | ❌ | 用于私有仓库的 GitHub token |
| string | ❌ | 默认分支名(默认为 |
| string | ❌ | 文件包含模式(默认使用文档模式) |
| boolean | ❌ | 强制只分析 README |
include_patterns 选项
值 | 说明 |
默认(不指定) | 分析文档文件(md, json, toml, yaml, txt, cfg, ini, conf) |
| 分析所有文件(包括源代码) |
| 自定义文件模式 |
📝 返回结果格式
🔒 反向代理配置(生产环境推荐)
服务默认绑定 127.0.0.1:8000,建议通过 Nginx 反向代理暴露公网。
HTTP 配置
HTTPS 配置(使用 Let's Encrypt)
🧪 本地开发
📚 使用示例
示例 1:分析开源项目
示例 2:分析特定子目录
示例 3:私有仓库分析
示例 4:快速了解项目
🐛 故障排除
MCP 服务器无法连接
检查服务器状态:
curl https://your-app.example.com/health检查防火墙设置
确认反向代理配置正确
分析超时
大型仓库可能需要较长时间
默认超时时间为 120 秒
可以通过指定
subdirectory减少分析范围
Token 限制
默认使用文档模式以减少 token 使用
超过 256k token 会自动降级到 README-only 模式
可通过
fallback_to_readme=true强制使用 README 模式
📄 License
MIT