AGY Transcript Search
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
AGY Transcript Search (agy-transcript-search)
面向 Antigravity 的零外部依赖本地只读 MCP 插件:基于 Node.js 内置 node:sqlite(SQLite FTS5)为会话转录日志提供增量字节偏移索引与中英文双语混合检索,并强制所有工具返回严格控制在 <= 4096 UTF-8 字节内,让智能体在不撑爆上下文窗口的前提下按需回查历史对话决策、报错码、文件路径与工具执行记录。
核心特性
1. 严格只读的增量字节偏移 SQLite FTS5 索引
零侵入只读访问:通过
openSync(path, 'r')(POSIX 上附带O_NOFOLLOW)+fstatSync校验dev/ino后以 256 KiB 分块流式只读读取会话日志,绝不修改、截断或锁定brain/目录中的原始文件。优先高精度日志与自动回退:优先读取
transcript_full.jsonl;缺失时自动回退至transcript.jsonl,当后续生成transcript_full.jsonl时自动重建缓存。增量追加与抗并发写入:在每会话独立的 SQLite 数据库(
<dataDir>/cache/<conversation_id>.sqlite)中持久化byte_offset、source_dev、source_ino、source_mtime_ns、prefix_sha256、file_size与schema_version('2');每次查询仅读取新增字节,并自动跳过尚未写完的尾部半行 JSONL。自动自愈重建:当日志被截断/重写(
fileSize < savedByteOffset)、内容指纹变化(prefix_sha256/dev/ino不匹配)、发生同大小覆盖(mtimeNs变化)、源文件切换或真正遇到 SQLite 损坏时自动重建索引(绝不因SQLITE_BUSY等瞬态锁冲突误删缓存)。
2. 中英文双语检索与精准混合排序
英文 / 代码 / 报错码 / 路径精确匹配:基于 FTS5
unicode61分词器索引在 CJK 边界自动空格切分后的文本(支持无空格混排如"我们使用SQLite数据库"、"修复ECONNREFUSED错误",以及byte_offset、ECONNREFUSED、src/auth/token-store.mjs),并对所有查询词进行严格双引号转义,彻底屏蔽-、/、.、:或AND/OR/NOT/NEAR引发的 FTS5 语法注入或报错。CJK 连续 2-gram + 精确短语与单字校验:支持汉字、假名与韩文(
Han/Hiragana/Katakana/Hangul)连续片段生成重叠 2-gram(cjk_bigrams)配合unicode61检索;长度 ≥ 3 的 CJK 短语与单字查询均自动叠加INSTR()校验,兼顾“压缩”“报错”“增量索引”等多字词召回与精确度,同时避免跨标点(如“甲乙,乙丙”误命中“甲乙丙”)或非相邻单字误命中。三种排序模式(
sort):hybrid(默认):综合 BM25 相关性(60%)、步骤近因度(32%)与高信号角色加权(USER_INPUT/PLANNER_RESPONSE+0.12,ERROR_MESSAGE+0.08)。recent:按step_index DESC返回最新匹配。relevance:按 BM25 相关性优先排序。
3. 噪声压缩与硬性 4096 字节返回上限
高信号保留与噪声折叠:完整保留
USER_INPUT(上限 16000 字符)、PLANNER_RESPONSE(正文 16000 字符 + 精简思考摘要 + 工具调用摘要与引用文件列表)和ERROR_MESSAGE;自动将冗长的GENERIC/SYSTEM_MESSAGE/CHECKPOINT输出折叠压缩为首尾摘要(上限 2500 字符)。硬性上下文预算守卫:所有工具(
transcript_search、transcript_read_steps、transcript_timeline)共享fitPayloadToByteLimit(..., 4096),确保content[0].text序列化后的 JSON 响应严格<= 4096UTF-8 字节(包括错误响应,绝不截断成非法 JSON)。
Related MCP server: agy-brain-memory
MCP 工具参考
插件通过 mcp_config.json 注册本地 stdio MCP 服务(node ${PLUGIN_ROOT}/src/mcp-server.mjs),提供以下 3 个只读、非破坏性、幂等工具:
1. transcript_search
在指定会话中检索中英文关键词、报错码、标识符或文件路径,返回以命中位置为中心的紧凑摘要。
参数 | 类型 | 必填 | 默认值 | 说明 |
|
| 是 | — | 会话 ID(严格匹配 |
|
| 是 | — | 搜索关键词(支持中文、英文、代码符号、文件路径或混合查询) |
|
| 否 |
| 角色过滤: |
|
| 否 | — | 仅返回 |
|
| 否 | — | 仅返回 |
|
| 否 |
| 排序方式: |
|
| 否 |
| 返回条数上限( |
2. transcript_read_steps
按 step_index 闭区间精确回读指定步骤范围的原始内容与引用文件列表。单次最多返回 50 步;若区间内存在更多步骤,响应将标记 truncated: true 并返回 next_step 用于翻页续读。
参数 | 类型 | 必填 | 默认值 | 说明 |
|
| 是 | — | 会话 ID |
|
| 是 | — | 起始步骤号( |
|
| 是 | — | 结束步骤号( |
|
| 否 |
| 文本预算字符数( |
3. transcript_timeline
按倒序浏览会话时间线(用户输入、涉及文件或全部关键节点),快速定位需要进一步搜索或回读的 step_index 区间。
参数 | 类型 | 必填 | 默认值 | 说明 |
|
| 是 | — | 会话 ID |
|
| 否 |
| 时间线过滤: |
|
| 否 |
| 返回条数上限( |
前置条件与安全隐私披露
运行前置条件
Node.js ≥ 22.5.0(使用内置
node:sqlite的DatabaseSync与 FTS5,零第三方 npm 依赖;Node.js>= 22.13.0原生免参数支持node:sqlite,22.5–22.12需在启动命令中附带--experimental-sqlite)。本地存在 Antigravity 会话日志目录(默认
~/.gemini/antigravity/brain/<conversation_id>/.system_generated/logs/)。
本地读写路径清单(全平台)
用途 | 读写权限 | 路径 |
Antigravity 会话转录日志 | 严格只读 |
|
插件安装目录 | 安装 / 卸载写入 |
|
SQLite FTS5 索引缓存目录(POSIX | 读写 |
|
单会话 SQLite 缓存文件(POSIX | 读写 |
|
在 Windows 上,POSIX 权限位为无操作(no-op),由操作系统用户目录 ACL 控制
%USERPROFILE%\.gemini\antigravity\plugin_data\agy-transcript-search\的访问权限。
环境变量覆盖(可选):
AGY_TRANSCRIPT_SEARCH_BRAIN_DIR:显式覆盖brain/根目录路径。AGY_TRANSCRIPT_SEARCH_DATA_DIR(或PLUGIN_DATA):显式覆盖插件数据根目录(缓存将存放在<dataDir>/cache/)。ANTIGRAVITY_APP_DATA_DIR:显式覆盖 Antigravity 应用数据前缀(默认~/.gemini/antigravity)。
安全防护机制
路径穿越与符号链接逃逸防护:拒绝任何包含
/、\、..、%、:、空白符、NUL 字节、前导.、末尾.或 Windows 保留设备名(CON/NUL/COM1等)的conversation_id;逐级通过lstatSync()验证<conversation_id>/.system_generated/logs不含符号链接,并以O_NOFOLLOW+fstat核验dev/ino与realpathSync()位于brain/真实目录之内,同时禁止缓存目录与brain/重叠。零外网与零凭据访问:纯本地 stdio MCP 通信,零 HTTP 服务监听、零外网请求、零读取 OAuth/API Key 或系统钥匙串。
私有缓存权限:macOS 与 Linux 上自动强制
cache/为0o700、.sqlite(含-wal/-shm)为0o600。
安装、自检与卸载
安装
git clone https://github.com/liangsiweiethan-wq/agy-transcript-search.git
cd agy-transcript-search
node scripts/install.mjs安装脚本会校验 Node.js ≥ 22.5.0 及 node:sqlite FTS5 可用性,先在临时暂存目录校验 plugin.json、mcp_config.json 与必需文件后再原子替换 ~/.gemini/config/plugins/agy-transcript-search/(升级失败自动回滚备份,自动跳过 .git/、.github/、test/、scripts/、node_modules/ 与符号链接,并拒绝源目录中的 .jsonl/.sqlite*/.db 产物)。支持 --target-dir <dir> 或 npm run install-plugin。
开发与自检命令
npm run check # 全部 .mjs 模块语法检查 (node --check)
npm test # 运行单元测试与 MCP stdio 端到端测试
npm run privacy-check # 个人路径/敏感词/不安全调用/manifest 扫描完整卸载
# 仅移除已安装的插件文件(保留缓存数据库)
node scripts/uninstall.mjs
# 彻底卸载并安全清除插件 SQLite 缓存(仅删除 cache/*.sqlite*,目录为空时才移除并保留用户无关文件)
node scripts/uninstall.mjs --purge-data卸载脚本会先校验目标目录不包含 .git 且 plugin.json 确认为 agy-transcript-search 后再移除插件目录;支持 --target-dir <dir> 与 --data-dir <dir> 参数。
许可证
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Search your AI chat history (ChatGPT, Claude, Codex) from any MCP client. Remote, private, read-only
Your personal library, readable by AI agents: durable snapshots, hybrid search, 46 MCP tools.
Ingest and search LogsLoom logs from coding agents.
Verified doc corpora for agents: grep-first retrieval, hashed pages, Merkle+RFC-3161 receipts
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables Claude Code to search and retrieve information from its past session transcripts, including tool calls, errors, and project-specific history, via an SQLite FTS5 full-text search index.MIT
- AlicenseAqualityBmaintenanceEnables incremental SQLite/FTS5 indexing and cross-conversation BM25 search over Antigravity transcripts and artifacts, plus subagent lineage reconstruction, compact session digests, and health diagnostics through MCP tools.5MIT
- AlicenseAqualityCmaintenanceEnables full-text search and contextual lookup across local DSH session logs, workspace documents, skills, and persona files using an offline SQLite FTS5 index with Chinese bigram tokenization, plus incremental indexing and status statistics.4MIT
- AlicenseAqualityBmaintenanceEnables AI agents to index local codebases into isolated SQLite FTS5 databases and search them for ranked file paths, line ranges, and highlighted snippets, reducing context spent opening whole files.31MIT