contextplus
by forloopcodes·★ 1,896·综合分 56
Context+ 是一个 MCP 服务器,使用 RAG、AST 解析和语义链接将代码库转换为可搜索的特性图。
概述
Context+ 是一个专为处理大型代码库的开发者设计的复杂 MCP 服务器。它结合了多种先进技术,包括 RAG(检索增强生成)、Tree-sitter AST 解析、谱聚类和 Obsidian 风格链接,以创建可搜索的分层特性图。该服务器提供 17 个工具,涵盖发现、分析、代码操作、版本控制和内存/RAG 功能等多个类别。它支持多种嵌入提供商,包括 Ollama(默认)和 OpenAI 兼容 API,使其能够适应不同的部署环境和偏好。
试试问 AI
装完之后,这里有 6 个你可以让 AI 做的事:
什么时候选它
当处理需要深层语义理解、依赖分析和知识图谱功能的大型复杂代码库时,选择Context+。
什么时候不要选它
对于小型项目或需要轻量级简单代码导航而不需要嵌入模型和图存储开销的情况,避免使用Context+。
此 server 暴露的工具
从 README 抽取出 12 个工具get_context_treeGet structural AST tree of a project with file headers and symbol ranges.
get_file_skeletonGet function signatures, class methods, and type definitions without full bodies.
semantic_code_searchSearch code by meaning using embeddings over file headers/symbols.
semantic_identifier_searchRetrieve functions/classes/variables with ranked call sites.
get_blast_radiusTrace files and lines where a symbol is imported or used.
run_static_analysisRun linters to find unused variables, dead code, and type errors.
propose_commitWrite code with validation and create restore points.
get_feature_hubNavigate Obsidian-style feature hubs with wikilinks.
search_memory_graphSemantic search with graph traversal for direct matches and neighbors.
upsert_memory_nodeCreate or update memory nodes with auto-generated embeddings.
create_relationCreate typed edges between memory nodes.
undo_changeRestore files to state before specific AI changes.
可对比工具
安装
安装
快速开始(npx / bunx)
无需安装。将 Context+ 添加到您的 IDE MCP 配置中。
对于 Claude Code、Cursor 和 Windsurf,使用 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"
}
}
}
}对于 VS Code(.vscode/mcp.json),使用 servers 和 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": []
}FAQ
- Context+ 支持哪些编程语言?
- Context+ 通过 Tree-sitter 支持 43 种扩展,包括 TypeScript、Python、Rust、Go 等多种语言。
- 我可以使用不同的嵌入模型吗?
- 是的,Context+ 支持 Ollama(默认)和 OpenAI 兼容 API,包括 Gemini、OpenAI、Groq 和 vLLM。
contextplus 对比
最后更新于 · 由 README + GitHub 公开数据自动生成。