@theglitchking/semantic-pages 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 TheGlitchKing
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,150 @@
1
+ # semantic-pages
2
+
3
+ Semantic search + knowledge graph MCP server for any folder of markdown files.
4
+
5
+ No Docker. No Python. No Obsidian. Just `npx`.
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ npx semantic-pages --notes ./vault
11
+ ```
12
+
13
+ Or install globally:
14
+
15
+ ```bash
16
+ npm install -g semantic-pages
17
+ semantic-pages --notes ./vault
18
+ ```
19
+
20
+ ## MCP Configuration
21
+
22
+ Add to your `.mcp.json` (Claude Code, Cursor, etc.):
23
+
24
+ ```json
25
+ {
26
+ "semantic-pages": {
27
+ "command": "npx",
28
+ "args": ["-y", "semantic-pages", "--notes", "./vault"]
29
+ }
30
+ }
31
+ ```
32
+
33
+ Point `--notes` at any folder of `.md` files: `./vault`, `./docs`, `./notes`, or `.` for the whole repo.
34
+
35
+ ## What It Does
36
+
37
+ semantic-pages gives your AI assistant native tool access to your markdown notes via the Model Context Protocol. It replaces the Obsidian + Smart Connections + MCP plugin stack with a single npm package.
38
+
39
+ ### 21 MCP Tools
40
+
41
+ **Search**
42
+
43
+ | Tool | Description |
44
+ |------|-------------|
45
+ | `search_semantic` | Vector similarity search by meaning |
46
+ | `search_text` | Full-text keyword/regex search with filters |
47
+ | `search_graph` | Graph traversal via wikilinks and tags |
48
+ | `search_hybrid` | Combined semantic + graph, re-ranked |
49
+
50
+ **Read**
51
+
52
+ | Tool | Description |
53
+ |------|-------------|
54
+ | `read_note` | Read full content of a note |
55
+ | `read_multiple_notes` | Batch read multiple notes |
56
+ | `list_notes` | List all notes with metadata |
57
+
58
+ **Write**
59
+
60
+ | Tool | Description |
61
+ |------|-------------|
62
+ | `create_note` | Create a new markdown note |
63
+ | `update_note` | Edit (overwrite, append, prepend, patch by heading) |
64
+ | `delete_note` | Delete a note (requires confirmation) |
65
+ | `move_note` | Move/rename, updates wikilinks across vault |
66
+
67
+ **Metadata**
68
+
69
+ | Tool | Description |
70
+ |------|-------------|
71
+ | `get_frontmatter` | Read YAML frontmatter as JSON |
72
+ | `update_frontmatter` | Set/delete frontmatter keys |
73
+ | `manage_tags` | Add, remove, or list tags |
74
+ | `rename_tag` | Vault-wide tag rename |
75
+
76
+ **Graph**
77
+
78
+ | Tool | Description |
79
+ |------|-------------|
80
+ | `backlinks` | Notes linking TO a given note |
81
+ | `forwardlinks` | Notes linked FROM a given note |
82
+ | `graph_path` | Shortest path between two notes |
83
+ | `graph_statistics` | Most connected nodes, orphans, density |
84
+
85
+ **System**
86
+
87
+ | Tool | Description |
88
+ |------|-------------|
89
+ | `get_stats` | Vault stats (notes, chunks, embeddings, graph) |
90
+ | `reindex` | Force full reindex |
91
+
92
+ ## How It Works
93
+
94
+ 1. **Indexes** all `.md` files: parses frontmatter, extracts `[[wikilinks]]`, `#tags`, headers
95
+ 2. **Embeds** text chunks using a local model ([nomic-embed-text-v1.5](https://huggingface.co/nomic-ai/nomic-embed-text-v1.5)) via WASM — no API key needed
96
+ 3. **Builds** a knowledge graph from wikilinks and shared tags using [graphology](https://graphology.github.io/)
97
+ 4. **Creates** an HNSW vector index for fast approximate nearest neighbor search
98
+ 5. **Watches** for file changes and re-indexes incrementally
99
+ 6. **Serves** all of this over MCP stdio protocol
100
+
101
+ The index is stored in `.semantic-pages-index/` alongside your notes (gitignore it). The model is downloaded once to `~/.semantic-pages/models/`.
102
+
103
+ ## CLI
104
+
105
+ ```bash
106
+ # Start MCP server (default)
107
+ semantic-pages --notes ./vault
108
+
109
+ # Show vault statistics
110
+ semantic-pages --notes ./vault --stats
111
+
112
+ # Force reindex and exit
113
+ semantic-pages --notes ./vault --reindex
114
+
115
+ # Disable file watcher
116
+ semantic-pages --notes ./vault --no-watch
117
+ ```
118
+
119
+ ## As a Library
120
+
121
+ ```typescript
122
+ import { Indexer, Embedder, GraphBuilder, VectorIndex } from "semantic-pages";
123
+
124
+ const indexer = new Indexer("./vault");
125
+ const docs = await indexer.indexAll();
126
+
127
+ const embedder = new Embedder();
128
+ await embedder.init();
129
+ const vec = await embedder.embed("search query");
130
+ ```
131
+
132
+ ## Per-Repo Pattern
133
+
134
+ ```
135
+ any-repo/
136
+ ├── notes/ # your markdown files
137
+ ├── .mcp.json # point semantic-pages at ./notes
138
+ ├── .semantic-pages-index/ # gitignored, auto-rebuilt
139
+ └── .gitignore # add .semantic-pages-index/
140
+ ```
141
+
142
+ Each repo gets its own independent knowledge base. No shared state between projects.
143
+
144
+ ## Requirements
145
+
146
+ - Node.js >= 18
147
+
148
+ ## License
149
+
150
+ MIT