rag-hub-mcp
Integrates with Ollama as a local OpenAI-compatible embeddings provider (default at http://localhost:11434/v1), enabling vector search over knowledge bases using models such as bge-m3 and nomic-embed-text.
Provides OpenAI-compatible embeddings support, allowing the server to use OpenAI embedding models like text-embedding-3-small for vector search over indexed documents.
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., "@rag-hub-mcpsearch my infra knowledge base for how to set up SSO"
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.
rag-hub-mcp
Self-hosted RAG that speaks MCP. Drop folders, get a knowledge base. Zero infrastructure.
Drop documents into folders → each folder becomes a named knowledge base → search them from any MCP-compatible agent (Claude Code, OpenCode, Cline…) or over a tiny REST API. Your data stays on your machine — there's no vector database to run.
Full documentation: openhoat.github.io/rag-hub-mcp
Why rag-hub-mcp?
Most RAG setups need a vector database, a chunking pipeline, an embeddings service and glue code. rag-hub-mcp collapses all of that into one process:
Folders are knowledge bases — a 1st-level folder is a KB, named after the folder. No schema, no UI.
Zero infrastructure — one SQLite database with FTS5. No vector DB, no server to keep running.
MCP-native — 8 tools over the Model Context Protocol, so any agent can use it in seconds.
Hybrid search — vector cosine similarity fused with SQLite FTS5 keyword search.
Related MCP server: Phloem MCP Server
How it works
graph TD
KBS["./kbs/ — folders = knowledge bases"] -->|scan SHA-256 diff| PROC["extract → chunk → embed<br/>bge-m3 / any OpenAI-compatible API"]
PROC --> DB[("SQLite + FTS5<br/>vectors + full-text index")]
DB --> SRCH["hybrid score<br/>cosine 0.65 + FTS5 0.35"]
SRCH --> MCP["MCP tools<br/>stdio / http"]
SRCH --> REST["REST API<br/>/search"]Install
No install needed — run it directly with npx:
# stdio mode (default): serve MCP tools for a local agent
npx rag-hub-mcp
# HTTP mode: REST API + MCP (streamable-http) on a port
npx rag-hub-mcp --httpRequires Node 22+. better-sqlite3 compiles natively on first use (prebuilt binaries are used when available).
Quick start
mkdir -p ./kbs/my-knowledge-base
echo "Hello RAG" > ./kbs/my-knowledge-base/hello.md
npx rag-hub-mcpAny MCP-compatible agent can launch the server itself via npx — no server to keep running:
{
"mcpServers": {
"rag-hub-mcp": {
"command": "npx",
"args": ["rag-hub-mcp"],
"env": {
"EMBEDDINGS_BASE_URL": "http://localhost:11434/v1",
"EMBEDDINGS_MODEL": "bge-m3",
"KB_ROOT": "./kbs",
"DB_PATH": "./rag.db"
}
}
}
}The 8 rag_* tools are then available in your agent sessions.
HTTP server / Docker
For a shared server over the network or a Docker deployment, see getting started. In short:
MCP_API_KEY=my-secret-key EMBEDDINGS_BASE_URL=http://localhost:11434/v1 \
KB_ROOT=./kbs npx rag-hub-mcp --http
docker run -p 8000:8000 -e MCP_API_KEY=my-secret-key \
-e EMBEDDINGS_BASE_URL=http://host.docker.internal:11434/v1 ghcr.io/openhoat/rag-hub-mcp:latestMCP tools & REST API
8 tools over MCP, callable from any MCP-compatible agent:
Tool | Description |
| List KBs with stats |
| List documents in a KB |
| Hybrid search ( |
| Add a text document |
| Delete a document |
| Delete an entire KB |
| Trigger an immediate scan |
| Index overview (KBs, documents, chunks) |
Small REST API (--http mode), all endpoints except /health require MCP_API_KEY:
Endpoint | Method | Purpose |
| GET | Health check |
| GET | List KBs |
| GET / POST / DELETE | List / add / delete documents |
| DELETE | Delete a KB |
| POST | Force reindex |
| GET | Index status |
| GET | Hybrid search |
See the MCP tools and REST API docs for the full detail.
Configuration
Set via environment variables (MCP_API_KEY, EMBEDDINGS_BASE_URL, EMBEDDINGS_MODEL, KB_ROOT, DB_PATH, …). See the configuration docs for the full table.
Roadmap
Streaming search results over MCP
Web UI dashboard (stats, documents, live search)
Pluggable vector backends (pgvector, Qdrant)
Multi-tenant / shared deployments
Reranking of hybrid results
Documentation
The full docs live at openhoat.github.io/rag-hub-mcp — getting started, architecture, MCP tools, REST API, integrations, and an end-to-end example.
Development
npm install
npm run build # compile to dist/
npm run validate # lint + typecheck + test + build
npm start # start the server (stdio)
npm start -- --http # start in HTTP mode (REST + streamable-http MCP)
npm run start:inspector # open the MCP Inspector web UI (launches dist/)Uses Biome for linting/formatting and vitest for unit + e2e tests. The source is split into layered modules (core/, pipeline/, transport/, testing/) — see the architecture doc for the full picture. Contributions are welcome.
License
MIT
This server cannot be deployed
Maintenance
Related MCP Connectors
Persistent memory and knowledge management for AI agents with semantic search and 50+ tools.
- KumbukaOAuthai.kumbuka
Governed, auditable knowledge your team curates for its AI assistants, self-hostable
Self-hosted AI-native knowledge workspace with hybrid search, GraphRAG, and MCP.
Shared knowledge base for AI agents. Semantic search across agents, no setup required — just a URL.
Related MCP Servers
- AlicenseAqualityDmaintenanceSelf-hosted knowledge backend for AI agents. Provides 11 MCP tools for hybrid vector + keyword search, container-isolated knowledge bases, and 4 storage connectors (S3, Azure Blob, MinIO, filesystem). Built with .NET, runs via Docker.1117MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to query self-hosted knowledge bases through hybrid retrieval and list available datasets, providing grounded, retrieval-augmented answers.3 npmApache 2.0
- AlicenseBqualityAmaintenanceEnables file-based knowledge management with ranked keyword and semantic hybrid search, allowing AI agents to learn from documents and recall relevant knowledge as a persistent memory tool.30146 npmAGPL 3.0
- FlicenseAqualityBmaintenanceProvides AI agents with multi-format document indexing, hybrid dense and sparse search with reranking, and relational SQL querying over extracted tables.12-