obsidian-mcp-server 3.6.1 → 3.7.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.
Files changed (63) hide show
  1. package/AGENTS.md +27 -17
  2. package/CLAUDE.md +27 -17
  3. package/README.md +22 -13
  4. package/changelog/3.7.x/3.7.0.md +34 -0
  5. package/dist/config/server-config.d.ts +1 -0
  6. package/dist/config/server-config.d.ts.map +1 -1
  7. package/dist/config/server-config.js +4 -0
  8. package/dist/config/server-config.js.map +1 -1
  9. package/dist/index.js +28 -9
  10. package/dist/index.js.map +1 -1
  11. package/dist/mcp-server/resources/definitions/obsidian-tags.resource.d.ts +7 -5
  12. package/dist/mcp-server/resources/definitions/obsidian-tags.resource.d.ts.map +1 -1
  13. package/dist/mcp-server/resources/definitions/obsidian-tags.resource.js +12 -8
  14. package/dist/mcp-server/resources/definitions/obsidian-tags.resource.js.map +1 -1
  15. package/dist/mcp-server/tools/definitions/_shared/suggest-paths.d.ts +30 -9
  16. package/dist/mcp-server/tools/definitions/_shared/suggest-paths.d.ts.map +1 -1
  17. package/dist/mcp-server/tools/definitions/_shared/suggest-paths.js +28 -6
  18. package/dist/mcp-server/tools/definitions/_shared/suggest-paths.js.map +1 -1
  19. package/dist/mcp-server/tools/definitions/index.d.ts +230 -294
  20. package/dist/mcp-server/tools/definitions/index.d.ts.map +1 -1
  21. package/dist/mcp-server/tools/definitions/index.js +9 -3
  22. package/dist/mcp-server/tools/definitions/index.js.map +1 -1
  23. package/dist/mcp-server/tools/definitions/obsidian-delete-note.tool.d.ts +107 -10
  24. package/dist/mcp-server/tools/definitions/obsidian-delete-note.tool.d.ts.map +1 -1
  25. package/dist/mcp-server/tools/definitions/obsidian-delete-note.tool.js +237 -162
  26. package/dist/mcp-server/tools/definitions/obsidian-delete-note.tool.js.map +1 -1
  27. package/dist/mcp-server/tools/definitions/obsidian-get-note.tool.d.ts +1 -0
  28. package/dist/mcp-server/tools/definitions/obsidian-get-note.tool.d.ts.map +1 -1
  29. package/dist/mcp-server/tools/definitions/obsidian-get-note.tool.js +61 -19
  30. package/dist/mcp-server/tools/definitions/obsidian-get-note.tool.js.map +1 -1
  31. package/dist/mcp-server/tools/definitions/obsidian-list-notes.tool.d.ts +6 -1
  32. package/dist/mcp-server/tools/definitions/obsidian-list-notes.tool.d.ts.map +1 -1
  33. package/dist/mcp-server/tools/definitions/obsidian-list-notes.tool.js +8 -10
  34. package/dist/mcp-server/tools/definitions/obsidian-list-notes.tool.js.map +1 -1
  35. package/dist/mcp-server/tools/definitions/obsidian-list-tags.tool.d.ts +7 -5
  36. package/dist/mcp-server/tools/definitions/obsidian-list-tags.tool.d.ts.map +1 -1
  37. package/dist/mcp-server/tools/definitions/obsidian-list-tags.tool.js +13 -7
  38. package/dist/mcp-server/tools/definitions/obsidian-list-tags.tool.js.map +1 -1
  39. package/dist/mcp-server/tools/definitions/obsidian-open-in-ui.tool.d.ts +4 -1
  40. package/dist/mcp-server/tools/definitions/obsidian-open-in-ui.tool.d.ts.map +1 -1
  41. package/dist/mcp-server/tools/definitions/obsidian-open-in-ui.tool.js +15 -4
  42. package/dist/mcp-server/tools/definitions/obsidian-open-in-ui.tool.js.map +1 -1
  43. package/dist/mcp-server/tools/definitions/obsidian-search-notes.tool.js +1 -1
  44. package/dist/mcp-server/tools/definitions/obsidian-search-notes.tool.js.map +1 -1
  45. package/dist/services/obsidian/obsidian-service.d.ts +7 -0
  46. package/dist/services/obsidian/obsidian-service.d.ts.map +1 -1
  47. package/dist/services/obsidian/obsidian-service.js +57 -15
  48. package/dist/services/obsidian/obsidian-service.js.map +1 -1
  49. package/dist/services/obsidian/patch-instruction.d.ts +20 -1
  50. package/dist/services/obsidian/patch-instruction.d.ts.map +1 -1
  51. package/dist/services/obsidian/patch-instruction.js +30 -0
  52. package/dist/services/obsidian/patch-instruction.js.map +1 -1
  53. package/dist/services/obsidian/path-policy.d.ts +23 -1
  54. package/dist/services/obsidian/path-policy.d.ts.map +1 -1
  55. package/dist/services/obsidian/path-policy.js +45 -3
  56. package/dist/services/obsidian/path-policy.js.map +1 -1
  57. package/dist/services/obsidian/section-extractor.d.ts +24 -0
  58. package/dist/services/obsidian/section-extractor.d.ts.map +1 -1
  59. package/dist/services/obsidian/section-extractor.js +37 -0
  60. package/dist/services/obsidian/section-extractor.js.map +1 -1
  61. package/manifest.json +9 -1
  62. package/package.json +2 -2
  63. package/server.json +17 -3
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAgBH,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAEvE;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAK/B,CAAC;AAEF,kFAAkF;AAClF,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;KAK/B,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAOhC,CAAC;AAEF,mHAAmH;AACnH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAiD,CAAC"}
@@ -7,10 +7,12 @@
7
7
  * module free of eager config reads. `obsidian_search_notes` is exposed as a
8
8
  * factory (`buildSearchNotesTool`) because its mode enum is conditional on
9
9
  * Omnisearch reachability, which is only known after the startup probe runs.
10
+ * `obsidian_delete_note` is exposed as a factory (`buildDeleteNoteTool`)
11
+ * because its description and confirmation round follow
12
+ * `OBSIDIAN_DELETE_ELICITATION`, which the entry point reads.
10
13
  * @module mcp-server/tools/definitions/index
11
14
  */
12
15
  import { obsidianAppendToNote } from './obsidian-append-to-note.tool.js';
13
- import { obsidianDeleteNote } from './obsidian-delete-note.tool.js';
14
16
  import { obsidianExecuteCommand } from './obsidian-execute-command.tool.js';
15
17
  import { obsidianGetNote } from './obsidian-get-note.tool.js';
16
18
  import { obsidianListCommands } from './obsidian-list-commands.tool.js';
@@ -22,6 +24,7 @@ import { obsidianOpenInUi } from './obsidian-open-in-ui.tool.js';
22
24
  import { obsidianPatchNote } from './obsidian-patch-note.tool.js';
23
25
  import { obsidianReplaceInNote } from './obsidian-replace-in-note.tool.js';
24
26
  import { obsidianWriteNote } from './obsidian-write-note.tool.js';
27
+ export { buildDeleteNoteTool } from './obsidian-delete-note.tool.js';
25
28
  export { buildSearchNotesTool } from './obsidian-search-notes.tool.js';
26
29
  /**
27
30
  * Tools that don't depend on runtime probes — always registered, even with
@@ -42,7 +45,11 @@ export const readToolDefinitions = [
42
45
  obsidianListTags,
43
46
  obsidianOpenInUi,
44
47
  ];
45
- /** Write tools — wrapped with `disabledTool()` when `OBSIDIAN_READ_ONLY=true`. */
48
+ /**
49
+ * Write tools — wrapped with `disabledTool()` when `OBSIDIAN_READ_ONLY=true`.
50
+ * `obsidian_delete_note` joins this set in the entry point, built via
51
+ * `buildDeleteNoteTool`.
52
+ */
46
53
  export const writeToolDefinitions = [
47
54
  obsidianWriteNote,
48
55
  obsidianAppendToNote,
@@ -50,7 +57,6 @@ export const writeToolDefinitions = [
50
57
  obsidianReplaceInNote,
51
58
  obsidianManageFrontmatter,
52
59
  obsidianManageTags,
53
- obsidianDeleteNote,
54
60
  ];
55
61
  /** Command-palette tools — opt-in via `OBSIDIAN_ENABLE_COMMANDS=true`; suppressed by `OBSIDIAN_READ_ONLY=true`. */
56
62
  export const commandToolDefinitions = [obsidianListCommands, obsidianExecuteCommand];
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceR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/**
2
- * @fileoverview obsidian_delete_note — permanently delete a note. Suspends via
2
+ * @fileoverview obsidian_delete_note — permanently delete a note. Built by a
3
+ * factory because the confirmation is an operator choice
4
+ * (`OBSIDIAN_DELETE_ELICITATION`, read in the entry point): off, the handler
5
+ * checks write scope, reads the note, and deletes. On, it suspends via
3
6
  * `ctx.requestInput` to confirm with the user before the DELETE, and is
4
- * re-entered with the answer on `ctx.inputs`. The answer counts only on a
7
+ * re-entered with the answer on `ctx.inputs`; the answer counts only on a
5
8
  * round that redeems the consent record this handler stored when it asked.
6
9
  * @module mcp-server/tools/definitions/obsidian-delete-note.tool
7
10
  */
8
11
  import { z } from '@cyanheads/mcp-ts-core';
9
12
  import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
10
- export declare const obsidianDeleteNote: import("@cyanheads/mcp-ts-core").ToolDefinition<z.ZodObject<{
13
+ /**
14
+ * `elicitation` mirrors `OBSIDIAN_DELETE_ELICITATION`. Off, the operator's
15
+ * `OBSIDIAN_WRITE_PATHS` / `OBSIDIAN_READ_ONLY` are what bound a delete — the
16
+ * same bound `obsidian_write_note` with `overwrite: true` already has.
17
+ */
18
+ export declare function buildDeleteNoteTool({ elicitation }: {
19
+ elicitation: boolean;
20
+ }): import("@cyanheads/mcp-ts-core").ToolDefinition<z.ZodObject<{
11
21
  target: z.ZodDiscriminatedUnion<[z.ZodObject<{
12
22
  type: z.ZodLiteral<"path">;
13
23
  path: z.ZodString;
@@ -35,18 +45,105 @@ export declare const obsidianDeleteNote: import("@cyanheads/mcp-ts-core").ToolDe
35
45
  readonly code: JsonRpcErrorCode.Forbidden;
36
46
  readonly when: "The target path is outside OBSIDIAN_WRITE_PATHS, or OBSIDIAN_READ_ONLY=true denies all writes.";
37
47
  readonly recovery: "Use a path inside the configured write scope. The error data echoes the active scope.";
38
- }, {
39
- readonly reason: "cancelled";
48
+ }, ...{
49
+ readonly reason: 'cancelled';
40
50
  readonly code: JsonRpcErrorCode.InvalidRequest;
41
- readonly when: "User declined, cancelled, or answered false to the confirmation request.";
42
- readonly severity: "notice";
43
- readonly recovery: "Re-run the tool when the user is ready to confirm deletion.";
51
+ readonly when: 'User declined, cancelled, or answered false to the confirmation request.';
52
+ readonly severity: 'notice';
53
+ readonly recovery: 'Re-run the tool when the user is ready to confirm deletion.';
54
+ }[], {
55
+ readonly reason: "note_missing";
56
+ readonly thrownBy: "service";
57
+ readonly code: JsonRpcErrorCode.NotFound;
58
+ readonly when: "No note has exactly this vault path, letter case included. Near matches in the same folder, such as a different-case spelling, are listed in `suggestions` and never deleted in its place.";
59
+ readonly recovery: "Verify the path with obsidian_list_notes or use obsidian_search_notes to locate the note. Deletes match the path exactly, letter case included; pass a path from `suggestions` as given.";
60
+ }, {
61
+ readonly reason: "no_active_file";
62
+ readonly thrownBy: "service";
63
+ readonly code: JsonRpcErrorCode.NotFound;
64
+ readonly when: "Target was `active` but no file is currently open in Obsidian.";
65
+ readonly recovery: "Call obsidian_open_in_ui to focus a file, or pass an explicit path target instead.";
66
+ }, {
67
+ readonly reason: "periodic_unsupported";
68
+ readonly thrownBy: "service";
69
+ readonly code: JsonRpcErrorCode.NotFound;
70
+ readonly when: "Target was `periodic` and this vault runs Local REST API v5.0.2 or later without the companion periodic-notes extension, so the `/periodic/` routes are not served at all.";
71
+ readonly recovery: "Install the periodic-notes extension from https://github.com/coddingtonbear/obsidian-local-rest-api-periodic-notes, or address the note by an explicit vault path.";
72
+ }, {
73
+ readonly reason: "periodic_not_found";
74
+ readonly thrownBy: "service";
75
+ readonly code: JsonRpcErrorCode.NotFound;
76
+ readonly when: "Target was `periodic`, the `/periodic/` routes are served on this vault, and no note exists for the requested period.";
77
+ readonly recovery: "Pass an explicit path target — periodic notes must already exist.";
78
+ }, {
79
+ readonly reason: "periodic_disabled";
80
+ readonly thrownBy: "service";
81
+ readonly code: JsonRpcErrorCode.ValidationError;
82
+ readonly when: "Target was `periodic` but the requested period is not enabled in Obsidian's Periodic Notes plugin settings.";
83
+ readonly recovery: "Pass an explicit path target — the requested period is disabled in the operator's Periodic Notes plugin.";
84
+ }, {
85
+ readonly reason: "path_is_directory";
86
+ readonly thrownBy: "service";
87
+ readonly code: JsonRpcErrorCode.ValidationError;
88
+ readonly when: "The supplied path names a folder rather than a note file. Deleting a folder is not offered — the upstream removes it and everything inside it in one unrecoverable step.";
89
+ readonly recovery: "Call obsidian_list_notes with this path to list the folder, then delete files one at a time by their full paths.";
44
90
  }, {
91
+ readonly reason: "path_traversal";
92
+ readonly thrownBy: "service";
93
+ readonly code: JsonRpcErrorCode.ValidationError;
94
+ readonly when: "The path contains a `.` or `..` segment, which is rejected to prevent vault escape.";
95
+ readonly recovery: "Supply a vault-relative path with no `.` or `..` segments, e.g. \"Projects/Note.md\". Use obsidian_list_notes to browse the vault.";
96
+ }], undefined>;
97
+ /**
98
+ * Static specimen for the MCP definition linter (which duck-types tool
99
+ * exports out of each `.tool.ts` file) and for tests that import the tool
100
+ * directly. Built with the confirmation off — the default, and what an
101
+ * unconfigured install registers. The entry point (`src/index.ts`) builds the
102
+ * live tool via `buildDeleteNoteTool` from `OBSIDIAN_DELETE_ELICITATION`; this
103
+ * export is not the registered tool. The confirming variant is exercised by
104
+ * tests rather than the linter (two exports under the same tool name would
105
+ * collide on `name-unique`).
106
+ */
107
+ export declare const obsidianDeleteNote: import("@cyanheads/mcp-ts-core").ToolDefinition<z.ZodObject<{
108
+ target: z.ZodDiscriminatedUnion<[z.ZodObject<{
109
+ type: z.ZodLiteral<"path">;
110
+ path: z.ZodString;
111
+ }, z.core.$strip>, z.ZodObject<{
112
+ type: z.ZodLiteral<"active">;
113
+ }, z.core.$strip>, z.ZodObject<{
114
+ type: z.ZodLiteral<"periodic">;
115
+ period: z.ZodEnum<{
116
+ daily: "daily";
117
+ monthly: "monthly";
118
+ quarterly: "quarterly";
119
+ weekly: "weekly";
120
+ yearly: "yearly";
121
+ }>;
122
+ date: z.ZodOptional<z.ZodString>;
123
+ }, z.core.$strip>], "type">;
124
+ }, z.core.$strip>, z.ZodObject<{
125
+ path: z.ZodString;
126
+ deleted: z.ZodBoolean;
127
+ previousSizeInBytes: z.ZodNumber;
128
+ currentSizeInBytes: z.ZodNumber;
129
+ }, z.core.$strip>, readonly [{
130
+ readonly reason: "path_forbidden";
131
+ readonly thrownBy: "service";
132
+ readonly code: JsonRpcErrorCode.Forbidden;
133
+ readonly when: "The target path is outside OBSIDIAN_WRITE_PATHS, or OBSIDIAN_READ_ONLY=true denies all writes.";
134
+ readonly recovery: "Use a path inside the configured write scope. The error data echoes the active scope.";
135
+ }, ...{
136
+ readonly reason: 'cancelled';
137
+ readonly code: JsonRpcErrorCode.InvalidRequest;
138
+ readonly when: 'User declined, cancelled, or answered false to the confirmation request.';
139
+ readonly severity: 'notice';
140
+ readonly recovery: 'Re-run the tool when the user is ready to confirm deletion.';
141
+ }[], {
45
142
  readonly reason: "note_missing";
46
143
  readonly thrownBy: "service";
47
144
  readonly code: JsonRpcErrorCode.NotFound;
48
- readonly when: "The vault path does not resolve to an existing note.";
49
- readonly recovery: "Verify the path with obsidian_list_notes or use obsidian_search_notes to locate the note.";
145
+ readonly when: "No note has exactly this vault path, letter case included. Near matches in the same folder, such as a different-case spelling, are listed in `suggestions` and never deleted in its place.";
146
+ readonly recovery: "Verify the path with obsidian_list_notes or use obsidian_search_notes to locate the note. Deletes match the path exactly, letter case included; pass a path from `suggestions` as given.";
50
147
  }, {
51
148
  readonly reason: "no_active_file";
52
149
  readonly thrownBy: "service";
@@ -1 +1 @@
1
- {"version":3,"file":"obsidian-delete-note.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/obsidian-delete-note.tool.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,EAAuB,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAyBjE,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAgL7B,CAAC"}
1
+ {"version":3,"file":"obsidian-delete-note.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/obsidian-delete-note.tool.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,OAAO,EAAqC,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAC9E,OAAO,EAAE,gBAAgB,EAAsB,MAAM,+BAA+B,CAAC;AA6DrF;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,EAAE,WAAW,EAAE,EAAE;IAAE,WAAW,EAAE,OAAO,CAAA;CAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAmCvD,WAAW;;mBAEb,0EAA0E;uBACtE,QAAQ;uBACR,6DAA6D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eAgKpF;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAhLT,WAAW;;mBAEb,0EAA0E;uBACtE,QAAQ;uBACR,6DAA6D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA4KR,CAAC"}