vault-semantic-mcp
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.
vault-semantic-mcp
A local semantic search MCP server for a Markdown vault. Intended as a sidecar for OpenClaw or other MCP-enabled agents.
What it does
Indexes markdown files under a vault root (inbox, projects, decisions, entities, memory, sessions, templates)
Chunks content by headings, with paragraph subdivision for large sections
Embeds chunks using OpenAI
text-embedding-3-small(stored as JSON in SQLite for v1)Search combines FTS5 keyword search with cosine-similarity semantic search and folder-based ranking
Related notes finds notes similar to a given path
File watcher keeps the index in sync as files change
MCP tools expose everything to agents over stdio
Important: The vault markdown files are the source of truth. The SQLite database is a derived search index only. If the DB is lost, it can be rebuilt with a full reindex.
Related MCP server: mnemonic
Architecture
Vault root → scan
.mdfiles → parse frontmatter, chunk by headingsChunks → OpenAI embeddings → stored in SQLite with FTS5 for full-text
Search → hybrid FTS + semantic → folder boost (memory/entities/decisions > projects/sessions > inbox)
MCP → stdio transport → tools call search/get/recent/related/reindex/status
Setup
Requirements: Node.js 20+
Install:
npm installConfigure: Copy
.env.exampleto.env:cp .env.example .envSet
OPENAI_API_KEYand adjust paths:VAULT_ROOT– vault directory (default./data/vault)SQLITE_PATH– index DB (default./data/index/vault.db)
Run:
npm run dev # development with watch npm run build && npm start # production
Environment variables
Variable | Default | Description |
| (required) | OpenAI API key for embeddings |
|
| Root directory of the markdown vault |
|
| Path to SQLite index database |
|
| OpenAI embedding model |
|
| Default number of search results |
MCP usage
Configure your MCP client (e.g. OpenClaw) to run this server via stdio:
{
"mcpServers": {
"vault": {
"command": "node",
"args": ["/path/to/vault-semantic-mcp/dist/index.js"],
"env": {
"OPENAI_API_KEY": "...",
"VAULT_ROOT": "/path/to/vault",
"SQLITE_PATH": "/path/to/index/vault.db"
}
}
}
}Or with tsx for development:
{
"mcpServers": {
"vault": {
"command": "npx",
"args": ["tsx", "/path/to/vault-semantic-mcp/src/index.ts"],
"env": { ... }
}
}
}Tools
Tool | Args | Description |
|
| Hybrid search over the vault |
|
| Get full markdown for a file |
|
| Recently indexed documents |
|
| Notes related to a given path |
|
| Reindex one path or whole vault |
| – | Vault root, counts, watcher state |
Local validation (test harness)
Before wiring into OpenClaw, validate indexing and retrieval locally:
Seed vault
The repo includes sample notes in data/vault/ across projects, decisions, entities, memory, sessions, and inbox. Add or edit markdown files as needed.
Run test harness
# Reindex and run all evaluation queries (uses OPENAI_API_KEY)
npm run test:search
# Skip reindex, reuse existing index (faster for iterating on queries)
SKIP_REINDEX=1 npm run test:searchThe harness runs the same hybridSearch used by vault_search, so results reflect real MCP behavior.
Evaluation queries
Query ID | Purpose |
| FTS exact term match |
| FTS on common term |
| Semantic: "how should the agent store durable knowledge" |
| Semantic: "why OpenAI instead of local embeddings" |
| Semantic: "what happens when vault files are edited" |
| Semantic: "notes related to semantic search sidecar" |
| Semantic: "where did we decide vault files as source of truth" |
| FTS exact term |
What to inspect
Exact matches (SQLite, MCP, chunking): FTS should surface those notes
Semantic matches: Different phrasing should find the right notes (e.g. "durable knowledge" → memory/durable-knowledge-storage)
Deduplication: At most one chunk per document in results
Folder ranking: memory/entities/decisions should rank higher than inbox for similar content
Snippets: Chunk text should be readable and relevant
Reindex only
npm run reindex
VERBOSE=1 npm run reindex # log each fileEmbeddings
v1 uses OpenAI
text-embedding-3-smalland stores vectors as JSON in SQLite.No sqlite-vec or vector extensions. Future versions may add Ollama support.
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
Serve a folder of Markdown notes as an MCP server: hybrid search, reading, and sourced answers.
Markdown-based note-taking with a hosted MCP server. Your notes serve you and your AI.
Hosted MCP server for Obsidian Sync vaults: read, search, edit notes. Not affiliated with Obsidian.
Token-efficient MCP memory for Markdown vaults. Tiered search, GraphRAG, AI memories.
Related MCP Servers
- AlicenseNot gradedqualityAmaintenanceMCP server that indexes Obsidian notes and enables hybrid search (full-text, fuzzy, semantic) for AI assistants to find and read notes.1,190 npm127MIT
- AlicenseNot gradedqualityDmaintenanceMCP server for on-device hybrid search over markdown knowledge bases, combining BM25, vector embeddings, and LLM reranking with link graph and time decay.MIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server for personal markdown notes that enables hybrid search (keyword + semantic) with Reciprocal Rank Fusion, allowing users to save, search, update, and retrieve notes by meaning rather than exact wording.MIT
- AlicenseNot gradedqualityDmaintenanceA local, private hybrid-search MCP server for searching markdown notes using BM25 + vector fusion with local embeddings via Ollama.MIT