Context+
Context+ is a semantic intelligence MCP server that transforms large codebases into searchable, hierarchical graphs — combining AST parsing, vector embeddings, spectral clustering, and a persistent memory graph for AI-assisted engineering.
Discovery & Navigation
get_context_tree— Structural AST tree with file headers, function/class names, and line ranges; auto-prunes based on project sizeget_file_skeleton— View function signatures, class methods, and type definitions without reading full file bodiessemantic_code_search— Search by meaning using embeddings over file headers and symbolssemantic_identifier_search— Identifier-level semantic search for functions/classes/variables with ranked call sites and line numberssemantic_navigate— Browse the codebase by meaning using spectral clustering to group semantically related files into labeled clusters
Analysis
get_blast_radius— Trace every file and line where a symbol is imported or used before modifying/deleting itrun_static_analysis— Run native linters/compilers (TypeScript, Python, Rust, Go) to find unused variables, dead code, and type errors
Code Operations
propose_commit— The only way to write code; validates formatting rules and creates a shadow restore point before savingget_feature_hub— Navigate Obsidian-style feature hubs (.mdfiles with[[wikilinks]]) mapping features to code files; identifies orphaned files
Version Control (Shadow Restore)
list_restore_points— List all shadow restore points created before AI editsundo_change— Restore files to their pre-AI-change state without affecting Git history
Memory Graph & RAG
upsert_memory_node— Create or update a memory node (concept, file, symbol, or note) with auto-generated embeddingscreate_relation— Create typed edges between nodes (relates_to,depends_on,implements,references, etc.) with time-decayed weightssearch_memory_graph— Semantic search with graph traversal — finds direct matches then walks 1st/2nd-degree neighborsretrieve_with_traversal— Start from a specific node and walk the graph outward, scoring neighbors by decay and depthadd_interlinked_context— Bulk-add nodes with automatic similarity linking (cosine ≥ 0.72 creates edges automatically)prune_stale_links— Remove decayed edges and orphan nodes to keep the graph lean
Manages codebase changes via a shadow restore system that tracks file states before AI modifications, allowing undos without impacting the project's Git history.
Supports Obsidian-style feature hub navigation by using markdown files and wikilinks to map high-level features to their corresponding code files.
Integrates with Ollama to provide semantic intelligence, including vector embeddings for code search and chat models for labeling semantic file clusters.
Provides static analysis tools for Python codebases to detect unused variables, dead code, and type errors.
Provides static analysis tools for Rust codebases to detect unused variables, dead code, and type errors.
Provides static analysis tools for TypeScript codebases to detect unused variables, dead code, and type errors.
Click on "Deploy 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., "@Context+ show the blast radius of changing the 'processPayment' 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.
Context+
Semantic Intelligence for Large-Scale Engineering.
Context+ is an MCP server designed for developers who demand 99% accuracy. By combining RAG, Tree-sitter AST, Spectral Clustering, and Obsidian-style linking, Context+ turns a massive codebase into a searchable, hierarchical feature graph.
https://github.com/user-attachments/assets/a97a451f-c9b4-468d-b036-15b65fc13e79
Tools
Discovery
Tool | Description |
| Structural AST tree of a project with file headers and symbol ranges (line numbers for functions/classes/methods). Dynamic pruning shrinks output automatically. |
| Function signatures, class methods, and type definitions with line ranges, without reading full bodies. Shows the API surface. |
| Search by meaning, not exact text. Uses embeddings over file headers/symbols and returns matched symbol definition lines. |
| Identifier-level semantic retrieval for functions/classes/variables with ranked call sites and line numbers. |
| Browse codebase by meaning using spectral clustering. Groups semantically related files into labeled clusters. |
Analysis
Tool | Description |
| Trace every file and line where a symbol is imported or used. Prevents orphaned references. |
| Run native linters and compilers to find unused variables, dead code, and type errors. Supports TypeScript, Python, Rust, Go. |
Code Ops
Tool | Description |
| The only way to write code. Validates against strict rules before saving. Creates a shadow restore point before writing. |
| Obsidian-style feature hub navigator. Hubs are |
Version Control
Tool | Description |
| List all shadow restore points created by |
| Restore files to their state before a specific AI change. Uses shadow restore points. Does not affect git. |
Memory & RAG
Tool | Description |
| Create or update a memory node (concept, file, symbol, note) with auto-generated embeddings. |
| Create typed edges between nodes (relates_to, depends_on, implements, references, similar_to, contains). |
| Semantic search with graph traversal — finds direct matches then walks 1st/2nd-degree neighbors. |
| Remove decayed edges (e^(-λt) below threshold) and orphan nodes with low access counts. |
| Bulk-add nodes with auto-similarity linking (cosine ≥ 0.72 creates edges automatically). |
| Start from a node and walk outward — returns all reachable neighbors scored by decay and depth. |
Complementary server: pmll-memory-mcp (
npx pmll-memory-mcp) is a separate MCP server by @drQedwards that adapts Context+'s long-term memory graph and adds short-term KV context memory, Q-promise deduplication, and a solution engine on top. See drQedwards/PPM for details.
Related MCP server: TempoGraph
Setup
Quick Start (npx / bunx)
No installation needed. Add Context+ to your IDE MCP config.
For Claude Code, Cursor, and Windsurf, use mcpServers:
{
"mcpServers": {
"contextplus": {
"command": "bunx",
"args": ["contextplus"],
"env": {
"OLLAMA_EMBED_MODEL": "nomic-embed-text",
"OLLAMA_CHAT_MODEL": "gemma2:27b",
"OLLAMA_API_KEY": "YOUR_OLLAMA_API_KEY"
}
}
}
}For VS Code (.vscode/mcp.json), use servers and inputs:
{
"servers": {
"contextplus": {
"type": "stdio",
"command": "bunx",
"args": ["contextplus"],
"env": {
"OLLAMA_EMBED_MODEL": "nomic-embed-text",
"OLLAMA_CHAT_MODEL": "gemma2:27b",
"OLLAMA_API_KEY": "YOUR_OLLAMA_API_KEY"
}
}
},
"inputs": []
}If you prefer npx, use:
"command": "npx""args": ["-y", "contextplus"]
Or generate the MCP config file directly in your current directory:
npx -y contextplus init claude
bunx contextplus init cursor
npx -y contextplus init opencodeSupported coding agent names: claude, cursor, vscode, windsurf, opencode.
Config file locations:
IDE | Config File |
Claude Code |
|
Cursor |
|
VS Code |
|
Windsurf |
|
OpenCode |
|
CLI Subcommands
init [target]- Generate MCP configuration (targets:claude,cursor,vscode,windsurf,opencode).skeleton [path]ortree [path]- (New) View the structural tree of a project with file headers and symbol definitions directly in your terminal.[path]- Start the MCP server (stdio) for the specified path (defaults to current directory).
Including paths excluded by the workspace .gitignore
If your workspace .gitignore excludes a sub-directory that you still want
indexed (common in monorepos where sub-projects under repos/, packages/,
or vendor/ are gitignored at the top level), use --include or
CONTEXTPLUS_EXTRA_ROOTS to add the paths back.
CLI form (repeatable):
bunx contextplus /path/to/workspace \
--include repos/lacuna \
--include repos/graphrag-coreEnvironment variable (fallback when no --include flag is set; uses the
system path separator — : on Unix, ; on Windows):
CONTEXTPLUS_EXTRA_ROOTS=repos/lacuna:repos/graphrag-core \
bunx contextplus /path/to/workspaceIn .mcp.json the env form is usually more ergonomic:
{
"mcpServers": {
"contextplus": {
"command": "bunx",
"args": ["contextplus", "/path/to/workspace"],
"env": {
"CONTEXTPLUS_EXTRA_ROOTS": "repos/lacuna:repos/graphrag-core"
}
}
}
}Each path listed is walked independently of the workspace root, with a
fresh ignore scope. Each path's own .gitignore is respected. Paths are
validated at startup; invalid entries (non-existent, not a directory,
outside the workspace) emit a stderr warning and are skipped.
Nested .gitignore files inside the workspace and inside each extra root
are loaded and merged with inherited rules, matching git and ripgrep
behavior.
From Source
npm install
npm run buildEmbedding Providers
Context+ supports two embedding backends controlled by CONTEXTPLUS_EMBED_PROVIDER:
Provider | Value | Requires | Best For |
Ollama (default) |
| Local Ollama server | Free, offline, private |
OpenAI-compatible |
| API key | Gemini (free tier), OpenAI, Groq, vLLM |
Ollama (Default)
No extra configuration needed. Just run Ollama with an embedding model:
ollama pull nomic-embed-text
ollama serveGoogle Gemini (Free Tier)
Full Claude Code .mcp.json example:
{
"mcpServers": {
"contextplus": {
"command": "npx",
"args": ["-y", "contextplus"],
"env": {
"CONTEXTPLUS_EMBED_PROVIDER": "openai",
"CONTEXTPLUS_OPENAI_API_KEY": "YOUR_GEMINI_API_KEY",
"CONTEXTPLUS_OPENAI_BASE_URL": "https://generativelanguage.googleapis.com/v1beta/openai",
"CONTEXTPLUS_OPENAI_EMBED_MODEL": "text-embedding-004"
}
}
}
}Get a free API key at Google AI Studio.
OpenAI
{
"mcpServers": {
"contextplus": {
"command": "npx",
"args": ["-y", "contextplus"],
"env": {
"CONTEXTPLUS_EMBED_PROVIDER": "openai",
"OPENAI_API_KEY": "sk-...",
"OPENAI_EMBED_MODEL": "text-embedding-3-small"
}
}
}
}Other OpenAI-compatible APIs (Groq, vLLM, LiteLLM)
Any endpoint implementing the OpenAI Embeddings API works:
{
"mcpServers": {
"contextplus": {
"command": "npx",
"args": ["-y", "contextplus"],
"env": {
"CONTEXTPLUS_EMBED_PROVIDER": "openai",
"CONTEXTPLUS_OPENAI_API_KEY": "YOUR_KEY",
"CONTEXTPLUS_OPENAI_BASE_URL": "https://your-proxy.example.com/v1",
"CONTEXTPLUS_OPENAI_EMBED_MODEL": "your-model-name"
}
}
}
}Note: The
semantic_navigatetool also uses a chat model for cluster labeling. When using theopenaiprovider, setCONTEXTPLUS_OPENAI_CHAT_MODEL(default:gpt-4o-mini).For VS Code, Cursor, or OpenCode, use the same
envblock inside your IDE's MCP config format (see Config file locations table above).
Architecture
Three layers built with TypeScript over stdio using the Model Context Protocol SDK:
Core (src/core/) - Multi-language AST parsing (tree-sitter, 43 extensions), gitignore-aware traversal, Ollama vector embeddings with disk cache, wikilink hub graph, in-memory property graph with decay scoring.
Tools (src/tools/) - 17 MCP tools exposing structural, semantic, operational, and memory graph capabilities.
Git (src/git/) - Shadow restore point system for undo without touching git history.
Runtime Cache (.mcp_data/) - created on server startup; stores reusable file, identifier, and call-site embeddings to avoid repeated GPU/CPU embedding work. A realtime tracker refreshes changed files/functions incrementally.
Config
Variable | Type | Default | Description |
| string |
| Embedding backend: |
| string |
| Ollama embedding model |
| string | - | Ollama Cloud API key |
| string |
| Ollama chat model for cluster labeling |
| string | - | API key for OpenAI-compatible provider (alias: |
| string |
| OpenAI-compatible endpoint URL (alias: |
| string |
| OpenAI-compatible embedding model (alias: |
| string |
| OpenAI-compatible chat model for labeling (alias: |
| string (parsed as number) |
| Embedding batch size per GPU call, clamped to 5-10 |
| string (parsed as number) |
| Per-chunk chars before merge, clamped to 256-8000 |
| string (parsed as number) |
| Skip non-code text files larger than this many bytes |
| string (parsed as number) | - | Optional Ollama embed runtime |
| string (parsed as number) | - | Optional Ollama embed runtime |
| string (parsed as number) | - | Optional Ollama embed runtime |
| string (parsed as number) | - | Optional Ollama embed runtime |
| string (parsed as number) | - | Optional Ollama embed runtime |
| string (parsed as boolean) | - | Optional Ollama embed runtime |
| string (parsed as boolean) |
| Enable realtime embedding refresh on file changes |
| string (parsed as number) |
| Max changed files processed per tracker tick, clamped to 5-10 |
| string (parsed as number) |
| Debounce window before tracker refresh |
Test
npm test
npm run test:demo
npm run test:allAvailable Tools
17 toolsadd_interlinked_contextA
Bulk-add multiple memory nodes with automatic similarity linking. Computes embeddings for all items, then creates similarity edges between any pair (new-to-new and new-to-existing) with cosine similarity ≥ 0.72. Ideal for importing related concepts, files, or notes at once.
Inputs: items (required), auto_link.
create_relationA
Create a typed edge between two memory nodes. Supports relation types: relates_to, depends_on, implements, references, similar_to, contains. Edges have weights (0-1) that decay over time via e^(-λt). Duplicate edges update weight instead of creating new ones.
Inputs: source_id (required), target_id (required), relation (required), weight, +1 more.
get_blast_radiusA
Before deleting or modifying code, check the BLAST RADIUS. Traces every file and line where a specific symbol (function, class, variable) is imported or used. Prevents orphaned code. Also warns if usage count is low (candidate for inlining).
Inputs: symbol_name (required), file_context.
get_context_treeA
Get the structural tree of the project with file headers, function names, classes, enums, and line ranges. Automatically reads 2-line headers for file purpose. Dynamic token-aware pruning: Level 2 (deep symbols) -> Level 1 (headers only) -> Level 0 (file names only) based on project size.
Inputs: target_path, depth_limit, include_symbols, max_tokens.
get_feature_hubA
Obsidian-style feature hub navigator. Hub files are .md files containing [[path/to/file]] wikilinks that act as a Map of Content. Modes: (1) No args = list all hubs, (2) hub_path or feature_name = show hub with bundled skeletons of all linked files, (3) show_orphans = find files not linked to any hub. Prevents orphaned code and enables graph-based codebase navigation.
Inputs: hub_path, feature_name, show_orphans.
get_file_skeletonA
Get detailed function signatures, class methods, and type definitions of a specific file WITHOUT reading the full body. Shows the API surface: function names, parameters, return types, and line ranges. Perfect for understanding how to use code without loading it all.
Inputs: file_path (required).
list_restore_pointsA
List all shadow restore points created by propose_commit. Each point captures the file state before the AI made changes. Use this to find a restore point ID for undoing a bad change.
Inputs: no named parameters.
propose_commitA
The ONLY way to write code. Validates the code against strict rules before saving: 2-line header comments, no inline comments, max nesting depth, max file length. Creates a shadow restore point before writing. REJECTS code that violates formatting rules.
Inputs: file_path (required), new_content (required).
prune_stale_linksA
Remove stale memory graph edges whose weight has decayed below threshold via e^(-λt) formula. Also removes orphan nodes with no edges, low access count, and >7 days since last access. Keeps the graph lean.
Inputs: threshold.
retrieve_with_traversalA
Start from a specific memory node and traverse the graph outward. Returns the starting node plus all reachable neighbors within the depth limit, scored by edge weight decay and depth penalty. Use after search_memory_graph to explore a specific node's neighborhood.
Inputs: start_node_id (required), max_depth, edge_filter.
run_static_analysisA
Run the project's native linter/compiler to find unused variables, dead code, type errors, and syntax issues. Delegates detection to deterministic tools instead of LLM guessing. Supports TypeScript, Python, Rust, Go.
Inputs: target_path.
search_memory_graphA
Search the memory graph by meaning with graph traversal. First finds direct matches via embedding similarity, then traverses 1st/2nd-degree neighbors to discover linked context. Returns both direct hits and graph-connected neighbors with relevance scores.
Inputs: query (required), max_depth, top_k, edge_filter.
semantic_code_searchA
Search the codebase by MEANING, not just exact variable names. Uses Ollama embeddings over file headers and symbol names. Example: searching 'user authentication' finds files about login, sessions, JWT even if those exact words aren't used, with matched definition lines.
Inputs: query (required), top_k, semantic_weight, keyword_weight, +5 more.
semantic_identifier_searchA
Search semantic intent at identifier level (functions, methods, classes, variables) with definition lines and ranked call sites. Uses embeddings over symbol signatures and source context, then returns line-numbered definition/call chains.
Inputs: query (required), top_k, top_calls_per_identifier, include_kinds, +2 more.
undo_changeA
Restore files to their state before a specific AI change. Uses the shadow restore point system. Does NOT affect git history. Call list_restore_points first to find the point ID.
Inputs: point_id (required).
upsert_memory_nodeA
Create or update a memory node in the linking graph. Nodes represent concepts, files, symbols, or notes with auto-generated embeddings. If a node with the same label and type exists, it updates content and increments access count. Returns the node ID for use in create_relation.
Inputs: type (required), label (required), content (required), metadata.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 17 tools
Most tools have distinct purposes, but there is some overlap that could cause confusion. For example, search_memory_graph, semantic_code_search, and semantic_identifier_search all involve semantic search with embeddings, differing mainly in scope (graph vs. codebase vs. identifiers), which might lead to misselection. Similarly, get_context_tree and get_file_skeleton both provide structural insights into code, with one focusing on project-wide hierarchy and the other on file-level details, potentially blurring boundaries.
Tool names follow a consistent verb_noun pattern throughout, such as add_interlinked_context, create_relation, and get_blast_radius, which aids predictability. However, there are minor deviations like semantic_navigate (adjective_verb) and upsert_memory_node (verb_noun_noun), slightly breaking the pattern but remaining readable and understandable.
With 17 tools, the count is slightly high but reasonable for the server's purpose of context management and code analysis, as it covers diverse areas like memory graphs, code search, and project navigation. It might feel heavy, but each tool appears to serve a specific function, avoiding redundancy, though some trimming could improve focus.
The tool set offers comprehensive coverage for context management and codebase interaction, including CRUD-like operations for memory nodes (e.g., upsert_memory_node, create_relation, prune_stale_links), search capabilities, and project analysis tools. Minor gaps exist, such as no direct tool for deleting memory nodes or managing graph nodes beyond pruning, but agents can likely work around these with existing tools.
Maintenance
Related MCP Connectors
Deterministic context layer for your codebase: change impact, blast radius, answers with receipts.
Intelligent context infrastructure for AI teams: knowledge graph, sessions, tasks, documents.
The context platform for AI agents: code search, team decisions, and grounded project context.
Enterprise code intelligence for M&A, security audits, and tech debt. Hosted server with 200k free.
Related MCP Servers
- AlicenseAqualityBmaintenanceAn MCP server and CLI tool that transforms codebases into AI-ready context through semantic search, call graph analysis, and incremental indexing. It enables AI assistants to perform hybrid vector and keyword searches to understand complex repository structures and cross-file relationships.3526 npm3MIT
- AlicenseAqualityCmaintenanceCode graph context engine that parses codebases with tree-sitter (170+ languages), builds structural dependency graphs, and provides 24 MCP tools for code intelligence. One prepare_context call gives your AI agent the right files for any task. Includes focus, blast radius, hotspots, dead code detection, and hybrid search.241AGPL 3.0
- AlicenseNot gradedqualityBmaintenanceContext Bridge is a lightweight MCP server that builds a persistent semantic knowledge graph of your codebase, enabling AI assistants to query complex codebases with sub-millisecond latency without re-reading files every session.17 npmMIT
- AlicenseNot gradedqualityCmaintenanceProvides structured, token-efficient code context for AI assistants by indexing codebases with AST-level analysis, supporting 17+ languages, enabling semantic search, call-site tracking, and PR attribution.58 PyPI42MIT