KnowlinMCP
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.
⚰️ Archived — the index is frozen (2026)
KnowlinMCP was a per-project, fully-local knowledge layer for coding agents: dense (BGE-small) + sparse (SPLADE++) → RRF fusion → cross-encoder rerank, with intent routing and a warm per-project daemon for ~30ms queries over MCP. The retrieval design was the real SOTA recipe, not a toy.
Then qmd (Tobi Lütke's) did the same category in TypeScript, kept it maintained, and picked up ~30k stars and a killer context-tree feature. If you want a local hybrid-search knowledge tool for agentic flows today, use qmd. That's the honest recommendation.
What qmd (or anyone building this) could still borrow from here
Session transcripts as a first-class source. KnowlinMCP indexed
~/.claude/projects/sessions alongside docs and captured notes, so "what did we try last time this broke?" actually resolves. Most tools index docs and stop.Intent-aware source weighting. Classify the query (debug / howto / recall) and shift weight between sources — a bug favors sessions, a how-to favors docs. A cheap, useful prior that pure hybrid search ignores.
Learned sparse + cross-encoder defaults. SPLADE++ instead of plain BM25, plus a true cross-encoder rerank stage — more retrieval-sophisticated than a BM25+vector baseline.
A warm per-project daemon. Keeping the ~200MB of models hot in a tiny TCP service is what makes local retrieval fast enough to live in an agent loop.
Full disclosure, because the code is still readable
The cross-encoder reranker — the headline stage — is wired up but skipped on the default multi-source path (
MultiSourceSearchcalls each store withrerank=Falseand never reranks the fused list). One missed connection, not a missing idea. Left as an exercise for the reader, forever.Good design, out-executed by a tool with momentum. Archived with affection.
— Calin
KnowlinMCP
Per-project knowledge database with hybrid semantic search, exposed as an MCP server. Captures insights, indexes docs and session transcripts, retrieves them with dense + sparse + reranking search.
KnowlinMCP
+-----------+ +-------------------+ +-----------+
| Claude | | MCP Server | | .knowledge-db/
| Gemini |<--->| (stdio) |<--->| entries.jsonl
| Codex | | knowlin_search | | embeddings.npy
| Cursor | | knowlin_get | | sessions/
| VS Code | | knowlin_capture | | docs/
+-----------+ | knowlin_stats | +-----------+
| knowlin_ingest |
+-------------------+
|
+-------------------------+-------------------------+
| | |
v v v
Dense Search Sparse Search Cross-encoder
(BGE-small 384d) (SPLADE++ sparse) Reranker
| | |
+------------+------------+ |
| |
v |
RRF Fusion -------> Intent Weighting ------->+
(per source) DEBUG -> sessions
HOWTO -> docs
RECALL -> sessionsRelated MCP server: cc-history
Install
Requires Python 3.9+.
git clone https://github.com/calinfaja/KnowlinMCP.git && cd KnowlinMCP
./install.sh # creates .venv, installs deps + MCP support
./install.sh --with-pdf # also install PDF ingestionNote: PDF support uses
pymupdf4llmwhich is licensed under AGPL-3.0. The core KnowlinMCP package (MIT) does not include or require it.
Or manually:
pip install -e ".[mcp]"Quick Start (30 seconds)
# Activate the venv (or add .venv/bin to your PATH)
source .venv/bin/activate
# 1. Initialize in your project
cd /your/project
knowlin init # creates .knowledge-db/ + .mcp.json
# 2. Index your docs
knowlin ingest all # indexes docs/ and Claude sessions
# First run downloads ~200MB of ML models
# 3. Search
knowlin search "authentication"Example output:
1. [kb:warning] JWT tokens must be validated server-side (87%, 2026-01-10)
Client-side JWT validation is bypassable; always verify on the server.
2. [docs:finding] OAuth2 PKCE flow for single-page apps (72%, 2026-02-15)
Use PKCE instead of implicit grant for browser-based OAuth2 flows.That's it. Claude Code (and other MCP clients) can now use knowlin_search automatically via the .mcp.json created by init.
How It Works
Three sources, one search:
Source | What | Auto-discovered from |
| Manually captured insights |
|
| Markdown, PDF, text files |
|
| Claude Code transcripts |
|
Search pipeline: Every query is classified by intent (debug? howto? recall?), then searched with dense embeddings + sparse keywords + RRF fusion per source, fused across sources with intent-aware weights, and reranked with a cross-encoder. ~30ms via TCP server.
Incremental ingestion: SHA-256 file hashing tracks what's been processed. Only new or changed files are re-indexed. Run knowlin ingest all anytime -- it's fast.
CLI
# Search (default: compact format, all sources)
knowlin search "query"
knowlin search "query" -s kb -s docs # specific sources
knowlin search "query" -f detailed # verbose output
knowlin search "query" -f json # machine-readable
knowlin search "query" --type warning # filter by type
knowlin search "query" --since 2026-01-01 # date filter
# Capture knowledge
knowlin capture "JWT must be validated server-side" --type warning --tags "auth,jwt"
# Ingest
knowlin ingest all # docs + sessions (incremental)
knowlin ingest docs # docs only
knowlin ingest sessions # sessions only
knowlin ingest all --full # force re-process everything
# Browse & manage
knowlin list # recent entries across all sources
knowlin get <id> # full details of an entry
knowlin delete <id> # remove an entry
knowlin export # export entries as JSONL (pipeable)
# Admin
knowlin init # set up project (.knowledge-db/ + .mcp.json)
knowlin stats # entry counts per source
knowlin doctor --fix # health check and auto-repair
knowlin sources --init # create sources.yaml template
knowlin server start # TCP server for ~30ms queries (foreground)Entry types: finding, solution, pattern, warning, decision, discovery
Environment variables:
CLAUDE_PROJECT_DIR-- override project root detection (useful in CI or nested subdirs)KNOWLIN_DEBUG-- enable debug logging to stderr
Source Configuration
Without config, KnowlinMCP auto-discovers docs/, doc/, INFOS/ directories and Claude sessions from ~/.claude/projects/.
For explicit control, edit .knowledge-db/sources.yaml (created by knowlin init):
docs:
paths:
- docs/ # relative to project root
- ~/Desktop/INFOS/ # absolute path (~ expanded)
# include: ["*.md", "*.txt", "*.pdf", "*.rst"]
# exclude: ["drafts/**", "*.tmp"]
sessions:
auto_discover: true # scan ~/.claude/projects/MCP Server
knowlin init writes .mcp.json for Claude Code. For other clients:
Gemini CLI (~/.gemini/settings.json):
{ "mcpServers": { "knowlin-mcp": { "command": "knowlin-mcp" } } }Codex CLI (~/.codex/config.toml):
[mcp_servers.knowlin-mcp]
command = "knowlin-mcp"Cursor (.cursor/mcp.json):
{ "mcpServers": { "knowlin-mcp": { "command": "knowlin-mcp" } } }VS Code (.vscode/mcp.json):
{ "servers": { "knowlin-mcp": { "type": "stdio", "command": "knowlin-mcp" } } }5 tools exposed: knowlin_search, knowlin_get, knowlin_capture, knowlin_stats, knowlin_ingest.
Python API
from knowlin_mcp import KnowledgeDB, MultiSourceSearch
db = KnowledgeDB("/path/to/project")
results = db.search("query", limit=5)
ms = MultiSourceSearch("/path/to/project")
results = ms.search("how to configure auth", sources=["kb", "docs"])Storage
.knowledge-db/
sources.yaml # source config (optional)
entries.jsonl # curated KB (source of truth)
embeddings.npy # dense vectors (384-dim)
sparse_index.json # SPLADE++ sparse vectors
sessions/ # ingested session transcripts
entries.jsonl, embeddings.npy, session-registry.json
docs/ # ingested documentation chunks
entries.jsonl, embeddings.npy, doc-registry.jsonDevelopment
git clone https://github.com/calinfaja/KnowlinMCP.git && cd KnowlinMCP
./install.sh
.venv/bin/pytest tests/ -v # unit tests
.venv/bin/ruff check src/ tests/ # lint
.venv/bin/black src/ tests/ # formatLicense
MIT
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Shared memory for coding agents. Stop re-explaining your codebase every session.
Private, multimodal knowledge store for agents: hybrid search with cited, provenance-backed results.
Token-efficient search for coding agents over public and private documentation.
Universal persistent memory and knowledge retrieval layer for AI agents and LLMs.
Related MCP Servers
- AlicenseAqualityDmaintenanceProvides persistent memory for AI agents using hybrid search (vector embeddings + BM25) with neural reranking, enabling storage and retrieval of insights, debugging solutions, and patterns across coding sessions.8MIT
- AlicenseNot gradedqualityDmaintenanceProvides local-first, cross-session memory for Claude Code, enabling semantic search across past sessions to retrieve procedures, decisions, or answers without exposing secrets.Apache 2.0
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to index and search local files, websites, GitHub repos, and packages with hybrid AI-powered retrieval, all locally through IDE chat.Apache 2.0
- AlicenseAqualityCmaintenanceEnables coding agents to query a local, offline memory store of past session traces through hybrid BM25 plus semantic retrieval over extracted memories and chunks. Lets users recall relevant memories, search chunks and sessions, and explore cross-session clusters directly from their agent.31MIT