LLMem is an MCP (Model Context Protocol) server that provides interactive graph visualization of your codebase's import dependencies and function calls, alongside tools for generating architectural documentation.
Works with:
- Claude Code β as a CLI plugin with live-reloading webview
- Antigravity IDE / VS Code β as an extension with integrated panel
By pre-computing dependency graphs and structural summaries, LLMem allows MCP agents to provide rich codebase context without additional reasoning or searching. This reduces output tokens and enables broader codebase understanding in a single query.
Note: This project started December 11th, 2025 and is in the alpha stage. I am a team of one, developing this as a hobby. It will always stay free and open-source. If you find issues or have suggestions, please don't hesitate to contact me. You can find more information on the design of the project, and other topics on my personal website and (soon) substack.
- Dual Platform: Works as a Claude Code CLI plugin or VS Code/Antigravity extension
- MCP-Native: Full Model Context Protocol support for AI-powered codebase analysis
- Graph Visualization: Interactive visualization of import dependencies and function calls
- Code Intelligence: Structural analysis (imports, exports, function signatures) using Tree-sitter parsers
- Shadow Filesystem: Maintains a parallel
.arch/directory with AI-generated documentation - Live Reload: Graph server watches for changes and auto-updates the visualization
Important
Call graphs are TypeScript/JavaScript only. Other languages (Python, C++, Rust, R) support import graphs only.
LLMem uses tree-sitter for fast, reliable parsing. TypeScript/JavaScript also uses the compiler API for full call graph support.
| Language | Extensions | Parser | Import Graph | Call Graph |
|---|---|---|---|---|
| TypeScript | .ts, .tsx |
TS Compiler API | β | β |
| JavaScript | .js, .jsx |
TS Compiler API | β | β |
| Python | .py |
tree-sitter | β | β |
| C/C++ | .c, .h, .cpp, .hpp, .cc, .cxx, .hxx |
tree-sitter | β | β |
| Rust | .rs |
tree-sitter | β | β |
| R | .R, .r |
tree-sitter | β | β |
To enable additional languages, install the corresponding tree-sitter grammar:
npm install tree-sitter-python # Python support
npm install tree-sitter-cpp # C/C++ support
npm install tree-sitter-rust # Rust support
npm install @davisvaughan/tree-sitter-r # R supportTip
TypeScript/JavaScript works out of the box. Other languages require installing their grammar package.
Prerequisites:
- Node.js (v18+)
- Claude Code CLI, Antigravity IDE, or VS Code
-
Clone and build
git clone https://github.com/llmem/llmem.git cd llmem npm install npm run build:claude -
(Optional) Add language support β install grammars for languages you need:
npm install tree-sitter-python tree-sitter-cpp # etc. -
Add to Claude Code config (
~/.config/claude/config.jsonorsettings.json):{ "mcpServers": { "llmem": { "command": "node", "args": ["/path/to/llmem/dist/claude/index.js"] } } } -
Start the graph server (in your project directory):
npm run serve
This starts a live-reloading webview at
http://localhost:3000.
Note
dist/claude/index.js (the MCP server) and npm run serve (the graph server) are two separate processes. The MCP server handles tool calls from Claude; the graph server serves the visualization UI. Both must be running for the full experience.
-
Clone and build
git clone https://github.com/llmem/llmem.git cd llmem npm install npm run packageThis creates a
.vsixfile in the project root. -
(Optional) Add language support β install grammars for languages you need:
npm install tree-sitter-python tree-sitter-cpp # etc. -
Install the VSIX
code --install-extension llmem-0.1.0.vsix # or for Antigravity: antigravity --install-extension llmem-0.1.0.vsix
For contributors:
-
Clone and install
git clone https://github.com/llmem/llmem.git cd llmem npm install -
Build
npm run build:all # Build both VS Code extension and Claude CLI -
Run
- VS Code/Antigravity: Press
F5to launch Extension Development Host - Claude CLI: Run
npm run serveto start the graph server
- VS Code/Antigravity: Press
LLMem works in two stages: graph visualization and documentation generation (via MCP tools).
-
Start the graph server in your project:
npm run serve
This opens the webview at
http://localhost:3000with live reload. -
Toggle watched files in the left panel β click the circles next to files/folders to include them in the graph.
-
Use MCP tools via Claude:
- "Run mcp folder_info on src/graph"
- "Run mcp file_info on src/mcp/tools.ts"
-
Open the LLMem Panel via command palette (
Ctrl+Shift+P):LLMem: Open View Panel -
Toggle watched files β grey circles = unwatched, green = watched.
-
Use MCP tools via the IDE's agent.
The graph displays:
- Import edges: File-to-file import dependencies (all languages)
- Call edges: Function-to-function call relationships (TypeScript/JavaScript only)
Controls:
- Pan: Click and drag
- Zoom: Mouse wheel
- Select: Click a node to highlight connections
Tip
Toggle an entire folder to watch all files within it at once.
| Tool | Purpose |
|---|---|
folder_info |
Get folder structure + prompt for LLM documentation |
file_info |
Get file details + prompt for LLM documentation |
report_folder_info |
Save LLM-generated folder docs to .arch/{folder}/README.md |
report_file_info |
Save LLM-generated file docs to .arch/{file}.md |
inspect_source |
Read specific line ranges from source files |
open_window |
Open the LLMem panel in the IDE |
Important
MCP documentation tools require the graph to be computed first. Make sure to toggle watched files before generating summaries.
User β MCP Agent (Claude Code / Antigravity) β LLMem MCP Server
- User: Asks a question about the codebase
- Agent: Calls MCP tools to gather context
- LLMem:
- Parses code using Tree-sitter (TS Compiler API for TypeScript/JavaScript)
- Builds import/call graphs from edge list data
- Generates documentation prompts for the LLM
- Saves documentation to
.arch/directory
- Agent: Uses the context to answer the User
| Command | Description |
|---|---|
npm run build:all |
Build everything (VS Code + Claude CLI) |
npm run build:vscode |
Build VS Code extension only |
npm run build:claude |
Build Claude CLI only |
npm run watch |
Watch mode for TypeScript |
npm run serve |
Start graph server with live reload |
npm test |
Run tests |
| Directory | Description |
|---|---|
src/extension |
VS Code/Antigravity IDE integration |
src/claude |
Claude Code CLI plugin and graph server |
src/mcp |
MCP server implementation and tool handlers |
src/parser |
Tree-sitter parsers for code analysis |
src/graph |
EdgeList data structures for imports and calls |
src/info |
Information extraction for documentation |
src/webview |
Interactive graph visualization UI |
src/artifact |
Shadow filesystem (.arch/) management |
LLMem exposes three settings (configurable in VS Code settings or via environment):
| Setting | Default | Description |
|---|---|---|
artifactRoot |
.artifacts |
Directory for edge lists and generated webview files |
maxFilesPerFolder |
20 |
Maximum files processed per folder analysis |
maxFileSizeKB |
512 |
Files larger than this are skipped during analysis |
The MCP server determines the workspace root in this priority order:
- Root stored in extension context (set when the extension activates)
LLMEM_WORKSPACEenvironment variable- Auto-detect by walking up from cwd, looking for
.arch,.artifacts, orpackage.json - Fallback to current working directory
Claude Desktop β config file location:
- Linux/macOS:
~/.config/claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"llmem": {
"command": "node",
"args": ["/absolute/path/to/llmem/dist/claude/index.js"],
"env": {
"LLMEM_WORKSPACE": "/absolute/path/to/your/project"
}
}
}
}Claude Code β config file location:
- Linux/macOS:
~/.config/claude/config.json - Windows:
%APPDATA%\Claude\config.json
{
"mcpServers": {
"llmem": {
"command": "node",
"args": ["/absolute/path/to/llmem/dist/claude/index.js"]
}
}
}VS Code β .vscode/settings.json in your project:
{
"llmem.artifactRoot": ".artifacts",
"llmem.maxFilesPerFolder": 20,
"llmem.maxFileSizeKB": 512
}When running as a standalone MCP server (Claude Code / Claude Desktop), report_file_info and report_folder_info may save the generated .arch/ files to the application data directory instead of your project workspace.
Workaround: After calling report_file_info or report_folder_info, copy the generated content manually to the correct .arch/ path in your workspace.
This is a known limitation of the standalone MCP server mode and will be fixed in a future release.
This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.
