ontomics
by EtienneChollet·★ 31·综合分 44
ontomics 通过 MCP 从代码库中提取领域知识,减少 20% 的令牌消耗和 10% 的搜索时间,使概念和命名约定可查询。
概述
ontomics 是一个基于 Rust 的 MCP 服务器,通过将相关符号聚类为概念、检测命名约定、解析缩略词和按行为相似性对函数进行分组,来构建代码库的语义索引。它完全本地运行,无需 API 密钥,使用 tree-sitter 解析源文件,并使用嵌入模型对概念和逻辑进行聚类。该服务器提供工具用于查询概念、追踪词汇变化、查找功能相似的代码,并将领域知识作为可移植工件导出。
试试问 AI
装完之后,这里有 7 个你可以让 AI 做的事:
什么时候选它
当您处理大型代码库,需要快速理解领域概念、命名约定和行为关系,且希望避免过度的令牌消耗时,请选择 ontomics。
什么时候不要选它
如果您需要实时协作功能,或者您的项目使用了 ontomics 不支持的语言(目前仅支持 Python、TypeScript、JavaScript 和 Rust),请不要选择 ontomics。
此 server 暴露的工具
从 README 抽取出 12 个工具query_conceptFind all variants, related concepts, and occurrences of a term
locate_conceptFind the key signatures, classes, and files for a concept
describe_symbolGet the signature, docstring, and relationships for a function or class
trace_conceptTrace how a concept flows through the codebase via call chains
find_similar_logicFind functions with behaviorally similar implementations
describe_logicGet the behavioral description and logic cluster membership for a function
compact_contextAssemble tiered context for a symbol, optimized for LLM consumption
describe_fileOverview of a file's entities, concepts, and relationships
concept_mapShow which modules contain which domain concepts
list_conceptsList the top domain concepts by frequency
check_namingCheck an identifier against project conventions
export_domain_packExport domain knowledge as portable YAML
可对比工具
安装
使用您喜欢的方式安装 ontomics:
**npm (macOS/Linux):**
npm install -g @ontomics/ontomics**macOS (Homebrew):**
brew install EtienneChollet/tap/ontomics**与 Claude Desktop 注册:** 添加到您的 claude_desktop_config.json:
{
"mcpServers": {
"ontomics": {
"command": "ontomics"
}
}
}**与团队共享** — 在您的代码库根目录中放置一个 .mcp.json:
{
"mcpServers": {
"ontomics": {
"command": "npx",
"args": ["-y", "@ontomics/ontomics", "--repo", "."]
}
}
}FAQ
- ontomics 如何减少 20 倍的令牌消耗?
- ontomics 构建了一个领域概念的语义索引,使 LLM 能够通过单个工具调用找到概念信息,而不是在多个文件中搜索并进行大量工具调用。
- ontomics 支持哪些编程语言?
- 当前支持 Python、TypeScript、JavaScript 和 Rust,通过文件扩展名自动检测。
- 数据是否会被发送到外部服务器?
- 不会,ontomics 在本地机器上处理所有内容,不需要 API 密钥。索引存储在 <repo>/.ontomics/index.db 本地。
ontomics 对比
最后更新于 · 由 README + GitHub 公开数据自动生成。