Rag logo

Rag

Indexes local document collections and exposes hybrid multi-KB search, retrieval, and reindexing through MCP.

Install Rag

Pick your client, then add it in one click or paste the config.

No confirmed install command yet

We only publish a config when the install details come from the project itself — its README, its docs, or a verified owner. We haven’t found those for rag, and we’d rather show nothing than a guess you’d paste into your client.

Open setup steps on GitHub

Overview

The rag MCP server indexes local document collections and exposes hybrid keyword and semantic search across multiple knowledge bases. It stores chunks, embeddings, metadata, and queue state in SQLite, while optional AI contextualization adds bilingual Korean and English retrieval terms. Use it when an agent needs to search DOCX, HWPX, PDF, spreadsheet, presentation, or audio content stored on a local filesystem. Standard MCP stdio transport supports interactive search while indexing can continue through separate command-line workflows.

Use cases

  • Search local Korean and English document collections
  • Index scanned PDFs with OCR fallback
  • Retrieve full text for matching document chunks
  • Queue incremental reindexing after filesystem changes
  • Transcribe supported audio files on Windows

Key features

  • Hybrid BM25 and vector search with RRF
  • Multi-knowledge-base serving over MCP stdio
  • Incremental indexing with SHA256 change detection
  • Optional bilingual AI chunk contextualization
  • PDF OCR and Windows-only Whisper transcription
  • Queued and deferred reindex management

Tools7

What Rag lets your agent do. Expand a tool for its parameters.

Self-reported~146 tokens of context

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked Today

Recent health check succeeded.

4/4 checks healthy over the last 36d

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

Last commit5mo agoMost recent push to the default branch.
Tools exposed7Callable tools this server registers over MCP.

How Rag works

What the rag MCP server does

The rag MCP server indexes local document collections and makes them searchable through MCP. It supports DOCX, HWPX, PDF, Excel, PowerPoint, and audio files. Scanned PDFs can use Tesseract OCR, while audio transcription uses Whisper.net on Windows. The resulting knowledge bases are stored locally and can be served together from one base path.

Search combines BM25 keyword matching and vector similarity with Reciprocal Rank Fusion. It also supports BM25-only operation when no embedding provider is configured. Korean-oriented chunking, FTS5 trigram matching, and optional bilingual enrichment help with Korean, English, CJK, substring, and cross-language queries.

How the rag MCP server works

The indexing pipeline extracts content, divides it into roughly 1,000-character chunks, optionally contextualizes each chunk with an LLM, generates embeddings, and writes the results to SQLite. Original chunk text remains available for display, while contextualized text can be used for indexing and embedding. Hash-based change detection avoids repeating work for unchanged files.

A two-commit process saves extracted and enriched chunks before embedding completes. If an embedding request fails, later retries can use the saved chunks without repeating OCR, transcription, or contextualization. Individual oversized or invalid chunks can be isolated, allowing other chunks from the same file to remain searchable.

The MCP service uses SQLite WAL mode, so searches can continue while indexing runs. Reindex requests are queued and merged by scope; a separate queue executor processes deferred work sequentially to avoid concurrent indexing contention.

Setup and configuration

Run the serve command with a base path containing knowledge bases. The service uses standard MCP stdio transport and accepts a kb_id parameter for multi-KB operations. Each knowledge base has a config.json containing provider settings.

Embedding and contextualization can use Ollama, OpenAI-compatible endpoints, Gemini, or Anthropic for the supported roles. OpenAI-compatible configurations can target OpenAI, Azure OpenAI, Groq, LM Studio, or Together AI. Provider credentials are supplied through environment variables such as OPENAI_API_KEY or ANTHROPIC_API_KEY; the exact variables depend on the configured provider. Batch commands use environment variables, while interactive MCP search may use MCP elicitation when the client supports it.

Use exec for headless indexing of one knowledge base, exec-queue for deferred queue processing, prune-orphans to remove unconfigured knowledge-base folders, and smoke-ocr to test scanned-PDF OCR on Windows.

Tools and capabilities

The rag MCP server exposes these MCP tools:

  • list_knowledge_bases reports available knowledge bases, file and chunk counts, and indexing status.
  • search_documents runs automatic, BM25, or vector search.
  • get_document_chunk returns the complete content for a chunk ID.
  • start_reindex queues indexing with merge, force, and deferred options.
  • cancel_reindex removes a queued request that has not started.
  • get_index_info reports index metadata, queue position and status, errors, and contextualization health.
  • check_changes performs a lightweight filesystem scan without API calls.

Limitations and notes

Audio transcription is Windows-only, and OCR depends on the native OCR setup. Large scanned documents and long recordings may take substantial time during extraction; the first audio file may also require a one-time Whisper model download. The contextualization stage is optional, but embeddings require a configured provider for vector search.

The service is read-only at the MCP serving layer; indexing is managed through the command-line pipeline and queued reindex operations. Failed or deferred chunks may leave a knowledge base in a partial or degraded state until retries succeed. The project is distributed under the MIT license.

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Rag

rag is an MCP server that connects AI clients to local document collections stored in multiple knowledge bases. Its main tools list knowledge bases, run hybrid BM25 and vector searches, retrieve chunks, inspect index state, check filesystem changes, and queue or cancel reindexing requests.

Install the `fieldcure-mcp-rag` package or build the C# project, then run its `serve` command with a base path.

It supports DOCX, HWPX, PDF, Excel, PowerPoint, and audio files. Scanned PDFs can use Tesseract OCR, and supported audio formats can be transcribed with Whisper.net on Windows.

Ollama, OpenAI-compatible APIs, and Gemini are supported for embeddings. OpenAI-compatible endpoints include OpenAI, Azure OpenAI, Groq, LM Studio, and Together AI; provider credentials are configured through environment variables.

The server uses standard MCP stdio transport, so it can be used with MCP clients that support that transport.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewRag AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/rag?style=directory)](https://allmcps.com/mcp/rag)
HTML Embed
<a href="https://allmcps.com/mcp/rag"><img src="https://allmcps.com/api/badge/rag?style=directory" alt="Rag on AllMCPs" /></a>