Borrowing it
Nothing to install: this file belongs to damoqiongqiu/mcp-local-rag. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/damoqiongqiu/mcp-local-rag/main/AGENTS.mdgit clone --depth 1 https://github.com/damoqiongqiu/mcp-local-ragWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/instructions/damoqiongqiu/mcp-local-rag/agents-md)<a href="https://agentmods.dev/instructions/damoqiongqiu/mcp-local-rag/agents-md"><img src="https://agentmods.dev/badge/instructions/damoqiongqiu/mcp-local-rag/agents-md/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/instructions/damoqiongqiu/mcp-local-rag/agents-md"><img src="https://agentmods.dev/badge/instructions/damoqiongqiu/mcp-local-rag/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.02613 | $0.02613 |
| Opus 5 | $0.01307 | $0.01307 |
| Sonnet 5 | $0.00523 | $0.00523 |
| Haiku 4.5 | $0.00261 | $0.00261 |
Grade A, and why
mcp-local-rag AGENTS.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 216 lines — stays where its author put it; the contents beside it link to each section on GitHub.
AGENTS.md
为 mcp-local-rag 项目工作的 AI 编码 Agent 使用指南。
项目概述
mcp-local-rag 是一个本地 RAG(检索增强生成)MCP 服务器和 CLI 工具 — 带关键词增强的语义文档搜索,完全私有,零配置。支持摄入 PDF/DOCX/TXT/MD/HTML 文件,按语义(而非字符数)分块,使用 Transformers.js 生成嵌入向量,存入 LanceDB,并提供 7 个 MCP 工具和对应的 CLI 子命令。
- 包名:npm 上的
@damoqiongqiu/mcp-local-rag - 许可证:MIT
- Node 版本:>= 22
- 包管理器:pnpm(锁文件:
pnpm-lock.yaml) - 语言:TypeScript 6.0,严格模式,ES Modules(
"type": "module") - 模块系统:Node16(
"module": "node16"),相对导入须带.js扩展名
常用命令
pnpm install # 安装依赖
pnpm run build # TypeScript 编译 → dist/
pnpm run dev # 通过 tsx 运行(无需构建)
pnpm run test # 运行全部测试(CPU,maxWorkers: 1)
pnpm run check:all # 完整 CI 流水线(lint + format + unused + deps + build + test)
pnpm run check:fix # 自动修复 lint 和格式化问题
pnpm run type-check # tsc --noEmit
项目结构
src/
index.ts # 入口 — 路由到 CLI 或 MCP 服务器
cli-main.ts # CLI 调度器(ingest、query、list、delete、read-neighbors、status)
server-main.ts # MCP 服务器启动
cli/ # CLI 子命令实现 + 选项解析
server/ # MCP 工具处理器、定义、输入解析、错误工具
parser/ # 文档解析器(PDF 用 mupdf、DOCX 用 mammoth、TXT、MD、HTML、代码文件)
chunker/ # 分块(SemanticChunker 语义分块 + CodeChunker AST 分块)
embedder/ # Transformers.js 嵌入(通过 ONNX 加载 HuggingFace 模型)
vectordb/ # LanceDB 操作、向量存储、类型定义
ingest/ # 摄入流水线(计算分块、PDF 视觉标注)
utils/ # 共享工具(base-dirs、errors、raw-data、scan、scope-match)
__tests__/ # 全部测试套件(与 src/ 结构镜像)
skills/ # 随包发布的 Agent Skills
scripts/ # 构建/测试辅助脚本
代码规范
格式化(Biome)
- 缩进:2 空格
- 引号:单引号(
') - 分号:无(
"semicolons": "asNeeded") - 尾逗号:ES5(
"trailingCommas": "es5") - 行宽:100
- 自动修复:
pnpm run check:fix
Lint 规则
- Biome 推荐规则 +
noExplicitAny: "warn"(测试文件中关闭) noNonNullAssertion: "off"、useLiteralKeys: "off"knip检查未使用的导出(pnpm run check:unused)dpdm检查循环依赖(pnpm run check:deps)
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 11d ago First seen · 216 lines · 2,613 tokens per session scan A 4c9dfe8bd209
mcp-local-rag AGENTS.md is an instructions file published in the GitHub repository damoqiongqiu/mcp-local-rag (13 stars, last pushed 1mo ago), licensed MIT. It adds 2,613 tokens to every session, about $0.0131 per session on Opus 5. A static security scan graded it A with 0 findings. It comes from a forked repository.
Other instructions, from other repositories
next.js AGENTS.md
AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.
codex AGENTS.md
AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.
vscode buildNext.instructions.md
Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).
spec-kit AGENTS.md
AGENTS.md instructions for github/spec-kit, covering agents.md, about spec kit and specify, quickstart — add a new integration in 5 steps, integration architecture and integrationmanifest — file tracking.
vscode oss-third-party-notices.instructions.md
Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).
langchain AGENTS.md
AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.