neuro-vault-mcp 1.4.0 → 1.5.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/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Neuro Vault MCP
2
2
 
3
- **Semantic search over your Obsidian vault — right inside your AI assistant.**
3
+ **Semantic vault search and expansion for your Obsidian vault — right inside your AI assistant.**
4
4
 
5
5
  [![npm version](https://img.shields.io/npm/v/neuro-vault-mcp)](https://www.npmjs.com/package/neuro-vault-mcp)
6
6
  [![Node.js](https://img.shields.io/node/v/neuro-vault-mcp)](https://nodejs.org)
@@ -8,7 +8,7 @@
8
8
 
9
9
  > "What did I write about that idea last month?"
10
10
 
11
- Neuro Vault MCP connects your Obsidian vault to any MCP-compatible AI assistant. It reuses the embeddings already computed by [Smart Connections](https://github.com/brianpetro/obsidian-smart-connections) — no re-indexing, no extra infrastructure, no API keys.
11
+ Neuro Vault MCP provides semantic search over your Obsidian vault and semantic expansion for related notes. Agents can combine it with structural tools for exact note, path, date, tag, property, and link lookups when those tools are available. It reuses the embeddings already computed by [Smart Connections](https://github.com/brianpetro/obsidian-smart-connections) — no re-indexing, no extra infrastructure, no API keys.
12
12
 
13
13
  ---
14
14
 
@@ -19,20 +19,31 @@ Your question
19
19
  │
20
20
  ▼
21
21
  AI assistant
22
- │ rewrites to keyword queries + picks mode
22
+ │ routes by intent
23
23
  ▼
24
- search_notes (MCP tool)
24
+ ├──────────────► Structural tools
25
+ │ (exact file, title, path, daily note, tag, property, wikilink, backlink, link traversal)
25
26
  │
26
- ├─ vector search over Smart Connections embeddings
27
- ├─ block-level search (all modes)
28
- └─ expansion via similar notes (deep mode)
29
- │
30
- ▼
31
- Ranked results with note paths, similarity scores, section headings
27
+ └──────────────► search_notes
28
+ (semantic retrieval)
29
+ │
30
+ ▼
31
+ get_similar_notes
32
+ (semantic expansion)
32
33
  ```
33
34
 
34
35
  The server loads `.smart-env/multi/*.ajson` into memory at startup and keeps it there. No background processes, no watchers, no database.
35
36
 
37
+ ## Search Routing
38
+
39
+ Tool routing and retrieval policy are related, but not the same thing.
40
+
41
+ - Use structural tools first for exact file, title, path, daily note, tag, property, wikilink, backlink, and link traversal requests.
42
+ - Use `search_notes` for fuzzy topic, concept, and semantic retrieval.
43
+ - Use `get_similar_notes` after you already have a relevant note and want semantic expansion.
44
+ - Treat the routing guidance as behavior, not enforcement; the server does not hard-block other tool choices.
45
+ - Use semantic retrieval to find likely notes, then switch to structural tools when you need exact anchors.
46
+
36
47
  ---
37
48
 
38
49
  ## Requirements
@@ -41,10 +52,19 @@ The server loads `.smart-env/multi/*.ajson` into memory at startup and keeps it
41
52
  - Obsidian vault with [Smart Connections](https://github.com/brianpetro/obsidian-smart-connections) plugin (embeddings must be generated)
42
53
  - Smart Connections data at `<vault>/.smart-env/multi/*.ajson`
43
54
 
55
+ ### Operations module (optional)
56
+
57
+ - The [Obsidian CLI](https://github.com/AlexMost/obsidian-cli) installed and on `PATH` (or pass `--obsidian-cli`).
58
+ - Obsidian running with the URI handler available.
59
+ - Disable with `--no-operations` if you only want semantic search.
60
+
44
61
  ---
45
62
 
46
63
  ## Quick Start
47
64
 
65
+ <details>
66
+ <summary>Install instructions...</summary>
67
+
48
68
  **1. Install**
49
69
 
50
70
  ```bash
@@ -92,6 +112,8 @@ Or run without installing using `npx`:
92
112
  }
93
113
  ```
94
114
 
115
+ </details>
116
+
95
117
  **3. Try it**
96
118
 
97
119
  Ask your assistant:
@@ -198,6 +220,66 @@ Returns: `{ totalNotes, totalBlocks, embeddingDimension, modelKey }`
198
220
 
199
221
  ---
200
222
 
223
+ ## Vault Operations
224
+
225
+ Direct, structural operations on the vault via the Obsidian CLI. Requires Obsidian to be running.
226
+
227
+ ### `read_note`
228
+
229
+ Read a note's contents.
230
+
231
+ ```typescript
232
+ read_note({
233
+ name?: string, // wikilink-style: "My Note"
234
+ path?: string, // vault-relative: "Folder/My Note.md"
235
+ })
236
+ ```
237
+
238
+ Returns `{ path, content }`. Provide exactly one of `name` or `path`.
239
+
240
+ ### `create_note`
241
+
242
+ Create a new note.
243
+
244
+ ```typescript
245
+ create_note({
246
+ name?: string,
247
+ path?: string,
248
+ content?: string,
249
+ template?: string,
250
+ overwrite?: boolean,
251
+ })
252
+ ```
253
+
254
+ `overwrite: true` is destructive — the AI assistant will ask before passing it.
255
+
256
+ ### `edit_note`
257
+
258
+ Add content to an existing note.
259
+
260
+ ```typescript
261
+ edit_note({
262
+ name?: string,
263
+ path?: string,
264
+ content: string,
265
+ position: 'append' | 'prepend',
266
+ })
267
+ ```
268
+
269
+ ### `read_daily`
270
+
271
+ Read today's daily note. Returns `{ path, content }`.
272
+
273
+ ### `append_daily`
274
+
275
+ Append content to today's daily note.
276
+
277
+ ```typescript
278
+ append_daily({ content: string });
279
+ ```
280
+
281
+ ---
282
+
201
283
  ## AGENTS.md / CLAUDE.md Snippet
202
284
 
203
285
  Add this to your `AGENTS.md` or `CLAUDE.md` to help the AI assistant use the vault effectively:
@@ -205,15 +287,9 @@ Add this to your `AGENTS.md` or `CLAUDE.md` to help the AI assistant use the vau
205
287
  ```markdown
206
288
  ## Vault search
207
289
 
208
- Use the `search_notes` MCP tool to search my Obsidian vault before answering questions about my notes, projects, or ideas.
209
-
210
- Search protocol:
211
-
212
- 1. Choose mode: `quick` for specific questions, `deep` for broad topics
213
- 2. Rewrite the query: extract 2-4 keywords, remove filler words
214
- 3. Call search_notes once per concept — use separate calls for synonyms and UA↔EN translations
215
-
216
- Skip vault search for: general programming questions, translations, tasks with no personal knowledge component.
290
+ Use vault-aware tools when vault context matters.
291
+ Do not guess about note contents when the vault can be searched.
292
+ Follow the Neuro Vault MCP server instructions for routing between semantic search (`search_notes`, `get_similar_notes`) and operations (`read_note`, `create_note`, `edit_note`, `read_daily`, `append_daily`).
217
293
  ```
218
294
 
219
295
  ---
@@ -222,10 +298,13 @@ Skip vault search for: general programming questions, translations, tasks with n
222
298
 
223
299
  ### CLI Arguments
224
300
 
225
- | Argument | Required | Description |
226
- | --------- | -------- | --------------------------------------------- |
227
- | `--vault` | yes | Absolute path to the Obsidian vault directory |
228
- | `--help` | no | Show help |
301
+ | Argument | Required | Default | Description |
302
+ | ---------------- | -------- | ---------- | ------------------------------------------------------- |
303
+ | `--vault` | yes | — | Absolute path to the Obsidian vault directory |
304
+ | `--semantic` | no | `true` | Enable semantic search module (`--no-semantic` to skip) |
305
+ | `--operations` | no | `true` | Enable vault operations module (`--no-operations`) |
306
+ | `--obsidian-cli` | no | `obsidian` | Path to the `obsidian` CLI binary (override only) |
307
+ | `--help` | no | — | Show help |
229
308
 
230
309
  ### Startup Behavior
231
310
 
@@ -262,6 +341,7 @@ npm run format:write # fix formatting
262
341
  - stdio transport only — not HTTP or SSE
263
342
  - Local vault path only — no remote vaults
264
343
  - Embedding model loaded at startup; first run can be slow
344
+ - Operations tools require the Obsidian CLI and a running Obsidian instance — they fail gracefully per call when unavailable.
265
345
 
266
346
  ---
267
347
 
package/dist/cli.d.ts CHANGED
@@ -98,12 +98,79 @@ interface SmartConnectionsCorpus {
98
98
  sources: Map<string, SmartSource>;
99
99
  }
100
100
 
101
- type ToolServer = Pick<McpServer, 'registerTool' | 'connect'>;
102
- interface NeuroVaultStartupDependencies {
101
+ interface SemanticModuleDeps {
103
102
  loadCorpus?: (smartEnvPath: string, modelKey: string) => Promise<SmartConnectionsCorpus>;
104
- embeddingServiceFactory?: (modelKey: string) => EmbeddingProvider;
103
+ embeddingServiceFactory?: (modelId: string) => EmbeddingProvider;
105
104
  searchEngine?: SearchEngine;
106
105
  toolHandlersFactory?: (deps: ToolHandlerDependencies) => ToolHandlers;
106
+ }
107
+
108
+ type NoteIdentifier = {
109
+ kind: 'name';
110
+ value: string;
111
+ } | {
112
+ kind: 'path';
113
+ value: string;
114
+ };
115
+ interface ReadNoteInput {
116
+ identifier: NoteIdentifier;
117
+ }
118
+ interface ReadNoteResult {
119
+ path: string;
120
+ content: string;
121
+ }
122
+ interface CreateNoteInput {
123
+ name?: string;
124
+ path?: string;
125
+ content?: string;
126
+ template?: string;
127
+ overwrite?: boolean;
128
+ }
129
+ interface CreateNoteResult {
130
+ path: string;
131
+ }
132
+ type EditPosition = 'append' | 'prepend';
133
+ interface EditNoteInput {
134
+ identifier: NoteIdentifier;
135
+ content: string;
136
+ position: EditPosition;
137
+ }
138
+ interface DailyNoteResult {
139
+ path: string;
140
+ content: string;
141
+ }
142
+ interface AppendDailyInput {
143
+ content: string;
144
+ }
145
+ interface VaultProvider {
146
+ readNote(input: ReadNoteInput): Promise<ReadNoteResult>;
147
+ createNote(input: CreateNoteInput): Promise<CreateNoteResult>;
148
+ editNote(input: EditNoteInput): Promise<void>;
149
+ readDaily(): Promise<DailyNoteResult>;
150
+ appendDaily(input: AppendDailyInput): Promise<void>;
151
+ }
152
+
153
+ type ExecFn = (binary: string, args: string[], options: {
154
+ timeout: number;
155
+ }) => Promise<{
156
+ stdout: string;
157
+ stderr: string;
158
+ }>;
159
+ interface ObsidianCLIProviderOptions {
160
+ binaryPath?: string;
161
+ vaultName?: string;
162
+ timeoutMs?: number;
163
+ exec?: ExecFn;
164
+ }
165
+
166
+ interface OperationsModuleDeps {
167
+ vaultProviderFactory?: (opts: ObsidianCLIProviderOptions) => VaultProvider;
168
+ }
169
+
170
+ type ToolServer = Pick<McpServer, 'registerTool' | 'connect'>;
171
+ interface NeuroVaultStartupDependencies {
172
+ semantic?: SemanticModuleDeps;
173
+ operations?: OperationsModuleDeps;
107
174
  serverFactory?: () => ToolServer;
108
175
  transportFactory?: () => StdioServerTransport;
109
176
  }