obsidian-mcp-server 3.1.3 → 3.1.5
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 +3 -0
- package/Dockerfile +4 -0
- package/README.md +3 -1
- package/changelog/3.1.x/3.1.4.md +25 -0
- package/changelog/3.1.x/3.1.5.md +17 -0
- package/dist/index.js +1 -2
- package/dist/index.js.map +1 -1
- package/dist/mcp-server/resources/definitions/index.d.ts +11 -1
- package/dist/mcp-server/resources/definitions/index.d.ts.map +1 -1
- package/dist/mcp-server/resources/definitions/obsidian-status.resource.js +1 -1
- package/dist/mcp-server/resources/definitions/obsidian-status.resource.js.map +1 -1
- package/dist/mcp-server/resources/definitions/obsidian-vault-note.resource.d.ts +12 -1
- package/dist/mcp-server/resources/definitions/obsidian-vault-note.resource.d.ts.map +1 -1
- package/dist/mcp-server/resources/definitions/obsidian-vault-note.resource.js +17 -2
- package/dist/mcp-server/resources/definitions/obsidian-vault-note.resource.js.map +1 -1
- package/dist/mcp-server/tools/definitions/index.d.ts +100 -0
- package/dist/mcp-server/tools/definitions/index.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/obsidian-append-to-note.tool.d.ts +25 -0
- package/dist/mcp-server/tools/definitions/obsidian-append-to-note.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/obsidian-append-to-note.tool.js +31 -1
- package/dist/mcp-server/tools/definitions/obsidian-append-to-note.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/obsidian-get-note.tool.js +1 -1
- package/dist/mcp-server/tools/definitions/obsidian-get-note.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/obsidian-write-note.tool.d.ts +25 -0
- package/dist/mcp-server/tools/definitions/obsidian-write-note.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/obsidian-write-note.tool.js +31 -1
- package/dist/mcp-server/tools/definitions/obsidian-write-note.tool.js.map +1 -1
- package/package.json +2 -2
- package/server.json +3 -3
package/CLAUDE.md
CHANGED
|
@@ -206,6 +206,8 @@ async handler(input, ctx) {
|
|
|
206
206
|
}
|
|
207
207
|
```
|
|
208
208
|
|
|
209
|
+
**Declare contracts inline on each tool, even when they look similar across tools.** The contract is part of the tool's documented public surface — reading one tool definition file should give the full picture (input, output, errors, handler, format). Don't extract a shared `errors[]` constant or contract module to deduplicate; per-tool repetition is the intended cost of locality, and dynamic `recovery` hints often need tool-specific context anyway.
|
|
210
|
+
|
|
209
211
|
Services that accept `ctx` use the same resolver for parity. The Obsidian service threads `ctx` into `#throwForStatus` and spreads `ctx.recoveryFor(reason)` per status branch, so service-side throws carry the calling tool's contract recovery onto the wire:
|
|
210
212
|
|
|
211
213
|
```ts
|
|
@@ -288,6 +290,7 @@ Available skills:
|
|
|
288
290
|
| `add-test` | Scaffold test file for a tool, resource, or service |
|
|
289
291
|
| `field-test` | Exercise tools/resources/prompts with real inputs, verify behavior, report issues |
|
|
290
292
|
| `security-pass` | Audit server for MCP-flavored security gaps: output injection, scope blast radius, input sinks, tenant isolation |
|
|
293
|
+
| `tool-defs-analysis` | Audit MCP definition language across tools/resources/prompts — voice, leaks, defaults, recovery hints, sparsity, structure |
|
|
291
294
|
| `polish-docs-meta` | Finalize docs, README, metadata, and agent protocol for shipping |
|
|
292
295
|
| `release-and-publish` | Ship a release end-to-end across npm, MCP Registry, and GHCR |
|
|
293
296
|
| `maintenance` | Investigate changelogs, adopt upstream changes, sync skills to agent dirs |
|
package/Dockerfile
CHANGED
|
@@ -85,6 +85,10 @@ ARG PORT
|
|
|
85
85
|
# Set runtime environment variables
|
|
86
86
|
# Note: PORT is an automatic variable in many cloud environments (e.g., Cloud Run)
|
|
87
87
|
ENV MCP_HTTP_PORT=${PORT:-3010}
|
|
88
|
+
# Bind to all interfaces inside the container so the host's `-p` mapping can reach it;
|
|
89
|
+
# loopback would be unreachable from outside the container. For deployments beyond the
|
|
90
|
+
# operator's own machine, set MCP_AUTH_MODE=jwt or oauth — the default `none` plus this
|
|
91
|
+
# bind exposes the upstream OBSIDIAN_API_KEY to any caller that can reach the port.
|
|
88
92
|
ENV MCP_HTTP_HOST="0.0.0.0"
|
|
89
93
|
ENV MCP_TRANSPORT_TYPE="http"
|
|
90
94
|
ENV MCP_SESSION_MODE="stateless"
|
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
<div align="center">
|
|
9
9
|
|
|
10
|
-
[](https://www.npmjs.com/package/obsidian-mcp-server) [](https://www.npmjs.com/package/obsidian-mcp-server) [](./CHANGELOG.md) [](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) [](https://modelcontextprotocol.io/)
|
|
11
11
|
|
|
12
12
|
[](./LICENSE) [](https://www.typescriptlang.org/) [](https://bun.sh/)
|
|
13
13
|
|
|
@@ -320,6 +320,8 @@ docker run --rm -e OBSIDIAN_API_KEY=your-key -p 3010:3010 obsidian-mcp-server
|
|
|
320
320
|
|
|
321
321
|
The Dockerfile defaults to HTTP transport, stateless session mode, and logs to `/var/log/obsidian-mcp-server`. OpenTelemetry peer dependencies are installed by default — build with `--build-arg OTEL_ENABLED=false` to omit them.
|
|
322
322
|
|
|
323
|
+
The image binds to `0.0.0.0` inside the container (required for Docker port mapping). For any deployment reachable beyond your own machine, set `MCP_AUTH_MODE=jwt` (with `MCP_AUTH_SECRET_KEY`) or `oauth` — otherwise the listener forwards your `OBSIDIAN_API_KEY` to the vault on behalf of every caller.
|
|
324
|
+
|
|
323
325
|
## Project structure
|
|
324
326
|
|
|
325
327
|
| Directory | Purpose |
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
---
|
|
2
|
+
summary: Error contracts catch up to wire reality — obsidian://vault, obsidian_append_to_note, obsidian_write_note declare failure reasons (path_forbidden, note_missing, no_active_file, periodic_*, section_target_missing) the service already throws.
|
|
3
|
+
breaking: false
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# 3.1.4 — 2026-05-05
|
|
7
|
+
|
|
8
|
+
A discovery-side polish release: every failure mode the service already throws is now declared on the calling tool/resource, so the recovery hints reach the agent at `tools/list` and `resources/read` time rather than only after a failed call. New `tool-defs-analysis` skill bundles the audit pattern that surfaced the gaps. Adopts `@cyanheads/mcp-ts-core` 0.8.15.
|
|
9
|
+
|
|
10
|
+
## Added
|
|
11
|
+
|
|
12
|
+
- **`obsidian://vault/{+path}` resource — `errors[]` contract.** Declares `path_forbidden` (Forbidden) and `note_missing` (NotFound) so the resource's documented failure surface matches what `ObsidianService.getNote` already throws. Recovery hints flow to clients at `resources/list` time.
|
|
13
|
+
- **`obsidian_append_to_note` and `obsidian_write_note` — five additional declared reasons each.** `note_missing`, `no_active_file`, `periodic_not_found`, `periodic_disabled`, and `section_target_missing` were already raised by the service (and carried recovery hints via `ctx.recoveryFor`) but weren't part of the tool's published `errors[]` array. Now the agent sees the same recovery guidance at discovery time as at failure time.
|
|
14
|
+
- **`tool-defs-analysis` skill** — read-only audit of MCP definition language across tools, resources, and prompts. Walks every definition and checks 10 categories the LLM reads to decide whether and how to call: voice & tense, internal leaks, audience leaks, defaults, recovery hints, output descriptions, cross-references, sparsity, examples, structure. Complements `field-test` (behavior testing) and `security-pass` (security audit).
|
|
15
|
+
|
|
16
|
+
## Changed
|
|
17
|
+
|
|
18
|
+
- **`@cyanheads/mcp-ts-core` bumped from 0.8.13 to 0.8.15.** `disabledTool` is now re-exported from the package root, so `src/index.ts` imports it from `@cyanheads/mcp-ts-core` directly instead of the `/tools` subpath.
|
|
19
|
+
- **Heading-section nesting clarified.** `obsidian_get_note`, `obsidian_append_to_note`, and `obsidian_write_note` descriptions now spell out the `Parent::Child` syntax for nested heading targets and point at `format: "document-map"` for discovery.
|
|
20
|
+
- **`obsidian://vault/{+path}` description** drops the internal `NoteJson` type name in favor of "parsed note", and the `frontmatter` field's `.describe()` notes that values are strings, numbers, booleans, arrays, or nested objects rather than just calling them "an object".
|
|
21
|
+
- **Skills synced from upstream framework**: `api-canvas` adds the `spillover()` helper documentation; `add-tool`, `design-mcp-server`, and `api-errors` pick up the inline-contract-per-tool guidance; `api-workers` clarifies storage provider whitelist behavior. CLAUDE.md gains the matching note that error contracts stay inline on each tool rather than being extracted to a shared module.
|
|
22
|
+
|
|
23
|
+
## Fixed
|
|
24
|
+
|
|
25
|
+
- **`obsidian://status` description** swaps the path-revealing "authenticated probe to /vault/" wording for "authenticated request to the vault listing" — strips an internal endpoint leak from the LLM-facing surface.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
---
|
|
2
|
+
summary: Bump @cyanheads/mcp-ts-core ^0.8.15 → ^0.8.18 and document the auth requirement for HTTP deployments beyond loopback.
|
|
3
|
+
breaking: false
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# 3.1.5 — 2026-05-06
|
|
7
|
+
|
|
8
|
+
Maintenance release: framework dep refresh, paired skill sync, and a documentation clarification around HTTP transport posture. No source-code changes in this server.
|
|
9
|
+
|
|
10
|
+
## Changed
|
|
11
|
+
|
|
12
|
+
- **`@cyanheads/mcp-ts-core` `^0.8.15 → ^0.8.18`.** Three upstream patch releases roll up:
|
|
13
|
+
- `0.8.16` — fixes an HTTP SSE per-request retention leak. `closePerRequestInstances` now binds to the request `AbortSignal` so ungraceful client disconnects close the per-request `McpServer` / transport pair. Affects this server when run under HTTP transport; pure framework fix, no consumer code change needed.
|
|
14
|
+
- `0.8.17` — surfaces `ctx.sessionId` on `Context` for HTTP handlers (defined in `stateful` / `auto` mode; opt-in via `createApp({ context: { exposeStatelessSessionId: true } })` under stateless). This server doesn't currently key on it.
|
|
15
|
+
- `0.8.18` — fixes `ctx.auth.token` being silently stripped in `toAuthContext`, and types `token?: string` on the public `AuthContext`. Doesn't apply here — this server forwards its own `OBSIDIAN_API_KEY` upstream, not the caller's bearer.
|
|
16
|
+
- **`skills/api-context` `1.2 → 1.3`.** Picks up the upstream skill update covering `ctx.sessionId` — defined-when matrix across transport / session / auth modes, the stateless opt-in, capability-token coherence note, and strict / lax state-keying recipes.
|
|
17
|
+
- **README + Dockerfile clarify auth requirement for non-loopback HTTP deployments.** The Docker image binds `MCP_HTTP_HOST=0.0.0.0` (required so the host's `-p` port mapping can reach the listener inside the container), and `MCP_AUTH_MODE` defaults to `none`. The README's Docker section and a new comment in the Dockerfile both now call this out and recommend `MCP_AUTH_MODE=jwt` or `oauth` for any deployment reachable beyond the operator's machine. Thanks to Ryan for surfacing the gap.
|
package/dist/index.js
CHANGED
|
@@ -5,8 +5,7 @@
|
|
|
5
5
|
* `getObsidianService()`.
|
|
6
6
|
* @module index
|
|
7
7
|
*/
|
|
8
|
-
import { createApp } from '@cyanheads/mcp-ts-core';
|
|
9
|
-
import { disabledTool } from '@cyanheads/mcp-ts-core/tools';
|
|
8
|
+
import { createApp, disabledTool } from '@cyanheads/mcp-ts-core';
|
|
10
9
|
import { requestContextService } from '@cyanheads/mcp-ts-core/utils';
|
|
11
10
|
import { getServerConfig } from './config/server-config.js';
|
|
12
11
|
import { allPromptDefinitions } from './mcp-server/prompts/definitions/index.js';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;GAKG;AAEH,OAAO,EAAE,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;GAKG;AAEH,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,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,sBAAsB,EACtB,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAE,mBAAm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AAG,MAAM,CAAC,QAAQ,EAAE;IACpB,cAAc,EAAE,MAAM,CAAC,cAAc,IAAI,CAAC,MAAM,CAAC,QAAQ;CAC1D,CAAC,CAAC;AACH,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,aAAa,EAAE,SAAS,CAAC,CAAC;AAC/C,IAAI,MAAM,CAAC,yBAAyB,EAAE,CAAC;IACrC,QAAQ,CAAC,MAAM,CAAC,OAAO,CACrB,uHAAuH,EACvH,SAAS,CACV,CAAC;AACJ,CAAC"}
|
|
@@ -32,5 +32,15 @@ export declare const allResourceDefinitions: (import("@cyanheads/mcp-ts-core").R
|
|
|
32
32
|
mtime: import("zod").ZodNumber;
|
|
33
33
|
size: import("zod").ZodNumber;
|
|
34
34
|
}, import("zod/v4/core").$strip>;
|
|
35
|
-
}, import("zod/v4/core").$strip>,
|
|
35
|
+
}, import("zod/v4/core").$strip>, readonly [{
|
|
36
|
+
readonly reason: "path_forbidden";
|
|
37
|
+
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.Forbidden;
|
|
38
|
+
readonly when: "The requested path is outside OBSIDIAN_READ_PATHS (and OBSIDIAN_WRITE_PATHS, since write paths imply read access).";
|
|
39
|
+
readonly recovery: "Use a path inside the configured read scope. The error data echoes the active scope.";
|
|
40
|
+
}, {
|
|
41
|
+
readonly reason: "note_missing";
|
|
42
|
+
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound;
|
|
43
|
+
readonly when: "The vault path does not resolve to an existing note.";
|
|
44
|
+
readonly recovery: "Verify the path with obsidian_list_notes or use obsidian_search_notes to locate the note.";
|
|
45
|
+
}]>)[];
|
|
36
46
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,eAAO,MAAM,sBAAsB
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAAoD,CAAC"}
|
|
@@ -17,7 +17,7 @@ export const obsidianStatus = resource('obsidian://status', {
|
|
|
17
17
|
service: z.string().describe('Service identifier returned by the plugin.'),
|
|
18
18
|
authenticated: z
|
|
19
19
|
.boolean()
|
|
20
|
-
.describe('True when the configured OBSIDIAN_API_KEY is accepted by an authenticated
|
|
20
|
+
.describe('True when the configured OBSIDIAN_API_KEY is accepted by an authenticated request to the vault listing.'),
|
|
21
21
|
versions: z
|
|
22
22
|
.object({
|
|
23
23
|
obsidian: z.string().optional().describe('Obsidian app version, when reported.'),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"obsidian-status.resource.js","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/obsidian-status.resource.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAE7E,MAAM,CAAC,MAAM,cAAc,GAAG,QAAQ,CAAC,mBAAmB,EAAE;IAC1D,IAAI,EAAE,iBAAiB;IACvB,WAAW,EACT,uQAAuQ;IACzQ,QAAQ,EAAE,kBAAkB;IAC5B,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC;IACpB,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,kCAAkC,CAAC;QAC/D,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,4CAA4C,CAAC;QAC1E,aAAa,EAAE,CAAC;aACb,OAAO,EAAE;aACT,QAAQ,CACP,
|
|
1
|
+
{"version":3,"file":"obsidian-status.resource.js","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/obsidian-status.resource.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAE7E,MAAM,CAAC,MAAM,cAAc,GAAG,QAAQ,CAAC,mBAAmB,EAAE;IAC1D,IAAI,EAAE,iBAAiB;IACvB,WAAW,EACT,uQAAuQ;IACzQ,QAAQ,EAAE,kBAAkB;IAC5B,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC;IACpB,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,kCAAkC,CAAC;QAC/D,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,4CAA4C,CAAC;QAC1E,aAAa,EAAE,CAAC;aACb,OAAO,EAAE;aACT,QAAQ,CACP,yGAAyG,CAC1G;QACH,QAAQ,EAAE,CAAC;aACR,MAAM,CAAC;YACN,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,sCAAsC,CAAC;YAChF,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,+CAA+C,CAAC;SACtF,CAAC;aACD,QAAQ,EAAE;aACV,QAAQ,CAAC,oDAAoD,CAAC;QACjE,QAAQ,EAAE,CAAC;aACR,MAAM,CAAC;YACN,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,qBAAqB,CAAC;YAC9C,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,sBAAsB,CAAC;YACjD,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,iBAAiB,CAAC;SAChD,CAAC;aACD,QAAQ,EAAE;aACV,QAAQ,CAAC,iCAAiC,CAAC;KAC/C,CAAC;IACF,IAAI,EAAE,CAAC,+BAA+B,CAAC;IAEvC,KAAK,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG;QACxB,MAAM,GAAG,GAAG,kBAAkB,EAAE,CAAC;QACjC,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;YAChD,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC;YAClB,GAAG,CAAC,kBAAkB,CAAC,GAAG,CAAC;SAC5B,CAAC,CAAC;QACH,OAAO,EAAE,GAAG,MAAM,EAAE,aAAa,EAAE,CAAC;IACtC,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* @module mcp-server/resources/definitions/obsidian-vault-note.resource
|
|
6
6
|
*/
|
|
7
7
|
import { z } from '@cyanheads/mcp-ts-core';
|
|
8
|
+
import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
|
|
8
9
|
export declare const obsidianVaultNote: import("@cyanheads/mcp-ts-core").ResourceDefinition<z.ZodObject<{
|
|
9
10
|
path: z.ZodString;
|
|
10
11
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -17,5 +18,15 @@ export declare const obsidianVaultNote: import("@cyanheads/mcp-ts-core").Resourc
|
|
|
17
18
|
mtime: z.ZodNumber;
|
|
18
19
|
size: z.ZodNumber;
|
|
19
20
|
}, z.core.$strip>;
|
|
20
|
-
}, z.core.$strip>,
|
|
21
|
+
}, z.core.$strip>, readonly [{
|
|
22
|
+
readonly reason: "path_forbidden";
|
|
23
|
+
readonly code: JsonRpcErrorCode.Forbidden;
|
|
24
|
+
readonly when: "The requested path is outside OBSIDIAN_READ_PATHS (and OBSIDIAN_WRITE_PATHS, since write paths imply read access).";
|
|
25
|
+
readonly recovery: "Use a path inside the configured read scope. The error data echoes the active scope.";
|
|
26
|
+
}, {
|
|
27
|
+
readonly reason: "note_missing";
|
|
28
|
+
readonly code: JsonRpcErrorCode.NotFound;
|
|
29
|
+
readonly when: "The vault path does not resolve to an existing note.";
|
|
30
|
+
readonly recovery: "Verify the path with obsidian_list_notes or use obsidian_search_notes to locate the note.";
|
|
31
|
+
}]>;
|
|
21
32
|
//# sourceMappingURL=obsidian-vault-note.resource.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"obsidian-vault-note.resource.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/obsidian-vault-note.resource.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAY,CAAC,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"obsidian-vault-note.resource.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/obsidian-vault-note.resource.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAY,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAGjE,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;GAgD5B,CAAC"}
|
|
@@ -5,10 +5,11 @@
|
|
|
5
5
|
* @module mcp-server/resources/definitions/obsidian-vault-note.resource
|
|
6
6
|
*/
|
|
7
7
|
import { resource, z } from '@cyanheads/mcp-ts-core';
|
|
8
|
+
import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
|
|
8
9
|
import { getObsidianService } from '../../../services/obsidian/obsidian-service.js';
|
|
9
10
|
export const obsidianVaultNote = resource('obsidian://vault/{+path}', {
|
|
10
11
|
name: 'obsidian-vault-note',
|
|
11
|
-
description: 'A note in the Obsidian vault. Returns the parsed
|
|
12
|
+
description: 'A note in the Obsidian vault. Returns the parsed note — content, frontmatter, tags, and stat — so clients can attach a specific note to a conversation.',
|
|
12
13
|
mimeType: 'application/json',
|
|
13
14
|
params: z.object({
|
|
14
15
|
path: z.string().min(1).describe('Vault-relative path of the note, including extension.'),
|
|
@@ -18,7 +19,7 @@ export const obsidianVaultNote = resource('obsidian://vault/{+path}', {
|
|
|
18
19
|
content: z.string().describe('Raw markdown body.'),
|
|
19
20
|
frontmatter: z
|
|
20
21
|
.record(z.string(), z.unknown())
|
|
21
|
-
.describe('Parsed YAML frontmatter
|
|
22
|
+
.describe('Parsed YAML frontmatter. Values are strings, numbers, booleans, arrays, or nested objects.'),
|
|
22
23
|
tags: z.array(z.string()).describe('Tags from frontmatter and inline #tag syntax.'),
|
|
23
24
|
stat: z
|
|
24
25
|
.object({
|
|
@@ -29,6 +30,20 @@ export const obsidianVaultNote = resource('obsidian://vault/{+path}', {
|
|
|
29
30
|
.describe('File metadata.'),
|
|
30
31
|
}),
|
|
31
32
|
auth: ['resource:obsidian-vault-note:read'],
|
|
33
|
+
errors: [
|
|
34
|
+
{
|
|
35
|
+
reason: 'path_forbidden',
|
|
36
|
+
code: JsonRpcErrorCode.Forbidden,
|
|
37
|
+
when: 'The requested path is outside OBSIDIAN_READ_PATHS (and OBSIDIAN_WRITE_PATHS, since write paths imply read access).',
|
|
38
|
+
recovery: 'Use a path inside the configured read scope. The error data echoes the active scope.',
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
reason: 'note_missing',
|
|
42
|
+
code: JsonRpcErrorCode.NotFound,
|
|
43
|
+
when: 'The vault path does not resolve to an existing note.',
|
|
44
|
+
recovery: 'Verify the path with obsidian_list_notes or use obsidian_search_notes to locate the note.',
|
|
45
|
+
},
|
|
46
|
+
],
|
|
32
47
|
async handler(params, ctx) {
|
|
33
48
|
const svc = getObsidianService();
|
|
34
49
|
const note = await svc.getNoteJson(ctx, { type: 'path', path: params.path });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"obsidian-vault-note.resource.js","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/obsidian-vault-note.resource.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAE7E,MAAM,CAAC,MAAM,iBAAiB,GAAG,QAAQ,CAAC,0BAA0B,EAAE;IACpE,IAAI,EAAE,qBAAqB;IAC3B,WAAW,EACT,
|
|
1
|
+
{"version":3,"file":"obsidian-vault-note.resource.js","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/obsidian-vault-note.resource.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAE7E,MAAM,CAAC,MAAM,iBAAiB,GAAG,QAAQ,CAAC,0BAA0B,EAAE;IACpE,IAAI,EAAE,qBAAqB;IAC3B,WAAW,EACT,yJAAyJ;IAC3J,QAAQ,EAAE,kBAAkB;IAC5B,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,uDAAuD,CAAC;KAC1F,CAAC;IACF,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,kCAAkC,CAAC;QAC7D,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,oBAAoB,CAAC;QAClD,WAAW,EAAE,CAAC;aACX,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC;aAC/B,QAAQ,CACP,4FAA4F,CAC7F;QACH,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,CAAC,+CAA+C,CAAC;QACnF,IAAI,EAAE,CAAC;aACJ,MAAM,CAAC;YACN,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,+BAA+B,CAAC;YAC3D,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,gCAAgC,CAAC;YAC5D,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,qBAAqB,CAAC;SACjD,CAAC;aACD,QAAQ,CAAC,gBAAgB,CAAC;KAC9B,CAAC;IACF,IAAI,EAAE,CAAC,mCAAmC,CAAC;IAC3C,MAAM,EAAE;QACN;YACE,MAAM,EAAE,gBAAgB;YACxB,IAAI,EAAE,gBAAgB,CAAC,SAAS;YAChC,IAAI,EAAE,oHAAoH;YAC1H,QAAQ,EACN,sFAAsF;SACzF;QACD;YACE,MAAM,EAAE,cAAc;YACtB,IAAI,EAAE,gBAAgB,CAAC,QAAQ;YAC/B,IAAI,EAAE,sDAAsD;YAC5D,QAAQ,EACN,2FAA2F;SAC9F;KACF;IAED,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG;QACvB,MAAM,GAAG,GAAG,kBAAkB,EAAE,CAAC;QACjC,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,WAAW,CAAC,GAAG,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;QAC7E,OAAO,IAAI,CAAC;IACd,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -289,6 +289,31 @@ export declare const writeToolDefinitions: (import("@cyanheads/mcp-ts-core").Too
|
|
|
289
289
|
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.Forbidden;
|
|
290
290
|
readonly when: "The target path is outside OBSIDIAN_WRITE_PATHS, or OBSIDIAN_READ_ONLY=true denies all writes.";
|
|
291
291
|
readonly recovery: "Use a path inside the configured write scope. The error data echoes the active scope.";
|
|
292
|
+
}, {
|
|
293
|
+
readonly reason: "note_missing";
|
|
294
|
+
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound;
|
|
295
|
+
readonly when: "Section append targets a path that does not resolve to an existing note (PATCH requires the file to exist).";
|
|
296
|
+
readonly recovery: "Verify the path with obsidian_list_notes, or omit `section` to fall back to whole-file append (which creates the note if missing).";
|
|
297
|
+
}, {
|
|
298
|
+
readonly reason: "no_active_file";
|
|
299
|
+
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound;
|
|
300
|
+
readonly when: "Target was `active` but no file is currently open in Obsidian.";
|
|
301
|
+
readonly recovery: "Call obsidian_open_in_ui to focus a file, or pass an explicit path target instead.";
|
|
302
|
+
}, {
|
|
303
|
+
readonly reason: "periodic_not_found";
|
|
304
|
+
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound;
|
|
305
|
+
readonly when: "Target was `periodic` but no matching periodic note exists.";
|
|
306
|
+
readonly recovery: "Create the periodic note first or pass an explicit path target.";
|
|
307
|
+
}, {
|
|
308
|
+
readonly reason: "periodic_disabled";
|
|
309
|
+
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError;
|
|
310
|
+
readonly when: "Target was `periodic` but the requested period is not enabled in Obsidian's Periodic Notes plugin settings.";
|
|
311
|
+
readonly recovery: "Pass an explicit path target — the requested period is disabled in the operator's Periodic Notes plugin.";
|
|
312
|
+
}, {
|
|
313
|
+
readonly reason: "section_target_missing";
|
|
314
|
+
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError;
|
|
315
|
+
readonly when: "`section` was provided but the named heading/block/frontmatter field does not exist in the note.";
|
|
316
|
+
readonly recovery: "Call obsidian_get_note with format document-map to discover available targets, or pass createTargetIfMissing: true to bring it into existence.";
|
|
292
317
|
}]> | import("@cyanheads/mcp-ts-core").ToolDefinition<import("zod").ZodObject<{
|
|
293
318
|
target: import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
|
|
294
319
|
type: import("zod").ZodLiteral<"path">;
|
|
@@ -684,6 +709,31 @@ export declare const writeToolDefinitions: (import("@cyanheads/mcp-ts-core").Too
|
|
|
684
709
|
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.Forbidden;
|
|
685
710
|
readonly when: "The target path is outside OBSIDIAN_WRITE_PATHS, or OBSIDIAN_READ_ONLY=true denies all writes.";
|
|
686
711
|
readonly recovery: "Use a path inside the configured write scope. The error data echoes the active scope.";
|
|
712
|
+
}, {
|
|
713
|
+
readonly reason: "note_missing";
|
|
714
|
+
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound;
|
|
715
|
+
readonly when: "Section replace targets a path that does not resolve to an existing note (PATCH requires the file to exist).";
|
|
716
|
+
readonly recovery: "Verify the path with obsidian_list_notes, or omit `section` to fall back to whole-file write (which creates the note when it is absent).";
|
|
717
|
+
}, {
|
|
718
|
+
readonly reason: "no_active_file";
|
|
719
|
+
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound;
|
|
720
|
+
readonly when: "Target was `active` but no file is currently open in Obsidian.";
|
|
721
|
+
readonly recovery: "Call obsidian_open_in_ui to focus a file, or pass an explicit path target instead.";
|
|
722
|
+
}, {
|
|
723
|
+
readonly reason: "periodic_not_found";
|
|
724
|
+
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound;
|
|
725
|
+
readonly when: "Target was `periodic` but no matching periodic note exists.";
|
|
726
|
+
readonly recovery: "Create the periodic note first or pass an explicit path target.";
|
|
727
|
+
}, {
|
|
728
|
+
readonly reason: "periodic_disabled";
|
|
729
|
+
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError;
|
|
730
|
+
readonly when: "Target was `periodic` but the requested period is not enabled in Obsidian's Periodic Notes plugin settings.";
|
|
731
|
+
readonly recovery: "Pass an explicit path target — the requested period is disabled in the operator's Periodic Notes plugin.";
|
|
732
|
+
}, {
|
|
733
|
+
readonly reason: "section_target_missing";
|
|
734
|
+
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError;
|
|
735
|
+
readonly when: "`section` was provided but the named heading/block/frontmatter field does not exist in the note.";
|
|
736
|
+
readonly recovery: "Call obsidian_get_note with format document-map to discover available targets.";
|
|
687
737
|
}]>)[];
|
|
688
738
|
/** Combined base set — preserves the previous registration order. */
|
|
689
739
|
export declare const baseToolDefinitions: (import("@cyanheads/mcp-ts-core").ToolDefinition<import("zod").ZodObject<{
|
|
@@ -725,6 +775,31 @@ export declare const baseToolDefinitions: (import("@cyanheads/mcp-ts-core").Tool
|
|
|
725
775
|
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.Forbidden;
|
|
726
776
|
readonly when: "The target path is outside OBSIDIAN_WRITE_PATHS, or OBSIDIAN_READ_ONLY=true denies all writes.";
|
|
727
777
|
readonly recovery: "Use a path inside the configured write scope. The error data echoes the active scope.";
|
|
778
|
+
}, {
|
|
779
|
+
readonly reason: "note_missing";
|
|
780
|
+
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound;
|
|
781
|
+
readonly when: "Section append targets a path that does not resolve to an existing note (PATCH requires the file to exist).";
|
|
782
|
+
readonly recovery: "Verify the path with obsidian_list_notes, or omit `section` to fall back to whole-file append (which creates the note if missing).";
|
|
783
|
+
}, {
|
|
784
|
+
readonly reason: "no_active_file";
|
|
785
|
+
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound;
|
|
786
|
+
readonly when: "Target was `active` but no file is currently open in Obsidian.";
|
|
787
|
+
readonly recovery: "Call obsidian_open_in_ui to focus a file, or pass an explicit path target instead.";
|
|
788
|
+
}, {
|
|
789
|
+
readonly reason: "periodic_not_found";
|
|
790
|
+
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound;
|
|
791
|
+
readonly when: "Target was `periodic` but no matching periodic note exists.";
|
|
792
|
+
readonly recovery: "Create the periodic note first or pass an explicit path target.";
|
|
793
|
+
}, {
|
|
794
|
+
readonly reason: "periodic_disabled";
|
|
795
|
+
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError;
|
|
796
|
+
readonly when: "Target was `periodic` but the requested period is not enabled in Obsidian's Periodic Notes plugin settings.";
|
|
797
|
+
readonly recovery: "Pass an explicit path target — the requested period is disabled in the operator's Periodic Notes plugin.";
|
|
798
|
+
}, {
|
|
799
|
+
readonly reason: "section_target_missing";
|
|
800
|
+
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError;
|
|
801
|
+
readonly when: "`section` was provided but the named heading/block/frontmatter field does not exist in the note.";
|
|
802
|
+
readonly recovery: "Call obsidian_get_note with format document-map to discover available targets, or pass createTargetIfMissing: true to bring it into existence.";
|
|
728
803
|
}]> | import("@cyanheads/mcp-ts-core").ToolDefinition<import("zod").ZodObject<{
|
|
729
804
|
target: import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
|
|
730
805
|
type: import("zod").ZodLiteral<"path">;
|
|
@@ -1360,6 +1435,31 @@ export declare const baseToolDefinitions: (import("@cyanheads/mcp-ts-core").Tool
|
|
|
1360
1435
|
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.Forbidden;
|
|
1361
1436
|
readonly when: "The target path is outside OBSIDIAN_WRITE_PATHS, or OBSIDIAN_READ_ONLY=true denies all writes.";
|
|
1362
1437
|
readonly recovery: "Use a path inside the configured write scope. The error data echoes the active scope.";
|
|
1438
|
+
}, {
|
|
1439
|
+
readonly reason: "note_missing";
|
|
1440
|
+
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound;
|
|
1441
|
+
readonly when: "Section replace targets a path that does not resolve to an existing note (PATCH requires the file to exist).";
|
|
1442
|
+
readonly recovery: "Verify the path with obsidian_list_notes, or omit `section` to fall back to whole-file write (which creates the note when it is absent).";
|
|
1443
|
+
}, {
|
|
1444
|
+
readonly reason: "no_active_file";
|
|
1445
|
+
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound;
|
|
1446
|
+
readonly when: "Target was `active` but no file is currently open in Obsidian.";
|
|
1447
|
+
readonly recovery: "Call obsidian_open_in_ui to focus a file, or pass an explicit path target instead.";
|
|
1448
|
+
}, {
|
|
1449
|
+
readonly reason: "periodic_not_found";
|
|
1450
|
+
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound;
|
|
1451
|
+
readonly when: "Target was `periodic` but no matching periodic note exists.";
|
|
1452
|
+
readonly recovery: "Create the periodic note first or pass an explicit path target.";
|
|
1453
|
+
}, {
|
|
1454
|
+
readonly reason: "periodic_disabled";
|
|
1455
|
+
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError;
|
|
1456
|
+
readonly when: "Target was `periodic` but the requested period is not enabled in Obsidian's Periodic Notes plugin settings.";
|
|
1457
|
+
readonly recovery: "Pass an explicit path target — the requested period is disabled in the operator's Periodic Notes plugin.";
|
|
1458
|
+
}, {
|
|
1459
|
+
readonly reason: "section_target_missing";
|
|
1460
|
+
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError;
|
|
1461
|
+
readonly when: "`section` was provided but the named heading/block/frontmatter field does not exist in the note.";
|
|
1462
|
+
readonly recovery: "Call obsidian_get_note with format document-map to discover available targets.";
|
|
1363
1463
|
}]>)[];
|
|
1364
1464
|
/** Command-palette tools — opt-in via `OBSIDIAN_ENABLE_COMMANDS=true`; suppressed by `OBSIDIAN_READ_ONLY=true`. */
|
|
1365
1465
|
export declare const commandToolDefinitions: (import("@cyanheads/mcp-ts-core").ToolDefinition<import("zod").ZodObject<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAiBH,gFAAgF;AAChF,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAM/B,CAAC;AAEF,kFAAkF;AAClF,eAAO,MAAM,oBAAoB
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAiBH,gFAAgF;AAChF,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAM/B,CAAC;AAEF,kFAAkF;AAClF,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAAoD,CAAC;AAErF,mHAAmH;AACnH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;+CAAiD,CAAC"}
|
|
@@ -44,5 +44,30 @@ export declare const obsidianAppendToNote: import("@cyanheads/mcp-ts-core").Tool
|
|
|
44
44
|
readonly code: JsonRpcErrorCode.Forbidden;
|
|
45
45
|
readonly when: "The target path is outside OBSIDIAN_WRITE_PATHS, or OBSIDIAN_READ_ONLY=true denies all writes.";
|
|
46
46
|
readonly recovery: "Use a path inside the configured write scope. The error data echoes the active scope.";
|
|
47
|
+
}, {
|
|
48
|
+
readonly reason: "note_missing";
|
|
49
|
+
readonly code: JsonRpcErrorCode.NotFound;
|
|
50
|
+
readonly when: "Section append targets a path that does not resolve to an existing note (PATCH requires the file to exist).";
|
|
51
|
+
readonly recovery: "Verify the path with obsidian_list_notes, or omit `section` to fall back to whole-file append (which creates the note if missing).";
|
|
52
|
+
}, {
|
|
53
|
+
readonly reason: "no_active_file";
|
|
54
|
+
readonly code: JsonRpcErrorCode.NotFound;
|
|
55
|
+
readonly when: "Target was `active` but no file is currently open in Obsidian.";
|
|
56
|
+
readonly recovery: "Call obsidian_open_in_ui to focus a file, or pass an explicit path target instead.";
|
|
57
|
+
}, {
|
|
58
|
+
readonly reason: "periodic_not_found";
|
|
59
|
+
readonly code: JsonRpcErrorCode.NotFound;
|
|
60
|
+
readonly when: "Target was `periodic` but no matching periodic note exists.";
|
|
61
|
+
readonly recovery: "Create the periodic note first or pass an explicit path target.";
|
|
62
|
+
}, {
|
|
63
|
+
readonly reason: "periodic_disabled";
|
|
64
|
+
readonly code: JsonRpcErrorCode.ValidationError;
|
|
65
|
+
readonly when: "Target was `periodic` but the requested period is not enabled in Obsidian's Periodic Notes plugin settings.";
|
|
66
|
+
readonly recovery: "Pass an explicit path target — the requested period is disabled in the operator's Periodic Notes plugin.";
|
|
67
|
+
}, {
|
|
68
|
+
readonly reason: "section_target_missing";
|
|
69
|
+
readonly code: JsonRpcErrorCode.ValidationError;
|
|
70
|
+
readonly when: "`section` was provided but the named heading/block/frontmatter field does not exist in the note.";
|
|
71
|
+
readonly recovery: "Call obsidian_get_note with format document-map to discover available targets, or pass createTargetIfMissing: true to bring it into existence.";
|
|
47
72
|
}]>;
|
|
48
73
|
//# sourceMappingURL=obsidian-append-to-note.tool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"obsidian-append-to-note.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/obsidian-append-to-note.tool.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAIjE,eAAO,MAAM,oBAAoB
|
|
1
|
+
{"version":3,"file":"obsidian-append-to-note.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/obsidian-append-to-note.tool.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAIjE,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoG/B,CAAC"}
|
|
@@ -8,7 +8,7 @@ import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
|
|
|
8
8
|
import { getObsidianService } from '../../../services/obsidian/obsidian-service.js';
|
|
9
9
|
import { ContentTypeSchema, SectionSchema, TargetSchema } from './_shared/schemas.js';
|
|
10
10
|
export const obsidianAppendToNote = tool('obsidian_append_to_note', {
|
|
11
|
-
description: 'Append content to a note. Without `section`, the body is appended to the end of the file. With `section`, the content is appended to the end of that heading/block/frontmatter. For block-reference targets, content is concatenated adjacent to the block line without inserting a separator — include a leading newline in `content` if you want one. Set `createTargetIfMissing` to bring the target section into existence rather than failing when it does not exist.',
|
|
11
|
+
description: 'Append content to a note. Without `section`, the body is appended to the end of the file. With `section`, the content is appended to the end of that heading/block/frontmatter; nested headings need `Parent::Child` syntax — use `obsidian_get_note` with `format: "document-map"` to discover available targets. For block-reference targets, content is concatenated adjacent to the block line without inserting a separator — include a leading newline in `content` if you want one. Set `createTargetIfMissing` to bring the target section into existence rather than failing when it does not exist.',
|
|
12
12
|
annotations: { destructiveHint: true },
|
|
13
13
|
input: z.object({
|
|
14
14
|
target: TargetSchema.describe('Where the note lives.'),
|
|
@@ -34,6 +34,36 @@ export const obsidianAppendToNote = tool('obsidian_append_to_note', {
|
|
|
34
34
|
when: 'The target path is outside OBSIDIAN_WRITE_PATHS, or OBSIDIAN_READ_ONLY=true denies all writes.',
|
|
35
35
|
recovery: 'Use a path inside the configured write scope. The error data echoes the active scope.',
|
|
36
36
|
},
|
|
37
|
+
{
|
|
38
|
+
reason: 'note_missing',
|
|
39
|
+
code: JsonRpcErrorCode.NotFound,
|
|
40
|
+
when: 'Section append targets a path that does not resolve to an existing note (PATCH requires the file to exist).',
|
|
41
|
+
recovery: 'Verify the path with obsidian_list_notes, or omit `section` to fall back to whole-file append (which creates the note if missing).',
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
reason: 'no_active_file',
|
|
45
|
+
code: JsonRpcErrorCode.NotFound,
|
|
46
|
+
when: 'Target was `active` but no file is currently open in Obsidian.',
|
|
47
|
+
recovery: 'Call obsidian_open_in_ui to focus a file, or pass an explicit path target instead.',
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
reason: 'periodic_not_found',
|
|
51
|
+
code: JsonRpcErrorCode.NotFound,
|
|
52
|
+
when: 'Target was `periodic` but no matching periodic note exists.',
|
|
53
|
+
recovery: 'Create the periodic note first or pass an explicit path target.',
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
reason: 'periodic_disabled',
|
|
57
|
+
code: JsonRpcErrorCode.ValidationError,
|
|
58
|
+
when: "Target was `periodic` but the requested period is not enabled in Obsidian's Periodic Notes plugin settings.",
|
|
59
|
+
recovery: "Pass an explicit path target — the requested period is disabled in the operator's Periodic Notes plugin.",
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
reason: 'section_target_missing',
|
|
63
|
+
code: JsonRpcErrorCode.ValidationError,
|
|
64
|
+
when: '`section` was provided but the named heading/block/frontmatter field does not exist in the note.',
|
|
65
|
+
recovery: 'Call obsidian_get_note with format document-map to discover available targets, or pass createTargetIfMissing: true to bring it into existence.',
|
|
66
|
+
},
|
|
37
67
|
],
|
|
38
68
|
async handler(input, ctx) {
|
|
39
69
|
const svc = getObsidianService();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"obsidian-append-to-note.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/obsidian-append-to-note.tool.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAC7E,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEtF,MAAM,CAAC,MAAM,oBAAoB,GAAG,IAAI,CAAC,yBAAyB,EAAE;IAClE,WAAW,EACT
|
|
1
|
+
{"version":3,"file":"obsidian-append-to-note.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/obsidian-append-to-note.tool.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,MAAM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AC,GAAG,EAAE,MAAM,EAAE,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC;QACtE,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,WAAW,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;QAChD,OAAO,EAAE,IAAI,EAAE,eAAe,EAAE,KAAK,EAAE,CAAC;IAC1C,CAAC;IAED,MAAM,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC;QAClB;YACE,IAAI,EAAE,MAAM;YACZ,IAAI,EAAE;gBACJ,iBAAiB,MAAM,CAAC,IAAI,IAAI;gBAChC,uBAAuB,MAAM,CAAC,eAAe,EAAE;aAChD,CAAC,IAAI,CAAC,IAAI,CAAC;SACb;KACF;CACF,CAAC,CAAC"}
|
|
@@ -20,7 +20,7 @@ export const obsidianGetNote = tool('obsidian_get_note', {
|
|
|
20
20
|
input: z.object({
|
|
21
21
|
format: z
|
|
22
22
|
.enum(['content', 'full', 'document-map', 'section'])
|
|
23
|
-
.describe('Which projection to return. `content` — raw markdown body. `full` — content plus parsed frontmatter, tags, and file metadata. `document-map` — catalog of headings, block IDs, and frontmatter field names (use to discover patch targets). `section` — a single heading, block, or frontmatter section (requires `section`); heading sections include the full subtree under that heading.'),
|
|
23
|
+
.describe('Which projection to return. `content` — raw markdown body. `full` — content plus parsed frontmatter, tags, and file metadata. `document-map` — catalog of headings, block IDs, and frontmatter field names (use to discover patch targets). `section` — a single heading, block, or frontmatter section (requires `section`); heading sections include the full subtree under that heading and use `Parent::Child` syntax for nesting.'),
|
|
24
24
|
target: TargetSchema.describe('Where the note lives.'),
|
|
25
25
|
section: SectionSchema.optional().describe('Required when `format` is `"section"`. Identifies the heading/block/frontmatter to extract.'),
|
|
26
26
|
includeLinks: z
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"obsidian-get-note.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/obsidian-get-note.tool.ts"],"names":[],"mappings":"AAAA;;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I,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC;IACvD,CAAC;IAED;;;;OAIG;IACH,KAAK,MAAM,CAAC,IAAI,OAAO,CAAC,QAAQ,CAAC,oDAAoD,CAAC,EAAE,CAAC;QACvF,IAAI,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC;QAC1B,IAAI,CAAC,MAAM;YAAE,SAAS;QACtB,IAAI,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;YACnD,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;QACtC,CAAC;QACD,IAAI,MAAM,IAAI,CAAC,uBAAuB,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;YACpD,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC;QAC3C,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -50,5 +50,30 @@ export declare const obsidianWriteNote: import("@cyanheads/mcp-ts-core").ToolDef
|
|
|
50
50
|
readonly code: JsonRpcErrorCode.Forbidden;
|
|
51
51
|
readonly when: "The target path is outside OBSIDIAN_WRITE_PATHS, or OBSIDIAN_READ_ONLY=true denies all writes.";
|
|
52
52
|
readonly recovery: "Use a path inside the configured write scope. The error data echoes the active scope.";
|
|
53
|
+
}, {
|
|
54
|
+
readonly reason: "note_missing";
|
|
55
|
+
readonly code: JsonRpcErrorCode.NotFound;
|
|
56
|
+
readonly when: "Section replace targets a path that does not resolve to an existing note (PATCH requires the file to exist).";
|
|
57
|
+
readonly recovery: "Verify the path with obsidian_list_notes, or omit `section` to fall back to whole-file write (which creates the note when it is absent).";
|
|
58
|
+
}, {
|
|
59
|
+
readonly reason: "no_active_file";
|
|
60
|
+
readonly code: JsonRpcErrorCode.NotFound;
|
|
61
|
+
readonly when: "Target was `active` but no file is currently open in Obsidian.";
|
|
62
|
+
readonly recovery: "Call obsidian_open_in_ui to focus a file, or pass an explicit path target instead.";
|
|
63
|
+
}, {
|
|
64
|
+
readonly reason: "periodic_not_found";
|
|
65
|
+
readonly code: JsonRpcErrorCode.NotFound;
|
|
66
|
+
readonly when: "Target was `periodic` but no matching periodic note exists.";
|
|
67
|
+
readonly recovery: "Create the periodic note first or pass an explicit path target.";
|
|
68
|
+
}, {
|
|
69
|
+
readonly reason: "periodic_disabled";
|
|
70
|
+
readonly code: JsonRpcErrorCode.ValidationError;
|
|
71
|
+
readonly when: "Target was `periodic` but the requested period is not enabled in Obsidian's Periodic Notes plugin settings.";
|
|
72
|
+
readonly recovery: "Pass an explicit path target — the requested period is disabled in the operator's Periodic Notes plugin.";
|
|
73
|
+
}, {
|
|
74
|
+
readonly reason: "section_target_missing";
|
|
75
|
+
readonly code: JsonRpcErrorCode.ValidationError;
|
|
76
|
+
readonly when: "`section` was provided but the named heading/block/frontmatter field does not exist in the note.";
|
|
77
|
+
readonly recovery: "Call obsidian_get_note with format document-map to discover available targets.";
|
|
53
78
|
}]>;
|
|
54
79
|
//# sourceMappingURL=obsidian-write-note.tool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"obsidian-write-note.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/obsidian-write-note.tool.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAIjE,eAAO,MAAM,iBAAiB
|
|
1
|
+
{"version":3,"file":"obsidian-write-note.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/obsidian-write-note.tool.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAIjE,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkI5B,CAAC"}
|
|
@@ -8,7 +8,7 @@ import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
|
|
|
8
8
|
import { getObsidianService } from '../../../services/obsidian/obsidian-service.js';
|
|
9
9
|
import { ContentTypeSchema, SectionSchema, TargetSchema } from './_shared/schemas.js';
|
|
10
10
|
export const obsidianWriteNote = tool('obsidian_write_note', {
|
|
11
|
-
description: 'Create or overwrite a note. With `section`, replaces just that heading/block/frontmatter section in place. Whole-file writes fail with `file_exists` against an existing note unless `overwrite: true` — for in-place edits, prefer `obsidian_patch_note` (sections), `obsidian_append_to_note` (append), or `obsidian_replace_in_note` (find-and-replace). For heading sections, `content` is the new body; the heading line is preserved automatically.',
|
|
11
|
+
description: 'Create or overwrite a note. With `section`, replaces just that heading/block/frontmatter section in place; nested headings need `Parent::Child` syntax — use `obsidian_get_note` with `format: "document-map"` to discover available targets. Whole-file writes fail with `file_exists` against an existing note unless `overwrite: true` — for in-place edits, prefer `obsidian_patch_note` (sections), `obsidian_append_to_note` (append), or `obsidian_replace_in_note` (find-and-replace). For heading sections, `content` is the new body; the heading line is preserved automatically.',
|
|
12
12
|
annotations: { idempotentHint: true, destructiveHint: true },
|
|
13
13
|
input: z.object({
|
|
14
14
|
target: TargetSchema.describe('Where the note lives.'),
|
|
@@ -45,6 +45,36 @@ export const obsidianWriteNote = tool('obsidian_write_note', {
|
|
|
45
45
|
when: 'The target path is outside OBSIDIAN_WRITE_PATHS, or OBSIDIAN_READ_ONLY=true denies all writes.',
|
|
46
46
|
recovery: 'Use a path inside the configured write scope. The error data echoes the active scope.',
|
|
47
47
|
},
|
|
48
|
+
{
|
|
49
|
+
reason: 'note_missing',
|
|
50
|
+
code: JsonRpcErrorCode.NotFound,
|
|
51
|
+
when: 'Section replace targets a path that does not resolve to an existing note (PATCH requires the file to exist).',
|
|
52
|
+
recovery: 'Verify the path with obsidian_list_notes, or omit `section` to fall back to whole-file write (which creates the note when it is absent).',
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
reason: 'no_active_file',
|
|
56
|
+
code: JsonRpcErrorCode.NotFound,
|
|
57
|
+
when: 'Target was `active` but no file is currently open in Obsidian.',
|
|
58
|
+
recovery: 'Call obsidian_open_in_ui to focus a file, or pass an explicit path target instead.',
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
reason: 'periodic_not_found',
|
|
62
|
+
code: JsonRpcErrorCode.NotFound,
|
|
63
|
+
when: 'Target was `periodic` but no matching periodic note exists.',
|
|
64
|
+
recovery: 'Create the periodic note first or pass an explicit path target.',
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
reason: 'periodic_disabled',
|
|
68
|
+
code: JsonRpcErrorCode.ValidationError,
|
|
69
|
+
when: "Target was `periodic` but the requested period is not enabled in Obsidian's Periodic Notes plugin settings.",
|
|
70
|
+
recovery: "Pass an explicit path target — the requested period is disabled in the operator's Periodic Notes plugin.",
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
reason: 'section_target_missing',
|
|
74
|
+
code: JsonRpcErrorCode.ValidationError,
|
|
75
|
+
when: '`section` was provided but the named heading/block/frontmatter field does not exist in the note.',
|
|
76
|
+
recovery: 'Call obsidian_get_note with format document-map to discover available targets.',
|
|
77
|
+
},
|
|
48
78
|
],
|
|
49
79
|
async handler(input, ctx) {
|
|
50
80
|
const svc = getObsidianService();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"obsidian-write-note.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/obsidian-write-note.tool.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAC7E,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEtF,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,CAAC,qBAAqB,EAAE;IAC3D,WAAW,EACT,
|
|
1
|
+
{"version":3,"file":"obsidian-write-note.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/obsidian-write-note.tool.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAC7E,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEtF,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,CAAC,qBAAqB,EAAE;IAC3D,WAAW,EACT,8jBAA8jB;IAChkB,WAAW,EAAE,EAAE,cAAc,EAAE,IAAI,EAAE,eAAe,EAAE,IAAI,EAAE;IAC5D,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,MAAM,EAAE,YAAY,CAAC,QAAQ,CAAC,uBAAuB,CAAC;QACtD,OAAO,EAAE,CAAC;aACP,MAAM,EAAE;aACR,QAAQ,CACP,0JAA0J,CAC3J;QACH,OAAO,EAAE,aAAa,CAAC,QAAQ,EAAE,CAAC,QAAQ,CACxC,uGAAuG,CACxG;QACD,WAAW,EAAE,iBAAiB;QAC9B,SAAS,EAAE,CAAC;aACT,OAAO,EAAE;aACT,OAAO,CAAC,KAAK,CAAC;aACd,QAAQ,CACP,iVAAiV,CAClV;KACJ,CAAC;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AAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,IAAI;QAAE,OAAO,OAAO,CAAC;IAChD,KAAK,CAAC,KAAK,EAAE,CAAC;IACd,IAAI,KAAK,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE;QAAE,KAAK,CAAC,KAAK,EAAE,CAAC;IAC3C,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "obsidian-mcp-server",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.5",
|
|
4
4
|
"mcpName": "io.github.cyanheads/obsidian-mcp-server",
|
|
5
5
|
"description": "MCP server for Obsidian vaults — read, write, search, and surgically edit notes, tags, and frontmatter via the Local REST API plugin. STDIO or Streamable HTTP.",
|
|
6
6
|
"type": "module",
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
"access": "public"
|
|
77
77
|
},
|
|
78
78
|
"dependencies": {
|
|
79
|
-
"@cyanheads/mcp-ts-core": "^0.8.
|
|
79
|
+
"@cyanheads/mcp-ts-core": "^0.8.18",
|
|
80
80
|
"@types/js-yaml": "^4.0.9",
|
|
81
81
|
"js-yaml": "^4.1.1",
|
|
82
82
|
"pino-pretty": "^13.1.3",
|
package/server.json
CHANGED
|
@@ -6,14 +6,14 @@
|
|
|
6
6
|
"url": "https://github.com/cyanheads/obsidian-mcp-server",
|
|
7
7
|
"source": "github"
|
|
8
8
|
},
|
|
9
|
-
"version": "3.1.
|
|
9
|
+
"version": "3.1.5",
|
|
10
10
|
"packages": [
|
|
11
11
|
{
|
|
12
12
|
"registryType": "npm",
|
|
13
13
|
"registryBaseUrl": "https://registry.npmjs.org",
|
|
14
14
|
"identifier": "obsidian-mcp-server",
|
|
15
15
|
"runtimeHint": "node",
|
|
16
|
-
"version": "3.1.
|
|
16
|
+
"version": "3.1.5",
|
|
17
17
|
"packageArguments": [
|
|
18
18
|
{
|
|
19
19
|
"type": "positional",
|
|
@@ -95,7 +95,7 @@
|
|
|
95
95
|
"registryBaseUrl": "https://registry.npmjs.org",
|
|
96
96
|
"identifier": "obsidian-mcp-server",
|
|
97
97
|
"runtimeHint": "node",
|
|
98
|
-
"version": "3.1.
|
|
98
|
+
"version": "3.1.5",
|
|
99
99
|
"packageArguments": [
|
|
100
100
|
{
|
|
101
101
|
"type": "positional",
|