obsidian-mcp-server 2.0.7 → 3.0.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/CLAUDE.md +364 -0
- package/Dockerfile +99 -0
- package/LICENSE +4 -6
- package/README.md +246 -206
- package/changelog/3.0.x/3.0.0.md +102 -0
- package/changelog/template.md +51 -0
- package/dist/config/server-config.d.ts +19 -0
- package/dist/config/server-config.d.ts.map +1 -0
- package/dist/config/server-config.js +55 -0
- package/dist/config/server-config.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +23 -295
- package/dist/index.js.map +1 -0
- package/dist/mcp-server/prompts/definitions/index.d.ts +8 -0
- package/dist/mcp-server/prompts/definitions/index.d.ts.map +1 -0
- package/dist/mcp-server/prompts/definitions/index.js +8 -0
- package/dist/mcp-server/prompts/definitions/index.js.map +1 -0
- package/dist/mcp-server/resources/definitions/index.d.ts +36 -0
- package/dist/mcp-server/resources/definitions/index.d.ts.map +1 -0
- package/dist/mcp-server/resources/definitions/index.js +9 -0
- package/dist/mcp-server/resources/definitions/index.js.map +1 -0
- package/dist/mcp-server/resources/definitions/obsidian-status.resource.d.ts +23 -0
- package/dist/mcp-server/resources/definitions/obsidian-status.resource.d.ts.map +1 -0
- package/dist/mcp-server/resources/definitions/obsidian-status.resource.js +47 -0
- package/dist/mcp-server/resources/definitions/obsidian-status.resource.js.map +1 -0
- package/dist/mcp-server/resources/definitions/obsidian-tags.resource.d.ts +13 -0
- package/dist/mcp-server/resources/definitions/obsidian-tags.resource.d.ts.map +1 -0
- package/dist/mcp-server/resources/definitions/obsidian-tags.resource.js +30 -0
- package/dist/mcp-server/resources/definitions/obsidian-tags.resource.js.map +1 -0
- package/dist/mcp-server/resources/definitions/obsidian-vault-note.resource.d.ts +21 -0
- package/dist/mcp-server/resources/definitions/obsidian-vault-note.resource.d.ts.map +1 -0
- package/dist/mcp-server/resources/definitions/obsidian-vault-note.resource.js +38 -0
- package/dist/mcp-server/resources/definitions/obsidian-vault-note.resource.js.map +1 -0
- package/dist/mcp-server/tools/definitions/_shared/schemas.d.ts +45 -0
- package/dist/mcp-server/tools/definitions/_shared/schemas.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/_shared/schemas.js +66 -0
- package/dist/mcp-server/tools/definitions/_shared/schemas.js.map +1 -0
- package/dist/mcp-server/tools/definitions/_shared/suggest-paths.d.ts +51 -0
- package/dist/mcp-server/tools/definitions/_shared/suggest-paths.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/_shared/suggest-paths.js +120 -0
- package/dist/mcp-server/tools/definitions/_shared/suggest-paths.js.map +1 -0
- package/dist/mcp-server/tools/definitions/index.d.ts +531 -0
- package/dist/mcp-server/tools/definitions/index.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/index.js +38 -0
- package/dist/mcp-server/tools/definitions/index.js.map +1 -0
- package/dist/mcp-server/tools/definitions/obsidian-append-to-note.tool.d.ts +42 -0
- package/dist/mcp-server/tools/definitions/obsidian-append-to-note.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/obsidian-append-to-note.tool.js +58 -0
- package/dist/mcp-server/tools/definitions/obsidian-append-to-note.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/obsidian-delete-note.tool.d.ts +46 -0
- package/dist/mcp-server/tools/definitions/obsidian-delete-note.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/obsidian-delete-note.tool.js +66 -0
- package/dist/mcp-server/tools/definitions/obsidian-delete-note.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/obsidian-execute-command.tool.d.ts +19 -0
- package/dist/mcp-server/tools/definitions/obsidian-execute-command.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/obsidian-execute-command.tool.js +43 -0
- package/dist/mcp-server/tools/definitions/obsidian-execute-command.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/obsidian-get-note.tool.d.ts +92 -0
- package/dist/mcp-server/tools/definitions/obsidian-get-note.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/obsidian-get-note.tool.js +245 -0
- package/dist/mcp-server/tools/definitions/obsidian-get-note.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/obsidian-list-commands.tool.d.ts +13 -0
- package/dist/mcp-server/tools/definitions/obsidian-list-commands.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/obsidian-list-commands.tool.js +38 -0
- package/dist/mcp-server/tools/definitions/obsidian-list-commands.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/obsidian-list-notes.tool.d.ts +59 -0
- package/dist/mcp-server/tools/definitions/obsidian-list-notes.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/obsidian-list-notes.tool.js +273 -0
- package/dist/mcp-server/tools/definitions/obsidian-list-notes.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/obsidian-list-tags.tool.d.ts +13 -0
- package/dist/mcp-server/tools/definitions/obsidian-list-tags.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/obsidian-list-tags.tool.js +38 -0
- package/dist/mcp-server/tools/definitions/obsidian-list-tags.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/obsidian-manage-frontmatter.tool.d.ts +68 -0
- package/dist/mcp-server/tools/definitions/obsidian-manage-frontmatter.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/obsidian-manage-frontmatter.tool.js +178 -0
- package/dist/mcp-server/tools/definitions/obsidian-manage-frontmatter.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/obsidian-manage-tags.tool.d.ts +77 -0
- package/dist/mcp-server/tools/definitions/obsidian-manage-tags.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/obsidian-manage-tags.tool.js +172 -0
- package/dist/mcp-server/tools/definitions/obsidian-manage-tags.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/obsidian-open-in-ui.tool.d.ts +22 -0
- package/dist/mcp-server/tools/definitions/obsidian-open-in-ui.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/obsidian-open-in-ui.tool.js +88 -0
- package/dist/mcp-server/tools/definitions/obsidian-open-in-ui.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/obsidian-patch-note.tool.d.ts +81 -0
- package/dist/mcp-server/tools/definitions/obsidian-patch-note.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/obsidian-patch-note.tool.js +83 -0
- package/dist/mcp-server/tools/definitions/obsidian-patch-note.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/obsidian-replace-in-note.tool.d.ts +59 -0
- package/dist/mcp-server/tools/definitions/obsidian-replace-in-note.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/obsidian-replace-in-note.tool.js +167 -0
- package/dist/mcp-server/tools/definitions/obsidian-replace-in-note.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/obsidian-search-notes.tool.d.ts +76 -0
- package/dist/mcp-server/tools/definitions/obsidian-search-notes.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/obsidian-search-notes.tool.js +244 -0
- package/dist/mcp-server/tools/definitions/obsidian-search-notes.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/obsidian-write-note.tool.d.ts +41 -0
- package/dist/mcp-server/tools/definitions/obsidian-write-note.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/obsidian-write-note.tool.js +76 -0
- package/dist/mcp-server/tools/definitions/obsidian-write-note.tool.js.map +1 -0
- package/dist/services/obsidian/frontmatter-ops.d.ts +34 -0
- package/dist/services/obsidian/frontmatter-ops.d.ts.map +1 -0
- package/dist/services/obsidian/frontmatter-ops.js +230 -0
- package/dist/services/obsidian/frontmatter-ops.js.map +1 -0
- package/dist/services/obsidian/obsidian-service.d.ts +73 -0
- package/dist/services/obsidian/obsidian-service.d.ts.map +1 -0
- package/dist/services/obsidian/obsidian-service.js +399 -0
- package/dist/services/obsidian/obsidian-service.js.map +1 -0
- package/dist/services/obsidian/section-extractor.d.ts +13 -0
- package/dist/services/obsidian/section-extractor.d.ts.map +1 -0
- package/dist/services/obsidian/section-extractor.js +124 -0
- package/dist/services/obsidian/section-extractor.js.map +1 -0
- package/dist/services/obsidian/types.d.ts +91 -0
- package/dist/services/obsidian/types.d.ts.map +1 -0
- package/dist/services/obsidian/types.js +7 -0
- package/dist/services/obsidian/types.js.map +1 -0
- package/package.json +63 -69
- package/server.json +167 -0
- package/CHANGELOG.md +0 -124
- package/dist/config/index.d.ts +0 -41
- package/dist/config/index.js +0 -191
- package/dist/mcp-server/server.d.ts +0 -33
- package/dist/mcp-server/server.js +0 -211
- package/dist/mcp-server/tools/obsidianDeleteNoteTool/index.d.ts +0 -12
- package/dist/mcp-server/tools/obsidianDeleteNoteTool/index.js +0 -12
- package/dist/mcp-server/tools/obsidianDeleteNoteTool/logic.d.ts +0 -51
- package/dist/mcp-server/tools/obsidianDeleteNoteTool/logic.js +0 -168
- package/dist/mcp-server/tools/obsidianDeleteNoteTool/registration.d.ts +0 -19
- package/dist/mcp-server/tools/obsidianDeleteNoteTool/registration.js +0 -91
- package/dist/mcp-server/tools/obsidianGlobalSearchTool/index.d.ts +0 -12
- package/dist/mcp-server/tools/obsidianGlobalSearchTool/index.js +0 -12
- package/dist/mcp-server/tools/obsidianGlobalSearchTool/logic.d.ts +0 -77
- package/dist/mcp-server/tools/obsidianGlobalSearchTool/logic.js +0 -341
- package/dist/mcp-server/tools/obsidianGlobalSearchTool/registration.d.ts +0 -18
- package/dist/mcp-server/tools/obsidianGlobalSearchTool/registration.js +0 -69
- package/dist/mcp-server/tools/obsidianListNotesTool/index.d.ts +0 -12
- package/dist/mcp-server/tools/obsidianListNotesTool/index.js +0 -12
- package/dist/mcp-server/tools/obsidianListNotesTool/logic.d.ts +0 -68
- package/dist/mcp-server/tools/obsidianListNotesTool/logic.js +0 -215
- package/dist/mcp-server/tools/obsidianListNotesTool/registration.d.ts +0 -23
- package/dist/mcp-server/tools/obsidianListNotesTool/registration.js +0 -98
- package/dist/mcp-server/tools/obsidianManageFrontmatterTool/index.d.ts +0 -3
- package/dist/mcp-server/tools/obsidianManageFrontmatterTool/index.js +0 -2
- package/dist/mcp-server/tools/obsidianManageFrontmatterTool/logic.d.ts +0 -42
- package/dist/mcp-server/tools/obsidianManageFrontmatterTool/logic.js +0 -152
- package/dist/mcp-server/tools/obsidianManageFrontmatterTool/registration.d.ts +0 -3
- package/dist/mcp-server/tools/obsidianManageFrontmatterTool/registration.js +0 -52
- package/dist/mcp-server/tools/obsidianManageTagsTool/index.d.ts +0 -3
- package/dist/mcp-server/tools/obsidianManageTagsTool/index.js +0 -2
- package/dist/mcp-server/tools/obsidianManageTagsTool/logic.d.ts +0 -28
- package/dist/mcp-server/tools/obsidianManageTagsTool/logic.js +0 -161
- package/dist/mcp-server/tools/obsidianManageTagsTool/registration.d.ts +0 -3
- package/dist/mcp-server/tools/obsidianManageTagsTool/registration.js +0 -52
- package/dist/mcp-server/tools/obsidianReadNoteTool/index.d.ts +0 -12
- package/dist/mcp-server/tools/obsidianReadNoteTool/index.js +0 -12
- package/dist/mcp-server/tools/obsidianReadNoteTool/logic.d.ts +0 -87
- package/dist/mcp-server/tools/obsidianReadNoteTool/logic.js +0 -216
- package/dist/mcp-server/tools/obsidianReadNoteTool/registration.d.ts +0 -20
- package/dist/mcp-server/tools/obsidianReadNoteTool/registration.js +0 -101
- package/dist/mcp-server/tools/obsidianSearchReplaceTool/index.d.ts +0 -12
- package/dist/mcp-server/tools/obsidianSearchReplaceTool/index.js +0 -12
- package/dist/mcp-server/tools/obsidianSearchReplaceTool/logic.d.ts +0 -255
- package/dist/mcp-server/tools/obsidianSearchReplaceTool/logic.js +0 -583
- package/dist/mcp-server/tools/obsidianSearchReplaceTool/registration.d.ts +0 -22
- package/dist/mcp-server/tools/obsidianSearchReplaceTool/registration.js +0 -111
- package/dist/mcp-server/tools/obsidianUpdateNoteTool/index.d.ts +0 -12
- package/dist/mcp-server/tools/obsidianUpdateNoteTool/index.js +0 -12
- package/dist/mcp-server/tools/obsidianUpdateNoteTool/logic.d.ts +0 -183
- package/dist/mcp-server/tools/obsidianUpdateNoteTool/logic.js +0 -490
- package/dist/mcp-server/tools/obsidianUpdateNoteTool/registration.d.ts +0 -21
- package/dist/mcp-server/tools/obsidianUpdateNoteTool/registration.js +0 -108
- package/dist/mcp-server/transports/auth/core/authContext.d.ts +0 -33
- package/dist/mcp-server/transports/auth/core/authContext.js +0 -24
- package/dist/mcp-server/transports/auth/core/authTypes.d.ts +0 -17
- package/dist/mcp-server/transports/auth/core/authTypes.js +0 -5
- package/dist/mcp-server/transports/auth/core/authUtils.d.ts +0 -18
- package/dist/mcp-server/transports/auth/core/authUtils.js +0 -45
- package/dist/mcp-server/transports/auth/index.d.ts +0 -10
- package/dist/mcp-server/transports/auth/index.js +0 -9
- package/dist/mcp-server/transports/auth/strategies/jwt/jwtMiddleware.d.ts +0 -27
- package/dist/mcp-server/transports/auth/strategies/jwt/jwtMiddleware.js +0 -149
- package/dist/mcp-server/transports/auth/strategies/oauth/oauthMiddleware.d.ts +0 -20
- package/dist/mcp-server/transports/auth/strategies/oauth/oauthMiddleware.js +0 -124
- package/dist/mcp-server/transports/httpErrorHandler.d.ts +0 -26
- package/dist/mcp-server/transports/httpErrorHandler.js +0 -73
- package/dist/mcp-server/transports/httpTransport.d.ts +0 -21
- package/dist/mcp-server/transports/httpTransport.js +0 -208
- package/dist/mcp-server/transports/stdioTransport.d.ts +0 -42
- package/dist/mcp-server/transports/stdioTransport.js +0 -63
- package/dist/services/obsidianRestAPI/index.d.ts +0 -15
- package/dist/services/obsidianRestAPI/index.js +0 -17
- package/dist/services/obsidianRestAPI/methods/activeFileMethods.d.ts +0 -38
- package/dist/services/obsidianRestAPI/methods/activeFileMethods.js +0 -62
- package/dist/services/obsidianRestAPI/methods/commandMethods.d.ts +0 -22
- package/dist/services/obsidianRestAPI/methods/commandMethods.js +0 -31
- package/dist/services/obsidianRestAPI/methods/openMethods.d.ts +0 -16
- package/dist/services/obsidianRestAPI/methods/openMethods.js +0 -21
- package/dist/services/obsidianRestAPI/methods/patchMethods.d.ts +0 -37
- package/dist/services/obsidianRestAPI/methods/patchMethods.js +0 -94
- package/dist/services/obsidianRestAPI/methods/periodicNoteMethods.d.ts +0 -42
- package/dist/services/obsidianRestAPI/methods/periodicNoteMethods.js +0 -66
- package/dist/services/obsidianRestAPI/methods/searchMethods.d.ts +0 -25
- package/dist/services/obsidianRestAPI/methods/searchMethods.js +0 -36
- package/dist/services/obsidianRestAPI/methods/vaultMethods.d.ts +0 -58
- package/dist/services/obsidianRestAPI/methods/vaultMethods.js +0 -144
- package/dist/services/obsidianRestAPI/service.d.ts +0 -195
- package/dist/services/obsidianRestAPI/service.js +0 -379
- package/dist/services/obsidianRestAPI/types.d.ts +0 -127
- package/dist/services/obsidianRestAPI/types.js +0 -7
- package/dist/services/obsidianRestAPI/vaultCache/index.d.ts +0 -4
- package/dist/services/obsidianRestAPI/vaultCache/index.js +0 -4
- package/dist/services/obsidianRestAPI/vaultCache/service.d.ts +0 -88
- package/dist/services/obsidianRestAPI/vaultCache/service.js +0 -299
- package/dist/types-global/errors.d.ts +0 -73
- package/dist/types-global/errors.js +0 -71
- package/dist/utils/index.d.ts +0 -5
- package/dist/utils/index.js +0 -13
- package/dist/utils/internal/asyncUtils.d.ts +0 -54
- package/dist/utils/internal/asyncUtils.js +0 -101
- package/dist/utils/internal/errorHandler.d.ts +0 -176
- package/dist/utils/internal/errorHandler.js +0 -351
- package/dist/utils/internal/index.d.ts +0 -4
- package/dist/utils/internal/index.js +0 -4
- package/dist/utils/internal/logger.d.ts +0 -141
- package/dist/utils/internal/logger.js +0 -406
- package/dist/utils/internal/requestContext.d.ts +0 -83
- package/dist/utils/internal/requestContext.js +0 -72
- package/dist/utils/metrics/index.d.ts +0 -1
- package/dist/utils/metrics/index.js +0 -1
- package/dist/utils/metrics/tokenCounter.d.ts +0 -27
- package/dist/utils/metrics/tokenCounter.js +0 -128
- package/dist/utils/obsidian/index.d.ts +0 -5
- package/dist/utils/obsidian/index.js +0 -5
- package/dist/utils/obsidian/obsidianApiUtils.d.ts +0 -14
- package/dist/utils/obsidian/obsidianApiUtils.js +0 -29
- package/dist/utils/obsidian/obsidianStatUtils.d.ts +0 -68
- package/dist/utils/obsidian/obsidianStatUtils.js +0 -143
- package/dist/utils/parsing/dateParser.d.ts +0 -56
- package/dist/utils/parsing/dateParser.js +0 -104
- package/dist/utils/parsing/index.d.ts +0 -2
- package/dist/utils/parsing/index.js +0 -3
- package/dist/utils/parsing/jsonParser.d.ts +0 -80
- package/dist/utils/parsing/jsonParser.js +0 -133
- package/dist/utils/security/idGenerator.d.ts +0 -140
- package/dist/utils/security/idGenerator.js +0 -194
- package/dist/utils/security/index.d.ts +0 -3
- package/dist/utils/security/index.js +0 -3
- package/dist/utils/security/rateLimiter.d.ts +0 -156
- package/dist/utils/security/rateLimiter.js +0 -235
- package/dist/utils/security/sanitization.d.ts +0 -244
- package/dist/utils/security/sanitization.js +0 -599
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
---
|
|
2
|
+
summary: Full rewrite on @cyanheads/mcp-ts-core. 14 tools and 3 resources expose the Obsidian Local REST API as a typed, declarative MCP surface — section-aware editing, three-mode search, and tag reconciliation.
|
|
3
|
+
breaking: true
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# 3.0.0 — 2026-04-28
|
|
7
|
+
|
|
8
|
+
Major version: complete rewrite of `obsidian-mcp-server` on top of [`@cyanheads/mcp-ts-core`](https://www.npmjs.com/package/@cyanheads/mcp-ts-core). The server exposes the Obsidian Local REST API plugin as a typed, declarative MCP surface — 14 tools and 3 resources, with section-aware editing, three-mode search, and tag reconciliation across inline and frontmatter representations.
|
|
9
|
+
|
|
10
|
+
## Migrating from 2.x
|
|
11
|
+
|
|
12
|
+
The 2.x tool surface is gone — every tool name and input/output schema changed. Consumers must update their integrations.
|
|
13
|
+
|
|
14
|
+
### Tool name map
|
|
15
|
+
|
|
16
|
+
| 2.x | 3.0.0 |
|
|
17
|
+
|:----|:------|
|
|
18
|
+
| `obsidian_read_note` | `obsidian_get_note` (`format`: `content` / `full` / `document-map` / `section` — replaces the v2 `markdown` vs `json` toggle and adds section-projection reads) |
|
|
19
|
+
| `obsidian_update_note` (single tool, `append` / `prepend` / `overwrite` modes) | Split: `overwrite` → `obsidian_write_note` (full-file PUT, plus new in-place section replace); `append` → `obsidian_append_to_note`. **Whole-file `prepend` is gone** — the closest paths are prepending before a known heading via `obsidian_patch_note` (new, section-aware) or read-modify-write through `obsidian_get_note` + `obsidian_write_note`. The `wholeFileMode` argument is gone with the split. |
|
|
20
|
+
| `obsidian_search_replace` | `obsidian_replace_in_note` — preserves `caseSensitive`, `wholeWord`, `flexibleWhitespace`, and `replaceAll` from v2; now also honors `$1` / `$&` capture-group references in regex replacements. |
|
|
21
|
+
| `obsidian_global_search` | `obsidian_search_notes` — three modes: text, Dataview DQL, JSONLogic. **Text mode is plain substring** — v2's regex toggle moved to JSONLogic's `regexp` operator. **Modification-date filtering moved to Dataview/JSONLogic** (`file.mtime` / `stat.mtime`); v2's text-mode date filter is gone. Pagination replaced by a 100-hit cap with an `excluded` indicator and a narrowing hint. |
|
|
22
|
+
| `obsidian_list_notes` | Same name. **Recursive walk** is back, bounded — default depth 2 (target dir plus its immediate children, a structural overview), max 20, capped at 1000 entries per call. Same extension and name-regex filters apply across the tree (regex-filtered directories are skipped without recursing into them). Returns flat `entries[]` (each `{path, type, truncated?}`) plus a box-drawing tree in the rendered output. Per-directory `truncated: true` flags where the depth limit cut off recursion; top-level `excluded.reason: 'entry_cap'` fires when the global entry cap stops the walk. v2's flat `files[]` / `directories[]` arrays are replaced by the unified `entries[]`; v2's infinite-recursion default is gone. |
|
|
23
|
+
| `obsidian_manage_frontmatter` | Same name. Atomic `get` / `set` / `delete` on a single key. |
|
|
24
|
+
| `obsidian_manage_tags` | Same name. Now reconciles inline `#tag` and frontmatter `tags:` together; skips fenced code blocks. |
|
|
25
|
+
| `obsidian_delete_note` | Same name. Uses `ctx.elicit` for human-in-the-loop confirmation when the client supports it. v2's silent case-insensitive path fallback was dropped — delete now requires an exact path match so a typo can't quietly delete a different file on case-sensitive filesystems. |
|
|
26
|
+
|
|
27
|
+
**New in 3.0.0:** `obsidian_list_tags`, `obsidian_list_commands`, `obsidian_open_in_ui`, `obsidian_patch_note` (section-aware edits — append / prepend / replace against headings, block refs, frontmatter fields), and `obsidian_execute_command` (opt-in via `OBSIDIAN_ENABLE_COMMANDS=true`). v2 had no resources; 3.0.0 adds three: `obsidian://vault/{+path}` (note as parsed `NoteJson`), `obsidian://tags`, and `obsidian://status`.
|
|
28
|
+
|
|
29
|
+
### Removed
|
|
30
|
+
|
|
31
|
+
- **`VaultCacheService`** and its env vars (`OBSIDIAN_ENABLE_CACHE`, `OBSIDIAN_CACHE_REFRESH_INTERVAL_MIN`). The server is stateless now — search and list hit the Local REST API on every call. If you relied on the cache as a fallback when upstream was unreachable, those failures now surface as service errors instead. For large vaults, narrow with the text-mode `pathPrefix` filter or Dataview/JSONLogic predicates against `file.path` / `path`.
|
|
32
|
+
|
|
33
|
+
### Default and config changes
|
|
34
|
+
|
|
35
|
+
- `OBSIDIAN_VERIFY_SSL` default flipped from `true` to `false`. The plugin's HTTPS port (27124) uses a self-signed cert and the HTTP port (27123) doesn't need verification — v2's `true` default required explicit overrides for almost every realistic config.
|
|
36
|
+
- `OBSIDIAN_BASE_URL` default unchanged (`http://127.0.0.1:27123`) but no longer marked required — the Zod default supplies it.
|
|
37
|
+
- Runtime requirements: `engines.node` bumped from `>=18` to `>=22`; `engines.bun` ≥ 1.3.11 is the install-time constraint because the dev workflow (build, test, devcheck) assumes Bun.
|
|
38
|
+
|
|
39
|
+
### Architectural notes
|
|
40
|
+
|
|
41
|
+
- The server is no longer a fork of `cyanheads/mcp-ts-template`; it depends on [`@cyanheads/mcp-ts-core`](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) as a package. Tools and resources are declarative definitions registered via `tool('name', { ... })` and `resource('uri', { ... })` builders.
|
|
42
|
+
- Per-request cancellation: `ctx.signal` propagates through to the upstream HTTP client, so client cancellations and per-request timeouts cut off in-flight Local REST API calls.
|
|
43
|
+
- HTTP-mode auth (`MCP_AUTH_MODE=jwt|oauth`) and tenant-aware logging via `ctx.tenantId` are framework features, retained from v2's posture.
|
|
44
|
+
|
|
45
|
+
## Added
|
|
46
|
+
|
|
47
|
+
- **Read tools:** `obsidian_get_note` (content / full / document-map / section projections), `obsidian_list_notes` (recursive walk with bounded `depth` plus extension and name-regex filters; returns flat `entries[]` and a box-drawing tree view), `obsidian_list_tags`, `obsidian_list_commands`, `obsidian_search_notes` (text / Dataview DQL / JSONLogic).
|
|
48
|
+
- **Write tools:** `obsidian_write_note` (full-file PUT or in-place section replace), `obsidian_append_to_note`, `obsidian_patch_note` (append / prepend / replace against headings, block refs, frontmatter fields), `obsidian_replace_in_note` (string and regex search-replace).
|
|
49
|
+
- **Manage tools:** `obsidian_manage_frontmatter` (atomic get / set / delete on a single key), `obsidian_manage_tags` (reconciles frontmatter `tags:` and inline `#tag`, skipping fenced code blocks).
|
|
50
|
+
- **Destructive tools:** `obsidian_delete_note` (with `ctx.elicit` confirmation when supported), `obsidian_open_in_ui`.
|
|
51
|
+
- **Opt-in tool:** `obsidian_execute_command` — registered only when `OBSIDIAN_ENABLE_COMMANDS=true`.
|
|
52
|
+
- **Resources:** `obsidian://vault/{+path}` (note as parsed NoteJson), `obsidian://tags`, `obsidian://status`.
|
|
53
|
+
- **Service layer:** Typed Local REST API client with `ctx.signal` propagation, frontmatter parse/serialize/edit helpers, section extraction across headings/blocks/frontmatter.
|
|
54
|
+
- **Configuration:** Five `OBSIDIAN_*` env vars wired through `parseEnvConfig` with Zod validation.
|
|
55
|
+
- **Search guardrails:** 100-hit cap with an `excluded` indicator that surfaces overflow count and a narrowing hint. Text-mode results additionally clip per file at `maxMatchesPerHit` (default 10) so a single match-heavy note can't blow the response budget — clipped hits carry `truncated: true` and `totalMatches`. Caller can override the per-hit cap.
|
|
56
|
+
- **Deployment:** Dockerfile (HTTP transport, stateless session, OCI metadata) and `server.json` manifest for MCP registry listings.
|
|
57
|
+
- **Path resolution UX:** Read and open tools (`obsidian_get_note`, `obsidian_open_in_ui`) share a `withCaseFallback()` helper. On a 404 against a `path:` target, it lists the parent directory and either (a) silently retries against the canonical filename when exactly one case-insensitive match exists (fixes `Readme.md` vs `README.md` on case-sensitive filesystems), (b) throws `Conflict` with the candidates when multiple case matches exist, or (c) re-throws `NotFound` with `data.suggestions[]` and a `Did you mean: "X", "Y"?` hint for extension-stripped near-matches. Resolved canonical paths flow back through `result.path`. `obsidian_delete_note` opts out — silent path normalization on a destructive op is too dangerous when not every client supports `ctx.elicit`.
|
|
58
|
+
- **`obsidian_replace_in_note` `wholeWord` and `flexibleWhitespace` options** for parity with v2's `obsidian_search_replace`. `wholeWord` works in both literal and regex modes (wraps the pattern in `\b…\b`). `flexibleWhitespace` is literal-mode only — substitutes any run of whitespace in the search pattern with `\s+` so `"foo bar"` matches `"foo\tbar"` and `"foo bar"` alike. Literal-with-transformations uses the callback overload of `String.replace` so `$1` / `$&` in `replace` stay literal (only `useRegex: true` honors capture-group references).
|
|
59
|
+
- **Typed error contracts on every tool.** All 10 tools declare an `errors: [{ reason, code, when, retryable? }]` array advertising the failure surface in `tools/list` (under `_meta['mcp-ts-core/errors']`); throws route through `ctx.fail(reason, …)` so `error.data.reason` is auto-populated and tamper-proof, and clients can switch on a stable identifier instead of parsing message text. Declared reasons: `note_missing`, `no_active_file`, `periodic_not_found`, `command_unknown`, `section_target_missing`, `section_required`, `value_required`, `tags_required`, `regex_invalid`, `query_required`, `logic_required`, `path_prefix_invalid_mode`, and `cancelled` (delete declined via elicitation).
|
|
60
|
+
|
|
61
|
+
## Changed
|
|
62
|
+
|
|
63
|
+
- `obsidian_write_note` now sets `Apply-If-Content-Preexists: true` on section-targeted PATCH and strips a leading duplicate heading line so a caller's `## Section` does not get embedded inside the section body.
|
|
64
|
+
- `obsidian://status.authenticated` is now a separate authenticated probe against `/vault/` instead of the unauthenticated `/` field — the resource still serves reachability info when the API key is wrong.
|
|
65
|
+
- Service errors report the vault-relative path (e.g. `Not found: Notes/foo.md`) instead of the internal HTTP path (`/vault/Notes/foo.md`). Periodic-note paths render as `daily note for 2026-04-26`, so 404s and log lines name the resource the caller asked for instead of the route.
|
|
66
|
+
- 400 responses that look like a missing PATCH section target are translated into actionable guidance pointing at `obsidian_get_note` `format: "document-map"`, with a reminder that nested headings need `Parent::Child` syntax.
|
|
67
|
+
- `obsidian_get_note` `format()` renders ISO 8601 timestamps for `stat.ctime` / `stat.mtime` instead of raw epoch ms.
|
|
68
|
+
- `obsidian_search_notes` empty-result rendering includes a narrowing hint; the JSONLogic mode description now enumerates the available `var` paths (`path`, `content`, `frontmatter.<key>`, `tags`, `stat.{ctime,mtime,size}`).
|
|
69
|
+
- `obsidian_list_notes` echoes any active filters as `appliedFilters` (extension and/or `nameRegex`) in both `structuredContent` and the rendered text twin, so callers can audit which filters narrowed the listing.
|
|
70
|
+
- `obsidian_open_in_ui` no longer carries `destructiveHint` — the `failIfMissing: true` default keeps the call read-like; opt-in create-on-open lives behind that flag. `obsidian_append_to_note` is now correctly flagged `destructiveHint`.
|
|
71
|
+
- `obsidian_write_note` and `obsidian_append_to_note` outputs drop the `updatedContent` echo. The Local REST API doesn't reliably return a body on the whole-file path, so the field was a coin flip; section-targeted edits already round-trip the new content through a separate read.
|
|
72
|
+
- Tool descriptions across `obsidian_*` rewritten to replace internal jargon (`OBSIDIAN_ENABLE_COMMANDS`, "upstream", "PATCH-with-append", "404", "NoteJson", "Echoed") with user-facing concepts and concrete next steps. Notable clarifications: heading projections include the full subtree (`obsidian_get_note`); `extension` filters files only, directories pass through (`obsidian_list_notes`); inline-location adds append at end of file and `list` ignores the `tags` field (`obsidian_manage_tags`); block-reference appends are concatenated without an upstream-inserted separator (`obsidian_append_to_note`); `contentType: "json"` requires JSON-literal encoding to avoid opaque upstream 400s (`ContentTypeSchema`). Cross-tool routing hints removed from `obsidian_open_in_ui` and `obsidian_manage_frontmatter` headers.
|
|
73
|
+
- `obsidian_search_notes` annotations include `idempotentHint: true` alongside `readOnlyHint: true` — same query → same results, both hints apply.
|
|
74
|
+
- `obsidian_manage_frontmatter` `delete` projects the post-state frontmatter locally by stripping the deleted key from the prior read instead of refetching. One fewer round-trip per delete; the upstream PUT is the source of truth either way.
|
|
75
|
+
- `obsidian_manage_tags` short-circuits on no-op reconciles. When `add`/`remove` resolves to zero applied changes, the handler skips both the upstream PUT and the post-write GET refetch and returns directly from the pre-read note. Re-adding tags a note already carries now costs one round-trip instead of two.
|
|
76
|
+
- `obsidian_open_in_ui` skips the existence probe when `failIfMissing: false`. The probe only existed to populate `createdIfMissing`, which is unambiguously `true` under the create-on-open contract — the open call is now a single round-trip with no upfront `GET /vault/<path>` or parent listing.
|
|
77
|
+
- `obsidian_search_notes` rejects `pathPrefix` outside `text` mode with an actionable error. The filter was silently ignored in `dataview` and `jsonlogic` (those modes filter by `path` / `file.path` predicates directly), which made result counts surprising.
|
|
78
|
+
- `npm start` script added (`node dist/index.js`) for distribution-time launches that don't go through the `MCP_TRANSPORT_TYPE`-prefixed `start:stdio` / `start:http` variants.
|
|
79
|
+
- Dependency bumps: `@cyanheads/mcp-ts-core` 0.7.5 → 0.8.1 (picks up typed error contracts, the `errors[]` conformance lint, and `httpErrorFromResponse`), `@modelcontextprotocol/sdk` ^1.13.0 → ^1.29.0 (transitive via `mcp-ts-core`), `@biomejs/biome` 2.4.7 → 2.4.13, `typescript` 5.9.3 → 6.0.3 (major), `vitest` 4.1.0 → 4.1.5.
|
|
80
|
+
- README polish: the `obsidian_open_in_ui` row documents both `failIfMissing` and `newLeaf` toggles; the project-structure table no longer references the removed `docs/design.md` (superseded by the shipped implementation).
|
|
81
|
+
- Internal cleanup: `ObsidianService.resolvePath()` collapses the repeated `target.type === 'path' ? … : getNoteJson()` ternary across handlers; `splice()` in `frontmatter-ops` captures YAML directly from the regex match group; `obsidian_open_in_ui` consolidates two near-duplicate try blocks; document-map fetch and path resolution run in parallel for non-`path` targets.
|
|
82
|
+
- Test infrastructure: `ObsidianService` constructor accepts an optional `fetchImpl` (`(url, init) => Promise<Response>`) instead of an undici `Dispatcher`. Bun's runtime treats `undici` as a builtin and silently ignores `vi.mock('undici', …)`, so tests inject a stub fetch directly. The harness keeps the same `pool.intercept(matcher).reply(...)` surface; no test bodies changed.
|
|
83
|
+
- Service-layer error classification carries `data.reason`. 404s are tagged by origin path: `/active/` → `no_active_file`, `/periodic/…` → `periodic_not_found`, `/commands/…` → `command_unknown`, vault paths → `note_missing`. 405 on a directory surfaces `path_is_directory`; 400 "could not be applied" PATCH responses surface `section_target_missing`. Service-thrown reasons flow through the auto-classifier unchanged, so clients see the same `error.data.reason` whether the throw originated in a service or a tool's `ctx.fail`.
|
|
84
|
+
- Semantic post-shape validation switched from `invalidParams` (-32602) to `validationError` (-32007). Once Zod accepts the input, downstream domain checks (mode-mismatched `pathPrefix`, missing `query` / `logic` / `section` / `value` / `tags`, malformed regex, malformed periodic-note date, 405 directory PUT) are validation failures, not protocol-level wrong-shape — `invalidParams` is reserved for the framework's pre-Zod JSON-RPC decoder. Wire-visible: code `-32007` instead of `-32602`.
|
|
85
|
+
- `obsidian_execute_command` 404s render `Unknown Obsidian command: <id>. Use \`obsidian_list_commands\` to discover valid command IDs.` instead of the bare upstream `Not found: …`. Service `displayPath()` strips `/commands/` so log lines name the command id, not the route.
|
|
86
|
+
- `obsidian_open_in_ui` keys off `err.data.reason === 'note_missing'` rather than `err.code === JsonRpcErrorCode.NotFound` when deciding whether to rewrite a `NotFound` from `withCaseFallback` into a `failIfMissing: true` rejection — satisfies `error-contract-prefer-fail`; conformance lint is now clean across every handler.
|
|
87
|
+
- CLAUDE.md `Errors` section reframed around the typed contract as the recommended path; factories scoped to ad-hoc cases and service-layer code. Skills `add-tool`, `add-service`, `api-errors`, `field-test`, `maintenance`, `report-issue-framework`, and `security-pass` document declaring `errors[]`, routing throws through `ctx.fail`, carrying contract `reason` from services via factory `data: { reason }`, and field-testing each declared reason against `_meta.error.code` and `data.reason`.
|
|
88
|
+
|
|
89
|
+
## Fixed
|
|
90
|
+
|
|
91
|
+
- `obsidian_replace_in_note` honors `$1` / `$2` / `$&` capture-group references in regex replacements. The regex path now uses the string overload of `String.replace` instead of the callback overload, which silently drops capture-group templates.
|
|
92
|
+
- `obsidian_list_tags` and `obsidian://tags` return `{name, count}` matching the upstream `/tags/` shape (was `{tag, count}`).
|
|
93
|
+
- `NoteTarget.date` aligned with the Zod-inferred shape (`string | undefined`) so handlers no longer need an `as NoteTarget` cast under `exactOptionalPropertyTypes`.
|
|
94
|
+
- `OBSIDIAN_VERIFY_SSL=false` actually disables TLS verification under Bun. Bun ignores undici's per-dispatcher `connect.rejectUnauthorized`, so calls to the HTTPS port (`https://127.0.0.1:27124`, self-signed) failed with `DEPTH_ZERO_SELF_SIGNED_CERT` regardless of the env var. The service constructor sets `NODE_TLS_REJECT_UNAUTHORIZED=0` only when `verifySsl: false` **and** the runtime is Bun — Node honors the dispatcher option directly and is not mutated process-wide.
|
|
95
|
+
- `extractSection` (heading and block) skips a leading YAML frontmatter block before scanning. Without this guard, a `# yaml comment` inside frontmatter false-matched as a Markdown heading, and block extraction's paragraph walk-back could pull the closing `---` fence into the result.
|
|
96
|
+
- `obsidian_manage_frontmatter` `get` on an absent key returns `value: null` in `structuredContent` instead of omitting the field — closes a parity gap with `content[]`, which already rendered `_(absent)_`.
|
|
97
|
+
- `ObsidianService.probeAuthenticated` re-throws when `ctx.signal` is aborted instead of catching the abort and reporting `false`. A cancelled or timed-out probe was masquerading as a 401 in `obsidian://status.authenticated`; cancellation now surfaces as a service error.
|
|
98
|
+
|
|
99
|
+
## Security
|
|
100
|
+
|
|
101
|
+
- Upstream error bodies pass through a `safeUpstream()` helper before being attached to JSON-RPC `error.data` — it keeps only the human `message` field (or trims raw text to 200 chars) and drops plugin-internal fields like `errorCode` that would otherwise leak into client-visible payloads.
|
|
102
|
+
- The TLS verify-disable fallback (`NODE_TLS_REJECT_UNAUTHORIZED=0`) is **scoped to Bun**. Outbound HTTPS only goes to the configured Obsidian Local REST API, so the blast radius is the upstream you already chose to trust by setting `verifySsl: false`. Node deployments use undici's per-dispatcher `rejectUnauthorized: false` and don't mutate process-wide TLS. The `OBSIDIAN_VERIFY_SSL` env var description calls this out.
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
---
|
|
2
|
+
# FORMAT REFERENCE — this file is never edited, never moved, never renamed.
|
|
3
|
+
#
|
|
4
|
+
# At release time, author a new per-version file at:
|
|
5
|
+
# changelog/<major.minor>.x/<version>.md (e.g. changelog/0.1.x/0.1.0.md)
|
|
6
|
+
# using this file's frontmatter and section layout as the starting point.
|
|
7
|
+
# Set that new file's H1 to `# <version> — YYYY-MM-DD` with a concrete date.
|
|
8
|
+
|
|
9
|
+
# Required. One-line headline describing the release. Max 250 chars. No markdown.
|
|
10
|
+
# This line is what the CHANGELOG.md rollup shows — write it like a GitHub Release title.
|
|
11
|
+
summary: ""
|
|
12
|
+
|
|
13
|
+
# Set to `true` only if this release has breaking changes (API removals, signature
|
|
14
|
+
# changes, config renames, anything that requires consumer code changes on update).
|
|
15
|
+
# Flagged as ⚠️ Breaking in the rollup.
|
|
16
|
+
breaking: false
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
# <version> — YYYY-MM-DD
|
|
20
|
+
|
|
21
|
+
<!--
|
|
22
|
+
FORMAT REFERENCE — do not edit this file. It exists so the per-version file
|
|
23
|
+
structure has a single copy-source. Create new release notes at
|
|
24
|
+
`changelog/<major.minor>.x/<version>.md` using this layout.
|
|
25
|
+
|
|
26
|
+
Optional narrative intro — 1-3 sentences framing the release theme. Delete if not needed.
|
|
27
|
+
|
|
28
|
+
Linking issues/PRs: use full URLs so the link works everywhere (GitHub web UI,
|
|
29
|
+
npm/node_modules reads, local editors). GitHub's bare `#NN` auto-link only
|
|
30
|
+
resolves inside its own UI.
|
|
31
|
+
|
|
32
|
+
[#12](https://github.com/<owner>/<repo>/issues/12) ← issue
|
|
33
|
+
[#17](https://github.com/<owner>/<repo>/pull/17) ← PR
|
|
34
|
+
|
|
35
|
+
Only link numbers you've verified exist (via `gh issue view NN` or
|
|
36
|
+
`gh pr view NN`). Never speculate on a future number — `#17` for "my
|
|
37
|
+
upcoming PR" will quietly resolve to whatever real item already owns 17,
|
|
38
|
+
and GitHub timeline previews will pull in that unrelated item's title.
|
|
39
|
+
-->
|
|
40
|
+
|
|
41
|
+
## Added
|
|
42
|
+
|
|
43
|
+
-
|
|
44
|
+
|
|
45
|
+
## Changed
|
|
46
|
+
|
|
47
|
+
-
|
|
48
|
+
|
|
49
|
+
## Fixed
|
|
50
|
+
|
|
51
|
+
-
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Server-specific config for obsidian-mcp-server.
|
|
3
|
+
* Loads OBSIDIAN_* env vars used by the Obsidian Local REST API service layer.
|
|
4
|
+
* @module config/server-config
|
|
5
|
+
*/
|
|
6
|
+
import { z } from '@cyanheads/mcp-ts-core';
|
|
7
|
+
declare const ServerConfigSchema: z.ZodObject<{
|
|
8
|
+
apiKey: z.ZodString;
|
|
9
|
+
baseUrl: z.ZodDefault<z.ZodString>;
|
|
10
|
+
verifySsl: z.ZodDefault<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodBoolean>>;
|
|
11
|
+
requestTimeoutMs: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
12
|
+
enableCommands: z.ZodDefault<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodBoolean>>;
|
|
13
|
+
}, z.core.$strip>;
|
|
14
|
+
export type ServerConfig = z.infer<typeof ServerConfigSchema>;
|
|
15
|
+
export declare function getServerConfig(): ServerConfig;
|
|
16
|
+
/** Test hook to reset the cached config. Not used at runtime. */
|
|
17
|
+
export declare function resetServerConfig(): void;
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=server-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server-config.d.ts","sourceRoot":"","sources":["../../src/config/server-config.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAY3C,QAAA,MAAM,kBAAkB;;;;;;iBA8BtB,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAI9D,wBAAgB,eAAe,IAAI,YAAY,CAS9C;AAED,iEAAiE;AACjE,wBAAgB,iBAAiB,IAAI,IAAI,CAExC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Server-specific config for obsidian-mcp-server.
|
|
3
|
+
* Loads OBSIDIAN_* env vars used by the Obsidian Local REST API service layer.
|
|
4
|
+
* @module config/server-config
|
|
5
|
+
*/
|
|
6
|
+
import { z } from '@cyanheads/mcp-ts-core';
|
|
7
|
+
import { parseEnvConfig } from '@cyanheads/mcp-ts-core/config';
|
|
8
|
+
const envBoolean = z.preprocess((val) => {
|
|
9
|
+
if (typeof val === 'boolean')
|
|
10
|
+
return val;
|
|
11
|
+
if (typeof val === 'string') {
|
|
12
|
+
const str = val.toLowerCase().trim();
|
|
13
|
+
return str === 'true' || str === '1';
|
|
14
|
+
}
|
|
15
|
+
return val;
|
|
16
|
+
}, z.boolean());
|
|
17
|
+
const ServerConfigSchema = z.object({
|
|
18
|
+
apiKey: z
|
|
19
|
+
.string()
|
|
20
|
+
.min(1)
|
|
21
|
+
.describe('Bearer token for the Obsidian Local REST API plugin (Settings → Community Plugins → Local REST API).'),
|
|
22
|
+
baseUrl: z
|
|
23
|
+
.string()
|
|
24
|
+
.url()
|
|
25
|
+
.default('http://127.0.0.1:27123')
|
|
26
|
+
.describe('Base URL of the Obsidian Local REST API. Defaults to http://127.0.0.1:27123 — enable "Non-encrypted (HTTP) Server" in the plugin settings to match. Use https://127.0.0.1:27124 to hit the always-on HTTPS port (self-signed cert; pair with OBSIDIAN_VERIFY_SSL=false).'),
|
|
27
|
+
verifySsl: envBoolean
|
|
28
|
+
.default(false)
|
|
29
|
+
.describe("Whether to verify the TLS certificate on the Obsidian endpoint. Defaults to false because the plugin uses a self-signed cert. On Node, the dispatcher's `rejectUnauthorized` option handles this without any process-wide change. On Bun, the runtime ignores that option, so the service additionally sets `NODE_TLS_REJECT_UNAUTHORIZED=0` — that fallback is scoped to Bun only."),
|
|
30
|
+
requestTimeoutMs: z.coerce
|
|
31
|
+
.number()
|
|
32
|
+
.int()
|
|
33
|
+
.positive()
|
|
34
|
+
.default(30_000)
|
|
35
|
+
.describe('Per-request timeout in milliseconds.'),
|
|
36
|
+
enableCommands: envBoolean
|
|
37
|
+
.default(false)
|
|
38
|
+
.describe('Opt-in flag for obsidian_execute_command. Off by default — Obsidian commands are opaque and can be destructive.'),
|
|
39
|
+
});
|
|
40
|
+
let _config;
|
|
41
|
+
export function getServerConfig() {
|
|
42
|
+
_config ??= parseEnvConfig(ServerConfigSchema, {
|
|
43
|
+
apiKey: 'OBSIDIAN_API_KEY',
|
|
44
|
+
baseUrl: 'OBSIDIAN_BASE_URL',
|
|
45
|
+
verifySsl: 'OBSIDIAN_VERIFY_SSL',
|
|
46
|
+
requestTimeoutMs: 'OBSIDIAN_REQUEST_TIMEOUT_MS',
|
|
47
|
+
enableCommands: 'OBSIDIAN_ENABLE_COMMANDS',
|
|
48
|
+
});
|
|
49
|
+
return _config;
|
|
50
|
+
}
|
|
51
|
+
/** Test hook to reset the cached config. Not used at runtime. */
|
|
52
|
+
export function resetServerConfig() {
|
|
53
|
+
_config = undefined;
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=server-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server-config.js","sourceRoot":"","sources":["../../src/config/server-config.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAE/D,MAAM,UAAU,GAAG,CAAC,CAAC,UAAU,CAAC,CAAC,GAAG,EAAE,EAAE;IACtC,IAAI,OAAO,GAAG,KAAK,SAAS;QAAE,OAAO,GAAG,CAAC;IACzC,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE,CAAC;QAC5B,MAAM,GAAG,GAAG,GAAG,CAAC,WAAW,EAAE,CAAC,IAAI,EAAE,CAAC;QACrC,OAAO,GAAG,KAAK,MAAM,IAAI,GAAG,KAAK,GAAG,CAAC;IACvC,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;AAEhB,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IAClC,MAAM,EAAE,CAAC;SACN,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,CACP,sGAAsG,CACvG;IACH,OAAO,EAAE,CAAC;SACP,MAAM,EAAE;SACR,GAAG,EAAE;SACL,OAAO,CAAC,wBAAwB,CAAC;SACjC,QAAQ,CACP,0QAA0Q,CAC3Q;IACH,SAAS,EAAE,UAAU;SAClB,OAAO,CAAC,KAAK,CAAC;SACd,QAAQ,CACP,qXAAqX,CACtX;IACH,gBAAgB,EAAE,CAAC,CAAC,MAAM;SACvB,MAAM,EAAE;SACR,GAAG,EAAE;SACL,QAAQ,EAAE;SACV,OAAO,CAAC,MAAM,CAAC;SACf,QAAQ,CAAC,sCAAsC,CAAC;IACnD,cAAc,EAAE,UAAU;SACvB,OAAO,CAAC,KAAK,CAAC;SACd,QAAQ,CACP,iHAAiH,CAClH;CACJ,CAAC,CAAC;AAIH,IAAI,OAAiC,CAAC;AAEtC,MAAM,UAAU,eAAe;IAC7B,OAAO,KAAK,cAAc,CAAC,kBAAkB,EAAE;QAC7C,MAAM,EAAE,kBAAkB;QAC1B,OAAO,EAAE,mBAAmB;QAC5B,SAAS,EAAE,qBAAqB;QAChC,gBAAgB,EAAE,6BAA6B;QAC/C,cAAc,EAAE,0BAA0B;KAC3C,CAAC,CAAC;IACH,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,iEAAiE;AACjE,MAAM,UAAU,iBAAiB;IAC/B,OAAO,GAAG,SAAS,CAAC;AACtB,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* @fileoverview obsidian-mcp-server entry point. Initializes the Obsidian
|
|
4
|
+
* Local REST API service in `setup()` so handlers can reach it via
|
|
5
|
+
* `getObsidianService()`.
|
|
6
|
+
* @module index
|
|
7
|
+
*/
|
|
2
8
|
export {};
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;GAKG"}
|
package/dist/index.js
CHANGED
|
@@ -1,298 +1,26 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
3
|
-
import { config, environment } from "./config/index.js"; // This loads .env via dotenv.config()
|
|
4
|
-
import { initializeAndStartServer } from "./mcp-server/server.js";
|
|
5
|
-
import { requestContextService, retryWithDelay } from "./utils/index.js";
|
|
6
|
-
import { logger } from "./utils/internal/logger.js"; // Import logger instance early
|
|
7
|
-
// Import Services
|
|
8
|
-
import { ObsidianRestApiService } from "./services/obsidianRestAPI/index.js";
|
|
9
|
-
import { VaultCacheService } from "./services/obsidianRestAPI/vaultCache/index.js"; // Import VaultCacheService
|
|
10
2
|
/**
|
|
11
|
-
*
|
|
12
|
-
*
|
|
3
|
+
* @fileoverview obsidian-mcp-server entry point. Initializes the Obsidian
|
|
4
|
+
* Local REST API service in `setup()` so handlers can reach it via
|
|
5
|
+
* `getObsidianService()`.
|
|
6
|
+
* @module index
|
|
13
7
|
*/
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
*
|
|
34
|
-
* @param signal - The signal or event name that triggered the shutdown (e.g., "SIGTERM", "uncaughtException").
|
|
35
|
-
*/
|
|
36
|
-
const shutdown = async (signal) => {
|
|
37
|
-
// Define context for the shutdown operation
|
|
38
|
-
const shutdownContext = requestContextService.createRequestContext({
|
|
39
|
-
operation: "Shutdown",
|
|
40
|
-
signal,
|
|
41
|
-
});
|
|
42
|
-
logger.info(`Received ${signal}. Starting graceful shutdown...`, shutdownContext);
|
|
43
|
-
try {
|
|
44
|
-
// Stop cache refresh timer first
|
|
45
|
-
if (config.obsidianEnableCache && vaultCacheService) {
|
|
46
|
-
vaultCacheService.stopPeriodicRefresh();
|
|
47
|
-
}
|
|
48
|
-
// Close the main MCP server (only relevant for stdio)
|
|
49
|
-
if (server) {
|
|
50
|
-
logger.info("Closing main MCP server (stdio)...", shutdownContext);
|
|
51
|
-
await server.close();
|
|
52
|
-
logger.info("Main MCP server (stdio) closed successfully", shutdownContext);
|
|
53
|
-
}
|
|
54
|
-
// Close the main HTTP server instance (if it exists)
|
|
55
|
-
if (httpServerInstance) {
|
|
56
|
-
logger.info("Closing main HTTP server...", shutdownContext);
|
|
57
|
-
await new Promise((resolve, reject) => {
|
|
58
|
-
httpServerInstance.close((err) => {
|
|
59
|
-
if (err) {
|
|
60
|
-
logger.error("Error closing HTTP server", err, shutdownContext);
|
|
61
|
-
reject(err);
|
|
62
|
-
return;
|
|
63
|
-
}
|
|
64
|
-
logger.info("Main HTTP server closed successfully", shutdownContext);
|
|
65
|
-
resolve();
|
|
66
|
-
});
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
if (!server && !httpServerInstance) {
|
|
70
|
-
logger.warning("No server instance (Stdio or HTTP) found to close during shutdown.", shutdownContext);
|
|
71
|
-
}
|
|
72
|
-
// Add any other necessary cleanup here (e.g., closing database connections if added later)
|
|
73
|
-
logger.info("Graceful shutdown completed successfully", shutdownContext);
|
|
74
|
-
process.exit(0);
|
|
75
|
-
}
|
|
76
|
-
catch (error) {
|
|
77
|
-
// Handle any errors during shutdown
|
|
78
|
-
logger.error("Critical error during shutdown", error instanceof Error ? error : undefined, {
|
|
79
|
-
...shutdownContext, // Spread the existing RequestContext
|
|
80
|
-
// error field is handled by logger.error's second argument
|
|
81
|
-
});
|
|
82
|
-
process.exit(1); // Exit with error code if shutdown fails
|
|
83
|
-
}
|
|
84
|
-
};
|
|
85
|
-
/**
|
|
86
|
-
* Initializes and starts the main MCP server.
|
|
87
|
-
* Sets up request context, initializes the server instance, starts the transport,
|
|
88
|
-
* and registers signal handlers for graceful shutdown and error handling.
|
|
89
|
-
*/
|
|
90
|
-
const start = async () => {
|
|
91
|
-
// --- Logger Initialization (Moved here AFTER config/dotenv is loaded) ---
|
|
92
|
-
const validMcpLogLevels = [
|
|
93
|
-
"debug",
|
|
94
|
-
"info",
|
|
95
|
-
"notice",
|
|
96
|
-
"warning",
|
|
97
|
-
"error",
|
|
98
|
-
"crit",
|
|
99
|
-
"alert",
|
|
100
|
-
"emerg",
|
|
101
|
-
];
|
|
102
|
-
// Read level from config (which read from env var or default)
|
|
103
|
-
const initialLogLevelConfig = config.logLevel;
|
|
104
|
-
// Validate the configured log level
|
|
105
|
-
let validatedMcpLogLevel = "info"; // Default to 'info'
|
|
106
|
-
if (validMcpLogLevels.includes(initialLogLevelConfig)) {
|
|
107
|
-
validatedMcpLogLevel = initialLogLevelConfig;
|
|
108
|
-
}
|
|
109
|
-
else {
|
|
110
|
-
// Use console.warn here as logger isn't initialized yet
|
|
111
|
-
console.warn(`Invalid MCP_LOG_LEVEL "${initialLogLevelConfig}" provided via config/env. Defaulting to "info".`);
|
|
112
|
-
}
|
|
113
|
-
// Initialize the logger with the validated MCP level and wait for it to complete.
|
|
114
|
-
await logger.initialize(validatedMcpLogLevel);
|
|
115
|
-
// Log initialization message using the logger itself (will go to file/console)
|
|
116
|
-
logger.info(`Logger initialized by start(). MCP logging level: ${validatedMcpLogLevel}`);
|
|
117
|
-
// --- End Logger Initialization ---
|
|
118
|
-
// Log that config is loaded (this was previously done earlier)
|
|
119
|
-
logger.debug("Configuration loaded successfully", requestContextService.createRequestContext({
|
|
120
|
-
configLoaded: true,
|
|
121
|
-
configSummary: {
|
|
122
|
-
serverName: config.mcpServerName,
|
|
123
|
-
transport: config.mcpTransportType,
|
|
124
|
-
logLevel: config.logLevel,
|
|
125
|
-
},
|
|
126
|
-
}));
|
|
127
|
-
// Create application-level request context using the service instance
|
|
128
|
-
// Use the validated transport type from the config object
|
|
129
|
-
const transportType = config.mcpTransportType;
|
|
130
|
-
const startupContext = requestContextService.createRequestContext({
|
|
131
|
-
operation: `ServerStartup_${transportType}`, // Include transport in operation name
|
|
132
|
-
appName: config.mcpServerName,
|
|
133
|
-
appVersion: config.mcpServerVersion,
|
|
134
|
-
environment: environment,
|
|
135
|
-
});
|
|
136
|
-
logger.info(`Starting ${config.mcpServerName} v${config.mcpServerVersion} (Transport: ${transportType})...`, startupContext);
|
|
137
|
-
try {
|
|
138
|
-
// --- Instantiate Shared Services ---
|
|
139
|
-
logger.debug("Instantiating shared services...", startupContext);
|
|
140
|
-
obsidianService = new ObsidianRestApiService(); // Instantiate Obsidian Service
|
|
141
|
-
// --- Perform Initial Obsidian API Status Check ---
|
|
142
|
-
try {
|
|
143
|
-
logger.info("Performing initial Obsidian API status check with retries...", startupContext);
|
|
144
|
-
const status = await retryWithDelay(async () => {
|
|
145
|
-
if (!obsidianService) {
|
|
146
|
-
// This case should not happen in practice, but it satisfies the type checker.
|
|
147
|
-
throw new Error("Obsidian service not initialized.");
|
|
148
|
-
}
|
|
149
|
-
const checkStatusContext = {
|
|
150
|
-
...startupContext,
|
|
151
|
-
operation: "checkStatusAttempt",
|
|
152
|
-
};
|
|
153
|
-
const currentStatus = await obsidianService.checkStatus(checkStatusContext);
|
|
154
|
-
if (currentStatus?.service !== "Obsidian Local REST API" ||
|
|
155
|
-
!currentStatus?.authenticated) {
|
|
156
|
-
// Throw an error to trigger a retry
|
|
157
|
-
throw new Error(`Obsidian API status check failed or indicates authentication issue. Status: ${JSON.stringify(currentStatus)}`);
|
|
158
|
-
}
|
|
159
|
-
return currentStatus;
|
|
160
|
-
}, {
|
|
161
|
-
operationName: "initialObsidianApiCheck",
|
|
162
|
-
context: startupContext,
|
|
163
|
-
maxRetries: 5, // Retry up to 5 times
|
|
164
|
-
delayMs: 3000, // Wait 3 seconds between retries
|
|
165
|
-
});
|
|
166
|
-
logger.info("Obsidian API status check successful.", {
|
|
167
|
-
...startupContext,
|
|
168
|
-
obsidianVersion: status.versions.obsidian,
|
|
169
|
-
pluginVersion: status.versions.self,
|
|
170
|
-
});
|
|
171
|
-
}
|
|
172
|
-
catch (statusError) {
|
|
173
|
-
logger.error("Critical error during initial Obsidian API status check after multiple retries. Check OBSIDIAN_BASE_URL, OBSIDIAN_API_KEY, and plugin status.", {
|
|
174
|
-
...startupContext,
|
|
175
|
-
error: statusError instanceof Error
|
|
176
|
-
? statusError.message
|
|
177
|
-
: String(statusError),
|
|
178
|
-
stack: statusError instanceof Error ? statusError.stack : undefined,
|
|
179
|
-
});
|
|
180
|
-
// Re-throw the final error to be caught by the main startup catch block, which will exit the process.
|
|
181
|
-
throw statusError;
|
|
182
|
-
}
|
|
183
|
-
// --- End Status Check ---
|
|
184
|
-
if (config.obsidianEnableCache) {
|
|
185
|
-
vaultCacheService = new VaultCacheService(obsidianService); // Instantiate Cache Service, passing Obsidian Service
|
|
186
|
-
logger.info("Vault cache is enabled and service is instantiated.", startupContext);
|
|
187
|
-
}
|
|
188
|
-
else {
|
|
189
|
-
logger.info("Vault cache is disabled by configuration.", startupContext);
|
|
190
|
-
}
|
|
191
|
-
logger.info("Shared services instantiated.", startupContext);
|
|
192
|
-
// --- End Service Instantiation ---
|
|
193
|
-
// Initialize the server instance and start the selected transport
|
|
194
|
-
logger.debug("Initializing and starting MCP server transport", startupContext);
|
|
195
|
-
// Start the server transport. Services are instantiated here and passed down.
|
|
196
|
-
// For stdio, this returns the McpServer instance.
|
|
197
|
-
// For http, it returns the http.Server instance.
|
|
198
|
-
const serverOrHttpInstance = await initializeAndStartServer(obsidianService, vaultCacheService);
|
|
199
|
-
if (transportType === "stdio" &&
|
|
200
|
-
serverOrHttpInstance instanceof McpServer) {
|
|
201
|
-
server = serverOrHttpInstance; // Store McpServer for stdio
|
|
202
|
-
logger.debug("Stored McpServer instance for stdio transport.", startupContext);
|
|
203
|
-
}
|
|
204
|
-
else if (transportType === "http" && serverOrHttpInstance) {
|
|
205
|
-
// The instance is of ServerType (http.Server or https.Server)
|
|
206
|
-
httpServerInstance = serverOrHttpInstance; // Store ServerType for http transport
|
|
207
|
-
logger.debug("Stored http.Server instance for http transport.", startupContext);
|
|
208
|
-
}
|
|
209
|
-
else if (transportType === "http") {
|
|
210
|
-
// This case should ideally not be reached if startHttpTransport always returns an http.Server
|
|
211
|
-
logger.warning("HTTP transport selected, but initializeAndStartServer did not return an http.Server instance.", startupContext);
|
|
212
|
-
}
|
|
213
|
-
// If initializeAndStartServer failed, it would have thrown an error,
|
|
214
|
-
// and execution would jump to the outer catch block.
|
|
215
|
-
logger.info(`${config.mcpServerName} is running with ${transportType} transport`, {
|
|
216
|
-
...startupContext,
|
|
217
|
-
startTime: new Date().toISOString(),
|
|
218
|
-
});
|
|
219
|
-
// --- Trigger Background Cache Build ---
|
|
220
|
-
if (config.obsidianEnableCache && vaultCacheService) {
|
|
221
|
-
// Start building the cache, but don't wait for it to finish.
|
|
222
|
-
// The server will be operational while the cache builds.
|
|
223
|
-
// Tools needing the cache should check its readiness state.
|
|
224
|
-
logger.info("Triggering background vault cache build...", startupContext);
|
|
225
|
-
// No 'await' here - run in background
|
|
226
|
-
vaultCacheService
|
|
227
|
-
.buildVaultCache()
|
|
228
|
-
.then(() => {
|
|
229
|
-
// Once the initial build is done, start the periodic refresh
|
|
230
|
-
vaultCacheService?.startPeriodicRefresh();
|
|
231
|
-
})
|
|
232
|
-
.catch((cacheBuildError) => {
|
|
233
|
-
// Log errors during the background build process
|
|
234
|
-
logger.error("Error occurred during background vault cache build", {
|
|
235
|
-
...startupContext, // Use startup context for correlation
|
|
236
|
-
operation: "BackgroundCacheBuild",
|
|
237
|
-
error: cacheBuildError instanceof Error
|
|
238
|
-
? cacheBuildError.message
|
|
239
|
-
: String(cacheBuildError),
|
|
240
|
-
stack: cacheBuildError instanceof Error
|
|
241
|
-
? cacheBuildError.stack
|
|
242
|
-
: undefined,
|
|
243
|
-
});
|
|
244
|
-
});
|
|
245
|
-
}
|
|
246
|
-
// --- End Cache Build Trigger ---
|
|
247
|
-
// --- Signal and Error Handling Setup ---
|
|
248
|
-
// Handle process signals for graceful shutdown
|
|
249
|
-
process.on("SIGTERM", () => shutdown("SIGTERM"));
|
|
250
|
-
process.on("SIGINT", () => shutdown("SIGINT"));
|
|
251
|
-
// Handle uncaught exceptions
|
|
252
|
-
process.on("uncaughtException", async (error) => {
|
|
253
|
-
const errorContext = {
|
|
254
|
-
...startupContext, // Include base context for correlation
|
|
255
|
-
event: "uncaughtException",
|
|
256
|
-
error: error instanceof Error ? error.message : String(error),
|
|
257
|
-
stack: error instanceof Error ? error.stack : undefined,
|
|
258
|
-
};
|
|
259
|
-
logger.error("Uncaught exception detected. Initiating shutdown...", errorContext);
|
|
260
|
-
// Attempt graceful shutdown; shutdown() handles its own errors.
|
|
261
|
-
await shutdown("uncaughtException");
|
|
262
|
-
// If shutdown fails internally, it will call process.exit(1).
|
|
263
|
-
// If shutdown succeeds, it calls process.exit(0).
|
|
264
|
-
// If shutdown itself throws unexpectedly *before* exiting, this process might terminate abruptly,
|
|
265
|
-
// but the core shutdown logic is handled within shutdown().
|
|
266
|
-
});
|
|
267
|
-
// Handle unhandled promise rejections
|
|
268
|
-
process.on("unhandledRejection", async (reason) => {
|
|
269
|
-
const rejectionContext = {
|
|
270
|
-
...startupContext, // Include base context for correlation
|
|
271
|
-
event: "unhandledRejection",
|
|
272
|
-
reason: reason instanceof Error ? reason.message : String(reason),
|
|
273
|
-
stack: reason instanceof Error ? reason.stack : undefined,
|
|
274
|
-
};
|
|
275
|
-
logger.error("Unhandled promise rejection detected. Initiating shutdown...", rejectionContext);
|
|
276
|
-
// Attempt graceful shutdown; shutdown() handles its own errors.
|
|
277
|
-
await shutdown("unhandledRejection");
|
|
278
|
-
// Similar logic as uncaughtException: shutdown handles its exit codes.
|
|
279
|
-
});
|
|
280
|
-
}
|
|
281
|
-
catch (error) {
|
|
282
|
-
// Handle critical startup errors (already logged by ErrorHandler or caught above)
|
|
283
|
-
// Log the final failure context, including error details, before exiting
|
|
284
|
-
logger.error("Critical error during startup, exiting.", {
|
|
285
|
-
...startupContext,
|
|
286
|
-
finalErrorContext: "Startup Failure",
|
|
287
|
-
error: error instanceof Error ? error.message : String(error),
|
|
288
|
-
stack: error instanceof Error ? error.stack : undefined,
|
|
289
|
-
});
|
|
290
|
-
process.exit(1);
|
|
291
|
-
}
|
|
292
|
-
};
|
|
293
|
-
// --- Async IIFE to allow top-level await ---
|
|
294
|
-
// This remains necessary because start() is async
|
|
295
|
-
(async () => {
|
|
296
|
-
// Start the application
|
|
297
|
-
await start();
|
|
298
|
-
})(); // End async IIFE
|
|
8
|
+
import { createApp } from '@cyanheads/mcp-ts-core';
|
|
9
|
+
import { getServerConfig } from './config/server-config.js';
|
|
10
|
+
import { allPromptDefinitions } from './mcp-server/prompts/definitions/index.js';
|
|
11
|
+
import { allResourceDefinitions } from './mcp-server/resources/definitions/index.js';
|
|
12
|
+
import { baseToolDefinitions, obsidianExecuteCommand, } from './mcp-server/tools/definitions/index.js';
|
|
13
|
+
import { initObsidianService } from './services/obsidian/obsidian-service.js';
|
|
14
|
+
const config = getServerConfig();
|
|
15
|
+
const tools = config.enableCommands
|
|
16
|
+
? [...baseToolDefinitions, obsidianExecuteCommand]
|
|
17
|
+
: baseToolDefinitions;
|
|
18
|
+
await createApp({
|
|
19
|
+
tools,
|
|
20
|
+
resources: allResourceDefinitions,
|
|
21
|
+
prompts: allPromptDefinitions,
|
|
22
|
+
setup() {
|
|
23
|
+
initObsidianService(config);
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;GAKG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,sBAAsB,EAAE,MAAM,6CAA6C,CAAC;AACrF,OAAO,EACL,mBAAmB,EACnB,sBAAsB,GACvB,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAC;AAE9E,MAAM,MAAM,GAAG,eAAe,EAAE,CAAC;AACjC,MAAM,KAAK,GAAG,MAAM,CAAC,cAAc;IACjC,CAAC,CAAC,CAAC,GAAG,mBAAmB,EAAE,sBAAsB,CAAC;IAClD,CAAC,CAAC,mBAAmB,CAAC;AAExB,MAAM,SAAS,CAAC;IACd,KAAK;IACL,SAAS,EAAE,sBAAsB;IACjC,OAAO,EAAE,oBAAoB;IAC7B,KAAK;QACH,mBAAmB,CAAC,MAAM,CAAC,CAAC;IAC9B,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Prompt registration barrel for obsidian-mcp-server.
|
|
3
|
+
* The server exposes a CRUD/search surface; no recurring multi-turn pattern
|
|
4
|
+
* benefits from a structured prompt template, so the array is intentionally empty.
|
|
5
|
+
* @module mcp-server/prompts/definitions/index
|
|
6
|
+
*/
|
|
7
|
+
export declare const allPromptDefinitions: never[];
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/prompts/definitions/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,oBAAoB,SAAK,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Prompt registration barrel for obsidian-mcp-server.
|
|
3
|
+
* The server exposes a CRUD/search surface; no recurring multi-turn pattern
|
|
4
|
+
* benefits from a structured prompt template, so the array is intentionally empty.
|
|
5
|
+
* @module mcp-server/prompts/definitions/index
|
|
6
|
+
*/
|
|
7
|
+
export const allPromptDefinitions = [];
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/mcp-server/prompts/definitions/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,oBAAoB,GAAG,EAAE,CAAC"}
|