Context+ is an MCP server designed for developers who demand 99% accuracy. By combining Tree-sitter AST parsing & Spectral Clustering, Context+ turns a massive codebase into a searchable, hierarchical graph.
“Context+ is the best thing that has happened to my agent.” Give it the semantic understanding it deserves. Add Context+ to your IDE by pasting the following JSON into your MCP configuration file.
Before using Context+, make sure Ollama is running and install the required models (for example, nomic-embed-text and gemma2:27b). Get your Ollama Cloud API key hereCopy the instruction file into your project root to teach your agent fast execute mode, line-numbered symbol retrieval, strict formatting rules, and anti-patterns that keep context lean and precise.
Context+ guarantees minimal context bloat. It gives your agent deep semantic understanding of your codebase, from AST parsing and symbol navigation to blast radius analysis and commit validation. Nothing misses the context.
get_context_tree | Get the structural AST tree of a project with file headers plus line-numbered function/class/method symbols. Dynamic token-aware pruning shrinks output automatically. INPUT{
target_path?: string,
depth_limit?: number,
include_symbols?: boolean,
max_tokens?: number
}OUTPUT"src/
index.ts — Entry point
function: getStars() (L170-L181)
function: Home() (L183-L760)
utils/
parser.ts — AST parsing
function: parseFile() (L22-L84)
function: walkTree() (L86-L132)" |
get_file_skeleton | Get function signatures, class methods, and type definitions of a file with line ranges, without reading the full body. INPUT{ file_path: string }OUTPUT"[function] L12-L58 export function parseFile(
filePath: string,
options?: ParseOptions
): Promise<AST>;
[class] L60-L130 export class Walker;
[method] L72-L94 walk(node: Node): void;
[method] L96-L118 getSymbols(): Symbol[];" |
semantic_code_search | Search the codebase by meaning, not exact text. Uses embeddings over file headers/symbols and returns matched definition lines. INPUT{ query: string, top_k?: number }OUTPUT"1. src/auth/jwt.ts (94.0% total)
Semantic: 91.5% | Keyword: 96.2%
Definition lines: verifyToken@L20-L58, signToken@L60-L102
2. src/auth/session.ts (87.4% total)
Definition lines: createSession@L12-L42" |
semantic_identifier_search | Find closest functions/classes/variables by meaning, then return ranked definition and call-chain locations with line numbers. Uses realtime-refreshed identifier embeddings. INPUT{
query: string,
top_k?: number,
top_calls_per_identifier?: number,
include_kinds?: string[]
}OUTPUT"1. function verifyToken — src/auth/jwt.ts (L20-L58)
Score: 92.4%
Calls (3/3):
1. src/middleware/guard.ts:L33 (88.1%) verifyToken(token)
2. src/routes/api.ts:L12 (84.7%) const user = verifyToken(raw)
2. variable tokenExpiry — src/auth/config.ts (L8)" |
get_blast_radius | Before modifying code, trace every file and line where a symbol is imported or used. Prevents orphaned references. INPUT{
symbol_name: string,
file_context?: string
}OUTPUT"parseFile — 7 usages
src/index.ts:14 import { parseFile }
src/tools/tree.ts:8 const ast = parseFile(p)
src/tools/skeleton.ts:22 parseFile(path)
test/parser.test.ts:5 import { parseFile }" |
run_static_analysis | Run the native linter or compiler to find unused variables, dead code, and type errors. Supports TypeScript, Python, Rust, Go. INPUT{ target_path?: string }OUTPUT"src/utils.ts:14:5
error TS2345: Argument of type string
is not assignable to parameter
src/old.ts:1:1
warning: file has no exports" |
propose_commit | The only way to write code. Validates against strict rules before saving. Creates a shadow restore point before writing. INPUT{
file_path: string,
new_content: string
}OUTPUT"✓ Header comment present
✓ No inline comments
✓ Max nesting depth: 3
✓ File length: 142 lines
Saved src/tools/search.ts
Restore point: rp-1719384000-a3f2" |
list_restore_points | List all shadow restore points created by propose_commit. Each captures file state before AI changes. INPUT{ }OUTPUT"rp-1719384000-a3f2 | 2025-06-26
src/tools/search.ts | refactor search
rp-1719383000-b7c1 | 2025-06-26
src/index.ts | add new tool" |
undo_change | Restore files to their state before a specific AI change. Uses shadow restore points. Does not affect git. INPUT{ point_id: string }OUTPUT"Restored 1 file(s):
src/tools/search.ts" |
semantic_navigate | Browse codebase by meaning using spectral clustering. Groups semantically related files into labeled clusters. INPUT{
max_depth?: number,
max_clusters?: number
}OUTPUT"Authentication (4 files)
src/auth/jwt.ts
src/auth/session.ts
src/middleware/guard.ts
src/models/user.ts
Parsing (3 files)
src/core/parser.ts
src/core/tree-sitter.ts
src/core/walker.ts" |
get_feature_hub | Obsidian-style feature hub navigator. Hubs are .md files with [[wikilinks]] that map features to code files. INPUT{
hub_path?: string,
feature_name?: string,
show_orphans?: boolean
}OUTPUT"## auth.md
[[src/auth/jwt.ts]]
→ verifyToken(token: string)
→ signToken(payload: object)
[[src/auth/session.ts]]
→ createSession(userId: string)
→ destroySession(id: string)" |
“Context engineering is the delicate art and science of filling the context window with just the right information for the next step.”
- Andrej Karpathy