Git 取证 MCP
专用于深度 git 存储库调查和分析的模型上下文协议 (MCP) 服务器。此取证工具提供对存储库历史记录、分支关系和开发模式的详细洞察,专注于 git 存储库分析,而非常规的 GitHub 或 git 操作。
特征
该服务器提供四种主要分析工具:
- 分支概览(
get_branch_overview
)- 提供分支状态和关系的高级概述
- 分析最后的提交、提交计数和合并基础
- 生成分支机构活动的统计摘要
- 时间段分析(
analyze_time_period
)- 分析特定时间段内的详细开发活动
- 对提交进行分类(功能、修复、重构、文档、其他)
- 提供带有提交模式的活动摘要
- 文件更改分析(
analyze_file_changes
)- 跟踪跨分支的特定文件的更改
- 确定潜在冲突区域
- 提供文件修改的风险评估
- 根据风险等级生成建议的审核顺序
- 合并建议(
get_merge_recommendations
)- 确定最佳合并策略
- 评估冲突风险
- 识别代码热点
- 提供分步合并指导
输入参数
每个工具都需要特定的参数:
repoPath
:git 存储库的路径branches
:要分析的分支名称数组outputPath
:分析结果写入的路径- 其他特定于工具的参数:
timeRange
:周期分析的开始和结束日期files
:用于文件更改分析的文件路径数组
输出格式
所有工具输出的 JSON 文件均包含以下内容:
- 详细分析结果
- 汇总统计数据
- 风险评估(如适用)
- 基于分析的建议
技术细节
- 使用 TypeScript 构建
- 使用 MCP SDK 实现服务器
- 通过子进程执行 git 命令
- 提供错误处理和验证
- 在 stdio 传输上运行
依赖项
- @modelcontextprotocol/sdk
- Node.js
- Git(必须安装并可访问)
用法
该服务器作为 MCP 服务运行,可与任何兼容 MCP 的客户端集成。所有分析结果均以 JSON 格式写入指定的输出文件。
贡献和许可
该项目根据 Apache 许可证 2.0 版获得许可 - 有关详细信息,请参阅LICENSE.txt文件。
欢迎合作
欢迎分叉和贡献。
所有贡献均遵循 Apache 2.0 许可证。此许可证允许您:
- 将代码用于商业用途
- 修改和分发代码
- 创作衍生作品
- 包含在其他项目中
版权所有 2025。本项目遵循 Apache 许可证 2.0 版;除非遵守该许可证,否则您不得使用本项目。您可以在http://www.apache.org/licenses/LICENSE-2.0获取该许可证的副本。
local-only server
The server can only run on the client's local machine because it depends on local resources.
专门用于深入分析 git 存储库的 MCP 服务器,提供分支概览、时间段分析、文件更改和合并建议的工具。
Related Resources
Related MCP Servers
- AsecurityFlicenseAqualityThe Git MCP Server allows AI assistants to perform enhanced Git operations via the Model Context Protocol, supporting core Git functions, branch and tag management, GitHub integration, and more.Last updated -21426TypeScript
- AsecurityFlicenseAqualityMCP server for managing Git operations on local repositories, allowing users to list repositories, get and create tags, list commits, push tags, and refresh repositories through a standardized interface.Last updated -63Python
- -securityAlicense-qualityAn MCP server that provides tools for standardized Git branch management and Jira integration, allowing developers to create, validate branches according to conventions and synchronize with Jira issues.Last updated -2PythonMIT License
- AsecurityFlicenseAqualityMCP server providing Git-related functionalities, primarily a tool to generate diffs for Git merge commits against their first parent.Last updated -2TypeScript