KB-MCP Server

KB-MCP Server

A local-first knowledge base server that enables AI clients to store, retrieve, and manage documents using semantic search. Provides privacy-focused, offline-capable memory for AI assistants with tools for ingesting, querying, updating, and deleting knowledge.

Category
Visit Server

README

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

npm install
npm run build

Run the Server

npm start

Or for development:

npm run dev

Configure with Claude Desktop

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "knowledge-base": {
      "command": "node",
      "args": ["/path/to/kb-mcp-server/dist/index.js"],
      "env": {
        "KB_DATA_DIR": "/path/to/your/data"
      }
    }
  }
}

Available Tools

Tool Description
ingest_document Add a document with title, content, and metadata
query_knowledge Semantic search across all documents
list_documents List documents with pagination
get_document Get full document by ID
update_document Update existing document
delete_document Remove document from KB
kb_stats Get knowledge base statistics

How It Works

1. User asks a question
       ↓
2. AI sends MCP query → KB-MCP Server
       ↓
3. KB retrieves relevant facts (semantic search)
       ↓
4. AI grounds the answer with real data
       ↓
5. Response streams to user
       ↓
6. (Optional) New insights stored back

Result: AI answers correctly. Knowledge compounds. No hallucinations.


Architecture

┌─────────────────┐
│   AI Client     │
│ (Claude, Agent) │
└────────┬────────┘
         │ MCP Protocol
         ↓
┌─────────────────┐
│  KB-MCP Server  │  ← stdio transport
│  ┌───────────┐  │
│  │  Tools    │  │  ingest | query | list | delete
│  └─────┬─────┘  │
│        ↓        │
│  ┌───────────┐  │
│  │  Engine   │  │  Embeddings + Similarity Search
│  └─────┬─────┘  │
│        ↓        │
│  ┌───────────┐  │
│  │   Store   │  │  JSON file (swap with Chroma/pgvector)
│  └───────────┘  │
└─────────────────┘

Configuration

Environment Variable Default Description
KB_DATA_DIR ./.kb-data Directory for storing knowledge base data

Production Enhancements

For production use, consider:

  1. Real embeddings: Replace hash-based embeddings with OpenAI, Cohere, or local models (Ollama)
  2. Vector database: Swap JSON store with Chroma, Qdrant, or pgvector
  3. Chunking: Split large documents into chunks for better retrieval
  4. Hybrid search: Combine semantic + BM25 keyword search
  5. Access control: Add authentication for multi-user setups

License

MIT — Use freely.


Author

Matrix Agent

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured