LLM Knowledge Base
БесплатноНе проверенMCP server providing a persistent markdown knowledge base with hybrid dense + sparse vector search (Qdrant, Cloudflare Workers AI, Splade).
Описание
MCP server providing a persistent markdown knowledge base with hybrid dense + sparse vector search (Qdrant, Cloudflare Workers AI, Splade).
README
An MCP server that gives an LLM a persistent, searchable markdown knowledge base. Documents are embedded with both dense and sparse vectors and stored in Qdrant, so the agent can ingest notes/output and later retrieve them with hybrid semantic search instead of relying only on its training data.
Description & Capabilities
- Persistent knowledge storage — ingests LLM-generated or user-provided markdown into a durable Qdrant vector collection instead of losing it at the end of a session.
- Hybrid retrieval — combines dense embeddings (Cloudflare Workers AI
bge-base-en-v1.5) with sparse embeddings (Splade_PP_en_v1), fused via Reciprocal Rank Fusion (RRF), for more accurate search than dense-only or keyword-only search. - Topic filtering — documents are tagged with short, descriptive "filters" (
filters.json) so retrieval can be scoped to a category (e.g.query_with_filter) or run across everything (query). - Full listing / browsing —
get_all_with_filterenumerates every stored document (optionally scoped to a filter) when the user wants a full list rather than a ranked search. - Enforced ingestion schema — a user-editable schema (
Schema_File.txt) defines how documents must be formatted before ingestion, keeping the knowledge base consistent; it can be replaced (set_schema) or extended (add_schema) on request. - Dual-access design (resources + tools) — every piece of metadata (filters, schema) is exposed as both an MCP resource (
knowledge-base://filters,knowledge-base://schema) and an equivalent tool (filters_tool,schema_tool), so the server works with MCP hosts that can't browse resources directly.
Project Structure
| File | Description |
|---|---|
server.py |
Main FastMCP server entry point. Defines the LLM-Knowledge-Base MCP server, its lifespan hook (creates the Qdrant collection on startup), and all tools/resources for ingesting, querying, filtering, and managing the schema. |
models.py |
Configures the embedding models: embedding_model (Cloudflare Workers AI dense embeddings) and sparse_model (Splade sparse embeddings). |
schema.py |
Defines ingest_model, the Pydantic input model for the ingest tool (text and filter fields). |
collection.py |
Qdrant client/connection management (get_client) and collection bootstrap logic (create_collection) that sets up dense + sparse vector configs. |
filters.json |
Data file storing the list of registered topic filters (filter_name + description) used to categorize ingested documents. |
Schema_File.txt |
Data file storing the current ingestion/output schema — the formatting rules documents must follow before being ingested. |
pyproject.toml |
Project metadata and Python dependencies (managed with uv). |
uv.lock |
Locked dependency versions for reproducible installs via uv. |
.env.example |
Template listing the required environment variables (copy to .env and fill in real values). |
.python-version |
Pins the Python version (3.11) for the project, used by uv/pyenv. |
.gitignore |
Excludes local/generated files (.venv, .env, __pycache__, filters.json, Schema_File.txt, notebooks) from version control. |
Tools & Resources
Tools
| Tool | Description |
|---|---|
ingest |
Stores a schema-formatted markdown document into the knowledge base under a given filter, embedding it with both dense and sparse vectors. |
query |
Hybrid (dense + sparse, RRF-fused) semantic search across the entire knowledge base; returns the top 7 matching text chunks. |
query_with_filter |
Same hybrid search as query, but scoped to documents whose filter matches the one provided. |
get_all_with_filter |
Returns every stored document (full payload), optionally scoped to one filter — enumeration rather than ranked search. |
add_filter |
Registers a new topic filter (filter_name + description) in filters.json so future ingestion/queries can use it. |
set_schema |
Overwrites Schema_File.txt with a brand-new ingestion schema. |
add_schema |
Appends additional rules to the existing ingestion schema without removing what's there. |
schema_tool |
Tool-call equivalent of the knowledge-base://schema resource, for hosts that can't browse resources. |
filters_tool |
Tool-call equivalent of the knowledge-base://filters resource, for hosts that can't browse resources. |
Resources
| Resource | MIME Type | Description |
|---|---|---|
knowledge-base://filters |
application/json |
Lists all registered topic filters (filter_name + description) from filters.json. |
knowledge-base://schema |
text/plain |
Returns the current ingestion/output schema from Schema_File.txt. |
Environment Variables
Set these in a .env file at the project root (see .env.example):
| Variable | Why it's needed |
|---|---|
CF_ACCOUNT_ID |
Cloudflare account ID required to authenticate with Cloudflare Workers AI, which generates the dense (bge-base-en-v1.5) embeddings used for ingestion and search. |
CF_API_TOKEN |
API token for Cloudflare Workers AI, used alongside CF_ACCOUNT_ID to authorize embedding requests. |
QDRANT_URL |
Endpoint of the Qdrant instance where the knowledge base vector collection is created, queried, and updated. |
QDRANT_API_KEY |
API key used to authenticate with the Qdrant instance at QDRANT_URL. |
collection_name |
Name of the Qdrant collection used to store ingested documents. Optional — defaults to LLM-Knowledge-Base if not set. |
Running with Claude Desktop
This server uses uv for dependency management and runs over stdio, so it can be registered directly in Claude Desktop's MCP config.
- Add your real credentials to a
.envfile in the project root (copy.env.exampleand fill it in). - Recreate the virtual environment and install dependencies with
uv:
uv sync
- Open Claude Desktop's config file (
claude_desktop_config.json) and add an entry undermcpServers:
{
"mcpServers": {
"LLM-Knowledge-Base": {
"command": "uv",
"args": [
"--directory",
"C:\\file\\path\\LLM-knowledge-Base",
"run",
"server.py"
]
}
}
}
- Restart Claude Desktop. The
LLM-Knowledge-Baseserver should appear in the MCP tools list, exposing theingest,query,query_with_filter,get_all_with_filter,add_filter,set_schema,add_schema,schema_tool, andfilters_tooltools.
Установка LLM Knowledge Base
У этого сервера нет опубликованного пакета — он собирается из исходников. Открой репозиторий и следуй инструкции в README.
▸ github.com/manveesh-achanta/LLM-Knowledge-Base-MCPFAQ
LLM Knowledge Base MCP бесплатный?
Да, LLM Knowledge Base MCP бесплатный — установка в пару кликов через Unyly без оплаты.
Нужен ли API-ключ для LLM Knowledge Base?
Нет, LLM Knowledge Base работает без API-ключей и переменных окружения.
LLM Knowledge Base — hosted или self-hosted?
Self-hosted: сервер запускается локально на твоей машине командой из раздела установки.
Как установить LLM Knowledge Base в Claude Desktop, Claude Code или Cursor?
Открой LLM Knowledge Base на unyly.org, выбери вкладку своего клиента (Claude Desktop, Claude Code, Cursor) и нажми Install — конфиг сгенерируется автоматически, без правки JSON.
Похожие MCP
wenb1n-dev/SmartDB_MCP
A universal database MCP server supporting simultaneous connections to multiple databases. It provides tools for database operations, health analysis, SQL optim
автор: wenb1n-devPostgres Server
This server enables interaction with PostgreSQL databases through the Model Context Protocol, optimized for the AWS Bedrock AgentCore Runtime. It provides tools
автор: madhurprashPostgres
Query your database in natural language
автор: AnthropicPostgreSQL
Read-only database access with schema inspection.
автор: modelcontextprotocolCompare LLM Knowledge Base with
Не уверен что выбрать?
Найди свой стек за 60 секунд
Автор?
Embed-бейдж для README
Похожее
Все в категории data
