gitquery-mcp
Provides read-only Git history and repository inspection tools backed by GitHub APIs, enabling queries for commit refs, blame, path history, merge bases, ancestry, associated pull requests, changed files, diffs, and file contents at specific refs without cloning the repository.
Click on "Deploy 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., "@gitquery-mcpwho last edited src/router.ts in expressjs/express, and in which PR?"
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.
gitquery-mcp
"Ask your repo questions through an API, no clone required."
A fast, lightweight Model Context Protocol (MCP) server that provides read-only repository history tools backed directly by GitHub APIs (GraphQL + REST), featuring aggressive caching of immutable data.
Why gitquery-mcp?
AI coding agents frequently need answers about a repository's history:
Who last touched this function and why?
Which pull request introduced this breaking change?
What is the merge base between feature and main?
What changed inside this specific directory between two release tags?
Today, agents solve this by running git clone or shelling out to local git. This approach is heavy on disk, drains network bandwidth, and fails entirely in container sandboxes where local repositories do not exist.
The architectural inspiration comes from Anthropic's engineering post, "Redesigning source control at Anthropic":
Source control queries should be fast, server-side API lookups. Clients and AI agents should never need a full local copy of a repository just to inspect history.
gitquery-mcp exposes read-only git history tools over standard MCP stdio transport, caches immutable commit-addressed results aggressively, and works with public or private repositories without cloning a single byte.
Related MCP server: Git MCP Server
Features
π Zero-Clone Operations: Answers blame, diff, log, and merge-base questions over the GitHub API.
β‘ Aggressive Caching: Data addressed by a 40-character commit SHA is mathematically immutable and cached permanently. Symbolic branch/tag resolutions use a short, configurable TTL.
πΎ Two-Tier Cache: High-speed in-memory LRU cache plus an optional persistent disk cache (
GITQUERY_CACHE_DIR) that survives server restarts.π‘οΈ Strictly Read-Only & Secure: Zero write operations exist. Auth tokens are read only from
GITHUB_TOKEN, redacted from logs and errors, and never returned to the LLM.π Repository Allowlisting: Restrict the server to specific repositories or organizations via
ALLOWED_REPOS.π Output Discipline: Diff and history outputs are strictly bounded with explicit truncation markers and instructions for LLMs to narrow their queries.
π Provider Abstraction: All GitHub operations sit behind a clean
GitProviderinterface, designed for future GitLab / Bitbucket backends.
Quick Start (npx)
Run gitquery-mcp instantly without local installation:
npx -y gitquery-mcpWith GitHub authentication:
GITHUB_TOKEN=ghp_yourTokenHere npx -y gitquery-mcpClient Configuration
1. Claude Desktop
Add to your claude_desktop_config.json:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"gitquery": {
"command": "npx",
"args": ["-y", "gitquery-mcp"],
"env": {
"GITHUB_TOKEN": "ghp_yourPersonalAccessTokenHere",
"ALLOWED_REPOS": ""
}
}
}
}2. Claude Code CLI
Add using the Claude Code MCP command:
claude mcp add gitquery -- npx -y gitquery-mcp(Note: Ensure GITHUB_TOKEN is exported in your active shell or passed in your environment).
3. Gemini CLI / Generic MCP Client
For MCP-compliant clients configuring servers via JSON:
{
"name": "gitquery",
"command": "npx",
"args": ["-y", "gitquery-mcp"],
"env": {
"GITHUB_TOKEN": "ghp_yourTokenHere",
"GITQUERY_CACHE_DIR": ".gitquery-cache"
}
}Client syntax for Claude Desktop and Claude Code was verified against official MCP specifications. If your client uses a custom schema or runner, adjust thecommand, args, and env properties accordingly.
Available Tools
All 10 tools validate input via Zod, enforce ALLOWED_REPOS, and return a one-line summary followed by compact structured JSON:
Tool | Description | Example Prompt |
| Resolves a branch, tag, or partial SHA to a full 40-character commit SHA. | "What is the exact commit SHA of branch 'release-2.4' in vercel/next.js?" |
| Line-by-line blame ranges with author, date, and associated merged PR. | "Who last edited lines 40 to 80 of src/router.ts in expressjs/express and in what PR?" |
| Lists commits that modified a file or folder (capped at 100). | "Show me the last 5 commits that touched the docs/ folder in facebook/react." |
| Finds the common ancestor commit and ahead/behind counts between two refs. | "Find the merge base between 'main' and 'feature/login' in myorg/webapp." |
| Evaluates whether commit A is an ancestor of commit B with full explanation. | "Is commit a419aa7 an ancestor of master in expressjs/express?" |
| Finds merged pull requests associated with a commit SHA. | "Find the pull request that merged commit 7e562c6 in expressjs/express." |
| Lists modified, added, or deleted files between two refs (capped at 500). | "What files changed between v4.21.0 and v4.21.1 in expressjs/express?" |
| Returns unified git diff between refs, truncated at | "Show me the diff of package.json between tag 4.21.0 and 4.21.1 in expressjs/express." |
| Retrieves text content of a file at a ref, with optional line range slicing. | "Show lines 1 to 50 of README.md at commit f1573b8 in expressjs/express." |
| Returns cache hits, misses, entry count, and hit rate percentage. | "Check the gitquery cache hit rate." |
How Caching Works
Caching is the core architectural value of gitquery-mcp:
Immutable by Commit SHA: Anything addressed by a 40-character commit SHA (
get_blame,compare,get_diff,get_file_at_ref,get_path_history) is mathematically immutable. Results are cached forever in memory.Short TTL for Mutable Refs: Resolving branches or tags (
main,HEAD,v1.0) to a SHA is cached for a short TTL (default: 30 seconds, configurable viaCACHE_TTL_MUTABLE_SECONDS).Optional Persistent Disk Cache: Set
GITQUERY_CACHE_DIR=.gitquery-cache. All immutable SHA-addressed queries are written atomically to disk and survive server restarts. Mutable ref resolutions are never written to disk. Total disk size is capped (default: 200 MB), automatically evicting the oldest entries first.Resilience: Unreadable or corrupted cache files are deleted safely without interrupting requests or crashing the server.
Security & Best Practices
Read-Only:
gitquery-mcpdoes not contain a single write or mutating API endpoint.Token Safety: The GitHub token is loaded only from the
GITHUB_TOKENenvironment variable. It is never logged (auto-redacted bysrc/util/logger.ts) and never exposed in MCP tool responses.Minimal Scope: A GitHub Fine-Grained Personal Access Token with read-only permissions is recommended:
Repository Permissions:
Contents: Read-only (for file content, blame, commits, diffs)Pull requests: Read-only (for PR association)
Repository Allowlist (
ALLOWED_REPOS): Restrict access to approved repositories:ALLOWED_REPOS=facebook/react,vercel/*,my-org/private-repoAny attempt to query unlisted repositories is rejected with an immediate error before dispatching API requests.
Limits & Truncation Behavior
To protect LLM context windows and token budgets, responses are strictly bounded:
Diffs: Default max size is 60,000 UTF-8 bytes (customizable via
max_bytes). If a diff exceeds the limit, it is cleanly truncated with a notice:[truncated: 12450 more bytes, narrow with paths]File Content: Files over 1 MB (1,048,576 bytes) and binary files (detected by null bytes) are refused with a clear error advising line slicing or cloning.
Changed Files: Capped at 500 files with advice to filter with
path_prefix.Path History: Capped at 100 commits (default: 20) with advice to narrow with
sinceoruntil.
Environment Variables
Variable | Default | Description |
| (optional) | GitHub Personal Access Token (classic or fine-grained). |
|
| Comma-separated list of allowed repos ( |
| (disabled) | Directory path for optional persistent on-disk cache. |
|
| Disk cache capacity ceiling in bytes (default: 200 MB). |
|
| In-memory LRU cache maximum entry count. |
|
| In-memory TTL for mutable branch/tag ref resolutions. |
|
| Stderr logging verbosity ( |
Roadmap
GitLab & Bitbucket Providers: Implement
GitProviderfor GitLab (REST + GraphQL) and self-hosted instances.AGENTS.md Repo-Rules Guard: A tool checking candidate diffs against guidelines specified in an
AGENTS.mdfile in the repository.Intelligent Change Classifier: Classify diff hunks into comment-only, documentation, test-only, logic, or security-sensitive changes.
Post-Merge Auto-Bisect & Revert: Automated commit bisecting over the GitHub API to pinpoint regressions without local cloning.
Contributing
Pull requests and issues are welcome!
git clone https://github.com/attaelahi/gitquery-mcp.git
cd gitquery-mcp
npm install
npm run build
npm testLicense
MIT Β© 2026 Atta Elahi
Available Tools
10 toolscache_statsA
Returns in-memory cache metrics including total cache hits, misses, current entry count, and hit rate percentage. Use to inspect caching performance and verify cache hits.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It implies a passive read ('Returns', 'inspect') and the zero-parameter schema means there is no destructive surface, but it never explicitly states read-only behavior, side effects, or that metrics are in-memory and reset per process.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two short sentences, front-loaded with the returned fields. The second sentence's 'verify cache hits' slightly overlaps with 'inspect caching performance', but the text is otherwise tight and waste-free.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With no output schema and no annotations, the description usefully enumerates the returned metrics, which is the key information needed. It is adequate for a trivial zero-parameter read tool, though a note on read-only/side-effect-free behavior would close the remaining gap.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The tool takes zero parameters, so the baseline of 4 applies. There is nothing for the description to disambiguate, and it correctly does not invent parameter detail.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb and resource ('Returns in-memory cache metrics') and enumerates the exact metrics returned (hits, misses, entry count, hit rate). This is unambiguous and clearly distinct from the git-oriented sibling tools.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Gives clear usage context: 'Use to inspect caching performance and verify cache hits.' No alternatives or when-not-to-use guidance is offered, but none of the siblings overlap with a cache-metrics tool, so the omission is low-impact.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
find_merge_baseA
Finds the common ancestor commit (merge base) between two git refs and reports ahead/behind commit counts. Use to check branch divergence before merging or comparing histories. Returns mergeBaseSha, aheadBy, behindBy, and status.
| Name | Required | Description | Default |
|---|---|---|---|
| base | Yes | Base branch, tag, or commit SHA. | |
| head | Yes | Head branch, tag, or commit SHA. | |
| repo | Yes | Repository name. | |
| owner | Yes | Repository owner (organization or user). |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the burden. It implies a read-only query ('finds', 'reports') and enumerates the return fields, but never explicitly states it is side-effect-free, nor mentions auth, rate limits, or error behavior for invalid refs.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Three compact sentences, front-loaded with the core operation and followed by usage and return values. Every sentence contributes, though the trailing return-field list slightly overlaps what a caller might infer.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With no output schema, enumerating mergeBaseSha/aheadBy/behindBy/status is genuinely useful return-value context. For a straightforward read-only query tool with fully documented params, this is nearly complete; only explicit read-only/error behavior is absent.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, with base/head/repo/owner all documented in the schema. The description adds no syntax or format detail (e.g. SHA vs branch vs tag nuances) beyond what the schema already conveys, so the baseline 3 holds.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb (finds) and resource (common ancestor commit / merge base between two refs), plus the extra ahead/behind reporting that distinguishes it from a pure ancestry check like is_ancestor. However, it never names the closest sibling (is_ancestor) explicitly, leaving differentiation to inference.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
'Use to check branch divergence before merging or comparing histories' gives a clear when-to-use context. It does not name alternatives (e.g. is_ancestor) or state when NOT to use this tool, so it stops short of a 5.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
find_pr_for_commitA
Finds merged pull requests associated with a commit SHA. Use to discover original PR discussions, reviews, and context for an existing commit. Returns PR number, title, URL, merged date, and author.
| Name | Required | Description | Default |
|---|---|---|---|
| sha | Yes | Commit SHA, branch, or tag to look up. | |
| repo | Yes | Repository name. | |
| owner | Yes | Repository owner (organization or user). |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations the description carries the full burden, and it does real work: it discloses that only *merged* PRs are returned and enumerates the return contract (number, title, URL, merged date, author). It does not mention auth requirements, rate limits, or what happens for a SHA with no associated PR.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Three short sentences, front-loaded with the action and scope, then usage, then return shape. No filler or restatement of the name.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
No output schema exists, but the description compensates by listing the returned fields, and the merged-only filter is stated. Missing only edge-case behavior (empty result, invalid SHA handling) for a fully complete picture.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so owner/repo/sha are already documented at the field level; the description only implies that the SHA may be a commit, and the schema actually broadens it to 'branch, or tag'. Baseline 3 for high-coverage schemas is correct with no added syntax or format guidance.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Specific verb+resource+scope: 'Finds merged pull requests associated with a commit SHA.' The merged-only constraint and the SHA linkage make it instantly distinguishable from the plumbing siblings (find_merge_base, resolve_ref, get_blame).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
'Use to discover original PR discussions, reviews, and context for an existing commit' gives a clear motivating scenario for when to reach for this tool. It stops short of naming alternatives or stating exclusions, which the very different sibling set makes less necessary.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_blameA
Returns line-by-line git blame annotations for a file at a commit or ref. Use to identify who changed specific lines, when, in which commit, and via which PR. Returns ranges of lines with commit, author, and PR metadata. Use start_line and end_line to slice.
| Name | Required | Description | Default |
|---|---|---|---|
| ref | No | Branch, tag, or commit SHA (default: default branch / HEAD). | |
| path | Yes | File path inside repository. | |
| repo | Yes | Repository name. | |
| owner | Yes | Repository owner (organization or user). | |
| end_line | No | Optional 1-indexed ending line number. | |
| start_line | No | Optional 1-indexed starting line number. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full behavioral burden; it usefully discloses the return shape (ranges of lines with commit, author, and PR metadata) and that start_line/end_line slice the result. It says nothing about auth requirements, behavior on large or binary files, or limits, which matters for a tool with no annotations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Three tight sentences: purpose, use case, return shape plus slicing hint, all front-loaded with zero filler. Each sentence carries distinct information, and the output-shape sentence is especially valuable given there is no output schema.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a read-only blame tool with no output schema and fully documented params, the description covers purpose, trigger, and return structure, which is nearly enough to call it correctly. It omits edge-case behavior (large files, renames/binary content) and any auth or limit context.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so all six parameters are documented in the schema; the baseline of 3 applies. The description only reinforces the start_line/end_line slicing and implies ref semantics via 'at a commit or ref,' adding little beyond the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb and resource: 'Returns line-by-line git blame annotations for a file at a commit or ref,' which is clearly distinct from siblings like get_path_history or get_diff. It never explicitly contrasts itself with those siblings, so an agent must infer the distinction from the resource type alone.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
'Use to identify who changed specific lines, when, in which commit, and via which PR' gives a concrete task-level trigger. No exclusions or named alternatives are offered, so it stops short of full when/when-not guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_diffA
Returns the unified git diff between two refs, optionally restricted to specific file paths. Use to inspect code changes without cloning. Output is truncated at max_bytes (default 60KB; narrow with paths).
| Name | Required | Description | Default |
|---|---|---|---|
| base | Yes | Base branch, tag, or commit SHA. | |
| head | Yes | Head branch, tag, or commit SHA. | |
| repo | Yes | Repository name. | |
| owner | Yes | Repository owner (organization or user). | |
| paths | No | Optional file paths to restrict diff output. | |
| max_bytes | No | Maximum UTF-8 bytes to return before truncation (default: 60000). |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations exist, so the description carries the burden and does meaningful work: it discloses truncation behavior and the default cap (60KB), plus the mitigation (narrow with paths). A read-only nature is implied but not stated, and no auth/rate-limit context is given.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences, fully front-loaded: purpose first, then actionable truncation guidance. Every clause earns its place with no redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a read-only diff tool with a fully documented schema and no output schema, the description covers purpose, scope, and the key behavioral gotcha (truncation). It lacks return-format framing (unified diff text) beyond naming it, but this is minor.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema already documents all six parameters clearly. The description reinforces the truncation parameter and paths restriction but adds no syntax or format detail beyond the schema. Baseline 3 is correct.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb (returns) and resource (unified git diff between two refs), names the scope (optionally restricted to file paths), and distinguishes its use case (inspect code changes without cloning) from siblings like get_file_at_ref or list_changed_files.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Gives clear context ('Use to inspect code changes without cloning') but does not explicitly name alternative siblings or state when not to use it, e.g. versus list_changed_files for a file list only.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_file_at_refA
Retrieves file content at a specific ref or commit, with optional line slicing. Use to inspect historical code without cloning. Rejects binary files and files exceeding 1 MB. Narrow with start_line and end_line.
| Name | Required | Description | Default |
|---|---|---|---|
| ref | No | Branch, tag, or commit SHA (default: default branch / HEAD). | |
| path | Yes | File path inside repository. | |
| repo | Yes | Repository name. | |
| owner | Yes | Repository owner (organization or user). | |
| end_line | No | Optional 1-indexed ending line number. | |
| start_line | No | Optional 1-indexed starting line number. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full load, and it discloses hard behavioral limits the schema cannot express: binary files are rejected and files over 1 MB are rejected. It leaves the return shape and error/pagination behavior unstated, which keeps it short of a 5.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Three short sentences, front-loaded with the core action, followed by usage then constraints. Every sentence adds information and nothing is repeated.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a six-parameter read tool with no annotations and no output schema, the description covers purpose, when to use it, and the two failure limits that matter. The main remaining gap is what the returned content looks like (raw text? truncated?), but this is minor.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so every parameter (owner, repo, path, ref, start_line, end_line) is already documented at the source. The description only adds a light hint to narrow with start_line/end_line and confirms the ref default, which is marginal beyond the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb ('Retrieves') and resource ('file content at a specific ref or commit') with a scope qualifier ('optional line slicing'). It implicitly separates itself from siblings like get_diff or get_blame by framing the job as reading file content, though it never names an alternative tool.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
'Use to inspect historical code without cloning' gives clear context for when this tool applies, and the binary/1 MB rejection plus 'Narrow with start_line and end_line' implicitly states when-not/refinement conditions. No explicit routing to sibling tools such as get_path_history or get_blame is offered.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_path_historyA
Lists commits modifying a specific file or directory up to a ref. Use to trace when a path was touched or refactored. Returns commit SHA, author, date, and headline. Capped at 100 commits (default 20). Narrow with since, until, or limit.
| Name | Required | Description | Default |
|---|---|---|---|
| ref | No | Branch, tag, or commit SHA (default: default branch / HEAD). | |
| path | Yes | File or directory path inside repository. | |
| repo | Yes | Repository name. | |
| limit | No | Maximum commits to return (1-100, default: 20). | |
| owner | Yes | Repository owner (organization or user). | |
| since | No | Optional ISO 8601 timestamp to filter commits after. | |
| until | No | Optional ISO 8601 timestamp to filter commits before. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden and does a fair job: it discloses the return shape (SHA, author, date, headline), the hard cap of 100 commits, the default of 20, and how to narrow results. It does not state pagination/ordering behavior or permissions, but for a read-only listing the disclosure is solid.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Four short sentences, each doing distinct work: purpose, use case, return values, limits/filters. Scope and output are front-loaded, and nothing is redundant or padded.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
No output schema exists, so the description correctly supplies the return fields and the result cap. Combined with the fully covered input schema, an agent has what it needs to call and interpret the tool; only ordering/pagination nuances are unstated.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema already documents ref, path, limit, since, and until with types and defaults. The description restates the cap/default and groups since/until/limit as narrowing controls, which is mildly useful but largely duplicative of the schema. Baseline 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb and resource: 'Lists commits modifying a specific file or directory up to a ref.' That clearly separates it from siblings like get_diff or get_blame, which operate at other granularities. It stops short of explicitly naming such siblings, so 4 rather than 5.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
'Use to trace when a path was touched or refactored' gives a concrete scenario, and 'Narrow with since, until, or limit' tells the agent how to scope a call. No explicit when-not or named alternative (e.g. get_blame for per-line authorship) is offered, so it is clear context without exclusions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
is_ancestorA
Determines whether commit 'ancestor' is an ancestor of commit 'descendant'. Use to verify whether a fix or feature branch is already contained within another branch without cloning. Returns a boolean and explanation.
| Name | Required | Description | Default |
|---|---|---|---|
| repo | Yes | Repository name. | |
| owner | Yes | Repository owner (organization or user). | |
| ancestor | Yes | Candidate ancestor commit SHA, branch, or tag. | |
| descendant | Yes | Candidate descendant commit SHA, branch, or tag. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden. It usefully discloses the return shape (boolean plus explanation) and that no clone is needed, but says nothing about authentication requirements, rate limits, or error behavior for unresolvable refs.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Three short sentences in a logical order: what it computes, when to use it, what it returns. No filler or redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a four-parameter read tool with no annotations and no output schema, the description covers purpose, a usage scenario, and the return value. Minor gaps remain around failure modes and how branch/tag names are resolved, but nothing essential to calling it is missing.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so owner, repo, ancestor, and descendant are already documented, including that refs may be SHAs, branches, or tags. The description adds no semantics beyond that, so the baseline 3 applies.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a precise verb and resource: it determines ancestry between two named commits, and even clarifies that 'ancestor' and 'descendant' are the two inputs. It does not differentiate from the closest sibling, find_merge_base, which answers a related graph question.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
It gives a concrete use case β verifying whether a fix or feature branch is contained in another branch without cloning β which tells the agent when this tool is appropriate. It offers no explicit exclusions or alternatives, so the agent must infer how it differs from find_merge_base or resolve_ref.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_changed_filesA
Lists all files modified, added, or deleted between two git refs with change statistics. Use to survey changes across commits or branches. Capped at 500 files; narrow with path_prefix.
| Name | Required | Description | Default |
|---|---|---|---|
| base | Yes | Base branch, tag, or commit SHA. | |
| head | Yes | Head branch, tag, or commit SHA. | |
| repo | Yes | Repository name. | |
| owner | Yes | Repository owner (organization or user). | |
| path_prefix | No | Optional path prefix to restrict results (e.g. "src/"). |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden and does disclose a meaningful behavioral trait: a hard 500-file cap and the escape hatch (path_prefix). It does not explain what happens at the cap (truncation vs. error) or any auth requirements, so it falls short of a 5.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Three short sentences, each earning its place: purpose, usage context, and limit workaround. The defining scope (two refs) is front-loaded and nothing is padding.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a read-only listing tool with full schema coverage and no output schema, the description covers what is returned at a high level (changed files plus change statistics) and the cap behavior. The residual gap is only the exact response shape and cap-handling semantics.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so base, head, owner, repo, and path_prefix are already documented. The description reinforces the path_prefix narrowing behavior but adds no syntax, default, or format detail beyond the schema β baseline 3.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a specific verb (lists), resource (files), and scope (between two git refs, modified/added/deleted, with change statistics). This makes it clearly distinguishable from get_diff (patch content) and get_path_history (single-path history) without naming them explicitly.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
"Use to survey changes across commits or branches" gives clear intended context, and the path_prefix hint points at narrowing scope. It stops short of naming a sibling or a when-not condition, so it is clear but not fully routing.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
resolve_refA
Resolves a git reference (branch name, tag, or partial SHA) to a full 40-character commit SHA. Use before queries when you need the canonical immutable commit identifier. Returns {sha, refType}. Fast and cached.
| Name | Required | Description | Default |
|---|---|---|---|
| ref | Yes | Branch name, tag name, or commit SHA to resolve. | |
| repo | Yes | Repository name. | |
| owner | Yes | Repository owner (organization or user). |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It does disclose useful traits: the return shape ({sha, refType}) and the 'fast and cached' performance profile. However, it says nothing about failure modes (invalid/ambiguous ref), required permissions for private repos, or cache staleness, leaving meaningful behavioral gaps for an annotation-free tool.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Three short sentences, front-loaded with the core operation, followed by usage and return shape. Every sentence earns its place with no padding.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Though no output schema exists, the description compensates by declaring the returned fields. Combined with the parameter schema being fully documented, an agent has enough to invoke it correctly; only error/permission behavior is unaddressed.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, and each of the three parameters (owner, repo, ref) is already documented in the schema with the same wording the description implies. The description adds only the accepted ref formats (branch/tag/partial SHA), which is marginal beyond the schema baseline of 3.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb (resolve) and resource (git reference) along with the exact transformation performed: branch/tag/partial SHA to full 40-character commit SHA. The output is also defined, so an agent can distinguish it from siblings like get_file_at_ref or find_merge_base without opening a schema.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly says to use it 'before queries when you need the canonical immutable commit identifier', which gives a clear triggering context. It does not name alternative tools or state when-not to use it, so it falls short of a 5.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
10 tool updates
v0.1.0- First observed
cache_stats - First observed
find_merge_base - First observed
find_pr_for_commit - First observed
get_blame - First observed
get_diff - First observed
get_file_at_ref - First observed
get_path_history - First observed
is_ancestor - First observed
list_changed_files - First observed
resolve_ref
TDQS
Scored across 10 tools
Each tool targets a distinct Git query operation: ref resolution, ancestry, blame, path history, PR lookup, changed files, diff, file content, merge base, and cache stats. Overlaps are only superficial (e.g., ancestry vs merge base, diff vs changed files), and descriptions make boundaries clear.
Most names follow a predictable verb_noun pattern (find_merge_base, resolve_ref, get_blame, get_path_history, list_changed_files, get_diff, get_file_at_ref). Minor deviations are predicate/noun forms like is_ancestor and cache_stats, but the set remains readable and coherent.
Ten tools is well-scoped for a read-only Git query server. Each tool earns its place by covering a distinct query need, with no obvious redundancy or bloat.
The surface covers core query operations: ref resolution, history, blame, diffs, changed files, file content, PR association, ancestry, and merge bases. Minor gaps include listing available branches/tags/remotes or richer commit metadata, but agents can often work around these with resolve_ref and path history.
Maintenance
Related MCP Connectors
Code intelligence for LLMs. Analyze, search, and retrieve code from any public git repository.
Ask any GitHub repository a question. Get source-backed answers.
Access the GitHub API, enabling file operations, repository management, search functionality, andβ¦
Connect AI assistants to GitHub - manage repos, issues, PRs, and workflows through natural language.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to access live GitHub repository data without cloning, supporting repo summarization, file explanation, recent changes, and dependency analysis.MIT
- FlicenseBqualityDmaintenanceEnables AI assistants to inspect local Git repositories and interact with the GitHub API for reading commits, diffs, files, issues, comments, pull requests, and project boards.1091 npm-
- AlicenseAqualityDmaintenanceEnables asking natural-language questions about any GitHub repository and receiving answers grounded in the actual code, with read-only enforcement and automatic repository fetching.16 npmMIT
- AlicenseNot gradedqualityFmaintenanceEnables AI agents to analyze local Git repositories with commit logs, diffs, blame, statistics, and branch analysis using native git commands without requiring a GitHub API.33 npmMIT