代码知识工具
一个使用向量嵌入的代码库知识管理工具。此工具使用高级嵌入技术,帮助您维护和查询代码库知识。
构建和安装
1. 构建包
首先,您需要构建分发文件:
这将在 dist/ 目录中创建两个文件:
- code_knowledge_tool-0.1.0-py3-none-any.whl(安装用wheel文件)
- code_knowledge_tool-0.1.0.tar.gz(源代码分发)
2.安装软件包
先决条件
- 确保 Ollama 已安装并正在运行:
- 安装软件包:
选项 1:从 wheel 文件安装(推荐使用)
选项 2:以可编辑模式安装(推荐用于开发)
如果您想修改该工具或为其开发做出贡献,那么此选项是最好的:
与 RooCode/Cline 集成
- 将 MCP 配置复制到您的设置中:
对于 Cline (VSCode):
添加此配置:
对于 RooCode:
添加与上面相同的配置。
- 重新启动 RooCode/Cline 以加载新工具。
用作记忆库和 RAG 上下文提供程序
此工具可用作项目的记忆库和 RAG 上下文提供程序。设置方法如下:
- 将提供的模板复制到您的项目中:
- 根据项目需求定制 .clinerules 中的规则和模式
该模板包含以下方面的全面说明:
- 知识库管理
- 基于 RAG 的开发工作流程
- 代码质量指南
- 内存管理实践
有关完整配置和使用详情,请参阅 clinerules_template.md。
特征
- 用于代码知识的本地向量存储
- 使用 Ollama 高效生成嵌入
- 支持多种文件类型
- 上下文感知代码理解
- 通过 MCP 与 RooCode 和 Cline 集成
- 基于 RAG 的上下文增强
- 持久知识存储
要求
- Python 3.8 或更高版本
- Ollama 服务在本地运行
- 用于向量运算的 chromadb
发展
运行测试
该项目采用集成优先的测试方法,重点关注端到端功能和 MCP 合同合规性。测试套件包括:
- MCP 合同测试
- 工具注册和执行
- 资源管理
- 知识运营
- 错误处理
- 包构建测试
- 安装验证
- 依赖关系解析
- MCP 服务器初始化
- 基本功能
运行测试:
测试环境要求:
测试使用临时目录(test_knowledge_store),该目录会在测试运行之间自动清理。
有关测试策略和模式的更多详细信息,请参阅docs/
中的文档。
未来分布
如果您想通过 pip 使用这个包(即pip install code-knowledge-tool
),您需要:
- 在PyPI上注册一个账户
- 安装 twine:
pip install twine
- 上传你的发行版:
twine upload dist/*
但是,目前请使用上面描述的本地构建和安装方法。
执照
MIT 许可证
This server cannot be installed
local-only server
The server can only run on the client's local machine because it depends on local resources.
提供项目存储库和 RAG 上下文提供程序,通过矢量嵌入增强代码理解和管理,并与 RooCode 和 Cline 集成。
Related Resources
Related MCP Servers
- -securityAlicense-qualityA VS Code extension provides a MCP server that exposes Roslyn language features. It enables tools like find usages, go to definition, quick info, etc.Last updated -111TypeScriptAGPL 3.0
- -securityAlicense-qualityA comprehensive code analysis and management tool that integrates with Claude Desktop to analyze code at project and file levels, helping adapt changes to projects intelligently.Last updated -29PythonMIT License
- AsecurityAlicenseAqualityChat with your codebase through intelligent code searching without embeddings by breaking files into logical chunks, giving the LLM tools to search these chunks, and letting it find specific code needed to answer your questions.Last updated -851PythonMIT License
- -securityFlicense-qualityA server component of the Model Context Protocol that provides intelligent analysis of codebases using vector search and machine learning to understand code patterns, architectural decisions, and documentation.Last updated -4Python