KB-MCP Server
A local-first Knowledge Base with Model Context Protocol (MCP) support. Give your AI a reliable memory. Run it locally. Stream answers in real time.
What is This?
A Knowledge Base (KB) is a structured collection of facts, documents, and embeddings stored in machine-readable form, with interfaces to:
Add knowledge
Query knowledge (semantic + keyword search)
Update/Delete knowledge
This MCP server exposes your KB to any MCP-compatible AI client (Claude, custom agents, etc.).
Why Local-First?
Benefit | Description |
Privacy | No cloud leaks — your data stays on your machine |
Zero latency | No network round-trips |
Offline support | Works without internet |
Full control | You own the data and the logic |
No vendor lock-in | Swap components freely |
Quick Start
Installation
Run the Server
Or for development:
Configure with Claude Desktop
Add to your claude_desktop_config.json:
Available Tools
Tool | Description |
| Add a document with title, content, and metadata |
| Semantic search across all documents |
| List documents with pagination |
| Get full document by ID |
| Update existing document |
| Remove document from KB |
| Get knowledge base statistics |
How It Works
Result: AI answers correctly. Knowledge compounds. No hallucinations.
Architecture
Configuration
Environment Variable | Default | Description |
|
| Directory for storing knowledge base data |
Production Enhancements
For production use, consider:
Real embeddings: Replace hash-based embeddings with OpenAI, Cohere, or local models (Ollama)
Vector database: Swap JSON store with Chroma, Qdrant, or pgvector
Chunking: Split large documents into chunks for better retrieval
Hybrid search: Combine semantic + BM25 keyword search
Access control: Add authentication for multi-user setups
License
MIT — Use freely.
Author
Matrix Agent