Knowledge MCP Server
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.
π§ Knowledge MCP Server
The High-Performance, Local-First Second Brain & Knowledge Base for AI Agents
English β’ TiαΊΏng Viα»t β’ Roadmap β’ Setup Guide
π‘ What is Knowledge MCP?
Knowledge MCP Server is a blazing-fast, local-first Knowledge Management & Retrieval-Augmented Generation (RAG) system exposed via the open Model Context Protocol (MCP) standard.
It empowers AI coding assistants and autonomous agents (Antigravity IDE / CLI, Claude Code, Cursor, ChatGPT / Codex, Windsurf) to seamlessly search, read, create, and maintain your personal or enterprise knowledge vault with zero cloud dependencies and zero data leakage.
βββββββββββββββββββ Streamable HTTP ββββββββββββββββββββββββββββββββββββββββ
β AI Assistants β ββββββββββββββββββββββββββ> β Knowledge MCP Server β
β (Antigravity / β β ββββββββββββββββββββββββββββββββββββ β
β Claude / Cursorβ <ββββββββββββββββββββββββββ β β Hybrid Search (BM25 + Vector) β β
βββββββββββββββββββ β β Anthropic Contextual Retrieval β β
β β Heading-Aware Markdown Chunker β β
β β Native SQLite FTS5 (Zero C++ bld)β β
β ββββββββββββββββββββββββββββββββββββ β
ββββββββββββββββββββββββββββββββββββββββRelated MCP server: RAGDown
β¨ Key Highlights
β‘ Native SQLite & FTS5 (Zero C++ Build Hell): Built on Node.js native
node:sqlite(DatabaseSync). Starts in milliseconds without compilation errors on Windows, macOS, or Linux.π― Hybrid Search with RRF (k=60): Combines exact keyword matching (SQLite FTS5 BM25) with semantic understanding (Dense Vector Cosine Similarity) using Reciprocal Rank Fusion for pinpoint technical accuracy.
π§© Heading-Aware Markdown Chunking: Intelligently parses document structure along
H1 > H2 > H3hierarchy, preserving YAML Frontmatter metadata (gray-matter) without breaking context.𧬠Anthropic Contextual Retrieval: Generates succinct context annotations for each chunk before embedding, drastically reducing ambiguity and retrieval hallucinations.
π Incremental Ingestion (SHA256 Diffing): Reindexes only modified chunks, saving computing power and embedding latency.
β‘ 1-Click All-in-One Setup (
setup-and-run.bat): Automated setup script that prepares environment, builds, indexes, configures Antigravity rules, and starts the server in 30 seconds.π‘οΈ Autonomous Agent Policy: Built-in rules and tool descriptions that prompt agents to automatically search your knowledge vault before answering technical queries.
π Feature Comparison Matrix
Feature | π§ Knowledge MCP | π Google NotebookLM | π€ Mem0 | π Obsidian MCP |
Primary Execution | Direct IDE Integration | Web App Tab | Cloud/Python SDK | Obsidian Desktop App |
Privacy & Security | 100% Local / On-Prem | Google Cloud | Cloud / SaaS | Local |
Read & Write Memory | Yes (Bi-directional) | Read-Only | Yes | Yes |
Search Architecture | BM25 + Vector RRF | Vector / Context Window | Graph + Vector | Regex / Plaintext |
Technical Symbol Search | Pinpoint (FTS5 exact) | Fuzzy | Semantic only | Basic |
Contextual Retrieval | Yes (Anthropic style) | No | No | No |
Windows Installation | Zero C++ Build (Native) | Cloud | Needs C++ toolchains | Needs Obsidian Plugins |
Protocol Support | MCP Streamable HTTP | Proprietary UI | Custom API / MCP | Local REST / MCP |
ποΈ System Architecture
graph TD
subgraph "AI Clients"
AG[Antigravity IDE / CLI]
CC[Claude Code / Desktop]
CX[Codex / Cursor / Others]
end
subgraph "Knowledge MCP Server (:3900)"
AUTH[Bearer Auth Middleware]
HTTP[Streamable HTTP Transport - /mcp]
TOOLS[MCP Tools Registry - 8 Tools]
subgraph "Core Intelligence Engines"
HYBRID[Hybrid Search Engine - RRF k=60]
INGEST[Incremental Ingestion Pipeline]
CHUNKER[Heading-Aware Markdown Chunker]
EMBED[Vector Embedder - 9router / Ollama / OpenAI]
CTX[Anthropic Contextualizer]
end
subgraph "Local Storage Layer"
DB[(SQLite Database - knowledge.db)]
FTS[FTS5 BM25 Full-Text Index]
VEC[Float32 Vector BLOBs]
VAULT[Vault Files - data/raw/*.md]
end
end
AG -->|HTTP POST /mcp| AUTH
CC -->|HTTP POST /mcp| AUTH
CX -->|HTTP POST /mcp| AUTH
AUTH --> HTTP --> TOOLS
TOOLS --> HYBRID
TOOLS --> INGEST
HYBRID --> FTS
HYBRID --> VEC
INGEST --> CHUNKER --> CTX --> EMBED
INGEST --> DB
INGEST --> VAULTπ Quick Start (30 Seconds)
Option 1: 1-Click All-in-One Launcher (Windows)
Double-click setup-and-run.bat at the root of the project:
.\setup-and-run.batThe script automatically verifies Node.js, connects to your embedding gateway (e.g. 9router/Ollama), builds TypeScript, indexes your vault, registers Antigravity MCP configs, and launches the server!
Option 2: Manual Step-by-Step Setup
Clone the repository:
git clone https://github.com/your-username/knowledge-mcp.git cd knowledge-mcpInstall dependencies:
npm installConfigure environment (
.env):cp .env.example .envSample
.envconfiguration:VAULT_DIR=./data/raw DB_PATH=./db/knowledge.db PORT=3900 # Embedding (Ollama or 9router OpenAI-compatible endpoint) EMBEDDING_BASE_URL=http://localhost:11434/v1 EMBEDDING_MODEL=nomic-embed-text EMBEDDING_API_KEY=ollama EMBEDDING_DIM=768 # Anthropic Contextual Retrieval (Optional) CONTEXTUAL_RETRIEVAL_ENABLED=false CHAT_BASE_URL=https://api.openai.com/v1 CHAT_MODEL=gpt-4o-mini CHAT_API_KEY=your-key # Authentication (Optional for remote deployments) MCP_AUTH_TOKEN=Index your knowledge documents: Drop your Markdown files into
data/raw/and run:npm run reindexStart the MCP server:
npm run build npm startServer endpoint:
http://localhost:3900/mcp| Health check:http://localhost:3900/health.
π οΈ MCP Tool Reference
Knowledge MCP exposes 8 production-ready tools:
Tool Name | Parameters | Description |
|
| Recommended primary tool. Assembles top relevant chunks into an LLM-ready Markdown block with sources. |
|
| Hybrid full-text (BM25) + dense vector search via Reciprocal Rank Fusion (RRF k=60). |
|
| Exact keyword and phrase search via SQLite FTS5. |
|
| Semantic cosine similarity vector search. |
|
| Read full content of a specific note file (path-traversal protected). |
|
| List all notes in the vault with optional directory prefix filter. |
|
| Create a new note file and instantly auto-reindex it into SQLite. |
|
| Append content to an existing note and instantly auto-reindex it. |
π Connecting to AI Clients
1. Antigravity IDE / CLI
Add to ~/.gemini/config/mcp_config.json:
{
"mcpServers": {
"knowledge-vault": {
"serverUrl": "http://localhost:3900/mcp"
}
}
}2. Claude Code & Claude Desktop
Add to .mcp.json or claude_desktop_config.json:
{
"mcpServers": {
"knowledge-vault": {
"type": "streamable-http",
"url": "http://localhost:3900/mcp"
}
}
}3. Cursor & VS Code
Under IDE Settings > Features > MCP:
Name:
knowledge-vaultType:
Streamable HTTP/SSEURL:
http://localhost:3900/mcp
π§ͺ Testing
Run comprehensive unit and integration tests:
# Run all test suites (DB, Chunker, Search, MCP Server)
npm run test:allπΊοΈ Roadmap
Check out our ROADMAP.md for upcoming milestones:
β‘ Phase 1: Real-Time Live File Watcher (
chokidar).βοΈ Phase 2: Surgical Note Editing (
update_section,patch_frontmatter).π Phase 3: Multi-Format Parsing (PDF, Word, Excel).
π― Phase 4: Cross-Encoder Re-Ranking Pipeline.
π₯οΈ Phase 5: Local Web Dashboard & RAG Playground.
π License & Contribution
Distributed under the MIT License. Contributions, issues, and feature requests are welcome!
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogβ¦
Related MCP Connectors
Personal context for every AI: search, read, and write back to your private Markdown library.
Private, multimodal knowledge store for agents: hybrid search with cited, provenance-backed results.
Markdown notes and whiteboards your AI agent can read and write.
AI research library. Save, organise and reuse notes and webpages as clean markdown context.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to manage Markdown notes via the Model Context Protocol, supporting creation, editing, searching, and conflict detection.MIT
- FlicenseAqualityBmaintenanceEnables agents to run hybrid dense and BM25 search over a local folder of Markdown files, read and write notes, and trigger reindexing as the folder changes. It also injects the most relevant sections into each prompt automatically and runs entirely locally with a bundled embedding model.12-
- AlicenseBqualityBmaintenanceEnables AI agents to securely read, search, and write to a local Markdown knowledge base with hybrid RAG retrieval, privacy zones, hash-locked writes, audit logging, and rollback-safe archiving.13MIT
- FlicenseNot gradedqualityAmaintenanceEnables AI agents to search and query a local knowledge base of scattered notes and docs through hybrid vector plus BM25 retrieval with section-level citations, and to store, retract and explore durable memories, note links and agent harness memories. It also exposes note resources plus briefing, study-plan and contradiction-check prompts, all backed by a shared local index.-