llm-wiki-mcp 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Sumitro Aji Prabowo
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,175 @@
1
+ # wiki-mcp
2
+
3
+ An MCP server that implements [Andrej Karpathy's LLM Wiki pattern](https://gist.github.com/karpathy/442a6bf555914893e9891c11519de94f) — enabling any MCP-compatible LLM client to build and maintain a persistent, compounding knowledge base as structured markdown files.
4
+
5
+ ## The Idea
6
+
7
+ Most LLM + document workflows use RAG: retrieve chunks at query time, generate an answer, discard context. The LLM rediscovers knowledge from scratch on every question. Nothing accumulates.
8
+
9
+ The LLM Wiki pattern is different. Instead of retrieving from raw documents, the LLM **incrementally builds and maintains a persistent wiki** — a structured, interlinked collection of markdown files. When you add a new source, the LLM reads it, extracts key information, and integrates it into the existing wiki — updating entity pages, revising summaries, noting contradictions, strengthening the evolving synthesis.
10
+
11
+ **The wiki is a persistent, compounding artifact.** Cross-references are already there. Contradictions are already flagged. The synthesis reflects everything you've read. It keeps getting richer with every source you add and every question you ask.
12
+
13
+ > You never write the wiki yourself — the LLM writes and maintains all of it. You're in charge of sourcing, exploration, and asking the right questions. The LLM does all the grunt work. — [Andrej Karpathy](https://gist.github.com/karpathy/442a6bf555914893e9891c11519de94f)
14
+
15
+ ### Three Layers
16
+
17
+ | Layer | Owner | Description |
18
+ |-------|-------|-------------|
19
+ | **Raw Sources** | You curate | Immutable source documents — articles, papers, notes. The LLM reads but never modifies. |
20
+ | **The Wiki** | LLM writes | Markdown pages — summaries, entities, concepts, comparisons. The LLM creates, updates, and cross-references. |
21
+ | **The Schema** | Co-evolved | Configuration that tells the LLM how the wiki is structured and what conventions to follow. |
22
+
23
+ ### Three Operations
24
+
25
+ | Operation | What happens |
26
+ |-----------|-------------|
27
+ | **Ingest** | Drop a new source, LLM processes it — writes summary, updates entities, cross-references across 10-15 pages. |
28
+ | **Query** | Ask questions against the wiki. Good answers get filed back as new pages — explorations compound too. |
29
+ | **Lint** | Health-check: find contradictions, orphan pages, stale claims, missing cross-references. |
30
+
31
+ ### Use Cases
32
+
33
+ - **Research** — papers, articles, reports building into a comprehensive wiki with an evolving thesis
34
+ - **Reading a book** — chapter-by-chapter, building pages for characters, themes, plot threads
35
+ - **Personal** — goals, health, self-improvement, journal entries structured over time
36
+ - **Business/team** — Slack threads, meeting transcripts, customer calls maintained by LLM
37
+ - **Competitive analysis, due diligence, trip planning, course notes, hobby deep-dives**
38
+
39
+ ### Why It Works
40
+
41
+ > Humans abandon wikis because the maintenance burden grows faster than the value. LLMs don't get bored, don't forget to update a cross-reference, and can touch 15 files in one pass.
42
+
43
+ Works with [Obsidian](https://obsidian.md/) — the LLM edits files, you browse in real time via graph view. Obsidian is the IDE; the LLM is the programmer; the wiki is the codebase.
44
+
45
+ ## Quick Start
46
+
47
+ Initialize a new vault:
48
+
49
+ ```bash
50
+ npx llm-wiki-mcp init ./my-wiki
51
+ ```
52
+
53
+ Run the server (stdio transport, for Claude Desktop / MCP clients):
54
+
55
+ ```bash
56
+ npx llm-llm-wiki-mcp --vault ./my-wiki
57
+ ```
58
+
59
+ ### Claude Desktop Configuration
60
+
61
+ Add to your Claude Desktop `claude_desktop_config.json`:
62
+
63
+ ```json
64
+ {
65
+ "mcpServers": {
66
+ "llm-wiki-mcp": {
67
+ "command": "npx",
68
+ "args": ["llm-wiki-mcp", "--vault", "/absolute/path/to/your/vault"]
69
+ }
70
+ }
71
+ }
72
+ ```
73
+
74
+ ## Tools
75
+
76
+ | Tool | Description |
77
+ |------|-------------|
78
+ | `wiki_init` | Create a new wiki vault with folder structure and default config |
79
+ | `wiki_ingest` | Read a raw source document and return its content with context |
80
+ | `wiki_create_page` | Create a new wiki page with frontmatter and typed content |
81
+ | `wiki_read_page` | Read a wiki page by title or path |
82
+ | `wiki_update_page` | Update an existing wiki page |
83
+ | `wiki_delete_page` | Delete a wiki page and report broken links |
84
+ | `wiki_search` | Search across wiki pages (text or semantic) |
85
+ | `wiki_lint` | Health-check: orphan pages, broken links, missing frontmatter |
86
+
87
+ ## Transports
88
+
89
+ **stdio** (default) -- for Claude Desktop and other MCP clients:
90
+
91
+ ```bash
92
+ llm-wiki-mcp --vault ./my-wiki
93
+ ```
94
+
95
+ **HTTP** (Streamable HTTP) -- for web-based clients:
96
+
97
+ ```bash
98
+ llm-wiki-mcp --vault ./my-wiki --transport http --port 3000
99
+ ```
100
+
101
+ The HTTP transport serves an MCP-compliant Streamable HTTP endpoint at `http://127.0.0.1:3000/mcp`.
102
+
103
+ ## Search
104
+
105
+ wiki-mcp supports two search backends:
106
+
107
+ - **qmd** (optional) -- if `qmd` is installed and available on PATH, wiki-mcp uses it for semantic/hybrid search.
108
+ - **Simple** (default fallback) -- case-insensitive substring search across page content. No external dependencies.
109
+
110
+ ## Configuration
111
+
112
+ Each vault has a `.wiki-schema.yaml` at its root:
113
+
114
+ ```yaml
115
+ name: "My Wiki"
116
+ version: 1
117
+ linkStyle: "wikilink" # or "markdown"
118
+ paths:
119
+ raw: "raw"
120
+ wiki: "wiki"
121
+ assets: "raw/assets"
122
+ pageTypes:
123
+ source:
124
+ description: "Summary of a raw source document"
125
+ requiredFields: [title, type, source_path, created]
126
+ concept:
127
+ description: "A concept or idea"
128
+ requiredFields: [title, type, tags, created]
129
+ entity:
130
+ description: "A person, organization, or thing"
131
+ requiredFields: [title, type, tags, created]
132
+ comparison:
133
+ description: "Comparison between concepts/entities"
134
+ requiredFields: [title, type, subjects, created]
135
+ ```
136
+
137
+ See `examples/` for research and personal vault configurations.
138
+
139
+ ## Vault Structure
140
+
141
+ ```
142
+ my-wiki/
143
+ .wiki-schema.yaml # vault configuration
144
+ index.md # auto-maintained page catalog
145
+ log.md # append-only operation log
146
+ raw/ # source documents (articles, PDFs, notes)
147
+ assets/ # images and attachments
148
+ wiki/ # generated wiki pages
149
+ ```
150
+
151
+ ## Development
152
+
153
+ ```bash
154
+ npm install
155
+ npm run build
156
+ npm test
157
+ ```
158
+
159
+ ## Obsidian Integration
160
+
161
+ wiki-mcp generates Obsidian-compatible markdown. Set `linkStyle: "wikilink"` in your schema (default) for native `[[wikilinks]]`, or `"markdown"` for standard `[links](path.md)` if you prefer other editors.
162
+
163
+ **Tips from Karpathy's gist:**
164
+ - Use [Obsidian Web Clipper](https://obsidian.md/clipper) to convert web articles to markdown sources
165
+ - Use Obsidian's graph view to see the shape of your wiki — hubs, orphans, connections
166
+ - Add [Dataview](https://github.com/blacksmithgu/obsidian-dataview) for dynamic tables from page frontmatter
167
+ - The wiki is just markdown files — version with git for free
168
+
169
+ ## Credits
170
+
171
+ Based on [Andrej Karpathy's LLM Wiki pattern](https://gist.github.com/karpathy/442a6bf555914893e9891c11519de94f), which draws on Vannevar Bush's Memex (1945) — a personal knowledge store with associative trails between documents. The part Bush couldn't solve was who does the maintenance. The LLM handles that.
172
+
173
+ ## License
174
+
175
+ MIT