fayna-rag-mcp
OfficialClick on "Install 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., "@fayna-rag-mcpWhat does our policy say about remote work?"
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.
{"type": "text"}# fayna-rag-mcp — local knowledge base with RAG and MCP
Developed by Fayna Digital Author: Volodymyr Shevchenko
Problem: the team collects documentation (policies, manuals, notes) in files and quickly loses natural-language access to it — searching by file name or Ctrl+F does not scale, and sending internal documents to a cloud LLM service is not always acceptable for privacy reasons.
Solution: a local RAG pipeline (FAISS + multilingual embeddings) based on a local LLM (Ollama) — and the same search/Q&A exposed as an MCP server, so any MCP client (Claude Desktop/Code, etc.) or an external automated workflow can use it via simple REST routes. No data leaves the machine it runs on.
Result: five MCP tools and four REST routes for semantic search, RAG Q&A with sources, document reading, and offline cataloging — ready to connect to Claude or n8n in minutes, with no cloud dependencies.
Features
Tool (MCP) | Purpose |
| read a full file from the database (with a path-traversal guard within |
| list all documents ( |
| FAISS semantic search → top-relevant chunks |
| RAG answer: FAISS-retrieve + Ollama LLM, with sources |
| read-only catalog of document tags (topic/type/language/audience) |
REST route | Body | What it does |
|
| FAISS-retrieve → |
|
| RAG answer → |
|
| exact substring search over |
|
| hybrid: Cyrillic↔Latin transliteration + token-match, semantic selection |
Related MCP server: OpenLMlib
Stack
Python 3.10+ · FAISS (faiss-cpu) · sentence-transformers · tiktoken ·
Ollama · FastMCP · Tesseract/poppler/Whisper for multi-format ingest ·
Docker.
RAG Pipeline
docs/ → load (.txt/.md/.pdf/.docx) → chunk (tiktoken) → embed (mpnet) → FAISS → retrieve → Ollama → answer + sourcesChunking — by
tiktokentokens (cl100k_base), not characters. DefaultCHUNK_SIZE=700tokens,CHUNK_OVERLAP=100tokens.Embeddings:
paraphrase-multilingual-mpnet-base-v2— a multilingual model (UA/PL/EN/RU and others) so search works regardless of query language.LLM: any Ollama model, default
qwen2.5:7b.Index: FAISS
IndexFlatIP(cosine similarity),TOP_K=5.
Quick start
pip install -r src/requirements.txt
# Przykład: demo-korpus na kilka dokumentów (sample-docs/)
export DOCUMENTS_DIR=./sample-docs
python -m src.main build-index # → src/index/index.faiss + chunks.pkl
# Interaktywne Q&A (CLI)
python -m src.main
# Serwer MCP (transport z env MCP_TRANSPORT: stdio|http)
python -m src.mcp.serverTests:
pip install -r tests/requirements-dev.txt
pytest -qDocker
docker compose up -dDefault values in docker-compose.yml/Dockerfile are designed for Ollama running on the host (via host.docker.internal); adjust OLLAMA_URL to your own network (bridge address on Linux, separate Ollama container, etc.).
Configuration (src/config.py, everything via env)
Env | Default | Description |
|
| knowledge base root |
|
| embedding model |
|
| LLM for RAG answers |
|
| Ollama endpoint |
|
| tokens ( |
|
| how many chunks retrieve returns |
|
|
|
|
| address when |
Connecting to an MCP client (e.g., Claude Code) — via its MCP server configuration, with the command python -m src.mcp.server (stdio) or the container URL (http).
Structure
src/
├── config.py # wszystkie env-zmienne + domyślne
├── main.py # CLI: build-index | interaktywne Q&A
├── assistant.py # CompanyKBAssistant (LLM decyduje czy wołać MCP-toolki)
├── catalog.py # offline-klasyfikacja dokumentów przez Ollama → JSON+HTML
├── ingest.py # multi-formatowy ingest: OCR skanów, vision-opis diagramów, Whisper-transkrypcja
├── rag/
│ ├── ingest.py # load_document (.txt/.md/.pdf/.docx)
│ ├── chunk.py # chunk_text (tiktoken cl100k_base, overlap)
│ ├── embed.py # embed_chunks (sentence-transformers)
│ ├── build_index.py # build_index → FAISS + pickle
│ └── query.py # retrieve / build_prompt / ask
└── mcp/
├── server.py # FastMCP: 5 MCP-toolków + 4 trasy REST
└── client.py # MCPClient (JSON-RPC przez subprocess)Multi-format ingest (OCR of scans via Tesseract, description of drawings/diagrams via a vision model, audio/video transcription via Whisper) — a separate, dependency-heavier path, not needed for the basic text corpus above.
License
MIT — see LICENSE. © Fayna Digital.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseNot gradedqualityAmaintenanceA headless local knowledge library and RAG substrate that enables LLM clients to search, retrieve chunks, and list documentation packs through read-only MCP tools.MIT
- AlicenseNot gradedqualityAmaintenanceProvides AI assistants with a local knowledge base and research library, enabling semantic and full-text retrieval, memory persistence, and multi-agent collaboration via 58 MCP tools.2MIT
- AlicenseNot gradedqualityDmaintenanceA knowledge base MCP server backed by Qdrant vector database with local embeddings for semantic search and document management.51ISC
- FlicenseNot gradedqualityCmaintenanceEnables users to build and query a private knowledge base by uploading documents, which are embedded and stored locally, then accessible via MCP for semantic search and retrieval.
Related MCP Connectors
Your memory, everywhere AI goes. Build knowledge once, access it via MCP anywhere.
Shared, governed long-term memory for AI agents across tools and sessions via MCP and REST.
Private-by-default, local-first memory/context/task orchestrator for MCP apps and agents.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/fayna-digital/fayna-rag-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server