graphify-mcp
It's a codebase knowledge-graph server, so an assistant can build a graph of a repo and then query, navigate, and label it cheaply.
Build or refresh the graph with
graphify_build(full build, incrementalupdate, clustering-only, optional HTML viz).Orient quickly with
graphify_overview: size, top god nodes, community count, surprise edges, suggested questions.Ask natural-language questions over the graph via
graphify_query(optionally DFS path tracing, token budget).Find paths and explain symbols with
graphify_path(node A → node B) andgraphify_explain(everything known about a node).Search and inspect nodes:
graphify_searchby name/label,graphify_node_detailsfor type,file:line, docstring, community.Traverse structure:
graphify_neighbors(1-hop, with relations) andgraphify_subgraph(BFS around a node under a token budget).Analyze the repo's shape:
graphify_god_nodes(most connected),graphify_surprises(unexpected cross-file links),graphify_communities(Leiden clusters).Name communities with
graphify_label_communities, using host-LLM sampling, an API-key backend, or placeholders;graphify_sampling_statusreports which is available.Add external sources (e.g. arXiv papers, tweets) with
graphify_add(http/https only).Check staleness with
graphify_freshness, which compares the graph against git HEAD and recommends an update.
Allows adding a source from arXiv by URL, enabling the knowledge graph to include research papers as nodes.
Optionally used as a local backend for labeling communities with semantic names via the graphify_label_communities tool.
Optionally used as a backend API for labeling communities with semantic names via the graphify_label_communities tool.
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., "@graphify-mcp give me an overview of the codebase graph"
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.
graphlore: an MCP server for codebase knowledge graphs
graphlore is a Model Context Protocol (MCP) server that gives AI coding
assistants the knowledge graph of a codebase, for the questions that need the
whole repository at once: what a change breaks, where a behavior lives, which
imports form cycles, which route reaches which handler, which code shares
state without calling each other. Each answer is one reply under a token
budget, with file:line on every row. It complements a language server and a
client's built-in code search, which answer one symbol at a time. graphlore
builds the graph with its own extractor (Rust and tree-sitter, 14 languages),
still reads one built by Graphify, and joins every node to its real
start..end source span (Python via ast, other languages via tree-sitter).
Find code by what it does.
graphlore_locate("where are failed requests retried?")returns the enclosing symbol, its neighborhood and similar-but-unconnected code in one call: about 235 tokens, against about 61,800 for grep + read on httpx (benchmark).See the blast radius of a change.
graphlore_impact("Response")lists what depends on a symbol, production code before tests, each row withfile:line.Read only the code you need.
graphlore_fetchreturns a symbol's exact span under a token budget.Review a pull request without a model.
graphlore review(and its GitHub Action) lists the definitions a change touches, what depends on them, the tests that reach them and the import cycles it brings in.Know how far to trust an answer. Results say how a name was matched, what a budget cut left out, and which files changed since the graph was built.
Local by default. The analysis tools read local files and need no API key;
GRAPHLORE_OFFLINE=1refuses every network path graphlore knows.
It works with any MCP client. Setup for Claude Code and Claude Desktop is below.
Quick start
Claude Code plugin (needs uv): installs the
server, graphlore's native engine and an exploration skill, with nothing to configure.
/plugin install graphlore --marketplace yasinyaman/graphloreOn Claude Code older than 2.1.275, run /plugin marketplace add yasinyaman/graphlore
and then /plugin install graphlore@graphlore.
Codex, GitHub Copilot CLI and Gemini CLI plugins (also need uv): the same
repository installs there as a plugin, with the server and the skill.
codex plugin marketplace add yasinyaman/graphlore && codex plugin add graphlore@graphlorecopilot plugin marketplace add yasinyaman/graphlore && copilot plugin install graphlore@graphloregemini extensions install https://github.com/yasinyaman/graphloreThe other clients and what each plugin carries are in clients.
Any other MCP client: install graphlore with its native engine, which builds the graph (prebuilt wheels, no Rust toolchain), then register the server.
pip install "graphlore[engine]"or run it with nothing installed: uvx --from "graphlore[engine]" graphlore.
Then let graphlore write your client's config, and the usage guide its agent
reads (AGENTS.md, GEMINI.md, Copilot's instructions):
graphlore setup codex --write --with-agents-mdgraphlore clients lists the clients it knows: Claude Code, Claude Desktop,
OpenAI Codex CLI, Google Gemini CLI, Cursor, VS Code (GitHub Copilot), Kimi
Code CLI, Zed, Windsurf and Cline. Without --write it prints the block and
where it goes. For any other MCP client the block is:
{
"mcpServers": {
"graphlore": {
"command": "graphlore",
"env": { "GRAPHLORE_PROJECT_DIR": "/absolute/path/to/your/project" }
}
}
}Each client's file, key and limits (tool caps, output truncation, prompts): docs/clients.md.
Optional extras, installed as graphlore[extra]: engine (graphlore's native
extractor, which builds the graph), embed (static code
embeddings for the built-in search behind graphlore_locate), semble (semble
as that search instead, with GRAPHLORE_SEMANTIC_BACKEND=semble), treesitter (spans for non-Python
languages; without it the native engine's compiled-in grammars give them), tiktoken (exact token
counts), watch (re-sync on file changes).
Then ask. The assistant builds the graph once and explores from there (output from the repository's small test fixture):
graphlore_build(".") # once; graphlore_build(".", update=True) after changes
graphlore_overview() # size, hubs, subsystems, suggested next steps
graphlore_impact("Response", hops=1)
2 node(s) depend on Response (≤1 hops, direction=dependents):
Client (distance 1) [returns] def: httpx/_client.py:50
DigestAuth (distance 1) [inferred] def: httpx/_auth.py:120A misspelled name gets a suggestion, not a guess:
No node matching 'Clinet'. Did you mean: Client (httpx/_client.py:50)?
Or look at it. Every build also writes graphify-out/graph.html, one file
that opens in any browser with no network: the communities first, then one
community or one symbol's neighbourhood, with search and a details panel. The
same page opens any graph.json, graphlore's or Graphify's, without graphlore
installed: the viewer on GitHub Pages
reads the file you drop in your browser and uploads nothing
(demo). A node's page copies
the graphlore_explain / graphlore_fetch call for it, so what you find there goes
straight to the assistant, and the address bar keeps the view, so a link opens it again.
The page also shows what graphlore's tools find: import and call cycles, shared
state with no call path, surprising links and unreferenced code (Findings, G),
and a node's blast radius as graphlore_impact walks it (Impact, I).
Related MCP server: repo-graphrag-mcp
Tools
The server starts on the lean surface, 12 tools that cover the whole explore
loop (orient, find, traverse, blast radius, read the code). A small surface
helps a model pick the right tool.
Tool | What it answers |
| Call first: size, most connected nodes, communities, suggested next steps |
| A question or a name → the enclosing symbol, its subgraph and hidden links (built-in search; better with |
| Which nodes match this name or id |
| The direct neighbors of a node |
| The neighborhood around a node, under a token budget |
| Blast radius: what depends on a node, or what it depends on, and the chokepoints it funnels through |
| A node's type, |
| A node's source code: the exact span, under a token budget |
| The subsystems (Leiden communities) of the codebase |
| Is the graph stale against git: fresh, update or rebuild |
| Build or update the graph with graphlore's native engine (graphify when the engine is not installed) |
| Show or switch the project directory the server reads |
GRAPHLORE_TOOLSET=full exposes all 34: structure review (import and call
cycles, layer rules, bridges and cut points, dead-code candidates, same-named
symbols, duplication, PageRank and betweenness),
framework routes and package API usage, tests for a symbol, signatures, git
diffs, community naming, natural-language queries and paths between nodes. The Claude Code
plugin runs on full.
→ Tool reference (all 34 tools, resources, prompts) · choosing a toolset
Benchmark
Tokens that reach the model to orient it in a code area, averaged over 6
queries on encode/httpx (2,101-node graph):
Approach | Tokens | Calls | Graph structure | Semantic search | Hidden links |
grep + read | 61,836 | ~14 | — | — | 0 |
semble alone | 1,613 | 1 | — | ✓ | 0 |
Graphify alone | 1,107 | 1 | ✓ | — | 0 |
semble + Graphify, separately | 2,721 | 4 | ✓ | ✓ | 0 |
| 235 | 1 | ✓ | ✓ | 7 |
That is 263× fewer tokens than grep + read and 11.6× fewer than running the two
tools separately. Those 235 tokens are a map (file:line plus neighborhood),
not the code; the code is fetched only where needed. Across Python, JS/TS, Go,
Java, Rust and C++ repositories, 70–96% of semantic hits land inside the
resolved symbol's real span.
Every repository measured is an HTTP-client library and the baseline is a naive grep, so treat the numbers as indicative.
The search behind locate was measured on its own on semble's published query
set (1,251 queries, 63 repositories, 19 languages, semble's scoring): the
built-in BM25 index, with no extra installed, reaches NDCG@10 0.814 against
semble's 0.852, with a median cold index of 0.6 s and a median query of 1 ms.
→ Method, per-language results and caveats
FAQ
What is graphlore used for?
Giving an AI coding assistant a cheap, structural view of a repository: onboarding to unfamiliar code, tracing how a feature works end to end, finding what a change would break, and reviewing structure (cycles, layering, dead or duplicated code).
How is it different from Graphify's own MCP server?
graphlore builds its own graph (its native engine, in Rust), so it does not
need graphify installed, and it reads a graph Graphify built too. Graphify's embedded server has graph navigation,
token-budgeted subgraphs, an HTTP transport and multi-project serving, which
graphlore lacks. graphlore adds the span engine and
what it makes possible: semantic locate joined to the enclosing symbol,
source hydration (fetch, skeleton), route and package-API extraction,
cosmetic-vs-structural freshness, and calls through a module object
(mod.func()) that the graph leaves out. Prefer one server per project.
→ How graphlore works
Does it replace grep?
No. An exact identifier is found faster with rg. graphlore earns its place on
multi-hop questions (who calls this, what breaks if it changes) and on
orientation in unfamiliar code. Every answer carries file:line, so it can be
checked with a plain read.
How is it different from a language server or built-in code search?
A language server (Claude Code's LSP tool, an editor's "find references")
answers one symbol at a time, with the compiler's precision: go to this
definition, list these references. A client's semantic search finds code by
what it says. graphlore answers what neither gives in one call: everything a
change reaches several hops out, the import cycles and layer violations of the
whole repository, which HTTP route reaches which handler and which code calls
it, which definitions share state with no call between them, and a pull
request's change set (graphlore review). Its edges are resolved from the
source by name and scope rules, not by a compiler, and say so
(confidence). Use them together.
→ How graphlore compares
Is it an agent memory?
No. It has no remember or recall tools and keeps no notes between sessions. It is a read-mostly view of a code graph; the only thing it persists is community names.
Does it need an API key or send my code anywhere?
The analysis tools read local files and need no key. A few paths can reach the
network: the first embedding search ([embed] or [semble]) downloads a model, the first use
of a language downloads its tree-sitter grammar (the native engine's grammars
are compiled in and download nothing), graphify, where it still builds the
graph, can call an LLM backend when you set its key, and graphlore_add
fetches a URL.
GRAPHLORE_OFFLINE=1 refuses or restricts the ones graphlore controls; the
table linked below also lists what it cannot constrain.
→ What reaches the network, and when
Which languages are supported?
The native engine builds the graph for Python, JavaScript, TypeScript/TSX, Go,
Java, Kotlin, Scala, C#, Rust, Swift, C, C++, Ruby and PHP, and gives their
spans from its compiled-in grammars. Without the engine, Python works through
the standard library and the other languages tree-sitter covers need the
[treesitter] extra; without either, non-Python files fall back to
nearest-line matching. Package-API extraction reads all of
these; route extraction reads Python, JS/TS, Go, Java, Kotlin, C#, Rust, Ruby
and PHP frameworks
(tool reference),
and both say which files they did not read.
What was measured in each language,
on 31 real repositories.
Does graphlore_locate need semble or an embedding model?
No. graphlore has its own search index: one chunk per function, method or
class, ranked with identifier-aware BM25, so graphlore_locate works in a
default install and every hit lands on its graph node. The [embed] extra adds
static code embeddings, which match a question to code that uses other words;
semble answers instead only when asked for (the [semble] extra and
GRAPHLORE_SEMANTIC_BACKEND=semble). Each reply's backend field says which
search answered.
→ The search bridge
Why do I see only 12 tools?
lean is the default surface. Set GRAPHLORE_TOOLSET=full for all 34.
How does the graph stay up to date?
graphlore_freshness says whether to update or rebuild, and
graphlore_build(".", update=True) re-extracts changed files. Answers also flag
their own files that changed since the build. A git post-commit hook or the
opt-in watcher automates it, and in Claude Code the plugin's hooks say when a
commit or an edit leaves the graph behind.
→ Keeping the graph fresh
Can it read several repositories at once?
Yes. Point it at a folder of git checkouts and build: the native engine builds
them as one graph, resolves each import in its own repository, links requests
to another repository's routes (a .graphlore-workspace.json names the hosts
each one serves), and freshness, diffs and reviews work per repository.
scope="api" narrows a tool to one of them.
→ Workspaces
Was this project called graphify-mcp?
Yes. It was renamed because graphifyy ships a graphify-mcp command of its
own. The old GRAPHIFY_* environment variables still work.
Known limits
One active project at a time;
graphlore_projectswitches it (stdio only). A folder of repositories can be that project (a workspace).graphlore's own extractor (
engine/, Rust, theengineextra) builds the graph: definitions, spans, imports, calls, bases and type references in 14 languages, resolved from the source, with its own communities and incremental updates. Without it thegraphifyCLI builds it; graphify, and with itgraphlore_addandmode="deep", goes in the next release.graphlore reviewreports on a change; it does not read or answer review threads.Calls through an object, a callback or dynamic dispatch are not in the graph, so an empty answer means "no edge was indexed", not "nothing calls this".
Documentation
Tool reference: all 34 tools, resources, prompts, what a result carries
MCP clients: setting up Codex, Gemini CLI, Cursor, Copilot, Kimi, Zed, Windsurf, Cline and Claude, and what each one shows the model
How graphlore works: resolved edges, import checks, analysis scope, freshness, the search bridge, naming communities
Configuration: toolsets, HTTP transport and security, offline mode, environment variables
Reviewing a change:
graphlore reviewand the GitHub Action, what the report holdsWorkspaces: several repositories built and read as one graph
Benchmark: method, cross-language results, caveats
Comparison: graphlore beside language servers, code search and other code-graph MCP servers, with sources
Native engine: graphlore's own extractor in Rust, compared with graphify on 31 repositories, and the roadmap
Development
pip install -e ".[dev,treesitter]"
ruff check .
mypy
pytest -qLicensed under MIT.
Available Tools
16 toolsgraphify_addA
Add an external source to the graph (arXiv paper, tweet, etc.). http/https only.
Args: url: Source URL to add. author: Original author tag (optional). contributor: Tag for who added it (optional).
Inputs: url (required), author, contributor. Returns: result
graphify_buildA
Build or update a knowledge graph from a folder. (Writes to graphify-out/.)
Args: path: Folder to extract the graph from (relative to the project dir or absolute). mode: "deep" -> more aggressive INFERRED edges; empty -> default. update: True -> re-extract only changed files and merge into the existing graph. cluster_only: True -> rerun clustering only, without re-extraction. no_viz: True -> skip the HTML visualization (faster for development).
Inputs: path, mode, update, cluster_only, +1 more. Returns: result
graphify_communitiesBRead-only
Summarize Leiden communities with sizes and sample members.
Inputs: as_json. Returns: result
graphify_explainCRead-only
Return everything Graphify knows about a node.
Inputs: node (required). Returns: result
graphify_freshnessARead-only
Check whether graph.json is stale relative to the current git HEAD.
Prefers the commit graphify recorded the graph was built from
(built_at_commit) over the file mtime — robust across checkouts where
mtime is reset — and flags both modified and newly-added (untracked) files.
Recommends graphify_build(update=True) if stale.
Inputs: as_json. Returns: result
graphify_god_nodesBRead-only
List the highest-degree (most connected) 'god nodes'.
Inputs: top_n, as_json. Returns: result
graphify_label_communitiesA
Give the Leiden communities human-readable names.
Args:
method: "auto" -> host-LLM sampling if the client supports it, else a
configured backend key (graphify CLI), else "Community N" placeholders.
"sampling" -> force host-LLM sampling (no API key needed).
"cli" -> force the graphify backend (GEMINI_API_KEY/OPENAI_API_KEY/...
or a local ollama). "placeholder" -> no LLM at all.
limit: Only the largest limit communities are named, to stay cheap.
sample_size: Member labels per community handed to the model.
Inputs: method, limit, sample_size, as_json. Returns: result
graphify_neighborsCRead-only
List the direct (1-hop) neighbors of a node, with relations.
Inputs: node (required), as_json. Returns: result
graphify_node_detailsCRead-only
Show a node's full metadata: type, source file/line, docstring, community.
Inputs: node (required), as_json. Returns: result
graphify_overviewARead-only
One-shot orientation: call this FIRST.
Returns graph size, top god nodes, community count, surprise-edge count and suggested starting questions — enough to plan further exploration cheaply.
Inputs: top_n, as_json. Returns: result
graphify_pathBRead-only
Find the exact path between two nodes (e.g. "DigestAuth" -> "Response").
Inputs: node_a (required), node_b (required). Returns: result
graphify_queryARead-only
Run a natural-language query against the graph.
Args: question: Natural-language question, e.g. "what connects attention to the optimizer?" dfs: True -> trace a specific path in depth. budget: If >0, cap the number of tokens returned (e.g. 1500).
Inputs: question (required), dfs, budget. Returns: result
graphify_sampling_statusARead-only
Capability test: how can semantic naming be produced in this session?
Reports whether the connected client supports host-LLM sampling (so the server needs no API key), whether a backend API key is configured as a fallback, and which method graphify_label_communities will pick.
Inputs: as_json. Returns: result
graphify_searchBRead-only
Search nodes by text in their name/label (case-insensitive).
Inputs: pattern (required), limit, as_json. Returns: result
graphify_subgraphARead-only
Extract a BFS subgraph around a node, capped at a token budget.
This is the token-cheap way to hand the model just the relevant slice of a large codebase instead of the whole graph.
Args: node: Center node (exact or fuzzy match). hops: BFS depth from the center. budget_tokens: Approximate cap on returned size; expansion stops when hit.
Inputs: node (required), hops, budget_tokens, as_json. Returns: result
graphify_surprisesCRead-only
List unexpected cross-file/cross-domain connections (surprise edges).
Inputs: limit, as_json. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 16 tools
Each tool has a clearly distinct purpose: adding sources, building graphs, checking freshness, exploring nodes and paths, analyzing communities, and querying. There is no overlap between tool functionalities.
All tools use the 'graphify_' prefix followed by descriptive names. While some are verbs (e.g., graphify_build) and others nouns (e.g., graphify_communities), the pattern is consistent and names clearly indicate tool purpose.
With 16 tools, the server covers the core operations for knowledge graph management—building, adding sources, exploring, and analyzing—without being bloated. Each tool serves a clear need.
The tool set covers building, adding, exploring, querying, and community analysis. Missing are tools for deletion or modification of nodes/edges, but the surface is largely complete for the intended exploration and building workflow.
Maintenance
Related MCP Connectors
Repository knowledge graph MCP server for codebase understanding and debugging.
An MCP server that gives your AI access to the source code and docs of all public github repos
Nifty's MCP server — exposes tasks, projects, messages, and files as tools for AI agents.
Persistent memory, knowledge graph, task management and more for AI agents via MCP.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceAn MCP server that transforms codebases into knowledge graphs using Neo4J, enabling AI assistants to understand code structure, relationships, and metrics for more context-aware assistance.28MIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server that builds a knowledge graph from code and text documents, enabling Q\&A and implementation planning via tools like graph_create, graph_plan, and graph_query.7MIT
- FlicenseNot gradedqualityDmaintenanceAn in-memory knowledge graph MCP server that gives coding agents structural and semantic recall over codebases by indexing Python source, ADR documents, and project configuration, exposing 7 tools for search, traversal, context retrieval, and natural-language Q&A.-
- AlicenseNot gradedqualityCmaintenanceA universal MCP server providing persistent, structured memory through a knowledge graph with graph storage, semantic vector search, and multi-hop traversal for AI agents and IDEs.60 PyPI1MIT