knowledge-mcp-server
Provides tools for semantic search, lookup, CRUD, graph exploration, validation, and statistics over hierarchical Markdown knowledge bases with YAML frontmatter.
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
MCP server for semantic search, CRUD, and graph operations over hierarchical knowledge bases stored as Markdown with YAML frontmatter.
Provides 8 tools via Model Context Protocol: knowledge_search, knowledge_lookup, knowledge_graph, knowledge_list, knowledge_write, knowledge_delete, knowledge_validate, and knowledge_stats.
Quick Start
# Initialize a new knowledge directory (also creates .mcp.json for Claude Code)
npx knowledge-mcp-server init
# Start the MCP server
npx knowledge-mcp-serverRelated MCP server: mcp-vault-reader
Installation
npm install knowledge-mcp-serverClaude Code Integration
Running npx knowledge-mcp-server init automatically creates a .mcp.json file in your project root, registering the server with Claude Code. If you need to configure it manually, add to your .mcp.json:
{
"mcpServers": {
"knowledge": {
"type": "stdio",
"command": "npx",
"args": ["knowledge-mcp-server", "--knowledge-dir", "./knowledge"]
}
}
}By default, the server uses a local embedding model (BAAI/bge-small-en-v1.5) for hybrid BM25 + vector search — no API keys required. The model is downloaded automatically on first use.
CLI Reference
knowledge-mcp-server [command] [options]
Commands:
serve Start the MCP server over stdio (default)
embeddings Generate embeddings for all documents
init Scaffold a new knowledge/ directory with config template
validate Run graph integrity checks and report issues
stats Display knowledge graph statistics
list List documents with metadata filtering
Options:
--knowledge-dir <path> Path to knowledge directory (default: ./knowledge)
--help, -h Show help
--version Show versionGenerate Embeddings
# Local model (default, no API key needed)
npx knowledge-mcp-server embeddings
# Or with Voyage AI (requires config + API key)
VOYAGE_API_KEY=your-key npx knowledge-mcp-server embeddingsUses incremental hashing — only re-embeds documents whose content has changed. Automatically detects provider/model changes and re-embeds all documents when switching.
Validate Graph
npx knowledge-mcp-server validateChecks for: orphaned documents, broken references, circular parents, missing tags, empty summaries, stale documents (>6 months), and embedding coverage. Exits with code 1 if integrity issues are found.
Programmatic API
import { createKnowledgeServer } from "knowledge-mcp-server";
const { server, engine } = createKnowledgeServer("./knowledge");The engine is a KnowledgeEngine instance providing search(), lookup(), write(), delete(), list(), validate(), stats(), and graphView() methods.
Exported Types
import type {
KnowledgeServerResult,
KnowledgeGraph,
KnowledgeDocument,
KnowledgeConfig,
} from "knowledge-mcp-server";
import { KnowledgeEngine } from "knowledge-mcp-server";Document Format
Knowledge documents are Markdown files with YAML frontmatter:
---
id: technology/audio-detection/pitch-detection
title: Pitch Detection Pipeline
type: detail
domain: technology
subdomain: audio-detection
tags: [audio, ml, crepe, yin]
phase: [1]
related: [technology/audio-detection/chord-recognition]
---
Your document content here in Markdown.Frontmatter Fields
Field | Required | Description |
| yes | Unique document ID (lowercase, hyphens, slashes) |
| yes | Human-readable title |
| yes |
|
| yes | Top-level domain |
| no | Subdomain within the domain |
| yes | Array of searchable tags |
| yes | Array of applicable phase numbers |
| no | Array of related document IDs |
| no |
|
Directory Structure
knowledge/
├── knowledge.config.yaml # Configuration (optional)
├── _summary.md # Root node
├── .embeddings.json # Generated embeddings (optional)
├── .embeddings-hashes.json # Content hashes for change detection
├── .tags.json # Tag taxonomy (optional)
├── technology/
│ ├── _summary.md
│ └── audio-detection/
│ ├── _summary.md
│ └── pitch-detection.md
└── business/
├── _summary.md
└── pricing-tiers.mdConfiguration
knowledge.config.yaml is optional. Without it, the server runs in zero-config mode (permissive validation, auto-discovered domains).
name: "my-project"
# Strict domain validation (only these domains are accepted)
domains:
- technology
- architecture
- business
# Phase definitions with optional aliases
phases:
- id: 1
name: "Foundation"
aliases: ["launch", "mvp"]
- id: 2
name: "Growth"
# Query hints for domain classification
query_hints:
technology: ["api", "database", "framework", "library"]
business: ["pricing", "revenue", "market"]
# Synonym expansion for search
synonyms:
ml: ["machine learning"]
ai: ["artificial intelligence"]
dkt: ["deep knowledge tracing"]
# Embedding configuration (local model by default, no API key needed)
embeddings:
provider: "local" # "local" (default) or "voyage"
model: "BAAI/bge-small-en-v1.5" # local model (384 dims, default)
# cache_dir: "~/.cache/my-models" # optional model cache override
# To use Voyage AI instead:
# embeddings:
# provider: "voyage"
# model: "voyage-3-lite"
# api_key_env: "VOYAGE_API_KEY"Search Architecture
The search pipeline uses a 4-stage hybrid approach:
Query Classification — extracts domains, phases, and query type from natural language
Metadata Pre-filter — O(1) lookups via in-memory indices (domain, phase, tag, type)
Hybrid Scoring — BM25 full-text search (k1=1.2, b=0.75, title 3x boost) + vector embeddings (local or Voyage AI), merged via Reciprocal Rank Fusion (RRF, k=60)
Hierarchical Expansion — includes ancestor documents and cross-references within a word budget
Environment Variables
Variable | Required | Description |
| No | Voyage AI API key (only when |
| No | Override cache directory for local embedding model files |
| No | Logging verbosity: |
License
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
Personal context for every AI: search, read, and write back to your private Markdown library.
Search, read, and safely update Markdown notes in your connected Phasoric knowledge vaults.
Search and reason over your Obsidian-style Markdown vault, right from ChatGPT.
Personal wiki and memory layer for AI assistants. Persistent, structured memory across sessions.
Related MCP Servers
- AlicenseAqualityDmaintenanceProvides semantic search and a tag-based knowledge graph for any project, auto-discovering local markdown knowledge bases with YAML frontmatter.1020 npmMIT
- AlicenseAqualityDmaintenanceEnables AI assistants to search, read, and traverse Markdown note vaults (Obsidian-compatible) with full-text search, backlinks, knowledge graphs, and a persistent memory system for cross-session context.164 npm4MIT
- AlicenseNot gradedqualityCmaintenanceProvides retrieval and graph tools for agents to search, backlink, and navigate a markdown-based knowledge vault, enabling hybrid search and serendipitous discovery.1MIT
- FlicenseNot gradedqualityDmaintenanceEnables AI agents to explore and analyze a markdown vault as a traversable knowledge graph, with tools for searching, traversing, and finding implicit semantic connections between notes.-