RAGFlow MCP
Optional integration with OpenAI for answer generation. When configured with an API key, the Q&A tool sends the user's question and retrieved evidence excerpts to the selected OpenAI model (default gpt-4o-mini) and returns a generated answer; without a key, it returns retrieved evidence only.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
RAGFlow MCP — RAG + Vector Search + MCP
A local retrieval-augmented generation knowledge base exposed through Model Context Protocol tools. Ingest Markdown/text, create overlapping chunks, embed them, search semantically, and optionally generate answers grounded in retrieved evidence.
Features
MCP tools: ingest, add raw text, list, semantic search, delete, and question answering.
Sentence-transformer embeddings (
all-MiniLM-L6-v2), lazy-loaded on first use.SQLite persistence for documents, chunks, and float32 vectors.
NumPy cosine-similarity ranking.
Optional OpenAI answer generation; retrieval works without an API key.
Tests use a fake embedder, so no model download is needed for testing.
Related MCP server: lore-mcp
Architecture
MCP Client -> FastMCP Server
|-> Ingest -> chunk -> embed -> SQLite
|-> Search -> query embedding -> cosine ranking
`-> Q&A -> retrieval -> evidence -> optional LLMSetup
Python 3.10+:
git clone https://github.com/YOUR_USERNAME/ragflow-mcp.git
cd ragflow-mcp
python -m venv .venv
# macOS/Linux
source .venv/bin/activate
# Windows PowerShell: .venv\\Scripts\\Activate.ps1
pip install -e .
ragflow-mcpThe transformer model downloads the first time a real embedding is requested.
Database defaults to data/ragflow.sqlite3; override with RAGFLOW_DB_PATH.
MCP client configuration
Adapt this example to your MCP client:
{
"mcpServers": {
"ragflow": {
"command": "ragflow-mcp",
"args": []
}
}
}Tools
Tool | Description |
| Index a local |
| Index supplied text |
| List indexed documents |
| Return ranked chunks |
| Remove a document and chunks |
| Retrieve evidence and optionally generate an answer |
Resource: ragflow://about.
Optional LLM generation
Install the optional SDK and set your key:
pip install openai
# macOS/Linux
export OPENAI_API_KEY="your-key"
# PowerShell
$env:OPENAI_API_KEY="your-key"OPENAI_MODEL is optional (default gpt-4o-mini). Without the key, the Q&A tool returns
retrieved evidence instead of generating a prose answer. When enabled, the question and
retrieved excerpts are sent to the configured provider.
Test
pip install -e ".[dev]"
pytest -qDemo workflow
Start the server.
Ingest
examples/knowledge_base/ai_engineering_notes.md.Search for
How does vector search support RAG?.Ask the same question using
answer_question.Inspect the document list and delete the demo document if desired.
Limitations and security
Only UTF-8
.txtand.mdare supported; PDF/DOCX parsing is not included.Retrieval scans vectors from SQLite in-process; suitable for a small demo, not huge corpora.
Restrict file access and add authentication, authorization, and tenant isolation before exposing this server to untrusted clients.
Retrieved documents are untrusted data. Prompt wording is not a complete prompt-injection defence.
Do not send sensitive excerpts to an external model unless your data policy permits it.
Extensions
Add PDF/DOCX parsing, FAISS/Qdrant/Chroma, metadata filters, hybrid BM25 search, reranking, source page references, and a RAG evaluation harness.
License
MIT
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
Related MCP Connectors
Ingest, manage, and retrieve documents for RAG-powered AI applications
Private, multimodal knowledge store for agents: hybrid search with cited, provenance-backed results.
Universal persistent memory and knowledge retrieval layer for AI agents and LLMs.
Governed, auditable knowledge your team curates for its AI assistants, self-hostable
Related MCP Servers
- FlicenseAqualityDmaintenanceEnables indexing local documents (PDF, Markdown, text, code) into a knowledge base and querying them via semantic search using local embeddings, all running privately on your machine.4-
- AlicenseAqualityBmaintenanceIndexes local Markdown/text files into a SQLite database with vector embeddings and provides MCP tools for semantic search without cloud dependencies.327 PyPI1AGPL 3.0
- AlicenseAqualityBmaintenanceIndexes local documents (PDF, Word, Markdown, text) into a SQLite database for AI agents to search and retrieve bounded, source-located passages. Runs fully locally with optional OCR, preserving privacy.5MIT
- FlicenseAqualityDmaintenanceEnables retrieval-augmented question answering over Obsidian vaults and document folders, with local embeddings, vector search, and cited source paths.7-