mcp-repo-devtools
One line: This server gives a coding agent a bounded, read-only tool surface over a repo's working tree, history, GitHub issues, failing CI, and pull-request context, plus opt-in human-gated GitHub writes.
Inspect the working tree —
git_statusreturns branch, upstream, ahead/behind, and up to 200 changed paths (with atruncatedflag).Read history —
git_loglists newest commits (hash, date, author, subject), optionally scoped to a path, up to 100.View diffs —
git_diffreturns a--statsummary or unified patch against any base rev/tag/sha, scoped by path and context lines.Search issues —
gh_issue_searchreturns issues (number, title, labels, state, updated, url, body excerpt) in one repo, newest activity first.Diagnose failing CI —
gh_ci_failureslists failing checks and step names for a commit/branch/PR, optionally fetching log tails (up to 200 lines, centred on the first error) for up to three jobs.Review pull requests —
gh_pr_contextreturns title, body, size, changed files, review states, and review comments in one call.Write (opt-in) — with
MCP_ENABLE_WRITE=1,gh_pr_create,gh_issue_create, andgh_pr_commentbecome available, each gated by human elicitation/confirmation.Agent-friendly protocol — structured
outputSchema/structuredContenton read tools, read-only/destructive/idempotent annotations, progress notifications, and cancellation that aborts in-flight fetches and git processes.Bounded output — every result capped at 64 KB / 200 lines with explicit truncation notes naming the argument to narrow the next call; optional sampling-based summarisation.
Workflow prompts —
diagnose-ci,review-pr, andtriage-issuesrender ordered plans over the read tools.Safety — no shell (
execFile+ argv), 13 allowlisted git subcommands, realpath containment withinMCP_ALLOWED_ROOTS, forbidden config flags, and credential redaction.
Provides bounded, read-only access to local Git repositories, including working tree status, commit history, and diffs with safety controls around allowed subcommands and repository paths.
Integrates with GitHub for issue search, CI failure inspection with optional log tails, and pull-request context; in opt-in write mode it can create pull requests, file issues, and comment on issues or pull requests.
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., "@mcp-repo-devtools check the git status of this repo and summarize the last few commits"
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.
mcp-repo-devtools
An agent that can read a whole log file will read a whole log file.
mcp-repo-devtools is the tool surface a coding agent calls before it touches a
repository — working tree, history, issues, failing CI, pull-request context — plus a
reference loop that uses those tools and a forty-fixture eval that scores that loop against
a model holding nothing but git. The eval publishes both halves of the answer: the raw
command is 2.1× cheaper whenever the history survives the clone, and cannot answer at
all when a depth-1 checkout leaves the CI log as the only evidence. Every result has a
hard budget, every query has a hard boundary, and both are measured rather than asserted.
It is built for the agent end of MCP, not for a human clicking through a UI: six tools declared read-only, structured results a host can read as fields, progress and cancellation for calls that take twenty seconds, a human gate in front of a write, and a byte budget on every answer. Works with Claude Code, Cursor, Codex, Copilot and any other MCP host.
Bounded, and measured. On a real failed CI run, reading the logs it needed cost 405,577 bytes raw; the tool returned 12,218 (97.0% less). Issue search over a busy repository: 176,170 → 4,371 (97.5%). Twenty commits with
git log -p: 19,300 → 992 (94.9%). The numbers, the fixtures and the caveats are inbench/README.md; the script that produced them isbench/measure.mjs.Read-only by construction. Thirteen git subcommands, an argv array, no shell anywhere. The three write tools exist only when
MCP_ENABLE_WRITE=1, and each one logs a line to stderr before the request goes out.Rooted, not vibes.
MCP_ALLOWED_ROOTSis required; paths arerealpath-resolved before the containment check, filesystem roots are refused, and model-supplied refs cannot start with-.Small surface, honest failures. Six tools by default. Errors say what to do next (
Error: GitHub rate limit exhausted; resets at … Set GITHUB_TOKEN …), and truncation is never silent — the last line names the argument that narrows the next call.
Built for an agent
The protocol is the product here: every feature below exists because a model, not a person, is on the other end of the call.
What the agent needs | What the server gives it |
choose a tool without reading prose |
|
read fields, not lines |
|
not look dead during a 20 s call | one |
stop work it no longer needs | the caller's abort signal reaches |
keep its context small | 64 KB / 200 lines per result, and a tail line that names the argument narrowing the next call |
trade a lossy clip for a summary |
|
act only when a human says so |
|
know the order to call things in | three prompts ( |
prove the tool helped |
|
Related MCP server: Local Commander
Quickstart
The package is not on npm yet, so the release tarball is the installable artifact today:
npm install -g https://github.com/MAOLVLHL/mcp-repo-devtools/releases/download/v0.3.0/mcp-repo-devtools-0.3.0.tgz
mcp-repo-devtools --version # 0.3.0
mcp-repo-devtools --help # prints the env contract and exitsUntil the publish lands, use the global binary mcp-repo-devtools wherever a client
config below says npx -y mcp-repo-devtools. Once it is on npm, npx is the
zero-install path and nothing else changes.
The server speaks MCP over stdio. Three variables matter:
Variable | Required | Meaning |
| yes | Directories the server may read, separated by the platform separator ( |
| no | Raises the GitHub limit from 60 to 5000 requests/hour and is required for log tails and for writes. Fine-grained, read-only is enough for the read tools. |
| no |
|
Configure a client
Claude Code
claude mcp add repo-devtools -s project \
-e MCP_ALLOWED_ROOTS=/home/you/code \
-e GITHUB_TOKEN=$GITHUB_TOKEN \
-- npx -y mcp-repo-devtools
claude mcp list # repo-devtools: … ✓ ConnectedCursor — .cursor/mcp.json in the project, or the same shape in ~/.cursor/mcp.json:
{
"mcpServers": {
"repo-devtools": {
"command": "npx",
"args": ["-y", "mcp-repo-devtools"],
"env": {
"MCP_ALLOWED_ROOTS": "/home/you/code",
"GITHUB_TOKEN": "${env:GITHUB_TOKEN}"
}
}
}
}Codex — ~/.codex/config.toml:
[mcp_servers.repo-devtools]
command = "npx"
args = ["-y", "mcp-repo-devtools"]
env = { MCP_ALLOWED_ROOTS = "/home/you/code", GITHUB_TOKEN = "ghp_…" }Restart the host, then ask it to "check the git status of this repo". Tool names appear
exactly as listed below. From a checkout instead of npm: npm install && npm run build
and point the client at /absolute/path/to/mcp-repo-devtools/dist/index.js.
The tools
Tool | One call returns | Notes |
| branch, upstream, ahead/behind, up to 200 changed paths | Start here; it tells you what to diff |
| the newest commits, one line each, optionally scoped to a path | No patches — that is the point |
|
|
|
| issues in one repo, newest activity first, body excerpt | Pull requests are filtered out |
| only failing checks, failed step names, optional log |
|
| title, body, size, files, review states, review comments | Replaces four REST calls |
| opens a PR from a branch already pushed | write mode only |
| files an issue | write mode only |
| comments on an issue or PR | write mode only |
Every tool also answers a machine, not only a model. The six read tools declare an
outputSchema and return the same data as structuredContent next to the text, so a
host can read fields instead of parsing lines; all nine tools carry
readOnlyHint/destructiveHint/idempotentHint/openWorldHint, and the server sends
one paragraph of usage instructions when a client connects. Annotations are hints, not
permissions — write tools stay unregistered unless MCP_ENABLE_WRITE=1.
A call that spans several GitHub hops can take ten to thirty seconds. If the client
sends a progressToken, gh_ci_failures reports one progress notification per hop
(check runs, then each run's jobs, then each job's log), so the host can show the step
instead of a spinner; the last notification equals the total. Without a token nothing
is sent and the result is unchanged. Cancelling the call aborts the in-flight fetch
and the running git process.
Full argument tables, example output, the exact truncation notes and what each layer
carries: docs/tools.md.
If you are the agent reading this
Five rules that keep a call cheap, learned from the eval rather than guessed:
git_statusfirst. It names the branch and the changed paths, which is how you choose betweengit_diffandgit_loginstead of calling both.When a result says
truncated, narrow it. The tail line names the argument — passpath=,base=or a smallerlog_lines. Re-running the same call wider spends the same budget again.gh_ci_failureswithoutinclude_logsis one round trip. Ask for the log only after the failing job is known, and ask for 40 lines, not the archive — the 40 lines come from around the first error, because the last 40 are teardown.gh_pr_contextreplaces four REST calls. If you are about to fetch a PR, then its files, then its reviews separately, call this instead.A write returns
isError: truewhen a human declined it. Read the note and change the plan; do not send the same call again.
Three prompts, two optional client features
A tool list is not a workflow. The server also registers three prompts — diagnose-ci,
review-pr and triage-issues — that a host can offer as slash commands. Each renders a
short, ordered plan over the read tools ("call gh_ci_failures with include_logs=true,
then map the log line to a file with git_log") and ends by saying what not to do: no
edits, no comments, no issues. They are prompts, not tools: nothing runs until the model
calls one.
Two client capabilities change how calls behave, and both are off unless you ask for them, so the default surface is unchanged:
Confirmation before a write. If the client advertises
elicitation, the three write tools ask a human first ("Approve this GitHub write?" with the action, target and title) and send nothing when the answer is no — the refusal comes back as a normal tool error with the reason.MCP_CONFIRM_WRITES=1refuses when the client cannot ask (fail closed);MCP_CONFIRM_WRITES=0never asks. Unset means: ask when possible, proceed when the client has no way to ask.Summarising instead of clipping.
MCP_SAMPLING_COMPRESSION=1lets an over-budget result be summarised by the client's own model instead of cut at 64 KB / 200 lines. The summary keeps identifiers, paths and error strings, is labelled…compressed from N bytes by the client model, and falls back to the ordinary clip if the model fails, times out or returns nothing. Results that already fit are byte-identical and never sent to the model.
Redaction runs before either feature, so a summary cannot bring back a secret the clip path would have removed.
Reference agent
The server is not an agent: it holds no loop, no planning and no memory between calls.
src/agent/ is the smallest loop that is one, built on the same six read
tools, answering one question — which commit introduced this CI failure?
npm run demo:agent # offline: a failing CI call, a real git log, a reportsrc/agent/provider.ts Provider seam; OpenAI-compatible and scripted implementations
src/agent/mcp-tools.ts the server's tools as a toolbox a model can call
src/agent/loop.ts turn/tool loop with turn, call and byte caps
src/agent/diagnose.ts the CI-failure task: system prompt, target, run
src/agent/cli.ts node dist/agent/cli.js --repo owner/name --ref mainrunAgent sends the conversation, executes the tool calls that come back, appends the
results, and stops when the model answers without calling a tool. Caps: 8 turns, 4 calls
per turn, 24 KiB per result. The run is read-only by construction — it connects with
enableWrite: false, so the three write tools are never registered — and it reports why
it stopped (final, max-turns, cancelled). A tool that throws, or a call whose
arguments were not valid JSON, becomes a tool result with isError: true rather than an
exception. The provider seam is one method, so the same loop runs against OpenAI, an
Ollama or vLLM endpoint, or a scripted list of turns in the tests.
Details, including how to point it at any OpenAI-compatible gateway:
docs/agent.md.
Measured, not estimated
The baseline in every row is the good version of what an agent does without this server: the same command, the same endpoint, no truncation. Measured 2026-11-11 on Windows 11, Node 22.14, git 2.56; tokens are bytes / 4.
Case | Naive | Tool | Saved |
| 405,577 B | 12,218 B | 97.0% |
| 176,170 B | 4,371 B | 97.5% |
| 19,300 B | 992 B | 94.9% |
| 75,960 B | 5,236 B | 93.1% |
| 3,641 B | 290 B | 92.0% |
| 8,320 B | 5,621 B | 32.4% |
Caveats, stated rather than buried: n = 1 per cell; the git rows use generated fixtures
so they reproduce anywhere, the GitHub rows hit a live public repository; and
gh_ci_failures is slower than the naive path (15.9 s vs 4.7 s) because it resolves
ref → commit → checks → jobs → logs before it decides what to download. Bytes and
latency trade against each other, and the table only measures one side. Full method:
bench/README.md.
An eval that can fail me
Most tool READMEs quote a benchmark their tool wins. This one runs mine against the boring
alternative, and publishes both halves: one raw git command is 2.1× cheaper on a repository
with its history intact, and cannot answer at all when the checkout is a depth-1 clone and the
only evidence is a CI log. Which half matters depends on the incident, so neither half is
tuned away.
eval/ measures answers, not bytes: forty offline fixtures, each a real repository
baked from a few commits with one regression in it, the failing test as a user would report
it, and the sha that introduced it. Both arms run the same loop, the same prompt and the
same 8-turn cap; the only variable is the tool surface — the six MCP tools, or one raw
git tool that returns its output verbatim.
npm run eval # scripted oracle, offline, must be 40/40
npm run eval:baseline # the raw git tool over the thirty git cases, 30/30
npm run eval:check # the run above, per fixture, against eval/baseline.json
npm run eval -- --kind github # the ten that need a CI log
OPENAI_API_KEY=… npm run eval -- --provider openai # a real model, real numbersScored from the trajectory, not a second opinion: success@1 (does the report name the
culprit commit), turns, tool calls, duplicate calls, tokens, and read-only violations. No
judge model, so the number cannot drift with the grader. The scripted oracle run must stay
40/40 — it proves fixtures, tool names and grader agree before a token is spent. Ten of the
forty are kind: "github": a real repository plus a stubbed workflow run, so a regression
whose only evidence is a CI log is scored through gh_ci_failures. Four of those ten are
shallow: the checkout is a depth-1 clone of the commit the run tested, the culprit came
earlier and was never fetched, and the job log's git blame/show --stat lines are the only
surviving pointer to it.
Three runs per arm, 2026-11-11, deepseek-flash at temperature 0, turn cap 8, forty
fixtures — 120 cases per arm:
six MCP tools | one raw | |
success@1 | 120/120 (100%) | 108/120 (90%) |
mean turns | 4.68 | 4.72 |
mean tool calls | 6.97 | 9.18 |
mean tokens per case | 13,898 | 8,534 |
— thirty git cases | 13,567 | 6,548 |
— six CI-log cases | 16,964 | 8,076 |
— four shallow cases | 11,779, 12/12 | 24,118, 0/12 |
On a repository whose history is intact, both arms name the right commit every time and one
raw command does it for 2.1× fewer tokens. The six schemas cost about 1,073 tokens on every
turn before a single result is read; the raw arm pays that once for one tool. That is the task
git was built for — log -p and show are one call each — so a typed surface has to earn
its overhead somewhere else.
The four shallow cases are where it does, and the first version of them did not. They were
built to be answerable only from a CI log: the checkout is a depth-1 clone of the commit the
workflow tested, the breaking commit came earlier and was never fetched, and the log's
git blame/ show --stat lines are the only place its sha survives. The first attempt made
that head sha the culprit's own sha, so the raw arm simply cited the only commit it could see
and scored 10/10 — a fixture that graded nothing. Moving the culprit one commit back made the
raw arm answer none of the twelve, at 24.1k tokens and 24.8 tool calls per case: it hunts for
a commit that is not on disk. The typed arm answered all twelve, cheaper than it answers the
git cases, because gh_ci_failures hands it the log that still names the change.
An eval you are willing to lose is the only kind worth quoting, and this one has already paid for itself five times:
it caught the harness being unfair to its own author: the first table read 87% for the typed arm because the task demanded a full sha while
git_logprints seven characters, so models padded the right commit with 33 invented ones. The prompt was wrong, not the models; fixing it moved that arm from 87% to 100% and left the token gap untouched;it caught a broken fixture — the "culprit" commit could not fail the failing test, and the model said so; the oracle could never have caught it, because it cites the expected sha by construction;
it caught a loop bug — a reply with no text was scored as an answer, so a model that stopped mid-thought looked wrong when the harness was wrong;
it put a number on the schema tax, which decides whether a seventh tool is worth its tokens;
it falsified its own hypothesis, twice. Six fixtures were built to need a CI log, on the theory that one git tool could never answer them: a model holding only git solved all eighteen anyway, from the diffs, at 8.1k tokens against 17.0k. That result is published rather than tuned away, and it is the reason the seventh fixture family deletes the history instead of asking a leading question. The four shallow fixtures then failed their author a second time — the first version let the raw arm score 10/10 — before the blame line closed it.
Method, the forty regressions, the per-fixture table and the caveats:
docs/eval.md.
Safety model
Control | Implementation |
No shell |
|
No write commands |
|
No config injection |
|
No path escape |
|
No inherited git state | child env limited to |
No secrets in output | every git stderr and GitHub response passes |
No token to the blob host | job-log redirects are followed by hand, without |
No hanging | 10 s git, 15 s GitHub, 30 s log download |
Every benchmark run also fires four boundary probes (path escape, --output,
shell metacharacters in a ref, a malformed owner/name) and requires all four to be
refused — see bench/README.md. The full threat
model, including what these controls do not cover, is in
docs/security.md.
What this is not
Not a sandbox. It reads the roots you configure, with your permissions. Point it at a code directory, not at your home directory.
Not an agent runtime. The server has no loop, no planning and no memory between calls.
src/agent/is a client of it — read-only, one task, not exposed as a tool — andeval/is how that client is judged, against a baseline that wins on cost wherever the git history survives the clone — and loses outright where it does not.Not a GitHub client. No push, merge, close, branch creation, or file editing. Those belong to the agent's own git client, where the human already watches.
Not an injection filter. Commit messages, issue bodies and log lines are returned as data; a string that says "ignore previous instructions" is still a string.
Not an HTTP service. stdio only. A hosted mode needs an auth design before it can be safe, and that design is not in this repository.
Development
npm install
npm run build # tsc -> dist/
npm test # build + node:test, 155 tests
npm run snapshot # rewrite tests/fixtures/tool-surface.json after a surface change
npm run bench # the measurement above (needs a checkout, and a token for GitHub rows)
npm run inspect # MCP Inspector against the built server
npm run demo:agent # the reference loop, offline, no key
npm run eval # the forty fixtures through the oracle, offline
npm run eval:check # the gate: no fixture the recorded baseline solved got worse
npm run eval -- --kind github # only the ten that need a CI logThe tool surface is a contract: tests/contract.test.ts fails if a tool appears,
disappears, or changes its arguments without the snapshot being updated on purpose.
If you are a coding agent working in this repository rather than installing it, read
AGENTS.md: the commands, the eight rules a change must not break, and where
each layer lives.
src/config.ts MCP_ALLOWED_ROOTS parsing and realpath containment
src/git.ts execFile wrapper, allowlists, status/log/diff
src/github.ts REST reads, CI log download, opt-in writes
src/zip.ts minimal zip reader for Actions log archives
src/text.ts output budget, error window, credential redaction
src/version.ts the version, read from package.json, and the User-Agent GitHub sees
src/server.ts tool registration and text formatting
src/agent/ reference loop: provider, toolbox, loop, diagnose task, CLI
src/eval/ task-level eval: fixtures, grading, two arms, CLI
src/index.ts stdio entry pointDocs: architecture · tool reference · reference agent · eval · security model · measurements.
Roadmap
gh_issue_search: ETag caching between callsgit_blame/git_show: already allowed at the transport layer, not exposed yeteval: PR-shaped fixtures, so
gh_pr_contextis scored the waygh_ci_failuresnow isHTTP transport: out of scope until there is an auth design worth shipping
Contributing
Issues and pull requests are welcome. Please run npm test before opening a PR, and if
you change the tool surface, include the tests/fixtures/tool-surface.json diff —
that diff is the review record. Security reports: see
SECURITY.md.
License
MIT
Available Tools
6 toolsgh_ci_failuresGitHub CI failuresARead-onlyIdempotent
List failing check runs for a commit or branch/PR head, with the failed step names when GitHub exposes them. Read-only. Set include_logs=true to also get the tail of the failing job's log, which is usually where the error is; that costs one extra request per job (up to three jobs).
Inputs: ref (required), repo (required), log_lines, include_logs. Returns: ref, sha, repo, failures, +1 more
gh_issue_searchsearch GitHub issuesARead-onlyIdempotent
Search issues in one repository with GitHub's search API, newest activity first. Read-only. Returns issue number, title, labels, updated date, url and a body excerpt. Requires GITHUB_TOKEN for anything beyond 60 requests/hour.
Inputs: repo (required), limit, query, state. Returns: repo, query, state, issues, +1 more
gh_pr_contextGitHub pull request contextARead-onlyIdempotent
Fetch everything needed to review a pull request in one call: title, body excerpt, base/head, size, changed files, review states and review comments. Read-only.
Inputs: repo (required), number (required). Returns: base, head, repo, draft, +12 more
git_diffgit diffARead-onlyIdempotent
Diff the working tree against a base revision (default HEAD). Read-only. mode='stat' (default) returns file names with line counts; mode='patch' returns the unified diff. If the output ends with a truncation note, narrow with path= or reduce context_lines=.
Inputs: repo (required), base, mode, path, +1 more. Returns: base, diff, mode, path, +1 more
git_loggit logARead-onlyIdempotent
List the newest commits (hash, date, author, subject), newest first. Read-only. Use path= to scope to a file or directory, limit= to cap the number of commits (max 100).
Inputs: repo (required), path, limit. Returns: path, commits
git_statusgit statusARead-onlyIdempotent
Summarise a repository's working tree: current branch, upstream, ahead/behind counts and changed paths. Read-only. Use this before deciding what to look at with git_diff.
Inputs: repo (required). Returns: ahead, behind, branch, changes, +2 more
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
Each tool targets a distinct artifact: working-tree state (git_status), history (git_log), changes (git_diff), issues (gh_issue_search), CI checks (gh_ci_failures), and PR review context (gh_pr_context). The descriptions even cross-reference each other (git_status tells you to use git_diff next), which resolves the only plausible overlap. No two tools would be reasonably confused by an agent.
A clear prefix convention separates local git operations (git_*) from GitHub API operations (gh_*), and all names are lower snake_case. Minor deviation: some names are prefix+noun (git_status, git_diff, gh_pr_context) while one embeds a verb (gh_issue_search), so the grammatical shape of the suffix is not fully uniform.
Six tools is well within the sweet spot for a focused inspection server, and each one covers a genuinely different question an agent asks when orienting in a repo. There are no near-duplicate or filler tools.
The surface is deliberately read-only, so missing write operations are defensible, but there are real dead ends for investigation: no way to read a file's contents, no branch/tag listing, no PR listing (only single-PR context), and no log/diff against arbitrary commit ranges beyond a base revision. An agent can diagnose a failing build but not fully explore the repo.
Maintenance
Related MCP Connectors
Hosted coding agent: start, follow up on and stop tasks that can open GitHub pull requests.
Operate GitHub from your AI assistant: repos, PRs, issues, Actions. Previews and read-only mode.
Git-backed platform for skills, tools, and context for AI agents
Hosted git for AI agents: repos, files, code search, issues, pull requests, branches, merges.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceEnables LLM clients to search, read, and patch a trusted source repository with rollback-safe edits, Git operations, and allowlisted validation over stdio or OAuth-protected HTTP. Keeps secrets and arbitrary shell access out of reach while enforcing bounded batched I/O and operator-controlled workspace trust.MIT
- AlicenseAqualityBmaintenanceFor people who want their AI to run the build, read the error and check the dev server itself, instead of pasting output into chat. Works with Claude Desktop (one-click installer), Cursor, Claude Code and Cline. Runs locally over stdio or HTTP, no telemetry. A seatbelt for everyday mistakes, not a sandbox.2049 npmMIT
- AlicenseAqualityBmaintenanceEnables AI assistants to turn local git history into answers about recent activity, file hotspots, change coupling, stale or already-merged branches, contributors, ref comparisons, and drafted release notes. It runs locally over stdio with a git subcommand allowlist, so it is read-only, works offline and without shell access, and is safe to auto-approve.1351 npmMIT
- AlicenseNot gradedqualityCmaintenanceEnables an agent to mine a repository's git history and answer questions a new teammate would ask: which files are riskiest based on churn, recency and author breadth, who actually knows each file based on surviving lines, which files secretly change together, which directories depend on one person, and what recent commits mean for release notes. All analysis runs through a read-only server sandboxed to a single directory.MIT