Git File Forensics MCP
Git 文件取证 MCP
用于深度 git 文件级取证的 MCP 工具,有助于深入了解文件历史、更改和模式,专注于单个文件分析而不是存储库范围的操作。
安装
克隆并构建服务器:
git clone [repository-url]
cd git-file-forensics
npm install
npm run build添加到您的 MCP 设置(
~/Library/Application Support/Code/User/globalStorage/david-dafu-dev.dafu/settings/cline_mcp_settings.json):
{
"mcpServers": {
"git-file-forensics": {
"command": "/opt/homebrew/bin/node",
"args": ["/path/to/git-file-forensics/build/index.js"],
"alwaysAllow": []
}
}
}Related MCP server: gitlore
可用工具
1. track_file_versions
跟踪特定文件的完整版本历史记录,包括重命名和移动。
{
"method": "tools/call",
"params": {
"name": "track_file_versions",
"arguments": {
"repoPath": "/path/to/repo",
"file": "path/to/file",
"outputPath": "output.json"
}
}
}2. 分析文件差异
分析文件任意两个版本之间的具体变化。
{
"method": "tools/call",
"params": {
"name": "analyze_file_diff",
"arguments": {
"repoPath": "/path/to/repo",
"file": "path/to/file",
"versions": {
"from": "commit-hash-1",
"to": "commit-hash-2"
},
"outputPath": "output.json"
}
}
}3. 分析文件上下文
分析特定提交中文件更改的更广泛的背景。
{
"method": "tools/call",
"params": {
"name": "analyze_file_context",
"arguments": {
"repoPath": "/path/to/repo",
"file": "path/to/file",
"commit": "commit-hash",
"outputPath": "output.json"
}
}
}4. 分析文件语义
分析文件历史中的语义变化和模式。
{
"method": "tools/call",
"params": {
"name": "analyze_file_semantics",
"arguments": {
"repoPath": "/path/to/repo",
"file": "path/to/file",
"outputPath": "output.json"
}
}
}输出格式
所有工具输出的 JSON 文件均包含以下内容:
详细分析结果
汇总统计数据
改变模式和关系
风险评估(如适用)
要求
Node.js
Git(必须安装并可访问)
MCP SDK
执照
该项目根据 Apache 许可证 2.0 版获得许可 - 有关详细信息,请参阅LICENSE.txt文件。
版权所有 davidorex.ai。本项目遵循 Apache 许可证 2.0 版;除非遵守该许可证,否则您不得使用本项目。您可以访问http://www.apache.org/licenses/LICENSE-2.0获取许可证副本。
Available Tools
4 toolsanalyze_file_contextC
Analyze broader context of file changes in a specific commit
Inputs: repoPath (required), file (required), commit (required), outputPath (required).
analyze_file_diffC
Analyze specific changes between any two versions of a file
Inputs: repoPath (required), file (required), versions (required), outputPath (required).
analyze_file_semanticsC
Analyze semantic changes and patterns in file history
Inputs: repoPath (required), file (required), outputPath (required).
track_file_versionsC
Track complete version history of a specific file, including renames and moves
Inputs: repoPath (required), file (required), outputPath (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
Each tool has a clearly distinct purpose: analyze_file_context focuses on broader changes in a commit, analyze_file_diff examines specific changes between versions, analyze_file_semantics looks at semantic patterns in history, and track_file_versions tracks complete version history including renames. There is no overlap or ambiguity between these tools.
All tools follow a consistent verb_noun pattern with 'analyze' or 'track' as the verb and descriptive nouns like 'file_context', 'file_diff', 'file_semantics', and 'file_versions'. The naming is uniform and predictable throughout the set.
With 4 tools, this server is well-scoped for its purpose of Git file forensics. Each tool earns its place by covering distinct aspects of file analysis and tracking, avoiding bloat while providing comprehensive coverage for the domain.
The tool set provides complete coverage for Git file forensics: analyzing context, diffs, semantics, and version tracking. There are no obvious gaps, as these tools cover the core lifecycle of file changes, renames, and historical patterns without dead ends.
Maintenance
Related MCP Connectors
Generate SBOMs, scan vulnerabilities, and analyze dependencies from local projects or Git repos.
Code intelligence for LLMs. Analyze, search, and retrieve code from any public git repository.
Hosted git for AI agents: repos, files, code search, issues, pull requests, branches, merges.
Live GitHub repo AST X-Ray, 42 coding-agent DoD gates, Git worktree guards & brownfield baselines.
Related MCP Servers
- FlicenseNot gradedqualityNot gradedmaintenanceEnables analysis of local Git repositories via standard git commands, providing insights like line authorship, commit frequency, code churn, and co-changed files.-
- AlicenseNot gradedqualityDmaintenanceProvides read-only, structured access to a Git repository's history through seven typed tools, enabling search commits, file evolution, blame, churn, contributors, commit details, and ref comparisons without a shell.MIT
- FlicenseNot gradedqualityBmaintenanceEnables analysis of multi-file git workspaces to synthesize dependency diffs and refactor sequences.8-
- AlicenseAqualityBmaintenanceEnables AI clients to interrogate a local Git repository's history, surfacing change hotspots, per-author activity, files that change together, single-file commit history, and draft changelogs between refs. It is strictly read-only, requires no API keys, and returns structured data for the client to interpret.6MIT