Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add damoqiongqiu/mcp-local-rag --skill ingestgit 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/skills/damoqiongqiu/mcp-local-rag/ingest)<a href="https://agentmods.dev/skills/damoqiongqiu/mcp-local-rag/ingest"><img src="https://agentmods.dev/badge/skills/damoqiongqiu/mcp-local-rag/ingest/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/skills/damoqiongqiu/mcp-local-rag/ingest"><img src="https://agentmods.dev/badge/skills/damoqiongqiu/mcp-local-rag/ingest.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.00037 | $0.01272 |
| Opus 5.5 | $0.00015 | $0.00509 |
| Sonnet 5.5 | $0.00007 | $0.00254 |
| Haiku 4.5 | $0.00004 | $0.00127 |
Grade A, and why
mcp-local-rag/ingest 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 2mo 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 — 120 lines — stays where its author put it; the contents beside it link to each section on GitHub.
摄入与索引
将内容写入本地知识库,供后续搜索。
Tools
ingest_file —— 摄入本地文件
支持代码文件(.ts/.js/.py/.go/.rs/.java/.c/.cpp/.h 等),以及 PDF、DOCX、TXT、MD。
ingest_file({ filePath: string, visual?: boolean, visualQuality?: "fast" | "quality" })
文件必须位于 BASE_DIR / BASE_DIRS 配置的根目录内,否则被拒绝。
分块策略自动路由
| 文件类型 | 分块器 | 说明 |
|---|---|---|
.ts/.js/.py/.go/.rs/.java |
CodeChunker | tree-sitter AST 级分块,含 scope chain + imports 上下文 |
.c/.cpp/.h/.json/.yaml/.css/.html 等 |
SemanticChunker | 纯文本读取后语义分块 |
.pdf |
SemanticChunker | 文本提取 + 可选 VLM 视觉 caption |
.docx |
SemanticChunker | mammoth 提取正文 |
.txt, .md |
SemanticChunker | 纯文本语义分块 |
CodeChunker 说明:代码文件通过 tree-sitter 解析为 AST,在函数/类/方法等语义边界切分,不会在语句中间截断。embedding 使用 contextualizedText(含 scope chain + import 信息的上下文增强文本),原始代码原文保留在 text 字段。
PDF 视觉模式
仅对 .pdf 生效。非 PDF 文件传 visual: true 静默忽略。
启用 visual 后,系统下载本地 VLM 模型,为 PDF 中的图表/表格/示意图生成 captions,作为独立 chunk(格式:[Visual content on page <N>: <caption>])进入搜索管线。
成本:
fast配置:约 250MB 模型下载,每页推理较轻quality配置:约 2.9GB 模型下载,每页推理约fast的 2 倍
决策流程:
- 当前请求已指定模式 → 直接遵循,不要重复询问。
- 用户未指定 → 用以下话术一次性问清楚:
这个 PDF 图片多吗(有需要被搜索的图表、表格、示意图吗)?
- 不需要 → 纯文本摄入(最快,无额外下载)
- 需要 → 视觉模式:
- fast(默认)— 提取图标题和类型;图中细节文字(坐标轴、注释)不太可靠。模型约 250MB。
- quality — 图中文字(坐标轴标签、子图标注、流程图节点)更可靠。模型约 2.9GB。
选哪个?
用户回复「不需要 / 纯文本」→ 不加 visual 参数。
「需要 + fast / 轻量」→ visual: true(默认 fast)。
「需要 + quality / 精确 / 准确」→ visual: true, visualQuality: "quality"。
Profile 选择信号(当 visual: true 但未指定 profile 时):
- 默认省略 →
fast - 使用
quality的信号:坐标轴标签、子图标注、论文配图、技术图表文字 - 不确定 → 用上面的话术询问
失败降级:VLM 失败自动回退纯文本,文件摄入仍完成。重新运行 ingest_file 可重试视觉富化。
ingest_data —— 摄入网页 / 原始内容
ingest_data({
content: string,
metadata: { source: string, format: "html" | "markdown" | "text" }
})
format 选择:
- HTML 字符串 →
"html" - Markdown 字符串 →
"markdown" - 纯文本 →
"text"
source 格式:
- 网页 → 完整 URL:
"https://example.com/page" - 其他内容 →
"类型://日期"或"类型://日期/详情"(如"clipboard://2026-07-11")
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.
- 2mo ago First seen · 120 lines · 37 tokens per session scan A eafc1ac1e042
mcp-local-rag/ingest is a skill published in the GitHub repository damoqiongqiu/mcp-local-rag (13 stars, last pushed 3mo ago), licensed MIT. It adds 37 tokens to every session and 1,272 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. It comes from a forked repository.
mcp-local-rag/ingest compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| mcp-local-rag/ingestdamoqiongqiu/mcp-local-rag | Skill | 13 | 3mo ago | MIT | A | 37 | Claude Code, Codex |
| markitdownK-Dense-AI/scientific-agent-skills | Skill | 56k | 4d ago | MIT | A | 62 | Claude Code, Codex |
| agents-llamaindexdavila7/claude-code-templates | Skill | 33k | yesterday | MIT | A | 72 | Claude Code, Codex |
| xberg-picking-a-formatxberg-io/xberg | Skill | 9.5k | yesterday | MIT | A | 51 | Claude Code |
| kb-retrieverConardLi/garden-skills | Skill | 14k | 12d ago | MIT | A | 105 | Claude Code, Codex |
| cx-knowledge-base-ingestionGoogleCloudPlatform/professional-services | Skill | 3.1k | 2d ago | Apache-2.0 | A | 48 | Gemini CLI |
| azure-aimicrosoft/skills | Skill | 3.2k | yesterday | MIT | A | 66 | Claude Code |