fayna-rag-mcp
Officialfayna-rag-mcp — lokale Wissensdatenbank mit RAG und MCP
Entwickelt von Fayna Digital Autor: Volodymyr Shevchenko
Problem: Das Team sammelt Dokumentation (Richtlinien, Handbücher, Notizen) in Dateien und verliert schnell den Zugriff darauf in natürlicher Sprache — die Suche nach Dateinamen oder Strg+F skaliert nicht, und das Senden interner Dokumente an einen Cloud-LLM-Dienst ist datenschutzrechtlich nicht immer akzeptabel.
Lösung: lokale RAG-Pipeline (FAISS + mehrsprachige Embeddings) auf Basis eines lokalen LLM (Ollama) — derselbe Sucher/Q&A wird als MCP-Server bereitgestellt, damit jeder MCP-Client (Claude Desktop/Code usw.) oder ein externer automatisierter Workflow über einfache REST-Routen darauf zugreifen kann. Keine Daten verlassen die Maschine, auf der dies läuft.
Ergebnis: fünf MCP-Werkzeuge und vier REST-Routen für semantische Suche, RAG-Q&A mit Quellenangaben, Dokumentenlesen und Offline-Katalogisierung — in wenigen Minuten an Claude oder n8n anschließbar, ohne Cloud-Abhängigkeiten.
Funktionen
Werkzeug (MCP) | Zweck |
| liest die vollständige Datei aus der Wissensdatenbank (mit Schutz gegen Path-Traversal innerhalb von |
| Liste aller Dokumente ( |
| semantische FAISS-Suche → Top-relevante Chunks |
| RAG-Antwort: FAISS-Retrieve + Ollama-LLM, mit Quellenangaben |
| Read-only-Katalog der Dokumenten-Tags (Thema/Typ/Sprache/Zielgruppe) |
REST-Route | Body | Funktion |
|
| FAISS-Retrieve → |
|
| RAG-Antwort → |
|
| exakte Teilstringsuche über |
|
| Hybrid: Transliteration Kyrillisch↔Lateinisch + Token-Match, Auswahl per Semantik |
Related MCP server: OpenLMlib
Stack
Python 3.10+ · FAISS (faiss-cpu) · sentence-transformers · tiktoken ·
Ollama · FastMCP · Tesseract/poppler/Whisper für Multi-Format-Ingest ·
Docker.
RAG-Pipeline
docs/ → load (.txt/.md/.pdf/.docx) → chunk (tiktoken) → embed (mpnet) → FAISS → retrieve → Ollama → answer + sourcesChunking – nach
tiktoken-Tokens (cl100k_base), nicht nach Zeichen. StandardmäßigCHUNK_SIZE=700Tokens,CHUNK_OVERLAP=100Tokens.Embeddings:
paraphrase-multilingual-mpnet-base-v2– ein mehrsprachiges Modell (UA/PL/EN/RU u. a.), damit die Suche unabhängig von der Abfragesprache funktioniert.LLM: ein beliebiges Ollama-Modell, standardmäßig
qwen2.5:7b.Index: FAISS
IndexFlatIP(Kosinus-Ähnlichkeit),TOP_K=5.
Schnellstart
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 -dDie Standardwerte in docker-compose.yml/Dockerfile sind für Ollama auf dem Host
ausgelegt (über host.docker.internal); passe OLLAMA_URL an dein
eigenes Netzwerk an (Bridge-Adresse unter Linux, separater Ollama-Container usw.).
Konfiguration (src/config.py, alles über env)
Env | Standard | Beschreibung |
|
| Wurzel der Wissensdatenbank |
|
| Embedding-Modell |
|
| LLM für RAG-Antworten |
|
| Ollama-Endpunkt |
|
| Tokens ( |
|
| wie viele Chunks der Retrieve zurückgibt |
|
|
|
|
| Adresse bei |
Anbindung an einen MCP-Client (z. B. Claude Code) — über dessen MCP-Server-Konfiguration,
per Befehl python -m src.mcp.server (stdio) oder die Container-URL (http).
Struktur
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 von Scans per Tesseract, Beschreibung von Zeichnungen/Schemata per Vision-Modell, Transkription von Audio/Video per Whisper) — ein separater, abhängigkeitsreicherer Pfad, der für den oben genannten Basistextkorpus nicht nötig ist.
Lizenz
MIT — siehe 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