Detects Express.js handlers and middleware patterns to trace end-to-end execution flows from entry points through the call graph.
Analyzes repository history to identify file change coupling and performs structural branch comparisons using git worktrees to identify added, modified, or removed symbols.
Indexes JavaScript source code to map relationships between functions and classes, with specific detection for common handler and middleware patterns.
Supports Neo4j as a backend for storing the codebase knowledge graph, allowing users to execute raw Cypher queries to explore code relationships.
Provides deep structural analysis of Python codebases, extracting symbols, types, and framework-specific entry points such as Flask/FastAPI routes and Click commands.
Performs structural and type analysis on TypeScript projects, extracting type references, interface implementations, and class inheritance hierarchies.
Click on "Install 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., "@AxonWhat breaks if I change the handleRequest function?"
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.
Axon
Graph-powered code intelligence engine — indexes your codebase into a knowledge graph and exposes it via MCP tools for AI agents and a CLI for developers.
Most code intelligence tools treat your codebase as flat text. Axon builds a structural graph — every function, class, import, call, type reference, and execution flow becomes a node or edge in a queryable knowledge graph. AI agents using Axon don't just search for keywords; they understand how your code is connected.
Why Axon?
For AI agents (Claude Code, Cursor):
"What breaks if I change this function?" → blast radius via call graph + type references + git coupling
"What code is never called?" → dead code detection with framework-aware exemptions
"Show me the login flow end-to-end" → execution flow tracing from entry points through the call graph
"Which files always change together?" → git history change coupling analysis
For developers:
Instant answers to architectural questions without grepping through files
Find dead code, tightly coupled files, and execution flows automatically
Raw Cypher queries against your codebase's knowledge graph
Watch mode that re-indexes on every save
Zero cloud dependencies. Everything runs locally — parsing, graph storage, embeddings, search. No API keys, no data leaving your machine.
Features
11-Phase Analysis Pipeline
Axon doesn't just parse your code — it builds a deep structural understanding through 11 sequential analysis phases:
Phase | What It Does |
File Walking | Walks repo respecting |
Structure | Creates File/Folder hierarchy with CONTAINS relationships |
Parsing | tree-sitter AST extraction — functions, classes, methods, interfaces, enums, type aliases |
Import Resolution | Resolves import statements to actual files (relative, absolute, bare specifiers) |
Call Tracing | Maps function calls with confidence scores (1.0 = exact match, 0.5 = fuzzy) |
Heritage | Tracks class inheritance (EXTENDS) and interface implementation (IMPLEMENTS) |
Type Analysis | Extracts type references from parameters, return types, and variable annotations |
Community Detection | Leiden algorithm clusters related symbols into functional communities |
Process Detection | Framework-aware entry point detection + BFS flow tracing |
Dead Code Detection | Multi-pass analysis with override, protocol, and decorator awareness |
Change Coupling | Git history analysis — finds files that always change together |
Hybrid Search (BM25 + Vector + RRF)
Three search strategies fused with Reciprocal Rank Fusion:
BM25 full-text search — fast exact name and keyword matching via KuzuDB FTS
Semantic vector search — conceptual queries via 384-dim embeddings (BAAI/bge-small-en-v1.5)
Fuzzy name search — Levenshtein fallback for typos and partial matches
Test files are automatically down-ranked (0.5x), source-level functions/classes boosted (1.2x).
Dead Code Detection
Finds unreachable symbols with intelligence — not just "zero callers" but a multi-pass analysis:
Initial scan — flags functions/methods/classes with no incoming calls
Exemptions — entry points, exports, constructors, test code, dunder methods,
__init__.pypublic symbols, decorated functions,@propertymethodsOverride pass — un-flags methods that override non-dead base class methods (handles dynamic dispatch)
Protocol conformance — un-flags methods on classes conforming to Protocol interfaces
Protocol stubs — un-flags all methods on Protocol classes (interface contracts)
Impact Analysis (Blast Radius)
When you're about to change a symbol, Axon traces upstream through:
Call graph — every function that calls this one, recursively
Type references — every function that takes, returns, or stores this type
Git coupling — files that historically change alongside this one
Community Detection
Uses the Leiden algorithm (igraph + leidenalg) to automatically discover functional clusters in your codebase. Each community gets a cohesion score and auto-generated label based on member file paths.
Execution Flow Tracing
Detects entry points using framework-aware patterns:
Python:
@app.route,@router.get,@click.command,test_*functions,__main__blocksJavaScript/TypeScript: Express handlers, exported functions,
handler/middlewarepatterns
Then traces BFS execution flows from each entry point through the call graph, classifying flows as intra-community or cross-community.
Change Coupling (Git History)
Analyzes 6 months of git history to find hidden dependencies that static analysis misses:
Files with coupling strength ≥ 0.3 and 3+ co-changes get linked. Surfaces coupled files in impact analysis.
Watch Mode
Live re-indexing powered by a Rust-based file watcher (watchfiles):
File-local phases (parse, imports, calls, types) run immediately on change
Global phases (communities, processes, dead code) batch every 30 seconds
Branch Comparison
Structural diff between branches using git worktrees (no stashing required):
Supported Languages
Language | Extensions | Parser |
Python |
| tree-sitter-python |
TypeScript |
| tree-sitter-typescript |
JavaScript |
| tree-sitter-javascript |
Installation
Requires Python 3.11+.
From Source
Quick Start
1. Index Your Codebase
2. Query It
3. Keep It Updated
CLI Reference
MCP Integration
Axon exposes its full intelligence as an MCP server, giving AI agents like Claude Code and Cursor deep structural understanding of your codebase.
Setup for Claude Code
Add to your .claude/settings.json or project .mcp.json:
This starts the MCP server with live file watching — the knowledge graph updates automatically as you edit code. To run without watching, use "args": ["mcp"] instead.
Or run the setup helper:
Setup for Cursor
Add to your Cursor MCP settings:
Or run:
MCP Tools
Once connected, your AI agent gets access to these tools:
Tool | Description |
| List all indexed repositories with stats |
| Hybrid search (BM25 + vector + fuzzy) across all symbols |
| 360-degree view — callers, callees, type refs, community, processes |
| Blast radius — all symbols affected by changing the target |
| List all unreachable symbols grouped by file |
| Map a |
| Execute read-only Cypher queries against the knowledge graph |
Every tool response includes a next-step hint guiding the agent through a natural investigation workflow:
MCP Resources
Resource URI | Description |
| Node and relationship counts by type |
| Full dead code report |
| Graph schema reference for writing Cypher queries |
Knowledge Graph Model
Nodes
Label | Description |
| Source file |
| Directory |
| Top-level function |
| Class definition |
| Method within a class |
| Interface / Protocol definition |
| Type alias |
| Enumeration |
| Auto-detected functional cluster |
| Detected execution flow |
Relationships
Type | Description | Key Properties |
| Folder → File/Symbol hierarchy | — |
| File → Symbol it defines | — |
| Symbol → Symbol it calls |
|
| File → File it imports from |
|
| Class → Class it extends | — |
| Class → Interface it implements | — |
| Symbol → Type it references |
|
| File → Symbol it exports | — |
| Symbol → Community it belongs to | — |
| Symbol → Process it participates in |
|
| File → File that co-changes with it |
|
Node ID Format
Architecture
Tech Stack
Layer | Technology | Purpose |
Parsing | tree-sitter | Language-agnostic AST extraction |
Graph Storage | KuzuDB | Embedded graph database with Cypher, FTS, and vector support |
Graph Algorithms | igraph + leidenalg | Leiden community detection |
Embeddings | fastembed | ONNX-based 384-dim vectors (~100MB, no PyTorch) |
MCP Protocol | mcp SDK (FastMCP) | AI agent communication via stdio |
CLI | Typer + Rich | Terminal interface with progress bars |
File Watching | watchfiles | Rust-based file system watcher |
Gitignore | pathspec | Full |
Storage
Everything lives locally in your repo:
Add .axon/ to your .gitignore.
The storage layer is abstracted behind a StorageBackend Protocol — KuzuDB is the default, with an optional Neo4j backend available via pip install axoniq[neo4j].
Example Workflows
"I need to refactor the User class — what breaks?"
"Is there dead code we should clean up?"
"What are the main execution flows in our app?"
"Which parts of the codebase are most tightly coupled?"
How It Compares
Capability | grep/ripgrep | LSP | Axon |
Text search | Yes | No | Yes (hybrid BM25 + vector) |
Go to definition | No | Yes | Yes (graph traversal) |
Find all callers | No | Partial | Yes (full call graph with confidence) |
Type relationships | No | Yes | Yes (param/return/variable roles) |
Dead code detection | No | No | Yes (multi-pass, framework-aware) |
Execution flow tracing | No | No | Yes (entry point → flow) |
Community detection | No | No | Yes (Leiden algorithm) |
Change coupling (git) | No | No | Yes (6-month co-change analysis) |
Impact analysis | No | No | Yes (calls + types + git coupling) |
AI agent integration | No | Partial | Yes (full MCP server) |
Structural branch diff | No | No | Yes (node/edge level) |
Watch mode | No | Yes | Yes (Rust-based, 500ms debounce) |
Works offline | Yes | Yes | Yes |
Development
License
MIT
Built by @harshkedia177