Codebase Context MCP Tools for Claude Code
I compare Serena, XERJ, Graphicle, Graphify and Vesalius for giving Claude Code codebase context: setup, pricing, license and honest caveats.
By agentools
- Serena: Symbol-level navigation and refactoring
- XERJ: Ranked search across code, docs and reference repos
- Graphicle: A local code graph plus project memory you approve
- Graphify: A visual knowledge graph of an unfamiliar project
- Vesalius: Read-only usages and architecture answers on a Mac
For most people I would start with Serena. It is free and open source, and it gives Claude Code symbol-level lookup and editing through language servers. If you want ranked search across code, docs and other repos, pick XERJ. If you want a code graph plus project memory you approve, try Graphicle. If you work on an Apple silicon Mac, Vesalius is worth a look.
When Claude Code needs to understand a repo, it usually greps for a string and cats whole files. That works, but every file it reads goes into the context window. Text search also misses some things, like uses that only show up through type inference. A codebase context MCP server lets the agent ask better questions: where this symbol is, who calls it, and which passage answers the question. The result includes the file and line.
These tools fall into two families. Semantic or symbol tools (Serena, Vesalius) work with functions, classes and references, much like an IDE does. Graph and search index tools (XERJ, Graphicle, Graphify) build an index or knowledge graph first and let the agent query it. Graphify is a skill and CLI rather than an MCP server.
At a glance
| Tool | Best for | Pricing | Type |
|---|---|---|---|
| Symbol-level navigation and refactoring | Open source | MCP Server | |
| Ranked search across code, docs and reference repos | Open source | MCP Server | |
Graphicle | A local code graph plus project memory you approve | Open source | CLI + MCP server + local app |
Graphify | A visual knowledge graph of an unfamiliar project | Open source + cloud | CLI + agent skill |
Vesalius | Read-only usages and architecture answers on a Mac | Open source | MCP server + CLI + Mac app |
The 5 picks
1. Serena
The IDE for your coding agent
Serena by Oraios is an MCP toolkit that gives coding agents IDE-level symbol tools. It uses language servers for symbol-level retrieval and editing, cross-file rename, move and find references. It works with Claude Code, Codex, Cursor, Copilot and others, and has about 31k GitHub stars.
uv tool install -p 3.13 serena-agent
serena init
serena setup claude-code
To add it by hand for all projects instead:
claude mcp add --scope user serena -- serena start-mcp-server --context claude-code --project-from-cwd
Don't install it from an MCP or plugin marketplace. The docs warn that those listings have outdated commands.
Pricing and license: free and open source (GPL-3.0-or-later for the app, MIT for the SolidLSP components).
Caveat: some languages need extra language server dependencies. The docs also say Claude Code sometimes fails to use Serena's tools or forgets them in long sessions. Serena provides reminder hooks (alpha) for this, and the docs suggest export MCP_TIMEOUT=60000 if it starts slowly.
Pricing: Open sourceMCP Server
2. XERJ
Local search engine so coding agents stop reading files one by one
XERJ is an open-source local search engine written in Rust and shipped as a single static binary. It autoindexes a folder (code, docs, logs, PDFs) and serves BM25, vector (kNN) and hybrid search with file:line results. That way the agent queries ranked passages instead of running grep and cat. It ships an MCP server plus a skill, go-to-definition lookups, an agent memory namespace (/_memory) and an Elasticsearch-compatible API.
The main use case in its docs is reference coding: the agent clones and indexes open-source repos close to the task, then searches them to see how they solved a problem. The project's own case study reports 2.7x fewer output tokens at the same solve rate.
curl -fsSL https://xerj.org/get | sh
xerj init
xerj autoindex ~/my-project
xerj init sets it up in Claude Code or Cursor as an MCP server plus a skill.
Pricing and license: free and open source (Apache-2.0), about 18.7k stars.
Caveat: the --insecure dev mode turns off TLS and auth. It is meant only for a single user on localhost.
Pricing: Open sourceMCP Server

3. Graphicle
Code graph and project memory for coding agents in one local Rust program
Graphicle by KarLex AI is a local Rust program. It has a tree-sitter code graph (files, functions, classes, calls, imports, plus impact and shortest path). It also builds project memory from docs (Markdown, PDF, Office, HTML), decisions, and captured Claude Code and Codex sessions. It returns cited excerpts (file and line) within a token budget you set, and its tools call no model.
When the agent proposes a memory, it waits for your approval in a local web app (graphicle open). Each memory is tied to a function and goes stale when that code changes. Everything lives in one SQLite file, with no account, no API key and no telemetry.
brew install graphicle-ai/tap/graphicle
graphicle setup
Without Homebrew:
curl -fsSL https://github.com/graphicle-ai/graphicle/releases/latest/download/install.sh | sh
graphicle setup indexes your project, connects the agents it finds (Claude Code, Codex, Cursor, VS Code, Claude Desktop) through one MCP server, and installs Git hooks. graphicle disconnect undoes it.
Pricing and license: free and open source (Apache-2.0).
Caveat: it is young (about 490 stars). Its code graph engine is a Rust port of Graphify. The README says it tied grep at finding code in their tests, and the authors don't claim token savings. It did beat Graphify on indexing speed and fact recall.
Pricing: Open sourceCLI + MCP server + local app

4. Graphify
Turns a codebase and its docs into a knowledge graph your coding agent can query
Graphify by Graphify Labs (YC S26) is a /graphify skill and CLI. It maps a project (code, docs, SQL schemas, configs, PDFs, images, video) into a knowledge graph, so the assistant follows relationships instead of grepping. Code is parsed locally and deterministically with tree-sitter, with no embeddings or vector store. Each edge is marked as either extracted from source or inferred. Docs, PDFs and images get a semantic pass with your assistant's model or an API key you configure.
You get an interactive graph.html, a GRAPH_REPORT.md with key concepts and suggested questions, and a graph.json that you can query later with the CLI's explain and path commands. It works with Claude Code, Cursor, Codex, Gemini CLI, Copilot and more, and has about 140k GitHub stars.
uv tool install graphifyy
graphify install
Then run /graphify . inside the assistant.
Pricing and license: the CLI is free under Apache-2.0. Graphify Cloud is paid (cross-repo graphs, code review, connectors like Sentry and Jira) and has a 14-day trial.
Caveat: it is a skill and CLI, not an MCP server.
Pricing: Open source + cloudCLI + agent skill

5. Vesalius
A local code map for Claude Code: callers, dependencies and feature locations in one MCP call instead of a chain of greps
Vesalius by Haplo, LLC indexes your repo locally into a graph of files, symbols and references. It has five read-only MCP tools: usages, feature_map, outline, architecture and dependency_cycles. usages finds callers and uses, including type-inferred ones that text search misses, and includes a completeness check. Answers include file:line. A CLI, a Mac app and a VS Code extension share the same index.
Swift gets a full syntax tree. TypeScript, JavaScript and Python are parsed with tree-sitter, and a dozen other languages are read lexically. It makes no network requests, has no accounts or telemetry, and never writes to your repo. The project ran its own benchmark of 20 questions across 6 codebases. A typical question used 51% fewer tokens with no measurable change in overall answer quality, though answers about where a feature lives scored about 2 points lower.
brew install haplollc/tap/vesalius
vesalius setup
vesalius setup registers it with Claude Code for every project and auto-allows its read-only tools. vesalius setup --undo reverses it.
Pricing and license: free and open source (MIT).
Caveat: it needs a Mac with Apple silicon on macOS 15 or later. It is also very young (about 80 stars, repo created October 2026).
Pricing: Open sourceMCP server + CLI + Mac app
More to consider
Comparison table
| Tool | Approach | Runs on | Claude Code setup | MCP support | Pricing | Open source |
|---|---|---|---|---|---|---|
| Serena | Symbol tools via language servers | Local | serena setup claude-code |
Yes | Free | Yes (GPL-3.0-or-later, MIT parts) |
| XERJ | BM25, vector and hybrid search index | Local, single binary | xerj init |
Yes, plus skill | Free | Yes (Apache-2.0) |
| Graphicle | Code graph plus project memory | Local, one SQLite file | graphicle setup |
Yes | Free | Yes (Apache-2.0) |
| Graphify | Knowledge graph of code and docs | Local CLI, optional paid Cloud | graphify install, then /graphify . |
No (skill and CLI) | Free CLI, paid Cloud | Yes (Apache-2.0 CLI) |
| Vesalius | Read-only symbol and reference graph | Apple silicon Mac, macOS 15+ | vesalius setup |
Yes (5 read-only tools) | Free | Yes (MIT) |
How I would choose
- You want the agent to navigate and edit by symbol (rename, move, find references): start with Serena.
- You need ranked passages across a lot of text, or want the agent to learn from other open-source repos: use XERJ.
- You want docs and decisions next to the code graph, and you want to approve what the agent remembers: try Graphicle. Don't expect much better code search, since its own tests tied grep.
- You are new to a project, want a map and a report, and don't need MCP: use Graphify.
- You are on an Apple silicon Mac and mostly ask who calls what: Vesalius is small and read-only.
- You want memory across sessions: see my memory tools article.
- You need library and framework docs, not your own code: use Context7.
FAQ
What is a codebase context MCP server?
It is an MCP server that gives the agent structured ways to look at your code (symbols, references, graph queries, ranked passages) instead of grep and cat. Results usually point to a file and line.
Do these tools actually save tokens?
The only numbers come from the projects themselves. Vesalius reports 51% fewer tokens on a typical question. XERJ reports 2.7x fewer output tokens at the same solve rate. Graphicle doesn't claim any savings. Test them on your own repo.
Is Graphify an MCP server?
No, it is a skill and CLI. You run /graphify . in the assistant and query the saved graph later.
Do they work outside Claude Code?
Mostly, yes. Serena, Graphicle and Graphify support Codex and Cursor among others. XERJ can be set up in Cursor, and Vesalius has a CLI, a Mac app and a VS Code extension.
Does my code leave my machine?
Graphicle has no account, API key or telemetry, and Vesalius makes no network requests. Graphify parses code locally, but docs, PDFs and images go through your assistant's model or an API key you configure.
