mcp-local-rag/ingest

mcp-local-rag/ingest is a skill for Claude Code, Codex from damoqiongqiu/mcp-local-rag. It costs 37 tokens per session (1,272 once invoked), scanned A, original, from a forked repository, MIT.

Tools for importing code and documents into a local search index, including source code, PDF, DOCX, TXT, and Markdown files.

In plain words
What is it for?
Indexing code by functions, classes, and methods, importing documents, and optionally describing charts or tables in PDFs for search.
Why use it?
They turn project files into searchable pieces so an agent can find relevant code or documentation later.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions Claude Code.

Good fit Indexing code by functions, classes, and methods, importing documents, and optionally describing charts or tables in PDFs for search.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/damoqiongqiu/mcp-local-rag/ingest
Install

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.

Any agent
npx skills add damoqiongqiu/mcp-local-rag --skill ingest
Clone the repo
git clone --depth 1 https://github.com/damoqiongqiu/mcp-local-rag

Made for: Claude Code, Codex.

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/ingest

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

agentmods 80×15 button for mcp-local-rag/ingest

Your own site · 80×15
<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>
Per session 37 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,272 The whole file, excluding the scripts and references it only reads on demand.
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.00037 $0.01272
Opus 5 $0.00018 $0.00636
Sonnet 5 $0.00007 $0.00254
Haiku 4.5 $0.00004 $0.00127

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

Security

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 12d 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.

skills/mcp-local-rag/ingest/SKILL.md · 120 lines

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 倍

决策流程

  1. 当前请求已指定模式 → 直接遵循,不要重复询问。
  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"

Read the full file on GitHub · 120 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. 12d ago First seen · 120 lines · 37 tokens per session scan A eafc1ac1e042

Subscribe to this mod's changes

mcp-local-rag/ingest is a skill published in the GitHub repository damoqiongqiu/mcp-local-rag (13 stars, last pushed 1mo ago), licensed MIT. It adds 37 tokens to every session and 1,272 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. It comes from a forked repository.

Related

Other skills, from other repositories

markitdown

Convert heterogeneous documents and selected URIs to Markdown with Microsoft MarkItDown for text analysis, search, and LLM/RAG ingestion. Covers safe local conversion, streams, Office/PDF/data formats, batch workflows, plugins, vision OCR, Azure extraction, and the official MCP server.

K-Dense-AI/scientific-agent-skills · 61 tokens

llamaindex

Data framework for building LLM applications with RAG. Specializes in document ingestion (300+ connectors), indexing, and querying. Features vector indices, query engines, agents, and multi-modal support. Use for document Q&A, chatbots, knowledge retrieval, or building RAG pipelines. Best for data-centric LLM…

davila7/claude-code-templates · 70 tokens

azure-ai

Use for Azure AI: Search, Speech, OpenAI, Document Intelligence. Helps with search, vector/hybrid search, speech-to-text, text-to-speech, transcription, OCR. WHEN: AI Search, query search, vector search, hybrid search, semantic search, speech-to-text, text-to-speech, transcribe, OCR, convert text to speech.

microsoft/skills · 76 tokens

kb-retriever

A retrieval and question-answering assistant for a local folder of documents, including Markdown, text, PDFs, and spreadsheets.

ConardLi/garden-skills · 105 tokens

bailian-kb

A command-line manager for Alibaba Cloud Bailian knowledge bases, which are collections of documents prepared for search and question answering. It handles the stored documents, search services, text chunks, and data-centre files rather than everyday searches.

modelstudioai/cli · 234 tokens

azure-ai-contentunderstanding-py

Multimodal AI service that extracts semantic content from documents, video, audio, and image files for RAG and automated workflows.

benjaminasterA/antigravity-awesome-skills · 0 tokens