mcp-local-rag: Instructions file for Codex

AGENTS.md

mcp-local-rag AGENTS.md is an instructions file for Codex, OpenCode from damoqiongqiu/mcp-local-rag. It costs 2,613 tokens per session, scanned A, original, from a forked repository, MIT.

Project instructions for mcp-local-rag, a private local search server and command-line tool that finds information in code and documents by meaning and keywords.

In plain words
What is it for?
They help with installing dependencies, building and testing the TypeScript project, maintaining its document parsers and search tools, and following its absolute-path and local-model requirements.
Why use it?
They explain the project structure, required commands, coding conventions, and setup details so an agent can work safely in the repository.

Instructions file for CodexOpenCode

Written for Codex and OpenCode: the file is AGENTS.md. Also seen: mentions CLAUDE.md; mentions AGENTS.md.

This is damoqiongqiu/mcp-local-rag's own configuration. It tells Codex and OpenCode how to work on mcp-local-rag itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything mcp-local-rag configures →

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is vi.doMock('../../parser/index.js', parserFactory).

Reuse

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.

Copy the file
curl -O https://raw.githubusercontent.com/damoqiongqiu/mcp-local-rag/main/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/damoqiongqiu/mcp-local-rag

Made for: Codex, OpenCode.

Wrote 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.

agentmods badge for mcp-local-rag AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/damoqiongqiu/mcp-local-rag/agents-md/github.svg)](https://agentmods.dev/instructions/damoqiongqiu/mcp-local-rag/agents-md)
Your own site
<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.

agentmods 80×15 button for mcp-local-rag AGENTS.md

Your own site · 80×15
<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>
Per session 2,613 This file is loaded in full into every session.
When invoked 2,613 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin fork From a forked repository.
Token cost

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.

ModelPer sessionOnce 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

Measured 11d ago against content hash 4c9dfe8bd209, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

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.

AGENTS.md · 216 lines

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

Read the full file on GitHub · 216 lines

Changes

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.

  1. 11d ago First seen · 216 lines · 2,613 tokens per session scan A 4c9dfe8bd209

Subscribe to this mod's changes

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.

Related

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.

vercel/next.js · 7,296 tokens

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.

openai/codex · 5,153 tokens

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).

microsoft/vscode · 6,785 tokens

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.

github/spec-kit · 7,104 tokens

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).

microsoft/vscode · 5,001 tokens

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.

langchain-ai/langchain · 4,469 tokens