█

AI/TLDR

Buy me a coffee
Buy me a coffee

Context+

An MCP server that turns a large codebase into a searchable, hierarchical feature graph

Code Indexing & SearchOpen source
Language
TypeScript
License
MIT
IN SHORT

What is Context+?

Context+ is a Model Context Protocol server that gives AI coding agents a semantic view of a codebase instead of making them read whole files. It combines retrieval over embeddings, Tree-sitter AST parsing, spectral clustering and Obsidian-style wikilinks to turn a large repository into what the project calls a searchable, hierarchical feature graph. It sits in the Code Indexing & Search category of the Retrieval & Knowledge (RAG) tools and is open-source, written in TypeScript and licensed MIT.

Overview

Context+ is a Model Context Protocol server that gives AI coding agents a semantic view of a codebase instead of making them read whole files. It combines retrieval over embeddings, Tree-sitter AST parsing, spectral clustering and Obsidian-style wikilinks to turn a large repository into what the project calls a searchable, hierarchical feature graph.

The server exposes 17 MCP tools in five groups. Discovery tools return a structural AST tree of the project, a file's skeleton of signatures and line ranges, meaning-based code and identifier search, and clusters of semantically related files. Analysis tools trace every place a symbol is used and run native linters and compilers. Code-ops tools route writes through a validating `propose_commit` step, version-control tools let you list and undo AI changes through shadow restore points that never touch git history, and a memory graph stores typed, decaying relations between concepts, files and symbols.

It is written in TypeScript, runs over stdio, and is published to npm as `contextplus`, so it starts with `bunx` or `npx` without a separate install. Embeddings come from a local Ollama server by default, or from any OpenAI-compatible endpoint such as OpenAI, Gemini, Groq or vLLM. Embeddings are cached on disk in `.mcp_data/`, and a realtime tracker refreshes changed files and functions incrementally.

What it does

  • Structural discovery: `get_context_tree` and `get_file_skeleton` return AST trees, symbol line ranges and API surfaces without reading full file bodies
  • Semantic search by meaning with `semantic_code_search` and `semantic_identifier_search`, plus `semantic_navigate`, which groups related files into labeled clusters via spectral clustering
  • Impact analysis with `get_blast_radius`, and `run_static_analysis` that runs native linters and compilers for TypeScript, Python, Rust and Go
  • Safe writes: `propose_commit` validates changes and creates a shadow restore point, and `undo_change` rolls back an AI edit without affecting git
  • A memory graph with typed edges, semantic search with neighbor traversal, and decay-based pruning of stale links
  • Multi-language AST parsing across 43 file extensions, gitignore-aware traversal and an `--include` flag for indexing gitignored sub-projects in monorepos

Getting started

Context+ runs straight from npm, so setup is mostly adding it to your editor's MCP config. By default it uses a local Ollama server for embeddings.

Start an embedding model

Ollama is the default embedding provider and needs no extra configuration beyond a running server with an embedding model.

bashbash
ollama pull nomic-embed-text
ollama serve

Generate the MCP config for your agent

The `init` subcommand writes the config file into the current directory. Supported targets are `claude`, `cursor`, `vscode`, `windsurf` and `opencode`.

bashbash
npx -y contextplus init claude
bunx contextplus init cursor

Or add it to the config by hand

For Claude Code, Cursor and Windsurf, register the server under `mcpServers` (Claude Code reads `.mcp.json`).

jsonjson
{
  "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"
      }
    }
  }
}

Switch to an OpenAI-compatible provider (optional)

Set `CONTEXTPLUS_EMBED_PROVIDER` to `openai` and point it at any endpoint that implements the OpenAI Embeddings API, for example OpenAI itself.

jsonjson
{
  "mcpServers": {
    "contextplus": {
      "command": "npx",
      "args": ["-y", "contextplus"],
      "env": {
        "CONTEXTPLUS_EMBED_PROVIDER": "openai",
        "OPENAI_API_KEY": "sk-...",
        "OPENAI_EMBED_MODEL": "text-embedding-3-small"
      }
    }
  }
}

Inspect a project from the terminal

The `skeleton` (or `tree`) subcommand prints the structural tree with file headers and symbol definitions; `--include` adds gitignored paths back when running the server.

bashbash
npx -y contextplus skeleton ./my-project
bunx contextplus /path/to/workspace --include repos/lacuna

Commands and code are distilled from the project's own documentation — always check the official repo for the latest.

When to use it

  • Let a coding agent find code by meaning in a large repository instead of grepping and reading whole files
  • Check every file and line that uses a symbol before an agent renames or removes it
  • Keep AI edits reversible with restore points that sit outside your git history
  • Run codebase search fully offline with a local Ollama embedding model

How Context+ compares

Context+ alongside other open-source code indexing & search tools AI/TLDR tracks, ranked by GitHub stars.

ToolStarsWhat it does
CodeGraph★ 79.3kBuilds a local SQLite knowledge graph of a codebase with a Rust tree-sitter kernel, keeps it in sync through a file watcher, and serves symbols, call paths and blast radius to coding agents over MCP.
codebase-memory-mcp★ 49.4kA native MCP server that indexes a repository into a persistent tree-sitter knowledge graph of functions, call chains and routes, queried by agents through 15 tools.
GitNexus★ 49kIndexes a codebase into a knowledge graph of dependencies, call chains and execution flows, then exposes it to Claude Code, Cursor and Codex through MCP tools.
code-review-graph★ 33kA local-first code intelligence graph built with Tree-sitter that serves precise, incrementally-updated structural context to AI coding tools over MCP, so they read only the code a task needs.
XERJ★ 22.9kSingle-binary, Elasticsearch-compatible search engine whose autoindex command turns any folder of code, docs, logs or PDFs into typed indices that AI coding agents query via CLI or MCP instead of grepping.
Claude Context★ 12.7kAn MCP server that indexes your codebase into a vector database so AI coding agents can find relevant code by meaning instead of loading whole folders.
Graft★ 11.6kBuilds a persistent knowledge graph of your codebase as linked markdown files, then feeds the matching nodes to coding agents so they stop re-exploring the repo on every task.
Context+★ 2kAn MCP server that turns a large codebase into a searchable, hierarchical feature graph