obsidian-mcp-server 3.7.1 → 3.7.2
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/AGENTS.md +19 -7
- package/CLAUDE.md +19 -7
- package/Dockerfile +7 -0
- package/README.md +22 -86
- package/changelog/3.7.x/3.7.2.md +34 -0
- package/dist/mcp-server/tools/definitions/_shared/markdown.d.ts +14 -0
- package/dist/mcp-server/tools/definitions/_shared/markdown.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/_shared/markdown.js +17 -0
- package/dist/mcp-server/tools/definitions/_shared/markdown.js.map +1 -0
- package/dist/mcp-server/tools/definitions/_shared/suggest-paths.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/_shared/suggest-paths.js +3 -1
- package/dist/mcp-server/tools/definitions/_shared/suggest-paths.js.map +1 -1
- 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 +3 -2
- package/dist/mcp-server/tools/definitions/obsidian-append-to-note.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/obsidian-delete-note.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/obsidian-delete-note.tool.js +2 -1
- package/dist/mcp-server/tools/definitions/obsidian-delete-note.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/obsidian-execute-command.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/obsidian-execute-command.tool.js +2 -1
- package/dist/mcp-server/tools/definitions/obsidian-execute-command.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/obsidian-get-note.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/obsidian-get-note.tool.js +31 -24
- package/dist/mcp-server/tools/definitions/obsidian-get-note.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/obsidian-list-commands.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/obsidian-list-commands.tool.js +7 -4
- package/dist/mcp-server/tools/definitions/obsidian-list-commands.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/obsidian-list-notes.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/obsidian-list-notes.tool.js +7 -6
- package/dist/mcp-server/tools/definitions/obsidian-list-notes.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/obsidian-list-tags.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/obsidian-list-tags.tool.js +3 -2
- package/dist/mcp-server/tools/definitions/obsidian-list-tags.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/obsidian-manage-frontmatter.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/obsidian-manage-frontmatter.tool.js +7 -5
- package/dist/mcp-server/tools/definitions/obsidian-manage-frontmatter.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/obsidian-manage-tags.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/obsidian-manage-tags.tool.js +5 -3
- package/dist/mcp-server/tools/definitions/obsidian-manage-tags.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/obsidian-open-in-ui.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/obsidian-open-in-ui.tool.js +2 -1
- package/dist/mcp-server/tools/definitions/obsidian-open-in-ui.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/obsidian-patch-note.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/obsidian-patch-note.tool.js +3 -2
- package/dist/mcp-server/tools/definitions/obsidian-patch-note.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/obsidian-replace-in-note.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/obsidian-replace-in-note.tool.js +8 -2
- package/dist/mcp-server/tools/definitions/obsidian-replace-in-note.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/obsidian-search-notes.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/obsidian-search-notes.tool.js +16 -21
- package/dist/mcp-server/tools/definitions/obsidian-search-notes.tool.js.map +1 -1
- 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 +3 -2
- package/dist/mcp-server/tools/definitions/obsidian-write-note.tool.js.map +1 -1
- package/manifest.json +1 -1
- package/package.json +7 -6
- package/server.json +3 -3
package/AGENTS.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# Agent Protocol
|
|
2
2
|
|
|
3
3
|
**Server:** obsidian-mcp-server
|
|
4
|
-
**Version:** 3.7.
|
|
5
|
-
**Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.13.
|
|
4
|
+
**Version:** 3.7.2
|
|
5
|
+
**Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.13.18`
|
|
6
6
|
**Engines:** Bun ≥1.4.0, Node ≥24.0.0
|
|
7
|
-
**MCP SDK:** `@modelcontextprotocol/server` ^2.
|
|
7
|
+
**MCP SDK:** `@modelcontextprotocol/server` ^2.4.0
|
|
8
8
|
**Zod:** ^4.6.7
|
|
9
9
|
|
|
10
10
|
> **Read the framework docs first:** `node_modules/@cyanheads/mcp-ts-core/CLAUDE.md` contains the full API reference — builders, Context, error codes, exports, patterns. This file covers server-specific conventions only.
|
|
@@ -319,9 +319,18 @@ src/
|
|
|
319
319
|
|
|
320
320
|
## Skills
|
|
321
321
|
|
|
322
|
-
|
|
322
|
+
Two skill trees can live at the project root, written for different readers:
|
|
323
323
|
|
|
324
|
-
|
|
324
|
+
| Tree | For | Written by |
|
|
325
|
+
|:-----|:----|:-----------|
|
|
326
|
+
| `framework-skills/` | The agent developing this server — framework skills (`metadata.audience: external`) plus any development-time skills of the server's own | `init` and the `maintenance` sync (framework skills); you (your own) |
|
|
327
|
+
| `skills/` | The agents that install the server and call its tools — tool chains, identifier sources, gates | You, deliberately, with the `add-skill` skill. Absent here: this server publishes none, so `createApp()` gets no `skills` option |
|
|
328
|
+
|
|
329
|
+
Development skills are modular instructions. Read them directly when a task matches — e.g., `framework-skills/add-tool/SKILL.md` when adding a tool. `bun run list-skills` prints the full registry. Their directory is deliberately not `skills/`: Claude Code and Codex auto-load a plugin's root `skills/`, so a server that ships `.claude-plugin/` or `.codex-plugin/` would hand them to every agent that installs it.
|
|
330
|
+
|
|
331
|
+
A published skill in root `skills/` reaches plugin installs and the `.mcpb` bundle as-is, ships in the npm package and the Docker image (`package.json` `files` and the Dockerfile already carry `skills/`), and reaches MCP clients when the server opts in with `createApp({ skills: 'skills' })`. `lint:packaging` validates the tree.
|
|
332
|
+
|
|
333
|
+
**Agent skill directory:** Copy `framework-skills/` into the directory your agent discovers (Claude Code: `.claude/skills/`, others: equivalent). Skills then load as context without referencing `framework-skills/` paths. After framework updates, run the `maintenance` skill — Phase B re-syncs the agent directory.
|
|
325
334
|
|
|
326
335
|
Available skills:
|
|
327
336
|
|
|
@@ -335,6 +344,7 @@ Available skills:
|
|
|
335
344
|
| `add-prompt` | Scaffold a new prompt definition |
|
|
336
345
|
| `add-service` | Scaffold a new service integration |
|
|
337
346
|
| `add-test` | Scaffold test file for a tool, resource, or service |
|
|
347
|
+
| `add-skill` | Author a skill the server publishes in root `skills/` for the agents that use it — when one earns its place, structure, validation, delivery |
|
|
338
348
|
| `field-test` | Exercise tools/resources/prompts with real inputs, verify behavior, report issues |
|
|
339
349
|
| `security-pass` | Audit server for MCP-flavored security gaps: output injection, scope blast radius, input sinks, tenant isolation |
|
|
340
350
|
| `tool-defs-analysis` | Read-only audit of MCP definition language across the surface — voice, leaks, defaults, recovery hints, output descriptions |
|
|
@@ -384,7 +394,7 @@ When you complete a skill's checklist, check the boxes and add a completion time
|
|
|
384
394
|
| `bun run format` | Auto-fix formatting (safe fixes only) |
|
|
385
395
|
| `bun run format:unsafe` | Also apply Biome's unsafe autofixes — review the diff; they can change behavior |
|
|
386
396
|
| `bun run lint:mcp` | Validate MCP definitions against the linter rules |
|
|
387
|
-
| `bun run lint:packaging` | Packaging surface checks — `server.json`/`manifest.json` env-var parity, `user_config` wiring, plugin manifest identity and env contract (run by devcheck) |
|
|
397
|
+
| `bun run lint:packaging` | Packaging surface checks — `server.json`/`manifest.json` env-var parity, `user_config` wiring, `.mcpbignore` coverage, plugin manifest identity and env contract, the published `skills/` tree (run by devcheck) |
|
|
388
398
|
| `bun run bundle` | Build, pack, and clean a `.mcpb` for one-click Claude Desktop install |
|
|
389
399
|
| `bun run test` | Run tests (Vitest — use `bun run test`, not `bun test`) |
|
|
390
400
|
| `bun run test:coverage` | Run tests with Istanbul coverage |
|
|
@@ -399,7 +409,7 @@ When you complete a skill's checklist, check the boxes and add a completion time
|
|
|
399
409
|
|
|
400
410
|
## Bundling
|
|
401
411
|
|
|
402
|
-
`bun run bundle` produces a `.mcpb` extension bundle for one-click install in Claude Desktop. The pack step is followed by `scripts/clean-mcpb.ts`, which prunes dev dependencies (`mcpb clean`) and strips
|
|
412
|
+
`bun run bundle` produces a `.mcpb` extension bundle for one-click install in Claude Desktop. `mcpb pack` reads `.mcpbignore`, not `.gitignore`, so every root path the bundle must not ship — source, tests, docs, caches, logs, agent docs, plugin manifests, gitignored local files — needs a root-anchored line there (`/docs/`, never `docs/`, which also strips `node_modules/*/docs/`); `lint:packaging` names each missing or unanchored line. Root `skills/` ships on purpose. The pack step is followed by `scripts/clean-mcpb.ts`, which prunes dev dependencies (`mcpb clean`) and strips four classes of `node_modules/**` content that root-anchored `.mcpbignore` patterns cannot reach: dependency-shipped agent docs (`framework-skills/`, `skills/`, `.claude/`, `.agents/`, `SKILL.md`); platform-specific native bindings, which would otherwise lock the bundle to the platform it was packed on; node-gyp build output beside a `binding.gyp`, which records the packing machine's paths (compiled `*.node` addons stay); and build-only package files — the framework's `changelog/`, `scripts/`, `templates/`, `CLAUDE.md`, `AGENTS.md`, and config bases. MCPB is stdio-only — HTTP deployments are unaffected. Delete `manifest.json` and `.mcpbignore` if not shipping MCPB bundles; `lint:packaging` skips cleanly.
|
|
403
413
|
|
|
404
414
|
**Adding an env var requires both files:** `server.json` (registry discovery, `environmentVariables[]`) and `manifest.json` (bundle install UX, `mcp_config.env` + `user_config`). `lint:packaging` (run by `devcheck`) verifies the env var names match, that every `user_config` option is wired into `mcp_config.env` as `"X": "${user_config.X}"` (the host substitutes nothing else — `"${X}"` reaches the server as that literal string), and that an optional string option carries `"default": ""`. A user-supplied variable also goes into the plugin manifests: `.claude-plugin/plugin.json` `userConfig` + `${user_config.<option>}` in `env`, and `.codex-plugin/mcp.json` `env_vars`.
|
|
405
415
|
|
|
@@ -478,7 +488,9 @@ import { getMyService } from '@/services/my-domain/my-service.js';
|
|
|
478
488
|
- [ ] If wrapping external API: tests include at least one sparse payload case with omitted upstream fields
|
|
479
489
|
- [ ] Registered in `createApp()` arrays (directly or via barrel exports). Conditional registration (e.g. `commandToolDefinitions` behind `OBSIDIAN_ENABLE_COMMANDS`) happens in `src/index.ts`, not in the barrel
|
|
480
490
|
- [ ] Tests use `createMockContext()` from `@cyanheads/mcp-ts-core/testing`
|
|
491
|
+
- [ ] `plugin.json` + `mcp.json` (Agent Plugins 1.0.0 — read by Codex, Cursor, GitHub Copilot, VS Code, Kiro) populated — `plugin.json` `name` = the unscoped repo name; `version`, `description`, `author`, `homepage`, `repository`, `license`, `keywords` from `package.json`; no other top-level field, `extensions` included. `mcp.json` holds one `"type": "stdio"` entry keyed by the unscoped name, `npx -y obsidian-mcp-server`, and the same fixed `env` as `.codex-plugin/mcp.json`. Neither file carries a user-supplied variable (no `""`, no `${…}` besides `${PLUGIN_ROOT}`/`${PLUGIN_DATA}`): keys reach Codex through `.codex-plugin/mcp.json` `env_vars`, which works only while `.codex-plugin/plugin.json` keeps `"mcpServers": "./.codex-plugin/mcp.json"`
|
|
481
492
|
- [ ] `.codex-plugin/plugin.json` populated — `name`, `version`, `description`, `repository`, `license` from `package.json`; `interface.displayName` = the unscoped repo name (never the npm scope — `lint:packaging` enforces this); `interface.shortDescription` from `package.json` description
|
|
482
493
|
- [ ] `.codex-plugin/mcp.json` updated — server name key is the unscoped repo name; every user-supplied variable (API key, instance URL) is listed in `env_vars` so Codex forwards it from the user's environment. Never write `"KEY": ""` into `env` — an empty value replaces the user's exported key and is read as unset
|
|
483
494
|
- [ ] `.claude-plugin/plugin.json` populated — `name`, `version`, `description`, `author`, `repository`, `license`, `keywords` from `package.json`; inline `mcpServers` entry keyed by the unscoped repo name. Every user-supplied variable is declared under `userConfig` (`type`, `title`, `description`; `sensitive: true` for keys and tokens; `required: true` or `default: ""`) and referenced from `env` as `"KEY": "${user_config.<option>}"` — mirror the `user_config` block in `manifest.json`. Never write `"KEY": ""` into `env`
|
|
495
|
+
- [ ] Any new root dev path has a root-anchored line in `.mcpbignore`; `bun run bundle` and `lint:packaging` pass
|
|
484
496
|
- [ ] `bun run devcheck` passes
|
package/CLAUDE.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# Agent Protocol
|
|
2
2
|
|
|
3
3
|
**Server:** obsidian-mcp-server
|
|
4
|
-
**Version:** 3.7.
|
|
5
|
-
**Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.13.
|
|
4
|
+
**Version:** 3.7.2
|
|
5
|
+
**Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.13.18`
|
|
6
6
|
**Engines:** Bun ≥1.4.0, Node ≥24.0.0
|
|
7
|
-
**MCP SDK:** `@modelcontextprotocol/server` ^2.
|
|
7
|
+
**MCP SDK:** `@modelcontextprotocol/server` ^2.4.0
|
|
8
8
|
**Zod:** ^4.6.7
|
|
9
9
|
|
|
10
10
|
> **Read the framework docs first:** `node_modules/@cyanheads/mcp-ts-core/CLAUDE.md` contains the full API reference — builders, Context, error codes, exports, patterns. This file covers server-specific conventions only.
|
|
@@ -319,9 +319,18 @@ src/
|
|
|
319
319
|
|
|
320
320
|
## Skills
|
|
321
321
|
|
|
322
|
-
|
|
322
|
+
Two skill trees can live at the project root, written for different readers:
|
|
323
323
|
|
|
324
|
-
|
|
324
|
+
| Tree | For | Written by |
|
|
325
|
+
|:-----|:----|:-----------|
|
|
326
|
+
| `framework-skills/` | The agent developing this server — framework skills (`metadata.audience: external`) plus any development-time skills of the server's own | `init` and the `maintenance` sync (framework skills); you (your own) |
|
|
327
|
+
| `skills/` | The agents that install the server and call its tools — tool chains, identifier sources, gates | You, deliberately, with the `add-skill` skill. Absent here: this server publishes none, so `createApp()` gets no `skills` option |
|
|
328
|
+
|
|
329
|
+
Development skills are modular instructions. Read them directly when a task matches — e.g., `framework-skills/add-tool/SKILL.md` when adding a tool. `bun run list-skills` prints the full registry. Their directory is deliberately not `skills/`: Claude Code and Codex auto-load a plugin's root `skills/`, so a server that ships `.claude-plugin/` or `.codex-plugin/` would hand them to every agent that installs it.
|
|
330
|
+
|
|
331
|
+
A published skill in root `skills/` reaches plugin installs and the `.mcpb` bundle as-is, ships in the npm package and the Docker image (`package.json` `files` and the Dockerfile already carry `skills/`), and reaches MCP clients when the server opts in with `createApp({ skills: 'skills' })`. `lint:packaging` validates the tree.
|
|
332
|
+
|
|
333
|
+
**Agent skill directory:** Copy `framework-skills/` into the directory your agent discovers (Claude Code: `.claude/skills/`, others: equivalent). Skills then load as context without referencing `framework-skills/` paths. After framework updates, run the `maintenance` skill — Phase B re-syncs the agent directory.
|
|
325
334
|
|
|
326
335
|
Available skills:
|
|
327
336
|
|
|
@@ -335,6 +344,7 @@ Available skills:
|
|
|
335
344
|
| `add-prompt` | Scaffold a new prompt definition |
|
|
336
345
|
| `add-service` | Scaffold a new service integration |
|
|
337
346
|
| `add-test` | Scaffold test file for a tool, resource, or service |
|
|
347
|
+
| `add-skill` | Author a skill the server publishes in root `skills/` for the agents that use it — when one earns its place, structure, validation, delivery |
|
|
338
348
|
| `field-test` | Exercise tools/resources/prompts with real inputs, verify behavior, report issues |
|
|
339
349
|
| `security-pass` | Audit server for MCP-flavored security gaps: output injection, scope blast radius, input sinks, tenant isolation |
|
|
340
350
|
| `tool-defs-analysis` | Read-only audit of MCP definition language across the surface — voice, leaks, defaults, recovery hints, output descriptions |
|
|
@@ -384,7 +394,7 @@ When you complete a skill's checklist, check the boxes and add a completion time
|
|
|
384
394
|
| `bun run format` | Auto-fix formatting (safe fixes only) |
|
|
385
395
|
| `bun run format:unsafe` | Also apply Biome's unsafe autofixes — review the diff; they can change behavior |
|
|
386
396
|
| `bun run lint:mcp` | Validate MCP definitions against the linter rules |
|
|
387
|
-
| `bun run lint:packaging` | Packaging surface checks — `server.json`/`manifest.json` env-var parity, `user_config` wiring, plugin manifest identity and env contract (run by devcheck) |
|
|
397
|
+
| `bun run lint:packaging` | Packaging surface checks — `server.json`/`manifest.json` env-var parity, `user_config` wiring, `.mcpbignore` coverage, plugin manifest identity and env contract, the published `skills/` tree (run by devcheck) |
|
|
388
398
|
| `bun run bundle` | Build, pack, and clean a `.mcpb` for one-click Claude Desktop install |
|
|
389
399
|
| `bun run test` | Run tests (Vitest — use `bun run test`, not `bun test`) |
|
|
390
400
|
| `bun run test:coverage` | Run tests with Istanbul coverage |
|
|
@@ -399,7 +409,7 @@ When you complete a skill's checklist, check the boxes and add a completion time
|
|
|
399
409
|
|
|
400
410
|
## Bundling
|
|
401
411
|
|
|
402
|
-
`bun run bundle` produces a `.mcpb` extension bundle for one-click install in Claude Desktop. The pack step is followed by `scripts/clean-mcpb.ts`, which prunes dev dependencies (`mcpb clean`) and strips
|
|
412
|
+
`bun run bundle` produces a `.mcpb` extension bundle for one-click install in Claude Desktop. `mcpb pack` reads `.mcpbignore`, not `.gitignore`, so every root path the bundle must not ship — source, tests, docs, caches, logs, agent docs, plugin manifests, gitignored local files — needs a root-anchored line there (`/docs/`, never `docs/`, which also strips `node_modules/*/docs/`); `lint:packaging` names each missing or unanchored line. Root `skills/` ships on purpose. The pack step is followed by `scripts/clean-mcpb.ts`, which prunes dev dependencies (`mcpb clean`) and strips four classes of `node_modules/**` content that root-anchored `.mcpbignore` patterns cannot reach: dependency-shipped agent docs (`framework-skills/`, `skills/`, `.claude/`, `.agents/`, `SKILL.md`); platform-specific native bindings, which would otherwise lock the bundle to the platform it was packed on; node-gyp build output beside a `binding.gyp`, which records the packing machine's paths (compiled `*.node` addons stay); and build-only package files — the framework's `changelog/`, `scripts/`, `templates/`, `CLAUDE.md`, `AGENTS.md`, and config bases. MCPB is stdio-only — HTTP deployments are unaffected. Delete `manifest.json` and `.mcpbignore` if not shipping MCPB bundles; `lint:packaging` skips cleanly.
|
|
403
413
|
|
|
404
414
|
**Adding an env var requires both files:** `server.json` (registry discovery, `environmentVariables[]`) and `manifest.json` (bundle install UX, `mcp_config.env` + `user_config`). `lint:packaging` (run by `devcheck`) verifies the env var names match, that every `user_config` option is wired into `mcp_config.env` as `"X": "${user_config.X}"` (the host substitutes nothing else — `"${X}"` reaches the server as that literal string), and that an optional string option carries `"default": ""`. A user-supplied variable also goes into the plugin manifests: `.claude-plugin/plugin.json` `userConfig` + `${user_config.<option>}` in `env`, and `.codex-plugin/mcp.json` `env_vars`.
|
|
405
415
|
|
|
@@ -478,7 +488,9 @@ import { getMyService } from '@/services/my-domain/my-service.js';
|
|
|
478
488
|
- [ ] If wrapping external API: tests include at least one sparse payload case with omitted upstream fields
|
|
479
489
|
- [ ] Registered in `createApp()` arrays (directly or via barrel exports). Conditional registration (e.g. `commandToolDefinitions` behind `OBSIDIAN_ENABLE_COMMANDS`) happens in `src/index.ts`, not in the barrel
|
|
480
490
|
- [ ] Tests use `createMockContext()` from `@cyanheads/mcp-ts-core/testing`
|
|
491
|
+
- [ ] `plugin.json` + `mcp.json` (Agent Plugins 1.0.0 — read by Codex, Cursor, GitHub Copilot, VS Code, Kiro) populated — `plugin.json` `name` = the unscoped repo name; `version`, `description`, `author`, `homepage`, `repository`, `license`, `keywords` from `package.json`; no other top-level field, `extensions` included. `mcp.json` holds one `"type": "stdio"` entry keyed by the unscoped name, `npx -y obsidian-mcp-server`, and the same fixed `env` as `.codex-plugin/mcp.json`. Neither file carries a user-supplied variable (no `""`, no `${…}` besides `${PLUGIN_ROOT}`/`${PLUGIN_DATA}`): keys reach Codex through `.codex-plugin/mcp.json` `env_vars`, which works only while `.codex-plugin/plugin.json` keeps `"mcpServers": "./.codex-plugin/mcp.json"`
|
|
481
492
|
- [ ] `.codex-plugin/plugin.json` populated — `name`, `version`, `description`, `repository`, `license` from `package.json`; `interface.displayName` = the unscoped repo name (never the npm scope — `lint:packaging` enforces this); `interface.shortDescription` from `package.json` description
|
|
482
493
|
- [ ] `.codex-plugin/mcp.json` updated — server name key is the unscoped repo name; every user-supplied variable (API key, instance URL) is listed in `env_vars` so Codex forwards it from the user's environment. Never write `"KEY": ""` into `env` — an empty value replaces the user's exported key and is read as unset
|
|
483
494
|
- [ ] `.claude-plugin/plugin.json` populated — `name`, `version`, `description`, `author`, `repository`, `license`, `keywords` from `package.json`; inline `mcpServers` entry keyed by the unscoped repo name. Every user-supplied variable is declared under `userConfig` (`type`, `title`, `description`; `sensitive: true` for keys and tokens; `required: true` or `default: ""`) and referenced from `env` as `"KEY": "${user_config.<option>}"` — mirror the `user_config` block in `manifest.json`. Never write `"KEY": ""` into `env`
|
|
495
|
+
- [ ] Any new root dev path has a root-anchored line in `.mcpbignore`; `bun run bundle` and `lint:packaging` pass
|
|
484
496
|
- [ ] `bun run devcheck` passes
|
package/Dockerfile
CHANGED
|
@@ -29,6 +29,11 @@ RUN --mount=type=cache,target=/root/.bun/install/cache \
|
|
|
29
29
|
# Copy the rest of the source code
|
|
30
30
|
COPY . .
|
|
31
31
|
|
|
32
|
+
# The skills a server publishes (`createApp({ skills: 'skills' })`) are read at
|
|
33
|
+
# runtime from the application root. Created when the project has none, so the
|
|
34
|
+
# production stage's copy below holds with or without one.
|
|
35
|
+
RUN mkdir -p skills
|
|
36
|
+
|
|
32
37
|
# Build the application
|
|
33
38
|
RUN bun run build
|
|
34
39
|
|
|
@@ -135,6 +140,7 @@ COPY --from=deps /usr/src/app/node_modules ./node_modules
|
|
|
135
140
|
|
|
136
141
|
# Copy the compiled application code from the build stage
|
|
137
142
|
COPY --from=build /usr/src/app/dist ./dist
|
|
143
|
+
COPY --from=build /usr/src/app/skills ./skills
|
|
138
144
|
|
|
139
145
|
# The 'oven/bun' image already provides a non-root user named 'bun'.
|
|
140
146
|
# We will use this existing user for enhanced security.
|
|
@@ -158,6 +164,7 @@ ENV MCP_HTTP_PORT=${PORT:-3010}
|
|
|
158
164
|
# bind exposes the upstream OBSIDIAN_API_KEY to any caller that can reach the port.
|
|
159
165
|
ENV MCP_HTTP_HOST="0.0.0.0"
|
|
160
166
|
ENV MCP_TRANSPORT_TYPE="http"
|
|
167
|
+
ENV MCP_SESSION_MODE="stateful"
|
|
161
168
|
ENV MCP_LOG_LEVEL="info"
|
|
162
169
|
ENV LOGS_DIR="/var/log/obsidian-mcp-server"
|
|
163
170
|
|
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
<div align="center">
|
|
9
9
|
|
|
10
|
-
[](./CHANGELOG.md) [](./LICENSE) [](https://github.com/users/cyanheads/packages/container/package/obsidian-mcp-server) [](https://modelcontextprotocol.io/) [](https://www.npmjs.com/package/obsidian-mcp-server) [](https://www.typescriptlang.org/) [](https://bun.sh/)
|
|
11
11
|
|
|
12
12
|
</div>
|
|
13
13
|
|
|
@@ -210,110 +210,37 @@ Agent-friendly output:
|
|
|
210
210
|
|
|
211
211
|
## Getting started
|
|
212
212
|
|
|
213
|
-
Add
|
|
213
|
+
Add it to Claude Code:
|
|
214
214
|
|
|
215
|
-
```
|
|
216
|
-
|
|
217
|
-
"mcpServers": {
|
|
218
|
-
"obsidian-mcp-server": {
|
|
219
|
-
"type": "stdio",
|
|
220
|
-
"command": "bunx",
|
|
221
|
-
"args": ["obsidian-mcp-server@latest"],
|
|
222
|
-
"env": {
|
|
223
|
-
"MCP_TRANSPORT_TYPE": "stdio",
|
|
224
|
-
"MCP_LOG_LEVEL": "info",
|
|
225
|
-
"OBSIDIAN_API_KEY": "your-local-rest-api-key"
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
}
|
|
215
|
+
```sh
|
|
216
|
+
claude mcp add obsidian-mcp-server -e OBSIDIAN_API_KEY=your-api-key -- npx -y obsidian-mcp-server
|
|
230
217
|
```
|
|
231
218
|
|
|
232
|
-
|
|
219
|
+
For other clients, add this to the MCP config file:
|
|
233
220
|
|
|
234
221
|
```json
|
|
235
222
|
{
|
|
236
223
|
"mcpServers": {
|
|
237
224
|
"obsidian-mcp-server": {
|
|
238
|
-
"type": "stdio",
|
|
239
225
|
"command": "npx",
|
|
240
|
-
"args": ["-y", "obsidian-mcp-server
|
|
241
|
-
"env": {
|
|
242
|
-
"MCP_TRANSPORT_TYPE": "stdio",
|
|
243
|
-
"MCP_LOG_LEVEL": "info",
|
|
244
|
-
"OBSIDIAN_API_KEY": "your-local-rest-api-key"
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
```
|
|
250
|
-
|
|
251
|
-
Or with Docker:
|
|
252
|
-
|
|
253
|
-
```json
|
|
254
|
-
{
|
|
255
|
-
"mcpServers": {
|
|
256
|
-
"obsidian-mcp-server": {
|
|
257
|
-
"type": "stdio",
|
|
258
|
-
"command": "docker",
|
|
259
|
-
"args": [
|
|
260
|
-
"run", "-i", "--rm",
|
|
261
|
-
"-e", "MCP_TRANSPORT_TYPE=stdio",
|
|
262
|
-
"-e", "MCP_LOG_LEVEL=info",
|
|
263
|
-
"-e", "OBSIDIAN_API_KEY=your-local-rest-api-key",
|
|
264
|
-
"ghcr.io/cyanheads/obsidian-mcp-server:latest"
|
|
265
|
-
]
|
|
226
|
+
"args": ["-y", "obsidian-mcp-server"],
|
|
227
|
+
"env": { "OBSIDIAN_API_KEY": "your-api-key" }
|
|
266
228
|
}
|
|
267
229
|
}
|
|
268
230
|
}
|
|
269
231
|
```
|
|
270
232
|
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
For Streamable HTTP, set the transport and start the server:
|
|
274
|
-
|
|
275
|
-
```sh
|
|
276
|
-
MCP_TRANSPORT_TYPE=http OBSIDIAN_API_KEY=... bun run start:http
|
|
277
|
-
# Server listens at http://127.0.0.1:3010/mcp by default
|
|
278
|
-
```
|
|
233
|
+
Generate the key in Obsidian under **Settings → Community Plugins → Local REST API**, with the plugin set up as [Prerequisites](#prerequisites) describes. For Docker or a source build, see [Running the server](#running-the-server).
|
|
279
234
|
|
|
280
235
|
### Prerequisites
|
|
281
236
|
|
|
282
|
-
- [
|
|
283
|
-
- The [Obsidian Local REST API](https://github.com/coddingtonbear/obsidian-local-rest-api) plugin, v4.0.0 or later, enabled in your vault. Generate an API key under **Settings → Community Plugins → Local REST API** and set it as `OBSIDIAN_API_KEY`.
|
|
237
|
+
- The [Obsidian Local REST API](https://github.com/coddingtonbear/obsidian-local-rest-api) plugin, v4.0.0 or later, enabled in your vault. Its API key is `OBSIDIAN_API_KEY`.
|
|
284
238
|
- The server defaults to `http://127.0.0.1:27123`, so enable **"Non-encrypted (HTTP) Server"** in the plugin settings, or set `OBSIDIAN_BASE_URL=https://127.0.0.1:27124` for the always-on HTTPS port (its self-signed cert is accepted while `OBSIDIAN_VERIFY_SSL=false`, the default).
|
|
285
239
|
- Periodic-note targets work natively on plugin v5.0.1 and earlier. From v5.0.2 they need the [periodic-notes API extension](https://github.com/coddingtonbear/obsidian-local-rest-api-periodic-notes); without it they fail with `periodic_unsupported`.
|
|
286
240
|
- On plugin v4.x, heading section writes to a note with CRLF (Windows) line endings land mid-line: the plugin's markdown-patch 1.x engine misplaces them, and the server can't correct it. Plugin v5.0 and later handle CRLF notes.
|
|
287
241
|
- Plugin v6.0 drops markdown-patch 1.x, which two table-row writes (`contentType: "json"`) still use: rows under a heading, and rows through a block ID on its own line below the table. On v6.0, target the table by an ID on its last row.
|
|
288
242
|
- With `OBSIDIAN_DELETE_ELICITATION=true`, an MCP client that supports elicitation and renders its form, to use `obsidian_delete_note`. Every other tool, and the default delete, works without it.
|
|
289
243
|
|
|
290
|
-
### Installation
|
|
291
|
-
|
|
292
|
-
1. **Clone the repository:**
|
|
293
|
-
|
|
294
|
-
```sh
|
|
295
|
-
git clone https://github.com/cyanheads/obsidian-mcp-server.git
|
|
296
|
-
```
|
|
297
|
-
|
|
298
|
-
2. **Navigate into the directory:**
|
|
299
|
-
|
|
300
|
-
```sh
|
|
301
|
-
cd obsidian-mcp-server
|
|
302
|
-
```
|
|
303
|
-
|
|
304
|
-
3. **Install dependencies:**
|
|
305
|
-
|
|
306
|
-
```sh
|
|
307
|
-
bun install
|
|
308
|
-
```
|
|
309
|
-
|
|
310
|
-
4. **Configure environment:**
|
|
311
|
-
|
|
312
|
-
```sh
|
|
313
|
-
cp .env.example .env
|
|
314
|
-
# edit .env and set OBSIDIAN_API_KEY
|
|
315
|
-
```
|
|
316
|
-
|
|
317
244
|
## Configuration
|
|
318
245
|
|
|
319
246
|
| Variable | Description | Default |
|
|
@@ -359,6 +286,16 @@ Three optional env vars limit which vault paths the tools can touch. Unset, read
|
|
|
359
286
|
|
|
360
287
|
### Local development
|
|
361
288
|
|
|
289
|
+
Requires [Bun v1.4.0](https://bun.sh/) or higher (or Node.js v24+).
|
|
290
|
+
|
|
291
|
+
- **Clone and install:**
|
|
292
|
+
|
|
293
|
+
```sh
|
|
294
|
+
git clone https://github.com/cyanheads/obsidian-mcp-server.git
|
|
295
|
+
cd obsidian-mcp-server && bun install
|
|
296
|
+
cp .env.example .env # set OBSIDIAN_API_KEY
|
|
297
|
+
```
|
|
298
|
+
|
|
362
299
|
- **Build and run the production version:**
|
|
363
300
|
|
|
364
301
|
```sh
|
|
@@ -367,7 +304,7 @@ Three optional env vars limit which vault paths the tools can touch. Unset, read
|
|
|
367
304
|
|
|
368
305
|
# Run the built server
|
|
369
306
|
bun run start:stdio
|
|
370
|
-
# or
|
|
307
|
+
# or, listening at http://127.0.0.1:3010/mcp
|
|
371
308
|
bun run start:http
|
|
372
309
|
```
|
|
373
310
|
|
|
@@ -382,11 +319,10 @@ Three optional env vars limit which vault paths the tools can touch. Unset, read
|
|
|
382
319
|
### Docker
|
|
383
320
|
|
|
384
321
|
```sh
|
|
385
|
-
docker
|
|
386
|
-
docker run --rm -e OBSIDIAN_API_KEY=your-key -p 3010:3010 obsidian-mcp-server
|
|
322
|
+
docker run --rm -e OBSIDIAN_API_KEY=your-key -p 3010:3010 ghcr.io/cyanheads/obsidian-mcp-server:latest
|
|
387
323
|
```
|
|
388
324
|
|
|
389
|
-
The image defaults to HTTP transport on `0.0.0.0`, stateful sessions, and logs in `/var/log/obsidian-mcp-server`.
|
|
325
|
+
The image defaults to HTTP transport on `0.0.0.0`, stateful sessions, and logs in `/var/log/obsidian-mcp-server`. Inside a container, the default `OBSIDIAN_BASE_URL` (`http://127.0.0.1:27123`) is the container's own loopback: point it at `http://host.docker.internal:27123` (Docker Desktop) or use `--network host` (Linux) to reach the plugin on your host. To run it over stdio from an MCP client, use `"command": "docker"` with `"args": ["run", "-i", "--rm", "-e", "MCP_TRANSPORT_TYPE=stdio", "-e", "OBSIDIAN_API_KEY=your-key", "-e", "OBSIDIAN_BASE_URL=http://host.docker.internal:27123", "ghcr.io/cyanheads/obsidian-mcp-server:latest"]`. To build locally, `docker build -t obsidian-mcp-server .`; OpenTelemetry peer dependencies are installed by default — build with `--build-arg OTEL_ENABLED=false` to omit them.
|
|
390
326
|
|
|
391
327
|
If the port is reachable from other machines, set `MCP_AUTH_MODE=jwt` (with `MCP_AUTH_SECRET_KEY`) or `oauth`. With the default `none`, every caller acts on your vault with your `OBSIDIAN_API_KEY`.
|
|
392
328
|
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
---
|
|
2
|
+
summary: "Vault text in content[] (paths, tags, headings, frontmatter keys and values, command names, search terms) reads back as written under a CommonMark parse. Adopts mcp-ts-core ^0.13.18, which escapes error text and renders enrichment trailer strings as code spans."
|
|
3
|
+
breaking: false
|
|
4
|
+
security: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# 3.7.2 — 2026-10-25
|
|
8
|
+
|
|
9
|
+
## Changed
|
|
10
|
+
|
|
11
|
+
- **`obsidian_get_note` `format: "full"` renders a non-string frontmatter value as compact JSON in a code span** (before: pretty-printed multi-line JSON inside the list item).
|
|
12
|
+
- **`obsidian_get_note` `format: "section"` on a `frontmatter` target renders a string value escaped and a non-string value as a fenced `json` block** (before: raw). Heading and block section values and note bodies still render as raw Markdown.
|
|
13
|
+
- **`obsidian_search_notes` empty-result notices show the query and path prefix as code spans** (before: in double quotes, raw). The `obsidian_list_notes` tree fence and the search result fences are sized by the framework's code-block builder.
|
|
14
|
+
- **Framework `@cyanheads/mcp-ts-core` ^0.13.15 → ^0.13.18:**
|
|
15
|
+
- Tool error `content[]` escapes the message, recovery hint, and reason; `structuredContent` is unchanged (0.13.16, cyanheads/mcp-ts-core#760).
|
|
16
|
+
- Enrichment trailer strings such as `requestedPath` and the search `echo` render as code spans, or a fenced block when they hold a line break (0.13.18, cyanheads/mcp-ts-core#785); every line of a multi-line notice stays inside the trailer blockquote (0.13.17, cyanheads/mcp-ts-core#765).
|
|
17
|
+
- A call whose handler returns after the request was cancelled settles as `RequestCancelled` (`-32011`) (0.13.16, cyanheads/mcp-ts-core#753).
|
|
18
|
+
- HTTP shutdown answers `503` with `Retry-After: 1` while draining and aborts in-flight requests instead of waiting out the drain (0.13.16, cyanheads/mcp-ts-core#749, cyanheads/mcp-ts-core#757).
|
|
19
|
+
- Out-of-range framework environment values (a non-integer count, an out-of-range timer) fail startup, and the error names the variable (0.13.16, cyanheads/mcp-ts-core#747, cyanheads/mcp-ts-core#746).
|
|
20
|
+
- CORS exposes `WWW-Authenticate` and `Retry-After` (0.13.16, cyanheads/mcp-ts-core#687); log redaction catches secret names run into another word (0.13.16, cyanheads/mcp-ts-core#702).
|
|
21
|
+
- The `.mcpb` bundle drops the framework's build-only files (its `changelog/`, `templates/`, `scripts/`, `CLAUDE.md`, and similar) (0.13.18, cyanheads/mcp-ts-core#791).
|
|
22
|
+
- MCP SDK `@modelcontextprotocol/server` ^2.3.1 → ^2.4.0 (0.13.17).
|
|
23
|
+
- **Packaging and repo:** root Agent Plugins 1.0.0 `plugin.json` and `mcp.json`; `.mcpbignore` anchors `/changelog/`, `/plugin.json`, `/mcp.json`; `package.json` `files` and the Dockerfile carry a root `skills/` directory per the framework template (this server publishes no skills, so nothing new ships); the Docker image sets `MCP_SESSION_MODE="stateful"` explicitly (already the default from `createApp`, so behavior is unchanged); README Getting started is condensed to a `claude mcp add` line and one `npx` config; issue forms use the template's Environment table; `bunfig.toml` `minimumReleaseAge` 3 days → 1 day; framework skills and scripts synced (new `add-skill`).
|
|
24
|
+
|
|
25
|
+
## Fixed
|
|
26
|
+
|
|
27
|
+
- **Every tool's `content[]` renders text it did not author through `escapeMarkdownInline` or a code span sized past the value's longest backtick run.** Paths, tags, headings, block IDs, frontmatter keys and values, link targets, command IDs and names, regexes, search terms, and cursors read back under a CommonMark parse as the value `structuredContent` carries; before, `_`, `*`, `[`, `]`, `|`, and backticks in vault names could render as emphasis, links, or a broken code span. `structuredContent`, `tools/list`, and error contracts are unchanged.
|
|
28
|
+
|
|
29
|
+
## Dependencies
|
|
30
|
+
|
|
31
|
+
- `@cyanheads/mcp-ts-core` ^0.13.15 → ^0.13.18
|
|
32
|
+
- `@biomejs/biome` ^2.6.2 → ^2.6.3 (dev)
|
|
33
|
+
- `ignore` ^7.0.13 → ^7.0.14 (dev)
|
|
34
|
+
- `tsc-alias` ^1.9.8 → ^1.9.9 (dev)
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Code-span encoding for the values `format()` and enrichment
|
|
3
|
+
* notices show as code — paths, tags, keys, command IDs, regexes, search terms.
|
|
4
|
+
* Free text outside a span goes through the framework's `escapeMarkdownInline`.
|
|
5
|
+
* @module mcp-server/tools/definitions/_shared/markdown
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* `value` as an inline code span whose delimiter outgrows its longest backtick
|
|
9
|
+
* run, so a value the tool did not author reads back byte-identical under a
|
|
10
|
+
* CommonMark parse and cannot close the span early. A line break inside reads
|
|
11
|
+
* back as a space.
|
|
12
|
+
*/
|
|
13
|
+
export declare function inlineCode(value: string): string;
|
|
14
|
+
//# sourceMappingURL=markdown.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markdown.d.ts","sourceRoot":"","sources":["../../../../../src/mcp-server/tools/definitions/_shared/markdown.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEhD"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Code-span encoding for the values `format()` and enrichment
|
|
3
|
+
* notices show as code — paths, tags, keys, command IDs, regexes, search terms.
|
|
4
|
+
* Free text outside a span goes through the framework's `escapeMarkdownInline`.
|
|
5
|
+
* @module mcp-server/tools/definitions/_shared/markdown
|
|
6
|
+
*/
|
|
7
|
+
import { markdown } from '@cyanheads/mcp-ts-core/utils';
|
|
8
|
+
/**
|
|
9
|
+
* `value` as an inline code span whose delimiter outgrows its longest backtick
|
|
10
|
+
* run, so a value the tool did not author reads back byte-identical under a
|
|
11
|
+
* CommonMark parse and cannot close the span early. A line break inside reads
|
|
12
|
+
* back as a space.
|
|
13
|
+
*/
|
|
14
|
+
export function inlineCode(value) {
|
|
15
|
+
return markdown().inlineCode(value).build();
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=markdown.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markdown.js","sourceRoot":"","sources":["../../../../../src/mcp-server/tools/definitions/_shared/markdown.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAExD;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CAAC,KAAa;IACtC,OAAO,QAAQ,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,CAAC;AAC9C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"suggest-paths.d.ts","sourceRoot":"","sources":["../../../../../src/mcp-server/tools/definitions/_shared/suggest-paths.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAEtD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAC/E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"suggest-paths.d.ts","sourceRoot":"","sources":["../../../../../src/mcp-server/tools/definitions/_shared/suggest-paths.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAEtD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAC/E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAY/D,uGAAuG;AACvG,MAAM,MAAM,YAAY,CAAC,CAAC,IACtB;IAAE,MAAM,EAAE,CAAC,CAAC;IAAC,YAAY,EAAE,MAAM,GAAG,SAAS,CAAC;IAAC,aAAa,CAAC,EAAE,KAAK,CAAA;CAAE,GACtE;IAAE,MAAM,EAAE,CAAC,CAAC;IAAC,YAAY,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,MAAM,CAAA;CAAE,CAAC;AAE/D;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,gBAAgB,CAAC,CAAC,EACtC,GAAG,EAAE,OAAO,EACZ,GAAG,EAAE,eAAe,EACpB,MAAM,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@@
|
|
|
26
26
|
* @module mcp-server/tools/definitions/_shared/suggest-paths
|
|
27
27
|
*/
|
|
28
28
|
import { conflict, JsonRpcErrorCode, McpError, notFound } from '@cyanheads/mcp-ts-core/errors';
|
|
29
|
+
import { inlineCode } from './markdown.js';
|
|
29
30
|
const MAX_SUGGESTIONS = 5;
|
|
30
31
|
/**
|
|
31
32
|
* Wrap a service call with case-insensitive path fallback and "did you mean"
|
|
@@ -90,7 +91,8 @@ export function discloseCaseSubstitution(ctx, fallback, action) {
|
|
|
90
91
|
if (fallback.requestedPath === undefined)
|
|
91
92
|
return;
|
|
92
93
|
const { requestedPath, resolvedPath } = fallback;
|
|
93
|
-
const
|
|
94
|
+
const resolved = inlineCode(resolvedPath);
|
|
95
|
+
const notice = `${inlineCode(requestedPath)} has no exact match; ${action} ${resolved}, the one file in that folder whose name matches it ignoring case. Write and delete tools match paths exactly — pass them ${resolved}.`;
|
|
94
96
|
ctx.enrich({ requestedPath });
|
|
95
97
|
ctx.enrich.notice(notice);
|
|
96
98
|
return notice;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"suggest-paths.js","sourceRoot":"","sources":["../../../../../src/mcp-server/tools/definitions/_shared/suggest-paths.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAGH,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"suggest-paths.js","sourceRoot":"","sources":["../../../../../src/mcp-server/tools/definitions/_shared/suggest-paths.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAGH,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAG/F,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,MAAM,eAAe,GAAG,CAAC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S,EAAE,CAAC;YACpD,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC;QAC3C,CAAC;IACH,CAAC;IACD,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,CAAC;AACzC,CAAC;AAED,SAAS,cAAc,CAAC,CAAS;IAC/B,MAAM,GAAG,GAAG,CAAC,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IAC/B,OAAO,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACvC,CAAC;AAED,SAAS,OAAO,CAAC,GAAW,EAAE,IAAY;IACxC,OAAO,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;AACvC,CAAC"}
|
|
@@ -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;;;;;;;GAOG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;
|
|
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;;;;;;;GAOG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAMjE,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA4N/B,CAAC"}
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import { tool, z } from '@cyanheads/mcp-ts-core';
|
|
10
10
|
import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
|
|
11
|
+
import { escapeMarkdownInline } from '@cyanheads/mcp-ts-core/utils';
|
|
11
12
|
import { getObsidianService } from '../../../services/obsidian/obsidian-service.js';
|
|
12
13
|
import { ContentTypeSchema, SectionSchema, TargetSchema } from './_shared/schemas.js';
|
|
13
14
|
import { withCaseVariantNamed } from './_shared/suggest-paths.js';
|
|
@@ -185,13 +186,13 @@ export const obsidianAppendToNote = tool('obsidian_append_to_note', {
|
|
|
185
186
|
},
|
|
186
187
|
format: (result) => {
|
|
187
188
|
const action = result.created ? 'Created' : 'Appended to';
|
|
188
|
-
const lines = [`**${action} ${result.path}**`];
|
|
189
|
+
const lines = [`**${action} ${escapeMarkdownInline(result.path)}**`];
|
|
189
190
|
if (result.created) {
|
|
190
191
|
lines.push('*Note:* this file did not exist before — your content is now the entire file. If you expected to add to existing content, double-check the path.');
|
|
191
192
|
}
|
|
192
193
|
lines.push(`*Size:* ${result.previousSizeInBytes} → ${result.currentSizeInBytes} bytes`);
|
|
193
194
|
lines.push(`*Created:* ${result.created}`);
|
|
194
|
-
lines.push(`*Section targeted:* ${result.sectionTargeted}${result.sectionTarget ? ` → ${result.sectionTarget}` : ''}`);
|
|
195
|
+
lines.push(`*Section targeted:* ${result.sectionTargeted}${result.sectionTarget ? ` → ${escapeMarkdownInline(result.sectionTarget)}` : ''}`);
|
|
195
196
|
return [{ type: 'text', text: lines.join('\n') }];
|
|
196
197
|
},
|
|
197
198
|
});
|
|
@@ -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;;;;;;;GAOG;AAEH,OAAO,E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B,OAAO,EAAE,mBAAmB,KAAK,IAAI;YACrC,mBAAmB,EAAE,mBAAmB,IAAI,CAAC;YAC7C,kBAAkB;SACnB,CAAC;IACJ,CAAC;IAED,MAAM,EAAE,CAAC,MAAM,EAAE,EAAE;QACjB,MAAM,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,aAAa,CAAC;QAC1D,MAAM,KAAK,GAAG,CAAC,KAAK,MAAM,IAAI,MAAM,CAAC,IAAI,IAAI,CAAC,CAAC;
|
|
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;;;;;;;GAOG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAC7E,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACtF,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAElE,MAAM,CAAC,MAAM,oBAAoB,GAAG,IAAI,CAAC,yBAAyB,EAAE;IAClE,WAAW,EACT,g/CAAg/C;IACl/C,WAAW,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE;IACtC,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,MAAM,EAAE,YAAY,CAAC,QAAQ,CAAC,uBAAuB,CAAC;QACtD,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,0DAA0D,CAAC;QACxF,OAAO,EAAE,aAAa,CAAC,QAAQ,EAAE,CAAC,QAAQ,CACxC,kGAAkG,CACnG;QACD,WAAW,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Ae,GAAG,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,MAAM,oBAAoB,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CACjI,CAAC;QACF,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACpD,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"obsidian-delete-note.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/obsidian-delete-note.tool.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,OAAO,EAAqC,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAC9E,OAAO,EAAE,gBAAgB,EAAsB,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"obsidian-delete-note.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/obsidian-delete-note.tool.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,OAAO,EAAqC,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAC9E,OAAO,EAAE,gBAAgB,EAAsB,MAAM,+BAA+B,CAAC;AA8DrF;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,EAAE,WAAW,EAAE,EAAE;IAAE,WAAW,EAAE,OAAO,CAAA;CAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAmCvD,WAAW;;mBAEb,0EAA0E;uBACtE,QAAQ;uBACR,6DAA6D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eAgKpF;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAhLT,WAAW;;mBAEb,0EAA0E;uBACtE,QAAQ;uBACR,6DAA6D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA4KR,CAAC"}
|
|
@@ -12,6 +12,7 @@ import { createHash, randomUUID } from 'node:crypto';
|
|
|
12
12
|
import { isDeepStrictEqual } from 'node:util';
|
|
13
13
|
import { inputRequired, tool, z } from '@cyanheads/mcp-ts-core';
|
|
14
14
|
import { JsonRpcErrorCode, McpError, notFound } from '@cyanheads/mcp-ts-core/errors';
|
|
15
|
+
import { escapeMarkdownInline } from '@cyanheads/mcp-ts-core/utils';
|
|
15
16
|
import { getObsidianService } from '../../../services/obsidian/obsidian-service.js';
|
|
16
17
|
import { TargetSchema } from './_shared/schemas.js';
|
|
17
18
|
import { findSimilarPaths } from './_shared/suggest-paths.js';
|
|
@@ -248,7 +249,7 @@ export function buildDeleteNoteTool({ elicitation }) {
|
|
|
248
249
|
format: (result) => [
|
|
249
250
|
{
|
|
250
251
|
type: 'text',
|
|
251
|
-
text: `**Deleted ${result.path}** (size: ${result.previousSizeInBytes} → ${result.currentSizeInBytes} bytes)`,
|
|
252
|
+
text: `**Deleted ${escapeMarkdownInline(result.path)}** (size: ${result.previousSizeInBytes} → ${result.currentSizeInBytes} bytes)`,
|
|
252
253
|
},
|
|
253
254
|
],
|
|
254
255
|
});
|