IndexGraph Server
БесплатноНе проверенEnables querying functions and their call relationships in frontend HTML inline scripts via indexgraph_node and indexgraph_explore tools.
Описание
Enables querying functions and their call relationships in frontend HTML inline scripts via indexgraph_node and indexgraph_explore tools.
README
A local code graph for frontend logic embedded in HTML
<script>blocks.
IndexGraph 是 CodeGraph 的补充——专门吃它吃不下的那块:写在 .html 文件里 <script> 标签内联的前端 JS。100% 本地,不上传任何代码。
✨ 特色
- 函数级索引 — 提取内联
<script>里的函数声明 / 箭头函数赋值,记录真实行号(映射回原始.html文件,不是提取后的偏移量) - 调用关系图 — 谁调用了谁,一次查询就有调用者 + 被调用者列表
- 精确查询 —
indexgraph node <函数名>:已知函数名时,一次拿到源码 + 调用链 - 模糊探索 —
indexgraph explore "<关键词>":不知道确切名字时,按函数名 / 函数体匹配打分排序 - MCP server — 接入 Claude Code 等 agent,作为
indexgraph_node/indexgraph_explore工具直接调用 - 源码永远现读现取(不是缓存),跟 Read 工具看到的内容逐字节一致
- 索引过期自动重建 — 查询前按文件 mtime 检测是否有改动,过期就透明重建,不用记得手动重跑
indexgraph init
🚀 开始使用
# 安装依赖
npm install
# 全局链接 CLI(开发/本地使用)
npm link
# 在目标项目里建索引
cd your-project
indexgraph init
# 查询
indexgraph node renderTable
indexgraph explore "对账单附件怎么渲染的"
⌨️ CLI 命令
| 命令 | 作用 |
|---|---|
indexgraph init [路径] |
扫描 .html 文件,提取内联 <script>,建立索引 |
indexgraph files |
列出已索引文件和符号数量 |
indexgraph node <name> |
精确符号:源码 + 调用者 + 被调用者 |
indexgraph explore "<query>" |
关键词模糊搜索 |
indexgraph version |
打印版本号 |
🔌 接入 MCP(Claude Code 等)
{
"mcpServers": {
"indexgraph": {
"type": "stdio",
"command": "node",
"args": ["D:\\AI\\IndexGraph\\mcp-server.js"]
}
}
}
重启 agent 后即可使用 indexgraph_node / indexgraph_explore 两个工具。
⚠️ 已知局限
- 只解析纯 JS(无
src=属性的内联<script>),不含 TS/JSX - 调用关系是同文件内的词法匹配,不做真正的作用域解析(动态派发、跨文件 import 追踪不到)
- 目前一次只处理一层——嵌套函数会被各自记录为独立符号,但父子关系不做特殊标注
🙏 致谢
设计理念上借鉴了 CodeGraph——node/explore 两个命令的分工、MCP 包一层的做法、"源码永远现读、不用缓存"这几个思路都来自它。IndexGraph 是从零实现的(没有读过 CodeGraph 的源码,它是编译发布的闭源分发包),定位是补上它不支持 .html 内联 <script> 的那块空白,不是它的替代品。
构建者:Red
Установить IndexGraph Server в Claude Desktop, Claude Code, Cursor
unyly install indexgraph-mcp-serverСтавит в Claude Desktop, Claude Code, Cursor и VS Code — сам разбирается с npx, uvx и сборкой из исходников.
Впервые? Поставь CLI: curl -fsSL https://unyly.org/install | sh
Или настроить вручную
Выполни в терминале:
claude mcp add indexgraph-mcp-server -- npx -y github:JiaHuiRed/IndexGraphFAQ
IndexGraph Server MCP бесплатный?
Да, IndexGraph Server MCP бесплатный — установка в пару кликов через Unyly без оплаты.
Нужен ли API-ключ для IndexGraph Server?
Нет, IndexGraph Server работает без API-ключей и переменных окружения.
IndexGraph Server — hosted или self-hosted?
Self-hosted: сервер запускается локально на твоей машине командой из раздела установки.
Как установить IndexGraph Server в Claude Desktop, Claude Code или Cursor?
Открой IndexGraph Server на unyly.org, выбери вкладку своего клиента (Claude Desktop, Claude Code, Cursor) и нажми Install — конфиг сгенерируется автоматически, без правки JSON.
Похожие MCP
GitHub
PRs, issues, code search, CI status
автор: GitHubFilesystem
Secure file operations with configurable access controls.
Memory
Knowledge graph-based persistent memory system.
Template MCP Server
A CLI tool to create a new Model Context Protocol server project with TypeScript support, dual transport options, and an extensible structure
автор: mcpdotdirectCompare IndexGraph Server with
Не уверен что выбрать?
Найди свой стек за 60 секунд
Автор?
Embed-бейдж для README
Похожее
Все в категории development
