git-mcp exposes four read-only MCP resources that map common Git views to URI-addressable endpoints. Resource-aware clients can subscribe to these URIs and receive structured JSON rather than calling tools.
Available Resources
| URI | Description |
|---|---|
git+repo://status/{repo_path} | Working tree status (staged, unstaged, untracked) |
git+repo://log/{repo_path} | The 20 most recent commits |
git+repo://branches/{repo_path} | All local branches with tracking info |
git+repo://diff/{repo_path} | Unstaged and staged changes |
URI Format
The {repo_path} segment is the absolute path to the repository, URI-encoded. For example:
text
git+repo://status//home/user/myproject
git+repo://log//Users/dan/dev/appOn Windows, encode the drive letter path:
git+repo://status/C%3A%5CUsers%5Cdan%5Cdev%5Capp
Resource Contents
git+repo://status/{repo_path}
Returns a JSON object mirroring the output of git status --porcelain=v2. Fields include:
staged— files in the index (key: file path, value: status code)unstaged— files modified in the working treeuntracked— new files not yet trackedbranch— current branch name orHEADif detachedtracking— upstream ref and ahead/behind counts
git+repo://log/{repo_path}
Returns a JSON array of up to 20 commit objects, each with:
hash— full commit SHAshort— abbreviated SHA (7 chars)author—{ name, email }date— ISO 8601 timestampmessage— commit subject linebody— commit body (may be empty)
git+repo://branches/{repo_path}
Returns a JSON array of branch objects, each with:
name— local branch namecurrent—trueif currently checked outupstream— tracking remote ref (ornull)ahead— commits ahead of upstreambehind— commits behind upstream
git+repo://diff/{repo_path}
Returns a JSON object with:
staged— unified diff of staged changesunstaged— unified diff of unstaged changes
When to Use Resources vs. Tools
Use resources when:
- Your client supports resource subscriptions and you want live updates
- You need a lightweight snapshot without additional parameters
- You are building a resource-aware UI on top of MCP
Use tools when:
- You need filtering, pagination, or custom options (e.g.
git_logwithauthor,since, orgrep) - You need a response format other than JSON (e.g.
markdown) - You are performing any write operation