manual-rag
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@manual-rag search my manuals for how to replace the toner cartridge"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
manual-rag-mcp
Feed any manual / book / text into your RAG, then use it as an MCP server so your AI can retrieve information from it.
An MCP server that exposes retrieval-augmented search over an arbitrary set of reference manuals. Ingestion turns a PDF into text chunks and embeds them locally with Ollama (nomic-embed-text); search runs a brute-force cosine similarity over those embeddings — no cloud, no API keys, fully local. Any number of sources can be added, each with an arbitrary name, and existing embedding stores from other RAG projects can be imported without re-embedding.
Any manual works — the indexed sources are discovered at runtime via get_sources.
How it works
PDF ──pdftotext -layout──▶ text ──chunk (1200 chars / 150 overlap)──▶ chunks
└─ chapter/page detection from headings │
▼
data/embeddings.json ◀── Ollama nomic-embed-text
▲ │
existing embeddings │ (npm run import) │
└─────────────────────────┤
query ──embed──▶ cosine similarity ──▶ top-k excerptsFile | Role |
| MCP stdio server — exposes |
| Ollama client ( |
| Data layer: paths, read/append/remove chunks, source metadata |
| Loads the store, cosine similarity search, source stats, dimension guard |
| Tool-level result shaping |
| PDF → text → chunks → embeddings (the ingest CLI) |
| Import an existing embeddings JSON from any RAG project (no re-embedding) |
Related MCP server: PDF RAG MCP Server
Requirements
Node.js ≥ 20
Ollama running locally with the embedding model:
ollama pull nomic-embed-text brew services start ollamapdftotext(from poppler) —brew install poppler
Install
git clone git@github.com:konraddiesch/manual-rag-mcp.git ~/Code/manual-rag-mcp
cd ~/Code/manual-rag-mcp
npm install
npm run buildbuild/ is committed, so a clone is runnable without building — but run npm run build after any change under src/.
Add a manual from a PDF
npm run ingest -- --pdf /path/to/manual.pdf --source my-manualFlag | Description |
| Path to the PDF (required) |
| Arbitrary source id used for filtering and |
| Characters per chunk (default |
| Overlap between chunks (default |
| Re-ingest an existing source (required if the id already exists) |
Embeddings are appended to data/embeddings.json; per-source metadata lands in data/sources/<source>/metadata.json.
Import an existing embeddings store
Already have a RAG store elsewhere? Bring its vectors in without re-embedding:
npm run import -- --from /path/to/other-rag/embeddings.json --source my-manual [--replace]The file must be a JSON array of chunks; each entry needs content and embedding, with optional id, page and chapter (also read from a nested metadata object). Chunk ids are prefixed with the source name.
⚠️ All sources in one store must share the same embedding model as the query, otherwise dimensions won't match and mismatching chunks are skipped at search (with a warning). Set EMBEDDING_MODEL if the imported data uses a different model than nomic-embed-text.
Register the MCP server
The repo root .mcp.json already registers the server for Claude Desktop / IDE clients:
{
"mcpServers": {
"manual-rag": {
"type": "stdio",
"command": "node",
"args": ["${HOME}/Code/manual-rag-mcp/build/index.js"]
}
}
}For opencode, add to ~/.config/opencode/opencode.jsonc:
"manual-rag": {
"type": "local",
"command": ["node", "{env:HOME}/Code/manual-rag-mcp/build/index.js"],
"enabled": true
}Tools
Tool | Purpose |
| List indexed manuals with chunk counts, page ranges, detected chapters |
| Semantic search — |
Returns excerpts with page number, chapter, source and relevance score. An unknown source returns a helpful error listing the indexed sources.
Data is not committed
data/ (embeddings, extracted text and per-source metadata — ~129 MB) and node_modules/ are gitignored. Re-create the data layer with npm run ingest or npm run import. Override the location with an absolute DATA_DIR.
Usage guide
See SKILL.md — a precise playbook for using the MCP server well (call get_sources first, when to filter by source, how to cite, troubleshooting). The same skill is installed globally at ~/.config/opencode/skills/manual-rag/SKILL.md.
License
MIT
Available Tools
2 toolsget_sourcesA
Get a list of all indexed reference manuals with their chunk counts, page ranges, and detected chapters.
Use this tool when the user wants to:
Know which manuals are available to search
See what topics are covered in each manual
Find out the structure of available documentation
Inputs: no named parameters.
search_manualA
Search the indexed reference manuals for information.
Call get_sources first to learn which manuals are indexed and what each covers. Then search a manual whenever the user asks about a feature, workflow, keyboard shortcut, setting, or concept covered by one of those manuals — this is the authoritative source, prefer it over guessing or a web search.
Pass the optional "source" parameter to restrict results to a single manual (use the exact source id returned by get_sources):
source="" — search only that manual
Omit "source" to search across all manuals simultaneously
The tool returns relevant excerpts with page numbers, chapter information, source identification, and a relevance score.
Inputs: query (required), source, maxResults.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 2 tools
search_manual and get_sources have clearly distinct purposes: one retrieves content from manuals, the other lists available sources and their structure. There is no overlap or ambiguity between them.
Both tools follow a consistent snake_case verb_noun pattern (search_manual, get_sources). The naming is predictable and readable.
Only 2 tools are provided, which is on the thin side for a RAG server. While both are essential and well-scoped, the count is borderline minimal.
The core workflow of listing sources and searching across or within manuals is covered. However, there is no direct way to retrieve full documents or specific pages beyond search excerpts, which is a minor gap.
Maintenance
Related MCP Connectors
Query your own PDFs and documents from any MCP client. Every answer cites the page it came from.
Add PDFs from a link, ask questions with page citations, and read summaries
Ingest, manage, and retrieve documents for RAG-powered AI applications
PDF AI for your own documents: ask from any MCP client and get answers that cite the source.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables AI assistants to search and query PDF documents through a local RAG system with vector embeddings. Provides semantic document search capabilities while keeping all data stored locally without external dependencies.-
- AlicenseNot gradedqualityDmaintenanceEnables intelligent search and question-answering over PDF documents using semantic similarity and keyword search. Supports OCR for scanned PDFs, persistent vector storage with ChromaDB, and maintains source tracking with page numbers.6MIT
- FlicenseNot gradedqualityDmaintenanceProvides semantic search and management of shared documentation using ChromaDB and OpenAI embeddings. It enables users to query local documents by meaning, list files, and read content through natural language tools.-
- AlicenseNot gradedqualityBmaintenanceLets coding agents index and search local PDF books, retrieve relevant passages with citations, and persist design lessons for system design and implementation tasks.1Apache 2.0