contextplus
forloopcodes · forloopcodes/contextplus
Máy chủ MCP này cung cấp thông tin tình báo ngữ nghĩa cho các cơ sở mã lớn bằng cách biến chúng thành biểu đồ tính năng phân cấp, có thể tìm kiếm bằng cách sử dụng phân tích RAG và AST.
Trí tuệ ngữ nghĩa cho Kỹ thuật Quy mô Lớn. Context+ là một MCP server được thiết kế cho các nhà phát triển yêu cầu độ chính xác 99%. Bằng cách kết hợp RAG, Tree-sitter AST, Spectral Clustering và liên kết kiểu Obsidian, Context+ biến một cơ sở mã khổng lồ thành biểu đồ tính năng phân cấp, có thể tìm kiếm.
Xem trước
Bạn có thể làm gì với nó
- Tìm kiếm ngữ nghĩa cho ý nghĩa mã trên một cơ sở mã lớn thay vì chỉ tìm kiếm văn bản.
- Hiểu cấu trúc cây AST và bề mặt API của một dự án mà không cần đọc toàn bộ tệp.
- Điều hướng cơ sở mã bằng cách duyệt các tệp liên quan ngữ nghĩa được nhóm thành các cụm.
Kiểm tra an toàn
Không thấy dấu hiệu rủi ro trong các file đã quét.
Quét tự động các file trong repo. Luôn xem lại code trước khi chạy.
Trích từ 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. |
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.
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"]