Context+

Context+

Context+ is a semantic intelligence server that transforms codebases into searchable, hierarchical feature graphs using RAG, Tree-sitter AST, and spectral clustering. It provides tools for deep code discovery, blast radius analysis, and memory graph management for high-accuracy engineering tasks.

Category
访问服务器

README

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
get_context_tree Structural AST tree of a project with file headers and symbol ranges (line numbers for functions/classes/methods). Dynamic pruning shrinks output automatically.
get_file_skeleton Function signatures, class methods, and type definitions with line ranges, without reading full bodies. Shows the API surface.
semantic_code_search Search by meaning, not exact text. Uses embeddings over file headers/symbols and returns matched symbol definition lines.
semantic_identifier_search Identifier-level semantic retrieval for functions/classes/variables with ranked call sites and line numbers.
semantic_navigate Browse codebase by meaning using spectral clustering. Groups semantically related files into labeled clusters.

Analysis

Tool Description
get_blast_radius Trace every file and line where a symbol is imported or used. Prevents orphaned references.
run_static_analysis Run native linters and compilers to find unused variables, dead code, and type errors. Supports TypeScript, Python, Rust, Go.

Code Ops

Tool Description
propose_commit The only way to write code. Validates against strict rules before saving. Creates a shadow restore point before writing.
get_feature_hub Obsidian-style feature hub navigator. Hubs are .md files with [[wikilinks]] that map features to code files.

Version Control

Tool Description
list_restore_points List all shadow restore points created by propose_commit. Each captures file state before AI changes.
undo_change Restore files to their state before a specific AI change. Uses shadow restore points. Does not affect git.

Memory & RAG

Tool Description
upsert_memory_node Create or update a memory node (concept, file, symbol, note) with auto-generated embeddings.
create_relation Create typed edges between nodes (relates_to, depends_on, implements, references, similar_to, contains).
search_memory_graph Semantic search with graph traversal — finds direct matches then walks 1st/2nd-degree neighbors.
prune_stale_links Remove decayed edges (e^(-λt) below threshold) and orphan nodes with low access counts.
add_interlinked_context Bulk-add nodes with auto-similarity linking (cosine ≥ 0.72 creates edges automatically).
retrieve_with_traversal Start from a node and walk outward — returns all reachable neighbors scored by decay and depth.

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 opencode

Supported coding agent names: claude, cursor, vscode, windsurf, opencode.

Config file locations:

IDE Config File
Claude Code .mcp.json
Cursor .cursor/mcp.json
VS Code .vscode/mcp.json
Windsurf .windsurf/mcp.json
OpenCode opencode.json

CLI Subcommands

  • init [target] - Generate MCP configuration (targets: claude, cursor, vscode, windsurf, opencode).
  • skeleton [path] or tree [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).

From Source

npm install
npm run build

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
OLLAMA_EMBED_MODEL string nomic-embed-text Embedding model
OLLAMA_API_KEY string - Ollama Cloud API key
OLLAMA_CHAT_MODEL string llama3.2 Chat model for cluster labeling
CONTEXTPLUS_EMBED_BATCH_SIZE string (parsed as number) 8 Embedding batch size per GPU call, clamped to 5-10
CONTEXTPLUS_EMBED_CHUNK_CHARS string (parsed as number) 2000 Per-chunk chars before merge, clamped to 256-8000
CONTEXTPLUS_MAX_EMBED_FILE_SIZE string (parsed as number) 51200 Skip non-code text files larger than this many bytes
CONTEXTPLUS_EMBED_NUM_GPU string (parsed as number) - Optional Ollama embed runtime num_gpu override
CONTEXTPLUS_EMBED_MAIN_GPU string (parsed as number) - Optional Ollama embed runtime main_gpu override
CONTEXTPLUS_EMBED_NUM_THREAD string (parsed as number) - Optional Ollama embed runtime num_thread override
CONTEXTPLUS_EMBED_NUM_BATCH string (parsed as number) - Optional Ollama embed runtime num_batch override
CONTEXTPLUS_EMBED_NUM_CTX string (parsed as number) - Optional Ollama embed runtime num_ctx override
CONTEXTPLUS_EMBED_LOW_VRAM string (parsed as boolean) - Optional Ollama embed runtime low_vram override
CONTEXTPLUS_EMBED_TRACKER string (parsed as boolean) true Enable realtime embedding refresh on file changes
CONTEXTPLUS_EMBED_TRACKER_MAX_FILES string (parsed as number) 8 Max changed files processed per tracker tick, clamped to 5-10
CONTEXTPLUS_EMBED_TRACKER_DEBOUNCE_MS string (parsed as number) 700 Debounce window before tracker refresh

Test

npm test
npm run test:demo
npm run test:all

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选