
一个模型上下文协议(MCP)服务器,为AI助手提供安全、只读访问您的ShadowGit仓库的权限。
概览
一个模型上下文协议(MCP)服务器,为 AI 助手提供对 ShadowGit 仓库的安全 git 访问,包括通过 Session API 创建有组织提交的能力。这通过让 AI 控制访问你项目的 git 历史,实现强大的调试、代码分析和干净的提交管理。 ShadowGit 会自动将每个存档捕获为 git 提交,同时提供会话 API,允许 AI 助手暂停自动提交并创建干净、有序的提交。MCP 服务器既提供详细开发历史的可读权限,也能妥善管理 AI 辅助的更改。 添加到你的Claude桌面MCP配置中: ~/.config/Claude/claude_desktop_config.json %APPDATA%\Claude\claude_desktop_config.json - - 安装并运行跟踪仓库 - 会话 API 需要 ShadowGit 版本 >= 0.3。
概述(AI 翻译)
赋予Claude代码、光标和Claude桌面访问ShadowGit的权限:自动快照 ShadowGit 每隔几分钟会查看你的项目,且与你自己的 git 历史分开。你的助理可以看到 变换和时,可以将自己的编辑保存为一个命名的检查点,而非多个部分快照。
要求
- Node.js 20岁或更晚
- ShadowGit 应用(检查点版本为 0.3.4 或更高版本,Lens 版本在 0.3.5 之后发布,链接版则在 0.3.7 之后发布 字数,地图0.3.9之后),至少跟踪一个项目。关闭应用时阅读历史有效; 游戏、检查点、透镜和地图都需要运行。
- 走上你的路径
布置
Claude Code(每个项目安装一次):
光标:在~/.cursor/mcp.json中:
Claude Desktop:在~/Library/Application Support/Claude/claude_desktop_config.json(macOS)中出现相同条目,或
%APPDATA%\Claude\claude_desktop_config.json(Windows)。
在 Claude Code 中,服务器知道你所在的项目。在光标和 Claude Desktop 中,将项目命名为(“in 当ShadowGit追踪不止一个时,“webshop”。
问什么
- “过去一小时发生了什么变化?”
- “登录页面什么时候坏的?”
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
ShadowGit MCP server
Gives Claude Code, Cursor and Claude Desktop access to ShadowGit: the automatic snapshots ShadowGit takes of your projects every few minutes, kept apart from your own git history. Your assistant can see what changed and when, and can save its own edits as one named checkpoint instead of many partial snapshots.
Requirements
- Node.js 20 or later
- The ShadowGit app (0.3.4 or later for checkpoints, a release after 0.3.5 for the Lens, after 0.3.7 for its linked words, after 0.3.9 for the map, after 0.3.10 for the Lens’s dependency facts, 0.3.11 or later for the project’s rules, 0.3.13 or later for a session’s unsaved edits in a snapshot as it ends and for the check of a checkpoint that finds nothing new), tracking at least one project. Reading history works while the app is closed; sessions, checkpoints, the Lens and the map need it running.
- Git on your PATH
Setup
Claude Code (one install for every project):
claude mcp add --scope user shadowgit -- npx -y shadowgit-mcp-server
Cursor: in ~/.cursor/mcp.json:
{ "mcpServers": { "shadowgit": { "command": "npx", "args": ["-y", "shadowgit-mcp-server"] } } }
Claude Desktop: the same entry in ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or
%APPDATA%\Claude\claude_desktop_config.json (Windows).
In Claude Code the server knows which project you are in. In Cursor and Claude Desktop, name the project (“in webshop”) when ShadowGit tracks more than one.
What to ask
- “What changed in the last hour?”
- “When did the login page break?”
- “Show me the history of Header.tsx”
- “How is this project organised?”
- “What depends on chargeCard?”
- “Start a ShadowGit session for this refactor”, then “Create a checkpoint: Fixed login redirect”, then “End the ShadowGit session”
- “Write the Lens words for this session”
- “What does the billing area do?”
- “Document this project in ShadowGit”
Tools
| Tool | Does |
|---|---|
list_repos |
Lists tracked projects, the current one, their last snapshot and any active session |
git_command |
Runs a read-only git command (log, diff, show, blame, …) on the snapshot history |
get_map |
Gives how the project is organised: its areas, layers and the links between them, or one area, the project’s rules and its docs pages’ summaries |
get_code_context |
Gives where files and symbols sit, what depends on them, where a change to them lands, the project’s rules for them and their areas’ docs pages’ summaries |
start_session |
Pauses automatic snapshots while the assistant edits |
checkpoint |
Saves the current changes as one named checkpoint, following .shadowgit-ignore, then checks it against the project’s .shadowgit-rules |
end_session |
Resumes automatic snapshots |
安装
npx -y shadowgit-mcp-server配置
{ "mcpServers": { "shadowgit": { "command": "npx", "args": ["-y", "shadowgit-mcp-server"] } } }