mcp-llm-wiki
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-llm-wiki Search the wiki for 'offline retrieval' and summarize the relevant pages."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
mcp-llm-wiki
MCP server for a wiki an LLM maintains itself: Markdown files with YAML frontmatter, searchable via BM25 and vectors computed locally on the CPU. No cloud service, no embedding API, no external database.
The idea comes from llm-wiki.md / idee.md: three layers (immutable sources, a wiki
owned by the model, schema as AGENTS.md) and three operations (Ingest, Query, Lint).
Layout
raw/ immutable sources -> read-only
wiki/ the wiki itself -> Markdown + YAML frontmatter
.llm-wiki/index.db -> SQLite: FTS5, sqlite-vec, metadata, link graph
.llm-wiki/models/ -> downloaded embedding modelThe server does not enforce folder conventions. It enforces safety (no escape from the
wiki directory), valid frontmatter, and a current index. Where a page belongs is the model's
decision - wiki_write_page therefore requires an explicit path.
Related MCP server: llm-wiki-mcp
Installation
No install needed if you start the server with npx (see Wiring). Otherwise:
npm install -g mcp-llm-wikiFrom a clone:
cd mcp-llm-wiki
npm install
npm run buildOn first start Transformers.js downloads the model Xenova/multilingual-e5-small (~120 MB,
384 dimensions, German and English) into MODEL_CACHE_DIR. After that everything runs offline;
ALLOW_REMOTE_MODELS=false blocks the download.
Wiring
.vscode/mcp.json via npx (no global install):
{
"servers": {
"llm-wiki": {
"type": "stdio",
"command": "npx",
"args": ["-y", "mcp-llm-wiki"],
"env": {
"WIKI_ROOT": "${workspaceFolder}/wiki",
"RAW_ROOT": "${workspaceFolder}/raw"
}
}
}
}After npm install -g mcp-llm-wiki:
{
"servers": {
"llm-wiki": {
"type": "stdio",
"command": "mcp-llm-wiki",
"env": {
"WIKI_ROOT": "${workspaceFolder}/wiki",
"RAW_ROOT": "${workspaceFolder}/raw"
}
}
}
}From a clone, use "command": "node" and "args": ["${workspaceFolder}/mcp-llm-wiki/dist/index.js"].
Copy templates/AGENTS.md from the package to wiki/AGENTS.md and adapt it - conventions live there, not in the server config. After a global install the template is at $(npm root -g)/mcp-llm-wiki/templates/AGENTS.md.
Configuration
Every value can be set as an environment variable (mcp.json → env) or as a CLI flag;
CLI overrides environment overrides the default.
Variable | Flag | Default | Meaning |
|
| required | Wiki root. |
|
|
| Source layer, read-only. |
|
|
| SQLite file. |
|
|
| Embedding model. |
|
|
| Model cache. |
|
|
| Allow download. |
|
|
| Target chunk size. |
|
|
| Overlap when splitting long sections. |
|
|
| Watch the filesystem. |
|
|
|
|
|
|
| Rank-fusion constant. |
|
|
| Reject unknown frontmatter fields. |
|
| - | Default for |
|
|
| Maximum folder depth. |
|
|
| Maximum path length. |
|
| - | Injected into tool descriptions. |
|
| - | Comma-separated extra ignore patterns. |
|
|
| Read size cap. |
|
|
|
|
Tools
Search and read
Tool | Purpose |
| Hybrid search (BM25 + vectors, Reciprocal Rank Fusion). Modes |
| Whole page, section ( |
| Page list with frontmatter, filterable by folder, type, status, tag. |
| Folder tree with page counts - before creating a page. |
| All tags with counts. |
| Access to the source layer. |
Write
Tool | Purpose |
| Create or replace a page. |
|
|
| Move a file or folder; relative links are rewritten ( |
| Moves to |
Bookkeeping and maintenance
Tool | Purpose |
| Writes |
| Chronology in |
| Inbound and outbound links, including dead ones. |
| Frontmatter, dates, duplicate ids, dead links, orphans, empty folders. |
| Rebuild the index or query its state. |
How search works
Each file is split on headings; sections that are still too long are split on paragraphs with overlap. The heading path (
H1 > H2) stays attached to the chunk.BM25 runs over FTS5 with weighted columns (text, heading path, title, summary, tags). Queries are wrapped in quotes so FTS5 operators do not leak through;
ANDis tried first, thenOR.Vector search uses
sqlite-vecwith cosine distance. The e5 model needs prefixes (passage:when indexing,query:when searching) - the server adds them.Both rankings are merged with Reciprocal Rank Fusion, then the best chunk per page remains.
Security
Every path is normalized and checked against the root (
.., absolute paths, UNC, reserved Windows names, control characters).realpathis also used so symlinks cannot escape; indexing skips symlinks entirely.RAW_ROOTis read-only.Delete means move to the trash and requires an explicit confirmation.
All SQL access uses parameters, never string concatenation.
Known vulnerabilities in dependencies
onnxruntime-node 1.24 (pulled by @huggingface/transformers) still declares adm-zip@0.5 and
global-agent@3 (boolean). sharp is declared <0.35. This package overrides those to patched
releases (adm-zip@0.6, global-agent@4, sharp@0.35). None of those paths are exercised here:
the server does not unpack untrusted archives and does not process images. If you disagree, skip
vector search with mode: "bm25".
Tests
npm run build
npm test # indexing, search, path safety, write, move, lint, delete
npm run test:stdio # real MCP client over stdio against the built serverBoth scripts create a throwaway wiki under .smoke/.
Notes
stdout belongs to the JSON-RPC protocol. Diagnostics go to stderr only.
The first index pass starts only after the connection is up - the client does not wait for the model download.
If the model is changed, the server detects the different dimension and rebuilds the vector index on the next pass.
Available Tools
18 toolsraw_listList source filesARead-only
List files in the immutable source layer (RAW_ROOT). This layer is strictly read-only.
Inputs: prefix.
raw_readRead source fileBRead-only
Read a file from RAW_ROOT, optionally as a line range. There is no write access here.
Inputs: path (required), endLine, startLine.
wiki_append_logAppend log entryA
Append an entry in the form '## [YYYY-MM-DD] | ' to log.md at the wiki root. Call after every content change (ingest, update, merge, split, delete, refactor) so history stays chronological.
Inputs: title (required), operation (required), date, details.
wiki_backlinksPage linksARead-only
Show which pages link to this page (inbound), where it links (outbound), and which of its links are dead. Call before delete, move, or merge.
Inputs: path (required).
wiki_delete_pageDelete wiki pageADestructive
Move a page to the trash (.trash//) and drop it from the index. Requires confirm=true. Check wiki_backlinks first to see if other pages link here.
Inputs: path (required), confirm (required).
wiki_index_statusIndex statusARead-only
Show index configuration and state: root directories, embedding model and dimension, counts of pages/chunks/tags/links, and last index time. A good first call in a session.
Inputs: no named parameters.
wiki_lintLint wikiARead-only
Check the wiki for frontmatter errors, invalid dates, duplicate ids, dead links, unresolved sources, orphan pages, and empty folders. Nothing is changed - the result is a work list. Folder layout is not judged, only technical limits (depth, path length).
Inputs: limit, checks, folder.
wiki_list_foldersShow folder treeARead-only
Show the wiki folder tree with page counts per folder. Call before creating a page so the path matches the existing structure.
Inputs: maxDepth.
wiki_list_pagesList wiki pagesARead-only
List indexed wiki pages with path, id, title, summary, type, status, tags, and updated date. Filterable by folder, type, status, and tag.
Inputs: tag, type, limit, folder, +3 more.
wiki_list_tagsList tagsARead-only
List all tags used in the wiki with counts, highest first.
Inputs: no named parameters.
wiki_move_pageMove page or folderADestructive
Move or rename a page or a whole folder and rewrite relative Markdown links (id-based wikilinks stay valid). With dryRun=true you get the planned changes without writing anything.
Inputs: to (required), from (required), dryRun, overwrite, +1 more.
wiki_patch_pagePatch wiki pageB
Change an existing page without rewriting it. Modes: 'replace-section' and 'append-section' (require section with the heading text), 'append', 'prepend', 'replace-body'. Omit mode to update frontmatter only. 'updated' is always refreshed.
Inputs: path (required), mode, content, section, +2 more.
wiki_read_logRead recent log entriesARead-only
Return the latest log.md entries, newest first - useful at the start of a session.
Inputs: limit.
wiki_read_pageRead wiki pageARead-only
Read a wiki page. With no extra args the full file including frontmatter is returned; section returns that heading's section; startLine/endLine return a line range.
Inputs: path (required), endLine, section, startLine, +1 more.
wiki_reindexRebuild indexAIdempotent
Refresh the search index. 'incremental' (default) processes changed files only; 'full' rebuilds everything. Usually unnecessary because write tools update the index - needed after filesystem changes made outside this server.
Inputs: mode, paths.
wiki_searchSearch wikiARead-only
Hybrid search over the wiki: BM25 (SQLite FTS5) and local CPU vectors combined with Reciprocal Rank Fusion. Returns the best hit per page with path, heading path, line range, and a frontmatter excerpt. Use mode='bm25' for exact terms, mode='vector' for semantic paraphrases, otherwise 'hybrid'.
Inputs: query (required), k, mode, tags, +7 more.
wiki_update_indexUpdate index.mdADestructiveIdempotent
Create or refresh an index.md catalogue. With no scope this is the root index; with scope it writes /index.md. Entries come from indexed page titles and summaries - keep frontmatter current before calling.
Inputs: scope, title.
wiki_write_pageWrite wiki pageADestructive
Create or fully overwrite a wiki page. The path is deliberately NOT derived by the server: you choose the folder and filename. Missing folders are created automatically. Call wiki_list_folders first so the path matches the existing structure. The YAML header is completed (id, title, type, created, updated); existing fields are kept. An existing file is replaced only with overwrite=true - use wiki_patch_page for partial edits.
Inputs: body (required), path (required), overwrite, frontmatter.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 18 tools
Each wiki_* and raw_* tool targets a distinct operation/resource: search, reads, lists, mutations, index maintenance, link analysis, and linting. Even close pairs like wiki_write_page vs wiki_patch_page and wiki_update_index vs wiki_reindex are clearly separated by write-versus-partial-edit and catalogue-versus-search-index semantics.
The dominant pattern is prefix + verb_noun (wiki_list_pages, wiki_write_page, wiki_read_page), with raw_list/raw_read forming a consistent raw_* subfamily. Minor deviations like wiki_backlinks (noun instead of verb) and wiki_index_status vs wiki_reindex/update_index break the pattern slightly, but the convention is still predictable.
At 18 tools the server is above the typical 3-15 sweet spot, but the count is justified by the breadth of the wiki lifecycle: search, CRUD, structure listing, index maintenance, backlinks, linting, and logging. A few tools could theoretically be merged, but each has a distinct purpose.
The server covers the full wiki lifecycle: search, read, create, overwrite, patch, move, delete, plus supporting functions like backlinks, index generation, lint, and reindexing. The read-only RAW layer is intentionally separate and documented, and no critical workflow appears to be a dead end.
Maintenance
Related MCP Connectors
Personal wiki and memory layer for AI assistants. Persistent, structured memory across sessions.
Private, multimodal knowledge store for agents: hybrid search with cited, provenance-backed results.
Self-hostable shared brain for you and your AI agents — docs, flows, meetings, decisions, rationale
Open-source Obsidian for MDX - edit local docs with agent assistance
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables creation of persistent, compounding knowledge bases using Karpathy's LLM Wiki pattern with LLM-maintained markdown wikis. Supports automated ingestion, cross-referencing, synthesis, and linting of sources as an alternative to traditional RAG systems.63MIT
- AlicenseNot gradedqualityDmaintenancePersistent markdown wiki for your AI agent, built on Karpathy's LLM wiki gist.2MIT
- 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-
- FlicenseAqualityBmaintenanceTurns a user's own Markdown wiki into a locally indexed knowledge base, enabling semantic search, per-page retrieval, source listing, and citation-backed RAG question answering. All embedding and generation run through a local Ollama instance, so queries and documents never leave the machine.4263 PyPI3-