Token导航 LogoToken导航TokenDH.com
AiDex MCP logo
搜索检索stdio官方级别未说明来源级核验

AiDex MCP

MCP Server

AiDex是一个为AI编码助手提供记忆、语义搜索和实时遥测的MCP服务器,支持本地优先和模型无关的操作,适用于多种MCP兼容的AI助手。

工具数

31

提示词数

0

GitHub Stars

30

资源数

0
代码索引本地优先TypeScriptClaudeClaude DesktopClaudeCursorWindsurfVS Code

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

CSCSoftware

提供方

CSCSoftware

最后核验

2026/5/17 20:42

运行时

Node.js

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

npm install -g aidex-mcp

详细介绍

Aidex

](https://www.npmjs.com/package/aidex-mcp) ![MIT License](LICENSE) ](https://nodejs.org/) ![MCP Server](https://modelcontextprotocol.io/) ](https://github.com/CSCSoftware/AiDex/discussions)

AI编码代理的持久大脑。

AiDex是一个MCP服务器,为AI编码助手提供内存、语义搜索和实时遥测——本地优先,与模型无关。可与任何兼容MCP的AI助手配合使用:Claude Code、Claude Desktop、Cursor、Windsurf、Gemini CLI、VS Code Copilot等。

三大支柱

🧠 记忆 --任务、笔记和会话笔记在每次聊天中都会保留下来。自动记录历史、计划任务、跨会话连续性。你的人工智能明天就知道今天重要的是什么。

🔍 搜索 --三种模式: exact (标识符), semantic (概念), hybrid (RRF融合两者)。将代码、文档和工作区项嵌入到一个排名中。跨项目——一个查询中的每个仓库。可选的LLM层翻译非英语查询并重新排序结果。

🌐 遥测 --LogHub通过HTTP(无SDK)从任何应用程序接收实时日志。AI会观察你的代码实际做了什么,而不仅仅是它说了什么。在查看器中实时流式传输。

And yes — it's still 50× more token-efficient than grep.

AiDex Demo - grep vs aidex

没有AiDex有AiDex
查找 PlayerHealth格雷普→ 200 在40个文件中点击→ 读取5个文件→ 2000+代币1个查询→ 3 确切位置→ 约50个代币
获取文件结构读取整个500行文件→ 1500个代币签名→ 类+方法→ 约80个代币
今天发生了什么变化?git diff +grep+上下文→ 3000+代币时间过滤查询→ 约50个代币

AiDex Demo GIF

里面有什么——一台服务器上有33个工具

类别工具功能
语义搜索 🆕search, settings对代码、文档和工作空间进行混合/语义/精确检索。配置嵌入+LLM层的设置选项卡
索引和标识符搜索init, query, update, remove, status为项目建立索引,按名称搜索标识符(精确/包含/starts_with),基于时间的过滤
签名signature, signatures在不读取任何文件的情况下获取其类和方法——单个文件或glob模式
项目概述summary, tree, describe, files入口点、语言细分、包含统计数据的文件树、按类型列出的文件
交叉项目link, unlink, links, scan链接依赖关系,发现索引项目
全局搜索global_init, global_query, global_signatures, global_status, global_refresh在所有项目中搜索标识符——“我写过X吗?”
指南global_guideline持久的人工智能指令和编码约定——在所有项目中共享
会话session, note跟踪会话,检测外部更改,为下一个会话留下笔记(具有可搜索的历史记录)
任务积压task, tasks内置任务管理,具有优先级、标签、自动记录的历史记录和 计划/重复任务
日志中心log通用日志接收器——任何程序都可以通过HTTP发送日志,人工智能可以查询,实时在查看器中
截图screenshot, windows具有LLM优化的跨平台屏幕截图——缩放+减色可节省高达95%的令牌
观众viewer具有文件树、签名、任务、日志、搜索和实时重新加载的交互式浏览器UI

12种语言 --C#、TypeScript、JavaScript、Rust、Python、C、C++、Java、Go、PHP、Ruby、HCL/Terraform

Quick Examples — see it in action

# Find where "PlayerHealth" is defined — 1 call, ~50 tokens
aidex_query({ term: "PlayerHealth" })
→ Engine.cs:45, Player.cs:23, UI.cs:156

# All methods in a file — without reading the whole file
aidex_signature({ file: "src/Engine.cs" })
→ class GameEngine { Update(), Render(), LoadScene(), ... }

# What changed in the last 2 hours?
aidex_query({ term: "render", modified_since: "2h" })

# Search across ALL your projects at once
aidex_global_query({ term: "TransparentWindow", mode: "contains" })
→ Found in: LibWebAppGpu (3 hits), DebugViewer (1 hit)

# Leave a note for your next session
aidex_note({ path: ".", note: "Test the parser fix after restart" })

# Create a task while working
aidex_task({ path: ".", action: "create", title: "Fix edge case in parser", priority: 1, tags: "bug" })

目录

语义搜索和LLM层

v2.0 通过本地运行的嵌入添加语义搜索——即使你的AI不知道确切的标识符,它也可以找到一个函数。

三种模式——为问题选择合适的工具

模式功能何时使用
exact标识符匹配(与 aidex_query)你知道这个名字。 PlayerHealth → 3 点击数
semantic基于嵌入式代码+文档+工作空间的矢量KNN你知道 *概念*“我们如何缓存模型”→ finds getQueryEmbedder
hybrid (默认)两者的RRF融合混合查询。默认情况下稳健

什么被嵌入

  • 代码 --每种方法和类型,三层分块(签名+文档注释+加权标识符包)
  • 文档 --Markdown部分(README、CHANGELOG、docs/、计划文件),在标题边界处拆分
  • 工作区 --任务、任务日志、会话笔记、存档笔记历史记录

一个排名,各种各样。一个类似的查询 *“如何从外部程序写入日志”* 展示README文件 ## Log Hub 第一节,然后 log 方法in commands/log.ts,然后是任何相关任务。

设置

// Enable embeddings on a project (one-time, ~30s for AiDex itself, cached afterwards)
aidex_init({ path: ".", embeddings: true })

// Search
aidex_search({ query: "how do we batch requests to the LLM", path: "." })
aidex_search({ query: "retry with backoff", scope: "all" })  // across every embedded project

或者使用 设置标签 在查看器中(aidex_settings({ path: ".", open: true }))--用于嵌入、LLM提供程序、模型和隐私开关的切换。

可选LLM层

当配置Anthropic/OpenAI/OpenRouter/Ollama/HuggingFace API密钥时,AiDex可以:

  • 翻译 non-English queries → “如何在本地保存日志” finds the right code
  • 扩展 将模糊查询转化为2-4个具体子查询(RRF合并)
  • 重新排序 前N个检索候选

隐私开关 llm_send_code 默认为 --只发送文字查询和元数据(路径、名称、锚点)。代码机构保持在本地。每个项目,易于在设置中验证。

本地优先:完全离线使用纯嵌入。LLM层是可选的,从不需要。

问题

每次你的AI助手搜索代码时,它都会:

  • Greps 通过数千个文件→ 数百个结果淹没了上下文
  • 倒像 一个接一个地理解结构→ 消耗更多上下文
  • 忘记 会话结束时的所有内容→ 从头开始重复

一个“X在哪里定义?”问题可以吃掉2000多个代币。这样做10次,你就在导航上烧掉了一半的上下文。

解决方案

索引一次,查询永远:

# Before: grep flooding your context
AI: grep "PlayerHealth" → 200 hits in 40 files
AI: read File1.cs, File2.cs, File3.cs...
→ 2000+ tokens consumed, 5+ tool calls

# After: precise results, minimal context
AI: aidex_query({ term: "PlayerHealth" })
→ Engine.cs:45, Player.cs:23, UI.cs:156
→ ~50 tokens, 1 tool call

结果:用于代码导航的上下文减少了50-80%。

为什么不只是Grep?

Grep/RipgrepAiDex
上下文用法每次搜索2000+个令牌~50个令牌
结果所有文本匹配仅标识符
精确度log 火柴 catalog, logarithmlog 仅查找 log
坚持每次都重新开始索引在会话中幸存下来
结构平面文本搜索知道方法、类、类型

grep的实际成本:每个grep结果都包含周围的上下文。搜索 User 在一个大型项目中,你会得到数百次点击——评论、字符串、部分匹配。你的AI会读取所有这些内容,在噪音上燃烧上下文标记。

AiDex索引标识符:它使用Tree sitter来实际解析您的代码。当你搜索 User,你会得到类定义、方法参数、变量声明,而不是每个提到“user”的注释。

运作原理

  1. 为您的项目建立一次索引 (每1000个文件约1秒)
   aidex_init({ path: "/path/to/project" })
  1. AI搜索索引而不是greping
   aidex_query({ term: "Calculate", mode: "starts_with" })
   → All functions starting with "Calculate" + exact line numbers

   aidex_query({ term: "Player", modified_since: "2h" })
   → Only matches changed in the last 2 hours
  1. 无需读取整个文件即可获取文件概述
   aidex_signature({ file: "src/Engine.cs" })
   → All classes, methods, and their signatures

该指数位于 .aidex/index.db (SQLite)-快速、可移植、无外部依赖。

特性

  • 树保姆解析:真正的代码解析,而不是正则表达式——索引标识符,忽略关键字和噪声
  • 每次搜索约50个代币:与使用grep的2000+相比——你的AI会为实际工作保留上下文
  • 持久索引:在会话之间生存--无需重新扫描,无需重新阅读
  • 增量更新:更改后重新索引单个文件,而不是整个项目
  • 基于时间的过滤:查找过去一小时、一天或一周内发生的变化
  • 自动清理:排除的文件(例如构建输出)将自动从索引中删除
  • 零依赖:带WAL模式的SQLite——单文件、快速、可移植

支持的语言

语言扩展
C .cs
TypeScript.ts, .tsx
JavaScript.js, .jsx, .mjs, .cjs
生锈.rs
python .py, .pyw
C .c, .h
C .cpp, .cc, .cxx, .hpp, .hxx
Java .java
去吧.go
PHP.php
红宝石.rb, .rake
HCL/地形.tf, .tfvars, .hcl

快速开始

先决条件

  • Node.js≥18 (检查 node --version)

- macOS: brew install nodenvm install 18 && nvm use 18 - Linux:使用您的包管理器或 非挥发性物质 - 窗户: - 如果你使用 nvm,回购交易 .nvmrcnvm use 自动选择正确的版本。

1.安装

npm install -g aidex-mcp

就这样 安装程序在安装后自动运行——它检测您安装的AI客户端(Claude Code、Claude Desktop、Cursor、Windsurf、Gemini CLI、VS Code Copilot),并将AiDex注册为MCP服务器。它还将使用说明添加到AI的配置中(~/.claude/CLAUDE.md, ~/.gemini/GEMINI.md).

要手动重新运行安装程序,请执行以下操作: aidex setup |要注销,请执行以下操作: aidex unsetup |要跳过自动设置,请执行以下操作: AIDEX_NO_SETUP=1 npm install -g aidex-mcp

2.或向您的AI助手手动注册

克劳德代码 (~/.claude/settings.json~/.claude.json):

{
  "mcpServers": {
    "aidex": {
      "type": "stdio",
      "command": "aidex",
      "env": {}
    }
  }
}

适用于克劳德桌面 (%APPDATA%/Claude/claude_desktop_config.json 在Windows上):

{
  "mcpServers": {
    "aidex": {
      "command": "aidex"
    }
  }
}
注: 两者 aidexaidex-mcp 用作命令名称。
重要提示: 配置中的服务器名称决定了MCP工具前缀。使用 "aidex" 如上所示,这为您提供了如下工具名称 aidex_query, aidex_signature等等。使用不同的名称(例如。, "codegraph")将相应地更改前缀。

适用于Gemini CLI (~/.gemini/settings.json):

{
  "mcpServers": {
    "aidex": {
      "command": "aidex"
    }
  }
}

VS代码副本 (奔跑 MCP: Open User Configuration 在命令面板中):

{
  "servers": {
    "aidex": {
      "type": "stdio",
      "command": "aidex"
    }
  }
}

对于其他MCP客户端:有关MCP服务器配置,请参阅客户的文档。

3.让你的AI真正使用它

添加到AI的指令中(例如。, ~/.claude/CLAUDE.md 适用于Claude Code,或适用于您的AI客户端的同等软件)。这告诉人工智能 何时以及如何 使用AiDex而不是greping:

## AiDex - Persistent Code Index (MCP Server)

AiDex provides fast, precise code search through a pre-built index.
**Always prefer AiDex over Grep/Glob for code searches.**

### REQUIRED: Before using Grep/Glob/Read for code searches

我想搜索代码吗? ├── .aidex/存在→ STOP!请改用AiDex ├── .aidex/失踪→ 运行aidex_init(不要问),然后使用aidex └── 配置/日志/文本→ Grep/Read没问题


**NEVER do this when .aidex/ exists:**
- ❌ `Grep pattern="functionName"` → ✅ `aidex_query term="functionName"`
- ❌ `Grep pattern="class.*Name"` → ✅ `aidex_query term="Name" mode="contains"`
- ❌ `Read file.cs` to see methods → ✅ `aidex_signature file="file.cs"`
- ❌ `Glob pattern="**/*.cs"` + Read → ✅ `aidex_signatures pattern="**/*.cs"`

### Session-Start Rule (REQUIRED — every session, no exceptions)

1. Call `aidex_session({ path: "
" })` — detects external changes, auto-reindexes
2. If `.aidex/` does NOT exist → run `aidex_init` automatically (don't ask)
3. If a session note exists → **show it to the user** before continuing
4. **Before ending a session:** always leave a note about what to do next

### Question → Right Tool

| Question | Tool |
|----------|------|
| "Where is X defined?" | `aidex_query term="X"` |
| "Find anything containing X" | `aidex_query term="X" mode="contains"` |
| "All functions starting with X" | `aidex_query term="X" mode="starts_with"` |
| "What methods does file Y have?" | `aidex_signature file="Y"` |
| "Explore all files in src/" | `aidex_signatures pattern="src/**"` |
| "Project overview" | `aidex_summary` + `aidex_tree` |
| "What changed recently?" | `aidex_query term="X" modified_since="2h"` |
| "What files changed today?" | `aidex_files path="." modified_since="8h"` |
| "Have I ever written X?" | `aidex_global_query term="X" mode="contains"` |
| "Which project has class Y?" | `aidex_global_signatures term="Y" kind="class"` |
| "All indexed projects?" | `aidex_global_status` |

### Search Modes

- **`exact`** (default): Finds only the exact identifier — `log` won't match `catalog`
- **`contains`**: Finds identifiers containing the term — `render` matches `preRenderSetup`
- **`starts_with`**: Finds identifiers starting with the term — `Update` matches `UpdatePlayer`, `UpdateUI`

### All Tools (30)

| Category | Tools | Purpose |
|----------|-------|---------|
| Search & Index | `aidex_init`, `aidex_query`, `aidex_update`, `aidex_remove`, `aidex_status` | Index project, search identifiers (exact/contains/starts_with), time filter |
| Signatures | `aidex_signature`, `aidex_signatures` | Get classes + methods without reading files |
| Overview | `aidex_summary`, `aidex_tree`, `aidex_describe`, `aidex_files` | Entry points, file tree, file listing by type |
| Cross-Project | `aidex_link`, `aidex_unlink`, `aidex_links`, `aidex_scan` | Link dependencies, discover projects |
| Global Search | `aidex_global_init`, `aidex_global_query`, `aidex_global_signatures`, `aidex_global_status`, `aidex_global_refresh` | Search across ALL projects |
| Guidelines | `aidex_global_guideline` | Persistent AI instructions & conventions (key-value, global) |
| Sessions | `aidex_session`, `aidex_note` | Track sessions, leave notes (with searchable history) |
| Tasks | `aidex_task`, `aidex_tasks` | Built-in backlog with priorities, tags, summaries, auto-logged history, scheduled/recurring tasks |
| Log Hub | `aidex_log` | Universal log receiver — any program sends logs via HTTP, AI queries them, live in Viewer |
| Screenshots | `aidex_screenshot`, `aidex_windows` | Screen capture with LLM optimization (scale + color reduction, no index needed) |
| Viewer | `aidex_viewer` | Interactive browser UI with file tree, signatures, tasks, and live logs |

**12 languages:** C#, TypeScript, JavaScript, Rust, Python, C, C++, Java, Go, PHP, Ruby, HCL/Terraform

### Session Notes

Leave notes for the next session — they persist in the database:

aidex_note({路径:“.”,注意:“重新启动后测试修复程序”})#写入 aidex_note({path:“.”,note:“也检查边缘情况”,append:true})#追加 aidex_note({路径:“.”})#读取 aidex_note({路径:“.”,搜索:“parser”})#搜索历史 aidex_note({path:“.”,clear:true})#清除

- **Before ending a session:** automatically leave a note about next steps
- **User says "remember for next session: ..."** → write it immediately

### Task Backlog

Track TODOs, bugs, and features right next to your code index:

aidex_task({路径:“.”,动作:“创建”,标题:“修复bug”,优先级:1,标签:“bug”}) aidex_task({路径:“.”,操作:“更新”,id:1,状态:“完成”}) aidex_task({路径:“.”,操作:“log”,id:1,注意:“找到根本原因”}) aidex_tasks({路径:“.”,状态:“活动”})

计划任务和重复任务

aidex_task({路径:“.”,操作:“创建”,标题:“检查PR状态”,到期时间:“3d”,间隔:“3d“,task_action:“gh-PR-list”})

Priority: 1=high, 2=medium, 3=low | Status: `backlog → active → done | cancelled`

### Global Search (across all projects)

aidex_global_init({路径:“/path/to/all/restore”})#扫描并注册 aidex_global_init({path:“…”,index_unindexed:true})#+自动索引小项目 aidex_global_query({术语:“透明窗口”,模式:“包含”})#到处搜索 aidex_global_signatures({术语:“Render”,种类:“method”})#到处都能找到方法 aidex_global_status({排序:“最近”})#列出所有项目


### Screenshots

aidex_screenshot()#全屏 aidex_screenshot({模式:“active_window”})#活动窗口 aidex_screenshot({模式:“窗口”,窗口标题:“VS代码”})#特定窗口 aidex_screenshot({比例:0.5,颜色:2})#黑白,半尺寸(最适合LLM) aidex_screenshot({颜色:16})#16种颜色(UI可读) aidex_windows({过滤器:“chrome”})#查找窗口标题

No index needed. Returns file path → use `Read` to view immediately.

**LLM optimization strategy:** Always start with aggressive settings, then retry if unreadable:
1. First try: `scale: 0.5, colors: 2` (B&W, half size — smallest possible)
2. If unreadable: retry with `colors: 16` (adds shading for UI elements)
3. If still unclear: `scale: 0.75` or omit `colors` for full quality
4. **Remember** what works for each window/app during the session — don't retry every time.

4.为你的项目建立索引

问你的AI: *“用AiDex索引此项目”*

或者在AI聊天中手动:

aidex_init({ path: "/path/to/your/project" })

可用工具

工具说明
aidex_init为项目建立索引(创建 .aidex/)
aidex_query按词搜索(精确/包含/开始)
aidex_signature获取一个文件的类+方法
aidex_signatures获取多个文件的签名(glob)
aidex_update重新索引单个已更改的文件
aidex_remove从索引中删除已删除的文件
aidex_summary项目概况
aidex_tree带有统计信息的文件树
aidex_describe在摘要中添加文档
aidex_link链接另一个索引项目
aidex_unlink删除链接项目
aidex_links列出链接的项目
aidex_status指数统计
aidex_scan在目录树中查找索引项目
aidex_files按类型列出项目文件(代码/配置/文档/资产)
aidex_note读/写会话笔记(在会话之间持续)
aidex_session启动会话,检测外部更改,自动重新索引
aidex_viewer在浏览器中打开交互式项目树
aidex_task创建、读取、更新、删除具有优先级和标签的任务
aidex_tasks按状态、优先级或标签列出和筛选任务
aidex_screenshot使用可选比例+减色进行屏幕截图(全屏、窗口、区域)
aidex_windows列出用于屏幕截图定位的打开窗口
aidex_global_init扫描目录树,在全局数据库中注册所有索引项目
aidex_global_status列出所有已注册的项目及其统计数据
aidex_global_query搜索所有已注册项目中的术语
aidex_global_signatures在所有项目中按名称搜索方法/类型
aidex_global_refresh更新统计数据并从全局数据库中删除过时的项目
aidex_global_guideline存储/检索人工智能指南和编码约定(键值,全局)
aidex_log通用日志接收器——启动HTTP服务器,查询日志,在查看器中实时流式传输

基于时间的过滤

跟踪最近发生了什么变化 modified_sincemodified_before:

aidex_query({ term: "render", modified_since: "2h" })   # Last 2 hours
aidex_query({ term: "User", modified_since: "1d" })     # Last day
aidex_query({ term: "API", modified_since: "1w" })      # Last week

支持的格式:

  • 相对的: 30m (分钟), 2h (小时), 1d (天), 1w (周)
  • ISO日期: 2026-01-272026-01-27T14:30:00

非常适合回答以下问题 *“在过去的一个小时里,我改变了什么?”*

项目结构

AiDex索引项目中的所有文件(不仅仅是代码),让您查询结构:

aidex_files({ path: ".", type: "config" })  # All config files
aidex_files({ path: ".", type: "test" })    # All test files
aidex_files({ path: ".", pattern: "**/*.md" })  # All markdown files
aidex_files({ path: ".", modified_since: "30m" })  # Changed this session

文件类型: code, config, doc, asset, test, other, dir

使用 modified_since 查找此会话中更改的文件-非常适合 *“我编辑了什么?”*

会议笔记

为下一个会话留下提醒-聊天之间不再失去上下文:

aidex_note({ path: ".", note: "Test the glob fix after restart" })  # Write
aidex_note({ path: ".", note: "Also check edge cases", append: true })  # Append
aidex_note({ path: "." })                                              # Read
aidex_note({ path: ".", clear: true })                                 # Clear

注释历史记录 (v1.10):旧笔记在被覆盖或清除时会自动存档。浏览和搜索过去的笔记:

aidex_note({ path: ".", history: true })                    # Browse archived notes (shows summaries)
aidex_note({ path: ".", search: "parser" })                 # Search note history (searches summaries too)
aidex_note({ path: ".", history: true, limit: 5 })          # Last 5 archived notes

注释摘要 (v1.15):提供 summary 在写/清除笔记时,存档的笔记会得到一句话的描述。然后,历史记录显示摘要,而不是截断的文本:

aidex_note({ path: ".", note: "New focus", summary: "Previous session: finished parser refactoring" })

使用案例:

  • 在结束会话之前: *“下次记得测试X”*
  • AI自动提醒:保存重启后要验证的内容
  • 移交说明:下一次会话的上下文,不编辑配置文件
  • 搜索过去的会话: *“我们对解析器做了什么?”*

注释存储在SQLite数据库中(.aidex/index.db)并无限期地持续下去。

任务积压

将项目任务放在代码索引旁边——没有Jira,没有Trello,没有上下文切换:

aidex_task({ path: ".", action: "create", title: "Fix parser bug", priority: 1, tags: "bug", summary: "Parser crashes on nested generics in C#" })
aidex_task({ path: ".", action: "update", id: 1, status: "done" })
aidex_task({ path: ".", action: "log", id: 1, note: "Root cause: unbounded buffer" })
aidex_tasks({ path: ".", status: "active" })

计划任务和重复任务

任务可以有截止日期和重复间隔。所有项目的每个会话开始时都会报告逾期任务:

# One-shot: remind in 3 days
aidex_task({ path: ".", action: "create", title: "Review PR", due: "3d", task_action: "Check if PR was submitted" })

# Recurring: check every week
aidex_task({ path: ".", action: "create", title: "Check dependencies", due: "1w", interval: "1w", task_action: "npm outdated" })

# Auto-execute: runs the action automatically when due
aidex_task({ path: ".", action: "create", title: "Refresh stats", due: "1d", interval: "1d", auto_go: true })

到期格式: 相对("30m", "2h", "3d", "1w")或ISO日期("2026-04-10")

在每一个 aidex_session 呼叫 任务计划程序 检查 ~/.aidex/global.db 适用于所有项目中的到期任务,即使您正在处理不同的项目。重复任务在每次触发后自动提前到期日期。

特征:

  • 摘要:每项任务一句话的目录——在不阅读全部细节的情况下扫描积压的工作
  • 优先事项: 🔴 高,🟡 中等,⚪ 低
  • 状态: backlog → active → done | cancelled
  • 标签:对任务进行分类(bug, feature, docs等等)
  • 历史记录:每次状态更改都会自动记录,并附有手动注释
  • 调度:所有项目的截止日期、重复间隔、操作、自动执行
  • 查看器集成:浏览器查看器中带有实时更新的“任务”选项卡
  • 持久:任务在会话之间存活,存储在 .aidex/index.db

您的AI助手可以在工作时创建任务(*在解析器中发现了一个错误,将其添加到待办事项列表中*),跟踪进度,并从下一节课结束的地方继续。

全局搜索

一次搜索所有索引项目。非常适合 *“我写过透明的窗户吗?”* 或 *“我在哪里使用了那个算法?”*

设置

aidex_global_init({ path: "Q:/develop" })                              # Scan & register
aidex_global_init({ path: "Q:/develop", exclude: ["llama.cpp"] })      # Skip external repos
aidex_global_init({ path: "Q:/develop", index_unindexed: true })       # Auto-index all found projects
aidex_global_init({ path: "Q:/develop", index_unindexed: true, show_progress: true })  # With browser progress UI

这将扫描您的项目目录,在全局数据库中注册所有AiDex索引项目(~/.aidex/global.db),并通过检测项目标记来报告它发现的任何未编制索引的项目(.csproj, package.json, Cargo.toml等等)。

随着 index_unindexed: true,它还自动索引所有发现的代码文件≤500的项目。较大的项目单独列出,供用户决策。添加 show_progress: true 在浏览器中打开实时进度UI(http://localhost:3334).

搜索

aidex_global_query({ term: "TransparentWindow" })                      # Exact match
aidex_global_query({ term: "transparent", mode: "contains" })          # Fuzzy search
aidex_global_signatures({ term: "Render", kind: "method" })            # Find methods
aidex_global_signatures({ term: "Player", kind: "class" })             # Find classes

运作原理

  • 使用SQLite ATTACH DATABASE 直接查询项目数据库--不复制数据
  • 结果缓存在内存中(5分钟TTL),用于快速重复查询
  • 项目被分批处理(一次8个)以遵守SQLite的附件限制
  • 每个项目都有自己的 .aidex/index.db 作为真理的唯一来源
  • 自动重复数据删除:包含子项目的父项目被自动跳过(例如。, MyApp/ 在以下情况下被删除 MyApp/Frontend/MyApp/Backend/ 作为单独的索引项目存在)

管理

aidex_global_status()                                                  # List all projects
aidex_global_status({ sort: "recent" })                                # Most recently indexed first
aidex_global_refresh()                                                 # Update stats, remove stale

人工智能指南

将持久的编码约定、审查清单和人工智能指令存储在一个地方——在所有项目中共享。

aidex_global_guideline({ action: "set", key: "review", value: "Always check: error handling, null safety, no hardcoded strings" })
aidex_global_guideline({ action: "set", key: "style", value: "Use PascalCase for classes, camelCase for methods, 4-space indent" })
aidex_global_guideline({ action: "get", key: "review" })               # Retrieve a guideline
aidex_global_guideline({ action: "list" })                             # Show all guidelines
aidex_global_guideline({ action: "list", filter: "code" })             # Filter by name
aidex_global_guideline({ action: "delete", key: "old-rule" })          # Remove a guideline

使用案例:

  • 代码审查清单:告诉你的AI每次都要寻找什么
  • 编码约定:存储一次团队风格规则,在任何项目中引用它们
  • 发布清单:逐步装运流程
  • 与项目无关的说明:不再将相同的上下文粘贴到每个会话中

指南存储在 ~/.aidex/global.db --适用于所有项目,无需 aidex_init问你的AI: *“加载审核指南并将其应用于此文件。”*

日志中心--通用日志记录

将任何程序转换为AI助手的日志源。您的应用程序通过HTTP POST发送日志,AI通过MCP查询日志,您可以在查看器中实时看到它们——零依赖关系,代码中的零设置。

运作原理

Your Program ──HTTP POST──→ AiDex Log Hub (port 3335) ──→ Ring Buffer
                                        │                      │
                                        │ WebSocket             │ MCP query
                                        ↓                      ↓
                                   Viewer (Logs tab)      AI Assistant
                                   (you see live)       (queries & analyzes)

快速启动

  1. AI启动日志中心: aidex_log({ action: "init" })
  2. AI打开查看器: aidex_viewer({ path: "." }) --日志选项卡显示实时流
  3. 在程序中添加一行:
// C#
await new HttpClient().PostAsJsonAsync("http://localhost:3335/log",
    new { level = "info", source = "MyApp", message = "Player spawned", data = new { x = 10, y = 20 } });
# Python
requests.post("http://localhost:3335/log", json={"level": "info", "source": "MyApp", "message": "Done"})
// JavaScript
fetch("http://localhost:3335/log", {
    method: "POST", headers: {"Content-Type": "application/json"},
    body: JSON.stringify({level: "info", source: "MyApp", message: "Started"})
});
# PowerShell
Invoke-RestMethod -Uri http://localhost:3335/log -Method POST -ContentType "application/json" -Body '{"level":"info","source":"Script","message":"Done"}'

HTTP API

端点方法主体描述
/log职位{ level, source, message, data? }单个日志条目
/logs职位[{ ... }, ...]批次(一次多个)
/healthGET--状态+缓冲区使用情况

领域: level (debug/info/warn/error), source (应用程序名称), message (文本,必填), data (可选JSON), timestamp (可选,毫秒)

特性

  • 环形缓冲区:固定大小的内存FIFO(默认10000个条目)--覆盖最旧的条目
  • 零成本:没有服务器、没有缓冲区、没有资源,直到 init 被称为
  • 坚持:可选的SQLite存储,具有7天自动清理功能(persist: true)
  • 消费模式: queryconsume: true 删除返回的条目——非常适合轮询
  • 查看器集成:带有WebSocket实时流、级别/源/文本过滤器、自动滚动的日志选项卡
  • 火与遗忘:只需POST并继续——如果服务器未运行,POST将自动失败

截图——LLM优化

截图并 将其减少到95% 对于LLM背景。一个典型的屏幕截图从大约100 KB到大约5 KB不等,也就是说每张图片保存了数千个令牌。

为什么这很重要

原始截图优化(比例=0.5,颜色=2)
文件大小约100-500kb约5-15kb
消耗的代币~5,000-25,000~250-750
文本可读?
颜色16M(24位)2(黑白)

人工智能环境中的大多数屏幕截图都是用于阅读文本的——错误消息、日志、UI标签。你不需要1600万种颜色。

用法

aidex_screenshot()                                             # Full screen (full quality)
aidex_screenshot({ mode: "active_window" })                    # Active window
aidex_screenshot({ mode: "window", window_title: "VS Code" }) # Specific window
aidex_screenshot({ scale: 0.5, colors: 2 })                   # B&W, half size (best for text)
aidex_screenshot({ scale: 0.5, colors: 16 })                  # 16 colors (UI readable)
aidex_screenshot({ colors: 256 })                              # 256 colors (good quality)
aidex_screenshot({ mode: "region" })                           # Interactive selection
aidex_screenshot({ mode: "rect", x: 100, y: 200, width: 800, height: 600 })  # Coordinates
aidex_windows({ filter: "chrome" })                            # Find window titles

优化参数

参数说明
scale0.1-1.0比例因子(0.5=半分辨率)。无论如何,大多数HiDPI屏幕都是2-3x的。
colors2、4、16、256减色。2=黑白,非常适合文本截图。

人工智能助手的推荐策略

工具描述告诉LLM自动优化:

  1. 开始咄咄逼人: scale: 0.5, colors: 2 (尽可能小)
  2. 如果不可读:重试 colors: 16 (为UI元素添加阴影)
  3. 如果仍然不清楚:试试 scale: 0.75 或全彩
  4. 记住:缓存会话剩余时间每个窗口/应用程序的工作内容

通过这种方式,AI可以学习每个应用程序的正确设置,而不会在超大图像上浪费令牌。

特性

  • 5种捕捉模式:全屏、活动窗口、特定窗口(按标题)、交互式区域选择、基于坐标的矩形
  • 跨平台:Windows(PowerShell+系统绘图)、macOS(sips+图像魔术)、Linux(图像魔术)
  • 多显示器:选择要捕获的监视器
  • 延迟:捕获前等待N秒(例如,先打开菜单)
  • 尺寸报告:显示原件→ 优化的大小和节省的百分比
  • 自动路径:默认保存到具有固定文件名的临时目录
  • 无需索引:独立工作,没有 .aidex/ 需要

交互式查看器

在浏览器中直观地浏览您的索引项目:

aidex_viewer({ path: "." })

打开 http://localhost:3333 与:

  • 交互式文件树 -单击以展开目录
  • 文件签名 -单击任何文件以查看其类型和方法
  • 实时重新加载 -编码时自动检测到更改
  • Git状态图标 -查看哪些文件被修改、暂存或未跟踪
  • 日志选项卡 -来自日志中心的实时日志流,带有过滤器(级别、来源、文本搜索)
  • 任务选项卡 -查看和管理您的任务积压

AiDex Viewer - Signatures

AiDex Viewer - Overview

AiDex Viewer - Code

AiDex Viewer - Tasks

AiDex Viewer - Logs

与…接近 aidex_viewer({ path: ".", action: "close" })

CLI使用情况

aidex scan Q:/develop       # Find all indexed projects
aidex init ./myproject      # Index a project from command line
aidex-mcp 用作的别名 aidex.

演出

项目文件项目索引时间查询时间
小(AiDex)191200\<1s1-5ms
中等(远程调试)101900\<1s1-5ms
大(LibPyramid3D)183000\<1s1-5ms
XL(梅洛TTS)564100~2s1-10ms

技术

  • 解析器: 树保姆 -真正的解析,而不是正则表达式
  • 数据库:带WAL模式的SQLite-快速、单文件、零配置
  • 协议: 主控程序 -适用于任何兼容的AI

项目结构

.aidex/                  ← Created in YOUR project
├── index.db             ← SQLite database
└── summary.md           ← Optional documentation

AiDex/                   ← This repository
├── src/
│   ├── commands/        ← Tool implementations
│   ├── db/              ← SQLite wrapper
│   ├── parser/          ← Tree-sitter integration
│   └── server/          ← MCP protocol handler
└── build/               ← Compiled output

社区

**** --提出问题,分享你的设置,提出想法。

类别适用
问答设置帮助、使用问题
想法功能建议
展示与讲述分享您的工作流程
公告发布新闻(仅限维护人员)

贡献

贡献.md 了解全部细节。快速摘要:

  • 程序错误提出问题
  • 想法?开始讨论
  • 新语言? → 在中添加关键字文件 src/parser/languages/ 并打开一个PR

许可证

MIT许可证-请参阅 许可证

作者

乌维·查拉斯和克劳德

目录标签

目录标签

代码索引本地优先TypeScriptClaude本地部署语义搜索AI编程辅助开发效率工具

支持客户端

Claude DesktopClaudeCursorWindsurfVS Code

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

token

运行时(runtime,运行环境)

Node.js

部署方式(deploymentType,部署类型)

local-only

工具数量(toolCount,工具数)

31

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdiotokenlocal-only

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP