KoboldCpp RAG MCP Server
Click 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., "@KoboldCpp RAG MCP ServerSearch my uploaded PDFs for the Q3 revenue figures and summarize them."
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.
# KoboldCpp RAG MCP Server | خادم استرجاع المعرفة لـ KoboldCpp عبر بروتوكول MCP
An enterprise-grade, privacy-first Retrieval-Augmented Generation (RAG) server designed specifically for KoboldCpp. It leverages the Model Context Protocol (MCP) and ChromaDB to grant local Large Language Models direct semantic access to private documents with zero data leaks.
خادم استرجاع معرفة وتوليد معزز (RAG) عالي الأداء ومحلي بالكامل، مصمم لربط نماذج الذكاء الاصطناعي داخل KoboldCpp بمستنداتك وملفاتك الخاصة عبر بروتوكول MCP وقاعدة ChromaDB المتجهة بأمان وخصوصية تامة 100%.
---
## Key Highlights | أبرز المزايا التقنية
- Multi-Format Ingestion: Full text and tabular parsing for PDF, DOCX, XLSX, XLS, CSV, TXT, and Markdown files.
  (دعم شامل لمختلف الصيغ: قراءة واستخراج النصوص والجداول من ملفات الـ PDF، الوورد، الإكسل، ملفات القيم المفصولة بفواصل، والنصوص الخام).
- Local Embedding Engine: Employs sentence-transformers/all-MiniLM-L6-v2 locally via Hugging Face and ONNX runtimes.
  (معالجة متجهات محلية سريعة بالاعتماد على نموذج التضمين القياسي دون الحاجة لطلب واجهات سحابية).
- Persistent Vector Storage: Powered by ChromaDB with persistent disk serialization in a dedicated vector space.
  (تخزين متجهي دائم ومفهرس دلالياً يضمن حفظ المقاطع وقراءتها فورياً من القرص الصلب).
- Autonomous Tool Calling: Directly integrated into KoboldCpp's tool system, allowing models to index files or query context autonomously during conversations.
  (استدعاء ذاتي للأدوات: يستطيع النموذج استكشاف قاعدة المعرفة وفهرسة الملفات الجديدة استجابة لطلب المستخدم داخل المحادثة).
- Zero Data Leakage: All processing, chunking, embedding, and vector querying are confined to the host machine.
  (أمان مطلق وخصوصية كاملة: لا يتم إرسال أي ملف أو متجه إلى الإنترنت).
---
## Architecture & MCP Tools | بنية السيرفر والأدوات المتاحة
The server implements two primary MCP functions executed via standard I/O (stdio):
1. index_documents:
  - Scans the documents/ directory.
  - Cleans and extracts text depending on file extensions.
  - Chunks text into 500-token windows with 50-token overlap to maintain coherence.
  - Generates vector embeddings and upserts data into data_db/.
  - (مسح مجلد المستندات، استخراج المحتوى، تقسيمه إلى مقاطع متداخلة لضمان الترابط الدلالي، ثم تحديث قاعدة المتجهات).
2. query_knowledge_base:
  - Takes a search query string and a top_k retrieval parameter.
  - Computes query embeddings and executes semantic similarity searches.
  - Returns matched chunks enriched with source document metadata.
  - (استقبال استفسارات المستخدم، مطابقتها دلالياً مع المقاطع المخزنة، وإرجاع أدق الفقرات مع الإشارة لاسم المصدر).
---
## Directory Structure | هيكلية المشروع
RAG_KoboldCpp/
│
├── documents/ # Drop your PDFs, Word, and Excel files here
├── data_db/ # Persistent ChromaDB vector storage (Git-ignored)
├── server.py # Core MCP RAG server implementation
├── test_rag.py # Standalone verification and indexing utility
├── run_mcp.bat # Automated environment launcher for KoboldCpp
├── mcp_config.json # MCP client configuration schema for KoboldCpp
├── requirements.txt # Pinned dependency manifest
└── .gitignore # Security exclusions (guards data_db and private files)
---
## Installation & Setup | خطوات التثبيت والتشغيل
1. Clone the Repository | استنساخ المستودع:
  git clone https://github.com/mamq144/KoboldCpp-RAG-MCP.git
  cd KoboldCpp-RAG-MCP
2. Prepare Virtual Environment | إعداد البيئة الافتراضية:
  python -m venv venv
  venv\Scripts\activate
3. Install Dependencies | تثبيت المكتبات:
  pip install -r requirements.txt
4. Index Your Knowledge Base | إضافة المستندات وفهرستها:
  - Place any documents (.pdf, .docx, .xlsx, .txt, etc.) inside the documents folder.
  - Run the manual indexing check:
  python test_rag.py
---
## KoboldCpp Integration | الربط مع KoboldCpp
Option A: Via Command Line (CLI)
Run your KoboldCpp instance with the --mcp flag pointing directly to your JSON configuration:
koboldcpp.exe --model your_model.gguf --gpulayers -1 --mcp "E:\RAG_KoboldCpp\mcp_config.json"
Option B: Via Web GUI (Settings)
1. Launch KoboldCpp and open http://localhost:5001.
2. Navigate to Settings -> Tools -> MCP Tool Calling.
3. Ensure "Enable Toolcalling" and "Automatically Execute Tools" are checked.
4. Verify that "index_documents" and "query_knowledge_base" are listed and enabled.
---
## License | الترخيص
Distributed under the MIT License. See LICENSE for more information.
مرخص تحت مظلة رخصة MIT المفتوحة.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
No tool schema history has been recorded yet.
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 Connectors
Private persistent memory for Claude, ChatGPT & Gemini via MCP - semantic search, zero-code setup.
Personal knowledge base MCP server with semantic search, auto-categorization, metadata extraction
Hosted MCP memory: save sessions/decisions once, search from Claude, Cursor, ChatGPT. EU-hosted FTS.
Search your AI chat history (ChatGPT, Claude, Codex) from any MCP client. Remote, private, read-only
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceAn MCP server that enables AI assistants to perform semantic searches over local document collections using multi-context organization and automatic OCR. It supports various file formats including PDF, DOCX, and images, ensuring all data processing remains local and private.7MIT
- AlicenseAqualityDmaintenanceProvides local Retrieval-Augmented Generation (RAG) capabilities using Ollama for embeddings and ChromaDB for vector storage. It enables users to ingest and perform semantic searches across PDF, Markdown, and TXT documents within MCP-compatible clients.448MIT
- AlicenseAqualityDmaintenanceLocal-first RAG indexing and semantic search MCP server. Enables document retrieval and context-aware queries using local embedding models.316MIT
- AlicenseAqualityCmaintenanceA local-first document retrieval MCP server that enables AI coding tools like Codex to search private local documents via semantic search and keyword boost, supporting ingestion of PDF, DOCX, TXT, Markdown, and HTML files.7MIT
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/mamq144/KoboldCpp-RAG-MCP'
If you have feedback or need assistance with the MCP directory API, please join our Discord server