Give your LLM structural awareness of any codebase via MCP
Project description
Cassetto 🧠
Give your AI assistant structural awareness of any codebase.
The Problem
Your AI coding assistant can see your open files. It cannot see your architecture, call graph, or which functions break if you change something. It guesses — and gets it wrong.
The Solution
Cassetto indexes your codebase into a call graph + vector database + keyword index and serves 18 intelligence tools to your AI via MCP. Three commands, 60 seconds, everything local.
pip install cassetto
ollama pull nomic-embed-text
cassetto index . && cassetto setup
That's it. Your AI now calls Cassetto tools automatically — you just talk normally.
What Changes
| You ask | Without Cassetto | With Cassetto |
|---|---|---|
"What breaks if I refactor auth?" |
Guesses from nearby code | 10 exact callers with file:line |
| "What are the riskiest files?" | Can't know | Ranked by git churn × PageRank |
"Show me getColor source" |
Searches through files | Jumps to exact line, 26ms |
| "Find dead code" | Can't do cross-file analysis | Lists unused functions, 20ms |
| "Trace the data pipeline" | Struggles with cross-file flow | Call graph + import graph |
Benchmarks
Tested on a React + Django project (52 files, 129 symbols):
| Metric | Score |
|---|---|
| Tool Precision | 92% |
| Tool Recall | 91% |
| Search MRR (vs keyword baseline) | 0.475 vs 0.350 (1.4× uplift) |
blast_radius latency |
26ms |
find_dead_code latency |
20ms |
| Index throughput | 14.6 files/sec |
| Head-to-head vs keyword (7 questions) | Cassetto 5 – 1 |
Full benchmark report with raw outputs: eval/benchmark_report.html
Setup
Prerequisites
- Python 3.11+
- Ollama running locally
- Git installed
Install & Index
pip install cassetto
ollama pull nomic-embed-text
cd /path/to/your/project
cassetto index .
This parses all source files, generates embeddings, builds call/import graphs, analyzes git history, and stores everything locally in ~/.cassetto/.
Connect to Your AI
cassetto setup
Auto-configures MCP for Antigravity (Gemini/Claude), Claude Desktop, and Cursor. Restart your assistant and you're done.
All 18 Tools
Your AI calls these automatically. You never need to know they exist.
Search
| Tool | What it does |
|---|---|
search_code |
Hybrid BM25 + semantic search with graph-aware reranking |
get_repo_map |
PageRank-ranked map of the most important symbols |
Symbol Intelligence
| Tool | What it does |
|---|---|
find_references |
All callers/renderers/extenders of a symbol |
goto_definition |
Jump to where a symbol is defined, with full source |
find_implementations |
Classes that extend a base class |
explain_symbol |
Deep profile: definition + callers + callees + PageRank |
Graph Analysis
| Tool | What it does |
|---|---|
get_call_graph |
What calls this function and what it calls |
blast_radius |
Everything that transitively depends on a symbol |
find_dead_code |
Unreferenced functions (safe to delete) |
find_cycles |
Circular dependencies in the import graph |
Git Intelligence
| Tool | What it does |
|---|---|
get_hotspots |
Riskiest files (high churn × many authors) |
get_change_history |
Git log per file |
get_ownership |
Who owns each file |
get_change_coupling |
Files that always change together |
Architecture
| Tool | What it does |
|---|---|
get_architecture_summary |
Frameworks, layers, entry points |
find_entry_points |
Main files, routes, CLI commands |
get_imports |
Module dependency graph |
get_index_status |
Index health check |
How It Works
Your Code → tree-sitter AST → Chunks (functions, classes)
↓
┌─────────────┼─────────────┐
↓ ↓ ↓
LanceDB SQLite FTS5 DuckDB
(vectors) (keywords) (call graph)
↓ ↓ ↓
└─────────────┼─────────────┘
↓
MCP Server (18 tools)
↓
Your AI Assistant
- AST Parsing (tree-sitter) — Extracts functions, classes, methods as structured chunks across 13 languages
- Embeddings (Ollama) — 768-dim semantic vectors for each chunk
- Hybrid Search (LanceDB + SQLite) — Vector similarity + BM25 keyword matching, merged with Reciprocal Rank Fusion
- Call Graph (DuckDB) — Who-calls-what, component renders, class inheritance, with PageRank scoring
- Import Graph — Module dependencies, resolved to actual file paths
- Git Intelligence — Churn rates, ownership, change coupling from git history
- MCP Server (FastMCP) — Exposes everything as tools via JSON-RPC over stdio
Everything runs locally. No cloud, no API keys required.
CLI Reference
cassetto index [dir] # Index a project (default: current dir)
cassetto index . --force # Force full re-index
cassetto setup # Auto-configure MCP for your AI assistant
cassetto setup -p myproject # Configure with specific project ID
cassetto serve # Start MCP server manually
cassetto search "auth flow" # Quick search from terminal
cassetto watch . # Watch for changes, re-index live
Configuration
| Variable | Default | Description |
|---|---|---|
CASSETTO_PROJECT_ID |
folder name | Which indexed project to query |
CASSETTO_DATA_DIR |
~/.cassetto |
Where indexes are stored |
CASSETTO_EMBEDDING_BACKEND |
ollama |
ollama or voyage |
CASSETTO_OLLAMA_URL |
http://localhost:11434 |
Ollama server URL |
CASSETTO_GIT |
true |
Enable git analysis |
Supported Languages
Python · JavaScript · TypeScript · JSX · TSX · Go · Rust · Java · Ruby · PHP · C# · C · C++
Contributing
We welcome contributions! See CONTRIBUTING.md for setup instructions and Good First Issues if you're looking for a place to start.
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cassetto-1.0.0.tar.gz.
File metadata
- Download URL: cassetto-1.0.0.tar.gz
- Upload date:
- Size: 46.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1c0ca6484b7be77aec19d8e21f3cd102cc89b3dd927842a97d71d02df901bb7f
|
|
| MD5 |
d10c7aedb76fa2bf052162d185d12d51
|
|
| BLAKE2b-256 |
2cb09638c88b07b00b586a1d61b50b0323ec06052cc697bc5be7cdc09eb1ba6c
|
Provenance
The following attestation bundles were made for cassetto-1.0.0.tar.gz:
Publisher:
publish.yml on shahanxd/cassetto
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cassetto-1.0.0.tar.gz -
Subject digest:
1c0ca6484b7be77aec19d8e21f3cd102cc89b3dd927842a97d71d02df901bb7f - Sigstore transparency entry: 1644810013
- Sigstore integration time:
-
Permalink:
shahanxd/cassetto@db21850893bd143adf68de1647279753a8a4e4c8 -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/shahanxd
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@db21850893bd143adf68de1647279753a8a4e4c8 -
Trigger Event:
release
-
Statement type:
File details
Details for the file cassetto-1.0.0-py3-none-any.whl.
File metadata
- Download URL: cassetto-1.0.0-py3-none-any.whl
- Upload date:
- Size: 42.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
61be04362e1bb09c7ce1c722c466ce872af3d80d6d400dbd050a12a2f15a4f8f
|
|
| MD5 |
b9d8d2b2892120f738800468cde5981d
|
|
| BLAKE2b-256 |
adde717ad8734086e264273323162370f8fc951a25b5f37361f5a5af6f7b4850
|
Provenance
The following attestation bundles were made for cassetto-1.0.0-py3-none-any.whl:
Publisher:
publish.yml on shahanxd/cassetto
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cassetto-1.0.0-py3-none-any.whl -
Subject digest:
61be04362e1bb09c7ce1c722c466ce872af3d80d6d400dbd050a12a2f15a4f8f - Sigstore transparency entry: 1644810109
- Sigstore integration time:
-
Permalink:
shahanxd/cassetto@db21850893bd143adf68de1647279753a8a4e4c8 -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/shahanxd
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@db21850893bd143adf68de1647279753a8a4e4c8 -
Trigger Event:
release
-
Statement type: