Skip to main content
Glama

ontomics

Python Rust TypeScript JavaScript platform MCP MCP Registry Glama Claude Code Codex pi

ontomics 为任何编码智能体提供代码库的即时知识。只需一次工具调用,而非 19 次。token 消耗减少约 20 倍。

https://github.com/user-attachments/assets/01afa8a0-1bc2-4686-94d7-965fef7610c3

voxelmorph 项目的可视化 —— 一个用于图像配准中无监督学习的库

基准测试

使用 Claude Sonnet 进行测试 —— 相同的问题,分别在有和没有 ontomics 的情况下。

voxelmorph 上询问“此代码库中的 'transform' 是什么意思?”(完整记录):

使用 ontomics

不使用

工具调用

1

19

Tokens

~3.7k

~76k

时间

5s

1m 15s

回答质量

完整

完整

ScribblePrompt 上询问“此代码库中的主要领域概念是什么?”(完整记录):

使用 ontomics

不使用

工具调用

1

26

Tokens

~3.7k

~61.6k

时间

~5s

56s

回答质量

完整

完整

两种情况下都产生了完整、正确的答案。ontomics 只需一次调用即可完成。

Related MCP server: Code-Index-MCP

它能做而搜索做不到的事

搜索只能告诉你字符串出现在哪里。LSP 可以告诉你符号在哪里定义和引用。但两者都无法回答:此代码库中的领域概念是什么?它们之间有什么联系?出现了哪些命名规范?自上次发布以来领域词汇发生了什么变化?哪些函数行为相似,无论它们叫什么名字?

ontomics 构建了项目领域的语义索引 —— 将相关符号聚类为概念,从使用频率中检测命名规范,解析缩写,按行为相似性对函数进行分组,并跟踪词汇随时间的演变。该索引可以导出为便携式工件,以在其他仓库中引导规范。

行为相似性

除了命名和概念之外,ontomics 还使用 CodeRankEmbed(768 维,对比代码检索)嵌入原始函数体,并按行为相似性对它们进行聚类。这揭示了命名和调用图都无法暴露的关系:

❯ What functions behave like spatial_transform()?

  random_transform()   nn/functional.py:352   0.80
  spatial_transform()  functional.py:596      0.69
  random_transform()   functional.py:1399     0.67
  random_disp()        nn/functional.py:275   0.65
  integrate_disp()     functional.py:764      0.65
  compose()            nn/functional.py:216   0.63
  disp_to_trf()        functional.py:343      0.62

结果还显示 random_transform 出现在两个位置,且具有不同的相似度分数 —— 这是概念级搜索完全无法发现的实现重复的迹象。

安装

安装一次,即可在每个项目中使用。无需配置 —— ontomics 会自动检测仓库并在首次运行时进行索引。

ontomics 需要一个 git 仓库(.git/ 目录)。它将拒绝索引主目录、根目录或临时目录。要索引非 git 目录,请使用 --force

1. 安装二进制文件

npm (macOS/Linux):

npm install -g @ontomics/ontomics

macOS (Homebrew):

brew install EtienneChollet/tap/ontomics

Shell 安装程序 (macOS/Linux):

curl --proto '=https' --tlsv1.2 -LsSf https://github.com/EtienneChollet/ontomics/releases/latest/download/ontomics-installer.sh | sh

从源码安装:

git clone https://github.com/EtienneChollet/ontomics.git
cd ontomics
cargo build --release

2. 在你的工具中注册

Claude Code:

claude mcp add -s user ontomics -- ontomics

Codex:

codex mcp add ontomics -- ontomics

OpenClaw:

openclaw mcp set ontomics '{"command":"ontomics"}'

pi-coding-agent:

pi install npm:@ontomics/ontomics

与团队共享 —— 在你的仓库根目录放入一个 .mcp.json

{
  "mcpServers": {
    "ontomics": {
      "command": "npx",
      "args": ["-y", "@ontomics/ontomics", "--repo", "."]
    }
  }
}

支持的语言

Python, TypeScript, JavaScript, Rust。根据文件扩展名自动检测。

工具

概念和词汇

工具

功能

query_concept

查找术语的所有变体、相关概念和出现位置

locate_concept

查找概念的关键签名、类和文件

describe_symbol

获取函数或类的签名、文档字符串和关系

trace_concept

通过调用链追踪概念如何在代码库中流动

list_concepts

按频率列出顶级领域概念

list_conventions

列出所有检测到的命名模式(前缀、后缀、转换)

list_entities

按概念、角色或类型过滤列出代码实体(类、函数)

check_naming

根据项目规范检查标识符;建议规范形式

suggest_name

生成符合项目词汇表的标识符名称

vocabulary_health

衡量规范覆盖率、命名一致性和聚类内聚性

ontology_diff

显示自 git ref 以来新增、更改或删除的领域概念

export_domain_pack

将领域知识导出为便携式 YAML,以便在其他仓库中使用

行为相似性

工具

功能

find_similar_logic

查找行为实现相似的函数,按嵌入相似度排序

describe_logic

获取函数的行为描述、主体文本和逻辑聚类成员资格

compact_context

为符号组装分层上下文(概念 + 逻辑),针对 LLM 消耗进行优化

代码库结构

工具

功能

describe_file

文件实体、概念和关系的概览

concept_map

显示哪些模块包含哪些领域概念

type_flows

显示主导类型以及数据如何在代码库中流动

trace_type

追踪特定类型如何在文件和调用点之间传播

资源

资源

功能

ontomics://briefing

会话简报:顶级规范、缩写、关键概念、对比对和词汇警告。也可通过 ontomics briefing CLI 获取。

工作原理

ontomics 完全在你的机器上运行多阶段流水线 —— 无需 API 密钥:

  1. 解析 — tree-sitter 从你的源文件中提取每个标识符、签名和调用点

  2. 分析 — TF-IDF 评分识别领域特定概念并检测命名规范

  3. 嵌入(概念) — BGE-small (384 维) 按语义相似度对相关概念进行聚类

  4. 嵌入(逻辑) — CodeRankEmbed (768 维) 嵌入原始函数体并按行为相似度对它们进行聚类

  5. 中心度 — PageRank 按结构重要性对实体进行评分

两种嵌入模型均在首次运行时下载并缓存在本地。索引位于 <repo>/.ontomics/index.db —— 后续启动将从缓存加载并监视文件更改。

通过仓库根目录下的 .ontomics/config.toml 进行配置。所有字段都有合理的默认值。请参阅 SPEC.md 获取完整的设计契约。

Install Server
A
license - permissive license
A
quality
C
maintenance

Maintenance

Maintainers
Response time
0dRelease cycle
23Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    -
    quality
    A
    maintenance
    Local-first code indexer that provides deep code understanding for Claude and other LLMs with symbol/text search across 48+ languages, semantic search capabilities, and real-time index updates through the Model Context Protocol.
    55
    MIT
  • A
    license
    A
    quality
    A
    maintenance
    A local-first codebase intelligence tool that enables AI assistants to research codebases using semantic search, multi-hop relationship discovery, and structural parsing. It allows users to extract architectural patterns and institutional knowledge across 30+ programming languages through an MCP-compatible interface.
    2
    1,408
    MIT
  • A
    license
    -
    quality
    D
    maintenance
    Persistent codebase knowledge layer for AI agents. Pre-digests codebases into structured knowledge (symbols, dependency graphs, co-change patterns, architectural decisions) and serves via MCP. 28 languages, 14 tools, ~85% token reduction.
    13
    7
    MIT

View all related MCP servers

Related MCP Connectors

  • Knowledge coverage map and health score. Ingest docs into a governed knowledge graph via MCP.

  • One shared context your team's AI tools read & write over MCP. No re-explaining. Free.

  • The project brain for AI coding agents — memory, decisions, sprints, knowledge base via MCP.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/EtienneChollet/ontomics'

If you have feedback or need assistance with the MCP directory API, please join our Discord server