
Graphkeeper
io.github.RudrenduPaul由 GitHub 帳號 RudrenduPaul 發布v0.1.5更新於 Oct 24, 2026
Mines git history for file co-change patterns into a queryable knowledge graph via MCP.
概覽
讓 AI 程式助理查詢預先算好的檔案共變圖,了解 git 儲存庫中哪些檔案歷史上總是一起修改。
- 可以做什麼
- GraphKeeper 挖掘儲存庫的 git log,統計檔案層級的共變關係,並寫入本機 .graphkeeper/graph.json 存放區。這個 MCP 伺服器只提供一個 run 工具,會呼叫 graphkeeper-cli 套件並附上子命令、參數與 --json,回傳解析後的 JSON。支援的查詢包括某個檔案的共變檔案清單,以及在安裝 graphify 後查詢某個符號的呼叫者與被呼叫者。建置也可以透過同一個工具執行。
- 適用情境
- 適合助理在不熟悉的程式庫上工作時,快速回答某個檔案通常還會連帶修改哪些檔案,而不必每次重新掃描 git 歷史。安裝 graphify 後也適用於呼叫圖問題。
- 執行需求
- 以本機 stdio 程序由 MCP 用戶端啟動,不需要託管。Python 套件需安裝 mcp 附加元件,並透過 uvx 從 graphkeeper-cli 啟動。run 工具透過 npx 呼叫已發布的 npm 套件,因此 PATH 中需要有 Node.js 與 git。需要完整的 git 歷史,淺層複製會得到空圖。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Graphkeeper,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
GraphKeeper
[npm version] [PyPI version] [npm downloads] [License: Apache 2.0]
Install • Quickstart • CLI Reference • Comparison • FAQ
A local-only CLI that mines your git log for which files actually change
together, then hands an AI coding agent a queryable answer instead of a
grep across the whole history.
(Real output from running GraphKeeper against its own repo, this early in its history. Co-change counts grow as a codebase accumulates more commits.)
No server, no account, no embeddings API. Every byte of output comes from
git log on the repo you already have checked out.
Install
GraphKeeper ships two independent, equally first-class packages. Pick
whichever fits your toolchain, or install both. Both mine the same git log co-change signal and share one on-disk .graphkeeper/graph.json
schema, so a store built by either can be read back by the other.
The npm package requires Node.js 18 or later; the Python package requires
Python 3.9 or later. Both require git on your PATH. The Python
package's CLI entry point is also graphkeeper (e.g. graphkeeper build).
See python/README.md for the Python-specific
walkthrough, and CHANGELOG.md for each distribution's
version history.
Quickstart
Run it against any git repo, including this one:
Now query it:
If graphify is installed
(uv tool install graphifyy), graphkeeper build automatically shells out to
its local, no-API-key graphify extract --code-only and merges its
symbol/call-graph into the same store, unlocking call-graph queries:
(Also real output, from running graphkeeper build against this repo with
graphify installed.)
Without graphify installed, that same command explains exactly why the answer isn't available instead of crashing or returning an empty result:
Every command also supports --json for scripts and agents:
Features
- Mines real commit history, not a static snapshot.
graphkeeper buildrunsgit log --no-merges --name-onlyacross the full history of the repo and counts every file pair that changed together in the same commit. There's no guessing at coupling from folder structure or import statements alone; the answer comes from how the codebase actually got edited over time. --max-files-per-commitprotects the signal. A single vendoring commit or mass reformat that touches 400 files would otherwise pollute every pair in that commit. The default cap (100 files) skips commits above that threshold so real coupling doesn't drown in noise.- Optional call-graph enrichment, never required. When
graphify is on
PATH,graphkeeper buildshells out to its localgraphify extract --code-only --no-clusterand merges the resulting symbol/call edges into the same store, unlockinggraphkeeper query calls. Without graphify, GraphKeeper still works in co-change-only mode and says so plainly instead of failing. - Every command has a
--jsonmode.graphkeeper query co-change <file> --jsonand the equivalents return machine-readable output, so an agent's calling code parses a real data structure instead of scraping text. - Two from-scratch implementations, one schema. The npm package
(
src/, TypeScript) and the PyPI package (python/src/graphkeeper/, Python) are independent ports, not a wrapper of one around the other. Both read and write the same.graphkeeper/graph.json, so a store built with one CLI is queryable from the other. - Every subprocess call uses an argv array, never a shell string. Git
and graphify are both invoked through
spawnSync/subprocess.runwith a list of arguments, so a crafted commit message or filename in the repo being analyzed can't be interpreted as shell syntax.
CLI Reference
graphkeeper build [path]
Walks path (default: current directory), runs git log --no-merges --name-only across the whole history, and counts how often each pair of
files was touched in the same commit. Writes the result to
.graphkeeper/graph.json.
If graphify is detected on
PATH, build also runs graphify extract <path> --code-only --no-cluster
(graphify's own headless, local, no-API-key AST extraction path) into a
directory inside .graphkeeper/, and merges its nodes/edges into the same
store. The build output always states plainly whether that enrichment was
included, and why it was skipped if not.
graphkeeper query co-change <file>
Lists files that historically changed alongside <file>, ranked by how many
commits touched both.
Exit code 0 when results are found, 1 when there's no co-change data for
that file yet, 2 on a usage or filesystem error.
graphkeeper query calls <symbol>
Shows callers and callees of <symbol>, using graphify's calls edges from
the most recent build. Only meaningful when that build included graphify
enrichment; if it didn't, this prints a clear explanation of why instead of
a crash or a silent empty result.
Exit code 0 when the symbol is found, 1 when it isn't (or enrichment
wasn't available), 2 on a usage or filesystem error.
MCP Server
GraphKeeper ships a Model Context Protocol server so an AI coding agent (Claude, Cursor, or any MCP-compatible client) can mine co-change history and query the graph directly, without a human invoking the CLI by hand.
Install the extra:
Add it to your MCP client's config (for Claude Desktop, claude_desktop_config.json):
The server exposes one tool, run, that shells out to the published graphkeeper-cli npm package
(via npx graphkeeper-cli) with the given subcommand and arguments plus --json, and returns the
parsed JSON result:
Transport is stdio, so there is nothing to host: the MCP client spawns the server as a local
subprocess. Source: python/src/graphkeeper/mcp_server.py.
Library API Reference
Both packages expose a real importable surface, listed below. The command line is a thin wrapper over the same functions.
TypeScript / JavaScript (graphkeeper-cli on npm)
Types (GraphKeeperStore, CoChangeEdge, GraphifyNode, GraphifyEdge,
GraphifyRawGraph, GraphifyEnrichment, BuildOptions, BuildResult,
CoChangeQueryResult, CallsQueryResult) ship as .d.ts declarations
alongside the compiled output; no separate generated docs site exists yet.
Python (graphkeeper-cli on PyPI)
graphkeeper.__all__ exports: build, query_co_change, query_calls,
find_graphify_node, normalize_file_arg, detect_graphify,
run_graphify_enrichment, mine_co_change, unquote_git_path, GitError,
resolve_repo_root, read_store, write_store, graph_file_path,
PathSafetyError, plus the GraphKeeperStore, CoChangeEdge,
GraphifyNode, GraphifyEdge, GraphifyEnrichment, BuildOptions,
BuildResult, CoChangeQueryResult, CoChangeResultRow, and
CallsQueryResult dataclasses. Same names as the TypeScript export table
above, in snake_case. No separate generated docs site exists yet; the
docstring at the top of python/src/graphkeeper/__init__.py covers the
same ground as this section.
Comparison
("Not publicly documented" is used instead of a guess anywhere a competitor doesn't publish the number. Verified against each project's own README, pricing page, or public site as of August 2026.)
What Is GraphKeeper, and Why Does It Exist
GraphKeeper is a local CLI and library, published to both npm and PyPI as
graphkeeper-cli, that mines git log for file-level co-change: which
files have historically been edited in the same commit as a given file.
It writes that data to a single JSON file, .graphkeeper/graph.json, and
answers queries against it with no network calls.
It exists because an AI coding agent working solo on a codebase it doesn't
already know well has no fast way to answer "what else usually changes
when I touch this file?" without running its own git log --name-only
scan and tallying the results by hand, every time it's asked. GraphKeeper
precomputes that answer once and makes it queryable, including in a
--json form a script or agent can parse directly.
GraphKeeper does not reimplement symbol or call-graph extraction.
graphify (100K+ GitHub stars,
Apache-2.0, pip install graphifyy) already does that across 36
tree-sitter grammars and ships as a slash-command skill for Claude Code,
Cursor, Codex, Gemini CLI, GitHub Copilot, and 15+ more assistants (20+
total). When graphify is on PATH, graphkeeper build shells out to its
local graphify extract --code-only --no-cluster and merges the result
into the same store, unlocking graphkeeper query calls. Without graphify,
GraphKeeper still works, in co-change-only mode, and says so directly
instead of failing.
How It Works
graphkeeper buildrunsgit log --no-merges --name-only(via a safe argv-array subprocess call, never a shell string) across the whole repo history.- For every commit, it counts every pair of files that changed together.
Commits touching more than
--max-files-per-commitfiles (default 100) are skipped, so a single vendoring or mass-reformat commit can't drown out real signal. - If
graphifyis detected onPATH, GraphKeeper also runsgraphify extract <path> --code-only --no-cluster, graphify's own local, no-LLM, no-API-key extraction mode, into a directory inside.graphkeeper/, then merges itsnodes/edgesinto the same store. - The merged result is written once, atomically, to
.graphkeeper/graph.json. graphkeeper queryreads that file back and answers co-change or call-graph questions against it. No network calls, ever.
Security
- Every
gitandgraphifyinvocation uses an argv array passed directly to the OS (spawnSyncin TypeScript,subprocess.runwith a list in Python), never a shell string, so commit messages, file names, or repo paths can't be interpreted as shell syntax. .graphkeeper/output paths are checked against the resolved repo root before every write (symlinks included, viafs.realpathSync), so a maliciously crafted repo can't redirect GraphKeeper's writes outside.graphkeeper/.- No telemetry, no network calls, no secrets. The only files GraphKeeper
reads are
git logoutput and, optionally, graphify's owngraph.json; the only file it writes is.graphkeeper/graph.json.
See SECURITY.md for the vulnerability reporting process.
FAQ
Is GraphKeeper a general codebase knowledge-graph indexer?
Not on its own. graphkeeper build mines git log for file-level
co-change and writes those edges to .graphkeeper/graph.json. That file
only becomes a symbol/call graph too if graphify is installed and gets
merged in during the same build. Without graphify on PATH, the store
holds co-change data only, and graphkeeper query calls says so directly
instead of returning an empty result.
What does GraphKeeper actually give an agent that grep or git log don't?
A pre-computed, queryable answer to "which files change together here,"
so an agent doesn't have to run its own git log --name-only scan and
tally the results by hand on every question. --json on every command
makes that answer script-consumable rather than something a human has to
read and re-type.
How do I install it, and does it work on Windows?
npm install -g graphkeeper-cli (Node.js 18+) or pip install graphkeeper-cli (Python 3.9+); both need git on PATH. Neither
package contains OS-specific branches or native bindings, and the PyPI
listing is classified Operating System :: OS Independent, so it runs
the same way on Windows, macOS, and Linux anywhere git and a supported
Node or Python runtime are available.
How is this different from graphify, the tool it links to for enrichment?
They answer different questions. graphify extracts symbols, imports, and
call graphs straight from source via tree-sitter, across 36 languages;
GraphKeeper mines commit history for which files were historically
edited together, a signal graphify has no reason to compute. GraphKeeper
shells out to graphify's own local extract command when it's present
and merges the result in, rather than reimplementing tree-sitter parsing
from scratch. Neither replaces the other; see the Comparison table above
for how GitNexus, Greptile, and Augment Code differ from both.
What actually breaks GraphKeeper, or gives an empty result?
Two real cases, both documented, neither a crash: a shallow git clone
(GitHub Actions' default fetch-depth: 1) has no history to mine, so
build reports 0 commit(s) analyzed and writes an empty co-change
graph; full history (fetch-depth: 0) is required. Separately,
query calls only returns results if the most recent build ran with
graphify on PATH; if it didn't, the command explains that plainly
(graphify was not found on PATH...) instead of pretending the symbol
doesn't exist.
Is it safe to run against a repo I don't fully trust?
Every git and graphify call goes through an argv array straight to
the OS (spawnSync / Python's subprocess.run with a list, never a
shell string), so filenames or commit messages can't be interpreted as
shell syntax. Every .graphkeeper/ write is checked against the
resolved repo root, symlinks included, before it happens. There are no
network calls anywhere in the tool, so nothing about the repo you point
it at leaves your machine.
Is the npm CLI just a wrapper around the Python one, or vice versa?
Neither. They're two independent, from-scratch implementations (src/
for TypeScript, python/src/graphkeeper/ for Python) that happen to
agree on the same .graphkeeper/graph.json schema, the same subcommands,
flags, and exit codes. A store built by one can be read by the other.
The Python port's own test suite (ported from the TypeScript vitest
suite) is 78 tests, run against a real subprocess CLI invocation, not a
mock of the other language's output. Both suites pass in a clean install
as of this writing: 78/78 on the TypeScript side (npm test), 78/78 on
the Python side (pytest).
What license is this under, and can I use it commercially?
Apache License 2.0, for both the npm and PyPI packages, with no dual licensing and no separate commercial tier. That permits commercial use, modification, and redistribution, with attribution and the standard Apache patent grant. See LICENSE for the full text.
Contributing
Issues and PRs welcome. To build the TypeScript package from source:
For the Python package, see python/README.md. Full
contribution guidelines covering both codebases are in
CONTRIBUTING.md.
License
來源:README.md,提交 1dd3d96
工具
0版本歷史
1- v0.1.5最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分