obsidian-mcp-pro 1.4.0 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +220 -19
- package/build/http-server.d.ts +10 -0
- package/build/http-server.d.ts.map +1 -1
- package/build/http-server.js +133 -12
- package/build/http-server.js.map +1 -1
- package/build/index.d.ts.map +1 -1
- package/build/index.js +78 -28
- package/build/index.js.map +1 -1
- package/build/lib/logger.d.ts +13 -0
- package/build/lib/logger.d.ts.map +1 -0
- package/build/lib/logger.js +88 -0
- package/build/lib/logger.js.map +1 -0
- package/build/lib/vault.d.ts.map +1 -1
- package/build/lib/vault.js +145 -46
- package/build/lib/vault.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -4,7 +4,9 @@
|
|
|
4
4
|
|
|
5
5
|
⭐ **Please [star us on GitHub](https://github.com/rps321321/obsidian-mcp-pro) — it helps us reach more users!**
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
[](https://ko-fi.com/rps321)
|
|
8
|
+
|
|
9
|
+
💙 **Support this project** — obsidian-mcp-pro is free and open-source. If it saves you time, consider [buying me a coffee on Ko-fi](https://ko-fi.com/rps321).
|
|
8
10
|
|
|
9
11
|
[](https://glama.ai/mcp/servers/rps321321/obsidian-mcp-pro)
|
|
10
12
|
|
|
@@ -13,7 +15,7 @@
|
|
|
13
15
|
[](https://github.com/rps321321/obsidian-mcp-pro)
|
|
14
16
|
[](https://opensource.org/licenses/MIT)
|
|
15
17
|
[](https://nodejs.org/)
|
|
16
|
-
[](https://github.com/rps321321/obsidian-mcp-pro)
|
|
17
19
|
[](https://glama.ai/mcp/servers/rps321321/obsidian-mcp-pro)
|
|
18
20
|
|
|
19
21
|
Give AI assistants deep, structured access to your Obsidian knowledge base. Read, write, search, tag, analyze links, traverse graphs, and manipulate canvases — all through the [Model Context Protocol](https://modelcontextprotocol.io/).
|
|
@@ -22,6 +24,25 @@ Every one of the 23 tools ships with rich descriptions, typed schemas, human-rea
|
|
|
22
24
|
|
|
23
25
|
---
|
|
24
26
|
|
|
27
|
+
## Contents
|
|
28
|
+
|
|
29
|
+
- [Features](#features)
|
|
30
|
+
- [Quick Start](#quick-start)
|
|
31
|
+
- [Usage](#usage)
|
|
32
|
+
- [Configuration](#configuration)
|
|
33
|
+
- [Security](#security)
|
|
34
|
+
- [Wikilink Resolution](#wikilink-resolution)
|
|
35
|
+
- [Tool Reference](#tool-reference)
|
|
36
|
+
- [MCP Resources](#mcp-resources)
|
|
37
|
+
- [Troubleshooting](#troubleshooting)
|
|
38
|
+
- [Development](#development)
|
|
39
|
+
- [Testing](#testing)
|
|
40
|
+
- [What's New](#whats-new)
|
|
41
|
+
- [Contributing](#contributing)
|
|
42
|
+
- [License](#license)
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
25
46
|
## Features
|
|
26
47
|
|
|
27
48
|
### Read & Search
|
|
@@ -66,7 +87,7 @@ Every one of the 23 tools ships with rich descriptions, typed schemas, human-rea
|
|
|
66
87
|
|
|
67
88
|
> **Using Obsidian?** There's also an [Obsidian plugin](https://github.com/rps321321/obsidian-mcp-pro-plugin) that runs this server inside the app with a ribbon toggle and settings UI — no config-file editing. Recommended for most users.
|
|
68
89
|
|
|
69
|
-
### One-
|
|
90
|
+
### One-Command Install (Claude Desktop / Cursor)
|
|
70
91
|
|
|
71
92
|
```bash
|
|
72
93
|
npx -y obsidian-mcp-pro install
|
|
@@ -80,7 +101,7 @@ Pin a specific vault:
|
|
|
80
101
|
npx -y obsidian-mcp-pro install --vault /path/to/your/vault
|
|
81
102
|
```
|
|
82
103
|
|
|
83
|
-
### Manual Claude Desktop
|
|
104
|
+
### Manual Claude Desktop Config
|
|
84
105
|
|
|
85
106
|
Add this to your Claude Desktop configuration file (`claude_desktop_config.json`):
|
|
86
107
|
|
|
@@ -117,7 +138,7 @@ If you have multiple vaults, specify which one:
|
|
|
117
138
|
claude mcp add obsidian-mcp-pro -- npx -y obsidian-mcp-pro
|
|
118
139
|
```
|
|
119
140
|
|
|
120
|
-
### HTTP
|
|
141
|
+
### HTTP Transport (Remote Clients, Cursor, ChatGPT, Web)
|
|
121
142
|
|
|
122
143
|
```bash
|
|
123
144
|
npx -y obsidian-mcp-pro --transport=http --port=3333
|
|
@@ -130,7 +151,79 @@ npx -y obsidian-mcp-pro --transport=http --token=your-secret
|
|
|
130
151
|
# or: MCP_HTTP_TOKEN=your-secret npx -y obsidian-mcp-pro --transport=http
|
|
131
152
|
```
|
|
132
153
|
|
|
133
|
-
The HTTP server binds to `127.0.0.1` by default with DNS rebinding protection enabled.
|
|
154
|
+
The HTTP server binds to `127.0.0.1` by default with DNS rebinding protection enabled.
|
|
155
|
+
|
|
156
|
+
> [!WARNING]
|
|
157
|
+
> **Never bind `--host=0.0.0.0` directly to the public internet.** Doing so exposes your entire Obsidian vault to anyone who can reach the port. If you need remote access:
|
|
158
|
+
> - Put the server behind a reverse proxy (nginx, Caddy, Cloudflare Tunnel) that terminates TLS, **and**
|
|
159
|
+
> - Require `--token=<secret>` (or `MCP_HTTP_TOKEN`), **and**
|
|
160
|
+
> - Restrict `--allow-origin` to the specific origins you trust, **and**
|
|
161
|
+
> - Set `--rate-limit` to cap request volume per IP.
|
|
162
|
+
>
|
|
163
|
+
> For local-only setups (same machine / VPN / SSH tunnel), keep the default `127.0.0.1` bind.
|
|
164
|
+
|
|
165
|
+
Additional hardening flags:
|
|
166
|
+
|
|
167
|
+
| Flag | Purpose |
|
|
168
|
+
|------|---------|
|
|
169
|
+
| `--allow-origin=<csv>` | Restrict CORS to an allowlist (e.g. `https://claude.ai,https://chat.openai.com`). Default is `*`. |
|
|
170
|
+
| `--rate-limit=<n>` | Cap requests per minute per client IP. `/health` and `/version` are exempt. Default is unlimited. |
|
|
171
|
+
|
|
172
|
+
Operational endpoints (no auth required):
|
|
173
|
+
|
|
174
|
+
| Endpoint | Returns |
|
|
175
|
+
|----------|---------|
|
|
176
|
+
| `GET /health` | `{ status: "ok", sessions: <n>, version: <string> }` — liveness + session count. |
|
|
177
|
+
| `GET /version` | `{ version: <string> }` — package version, for rollout auditing. |
|
|
178
|
+
|
|
179
|
+
Structured logging is controlled by `LOG_LEVEL` (`debug`/`info`/`warn`/`error`/`silent`, default `info`) and `LOG_FORMAT` (`text`/`json`, default `text`). All logs go to stderr so the stdio transport on stdout is never polluted.
|
|
180
|
+
|
|
181
|
+
---
|
|
182
|
+
|
|
183
|
+
## Usage
|
|
184
|
+
|
|
185
|
+
Once installed, the server exposes 23 tools and 3 resources to whichever MCP client you configured. Below is a transcript of a Claude Desktop conversation showing what day-to-day use looks like.
|
|
186
|
+
|
|
187
|
+
> **You:** Find notes tagged `#project` I touched this week, then summarize the status of each and append today's date under a "Last reviewed" heading in each one.
|
|
188
|
+
|
|
189
|
+
Claude picks the right tools in order, with no guidance beyond the prompt:
|
|
190
|
+
|
|
191
|
+
```text
|
|
192
|
+
🔧 search_by_tag(tag="project", includeContent=false)
|
|
193
|
+
→ 7 notes: "Atlas/overview.md", "Atlas/milestones.md", "Beacon/spec.md", ...
|
|
194
|
+
|
|
195
|
+
🔧 list_notes(folder="Atlas", limit=100)
|
|
196
|
+
→ filters to recent modifications via get_note stats
|
|
197
|
+
|
|
198
|
+
🔧 get_note(path="Atlas/overview.md")
|
|
199
|
+
→ reads content + frontmatter + tags
|
|
200
|
+
|
|
201
|
+
🔧 get_note(path="Atlas/milestones.md")
|
|
202
|
+
→ ...
|
|
203
|
+
|
|
204
|
+
🔧 append_to_note(
|
|
205
|
+
path="Atlas/overview.md",
|
|
206
|
+
content="\n## Last reviewed\n2026-04-21 — on track; waiting on design review."
|
|
207
|
+
)
|
|
208
|
+
→ ok
|
|
209
|
+
|
|
210
|
+
🔧 append_to_note(
|
|
211
|
+
path="Atlas/milestones.md",
|
|
212
|
+
content="\n## Last reviewed\n2026-04-21 — Q2 milestone at risk, see spec.md."
|
|
213
|
+
)
|
|
214
|
+
→ ok
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
> **Claude:** I reviewed 7 project notes tagged `#project`. Atlas is on track pending design review; the Q2 milestone is at risk — details in `milestones.md`. Beacon's spec is complete but has 3 open questions in the frontmatter. I appended a "Last reviewed" section to each.
|
|
218
|
+
|
|
219
|
+
Other things the tool set lets agents do without hand-holding:
|
|
220
|
+
|
|
221
|
+
- **Research a topic across the vault.** `search_notes` → `get_outlinks` → `get_graph_neighbors` walks the graph to `depth=2` and surfaces related notes the user may have forgotten.
|
|
222
|
+
- **Clean up dangling references after a rename.** `move_note` → `find_broken_links` returns every wikilink that now points nowhere, with source note and line number.
|
|
223
|
+
- **Maintain a daily log.** `get_daily_note` reads today's note (using the vault's configured date format) and `append_to_note` adds the new entry — daily-note plugin config is honored, no manual date formatting.
|
|
224
|
+
- **Canvas editing.** `read_canvas` → agent reasons about the node graph → `add_canvas_node` + `add_canvas_edge` lays out new ideas on an existing board.
|
|
225
|
+
|
|
226
|
+
Tool descriptions + typed schemas + safety hints (`readOnlyHint`, `destructiveHint`) are what make this work reliably — the agent knows `delete_note` is destructive and asks first, knows `search_notes` is free to call speculatively, and knows the expected shape of every argument.
|
|
134
227
|
|
|
135
228
|
---
|
|
136
229
|
|
|
@@ -146,6 +239,50 @@ The server locates your vault using the following priority:
|
|
|
146
239
|
|
|
147
240
|
Auto-detection works on **macOS**, **Windows**, and **Linux** by reading the platform-specific Obsidian configuration directory.
|
|
148
241
|
|
|
242
|
+
### Daily-Note Filename Format
|
|
243
|
+
|
|
244
|
+
`get_daily_note`, `create_daily_note`, and the `obsidian://daily` resource render the note path using your vault's `.obsidian/daily-notes.json` `format` string. Moment.js-style tokens are supported:
|
|
245
|
+
|
|
246
|
+
| Token | Example | | Token | Example |
|
|
247
|
+
|-------|---------|-|-------|---------|
|
|
248
|
+
| `YYYY` | `2026` | | `dddd` | `Thursday` |
|
|
249
|
+
| `YY` | `26` | | `ddd` | `Thu` |
|
|
250
|
+
| `MMMM` | `April` | | `dd` | `Th` |
|
|
251
|
+
| `MMM` | `Apr` | | `HH` / `H` | `05` / `5` |
|
|
252
|
+
| `MM` / `M` | `04` / `4` | | `hh` / `h` | `05` / `5` |
|
|
253
|
+
| `DD` / `D` | `09` / `9` | | `mm` / `m` | `07` / `7` |
|
|
254
|
+
| `Do` | `9th` | | `ss` / `s` | `03` / `3` |
|
|
255
|
+
| `DDDD` / `DDD` | `099` / `99` | | `Q` | `2` |
|
|
256
|
+
| `[literal]` | renders the bracket contents verbatim, e.g. `YYYY-[Q]Q` → `2026-Q2` |
|
|
257
|
+
|
|
258
|
+
Unrecognized tokens pass through unchanged. Local time is used (matching Obsidian's rendering).
|
|
259
|
+
|
|
260
|
+
---
|
|
261
|
+
|
|
262
|
+
## Security
|
|
263
|
+
|
|
264
|
+
- **Vault boundary** — every tool and resource routes through a single path resolver that rejects `..` traversal, null-byte injection, and symlinks pointing outside the vault (ancestor-realpath check).
|
|
265
|
+
- **Excluded directories** — `.obsidian`, `.git`, and `.trash` are pruned at traversal time and at resolution time, so nested occurrences never leak back to clients.
|
|
266
|
+
- **HTTP transport** — binds to `127.0.0.1` by default with DNS rebinding protection (host-header allowlist). Optional `--token=<secret>` requires `Authorization: Bearer <secret>` on every `/mcp` request; compared in constant time.
|
|
267
|
+
- **Error sanitization** — filesystem error messages are stripped of absolute host paths before being returned to MCP clients. Uncaught HTTP errors respond with a generic `Internal server error` body; full detail stays in the server log.
|
|
268
|
+
- **Atomic writes** — every note write (`create_note`, `append`, `prepend`, `update_frontmatter`, canvas mutations) stages content to a sibling temp file then renames onto the target, so a crash or kill mid-write never leaves a truncated file. Combined with per-path locks for the full read-modify-write cycle, concurrent callers can't lose each other's updates. The `install` subcommand uses the same pattern and keeps a backup of the previous config.
|
|
269
|
+
- **Rate limiting + CORS allowlist** — optional `--rate-limit` caps per-IP request volume; `--allow-origin` restricts browser-facing CORS. `/health` and `/version` stay reachable under load for monitoring.
|
|
270
|
+
- **Request timeout** — HTTP POST requests are capped at 2 minutes of wall-clock time. Long-lived SSE GET streams are exempt so idle clients aren't reaped.
|
|
271
|
+
- **Process supervision** — `uncaughtException` exits cleanly so systemd/Docker/npx supervisors can restart; `unhandledRejection` logs but doesn't kill the process.
|
|
272
|
+
|
|
273
|
+
---
|
|
274
|
+
|
|
275
|
+
## Wikilink Resolution
|
|
276
|
+
|
|
277
|
+
`[[Target]]` resolves in the same order Obsidian does:
|
|
278
|
+
|
|
279
|
+
1. Exact relative-path match (case-insensitive).
|
|
280
|
+
2. Path-suffix match (e.g. `[[projects/foo]]` picks `work/projects/foo.md`).
|
|
281
|
+
3. Basename match. When multiple notes share a basename, the one that shares the deepest directory prefix with the linking note wins; ties break on shortest overall path.
|
|
282
|
+
4. Frontmatter `aliases` — `[[Display Name]]` resolves to a note whose frontmatter declares that alias. `aliases`, `Aliases`, and `ALIASES` are all recognized.
|
|
283
|
+
|
|
284
|
+
Tag extraction is similarly case-tolerant: `tags`, `Tags`, `TAGS`, `tag`, and `Tag` frontmatter keys are all read.
|
|
285
|
+
|
|
149
286
|
---
|
|
150
287
|
|
|
151
288
|
## Tool Reference
|
|
@@ -190,6 +327,48 @@ Resources provide a URI-based way to access vault data:
|
|
|
190
327
|
|
|
191
328
|
---
|
|
192
329
|
|
|
330
|
+
## Troubleshooting
|
|
331
|
+
|
|
332
|
+
### Tools Don't Show Up in Claude Desktop
|
|
333
|
+
|
|
334
|
+
MCP clients only re-read their config on startup. After editing `claude_desktop_config.json` (or running `npx obsidian-mcp-pro install`), fully quit Claude Desktop (⌘Q on macOS, tray → Quit on Windows) and relaunch. Hot-reloading the window is not enough.
|
|
335
|
+
|
|
336
|
+
### "No Obsidian vault configured" on Startup
|
|
337
|
+
|
|
338
|
+
The server couldn't locate a vault. Resolution order is:
|
|
339
|
+
|
|
340
|
+
1. `OBSIDIAN_VAULT_PATH` env var (absolute path) — always wins if set.
|
|
341
|
+
2. `OBSIDIAN_VAULT_NAME` env var — picks a named vault from Obsidian's global config.
|
|
342
|
+
3. Auto-detection — reads `obsidian.json` (platform-specific) and uses the first valid vault found.
|
|
343
|
+
|
|
344
|
+
Fastest fix: set `OBSIDIAN_VAULT_PATH` in the `env` block of your MCP client's config. Auto-detection fails when Obsidian has never been launched, `obsidian.json` is missing/corrupt, or all registered vaults resolve to paths that no longer exist.
|
|
345
|
+
|
|
346
|
+
### "Path traversal detected" Error on Tool Calls
|
|
347
|
+
|
|
348
|
+
All tool paths must be **vault-relative** (e.g. `notes/hello.md`), never absolute (`/Users/me/vault/notes/hello.md`) or containing `..`. The agent normally gets this right — if you see this error, check whether a custom instruction is asking it to use absolute paths.
|
|
349
|
+
|
|
350
|
+
### HTTP Transport Returns `401 Unauthorized`
|
|
351
|
+
|
|
352
|
+
The server was started with `--token=<secret>` (or `MCP_HTTP_TOKEN` is set in the environment) but the client isn't sending a matching `Authorization: Bearer <secret>` header. Verify the token value and that the header is present — comparison is case-sensitive and constant-time.
|
|
353
|
+
|
|
354
|
+
### HTTP Transport Returns `429 Too Many Requests`
|
|
355
|
+
|
|
356
|
+
`--rate-limit=<n>` is set and the client exceeded N requests in the last 60 seconds from that IP. Either raise the limit, drop it, or wait 60 seconds. `/health` and `/version` are exempt if you need to check liveness under load.
|
|
357
|
+
|
|
358
|
+
### Daily-Note Path Is Wrong or Unresolved
|
|
359
|
+
|
|
360
|
+
The server reads `.obsidian/daily-notes.json` from the vault for the filename format and folder. If that file doesn't exist (the Daily Notes core plugin has never been configured), the server falls back to `YYYY-MM-DD.md` in the vault root. Configure the plugin once inside Obsidian and the server picks it up automatically.
|
|
361
|
+
|
|
362
|
+
### `npx obsidian-mcp-pro` Silently Exits With Code 0
|
|
363
|
+
|
|
364
|
+
This was a bug in versions < 1.4.1 where the `npx`-symlinked CLI entry failed to detect itself as the entrypoint. Upgrade: `npx -y obsidian-mcp-pro@latest install`.
|
|
365
|
+
|
|
366
|
+
### Windows: "EPERM: operation not permitted" During Writes
|
|
367
|
+
|
|
368
|
+
The server retries these transparently (Windows holds stricter file-sharing locks than POSIX) — if you still see the error, it usually means antivirus or a sync client (OneDrive, Dropbox) is holding the file. Exclude the vault folder from real-time antivirus scanning, or pause the sync client during heavy agent sessions.
|
|
369
|
+
|
|
370
|
+
---
|
|
371
|
+
|
|
193
372
|
## Development
|
|
194
373
|
|
|
195
374
|
```bash
|
|
@@ -214,18 +393,29 @@ OBSIDIAN_VAULT_PATH=/path/to/vault npm start
|
|
|
214
393
|
|
|
215
394
|
```
|
|
216
395
|
src/
|
|
217
|
-
index.ts
|
|
218
|
-
config.ts
|
|
219
|
-
|
|
396
|
+
index.ts # Server entry, CLI parser, resource registration
|
|
397
|
+
config.ts # Vault detection, daily-notes config loader
|
|
398
|
+
http-server.ts # Streamable HTTP transport, Bearer auth, session TTL
|
|
399
|
+
install.ts # `install` subcommand (Claude Desktop / Cursor)
|
|
400
|
+
types.ts # Shared TypeScript interfaces
|
|
220
401
|
lib/
|
|
221
|
-
vault.ts
|
|
222
|
-
|
|
402
|
+
vault.ts # Core vault ops (read, search, list, per-file locks,
|
|
403
|
+
# symlink boundary, canvas round-trip)
|
|
404
|
+
markdown.ts # Frontmatter, wikilinks, tags, alias-aware resolver
|
|
405
|
+
dates.ts # Moment-style date format for daily-note filenames
|
|
406
|
+
errors.ts # sanitizeError: strips absolute paths from fs errors
|
|
407
|
+
concurrency.ts # Bounded-concurrency fan-out helper (tag/link scans)
|
|
408
|
+
logger.ts # Leveled stderr logger (text + JSON modes)
|
|
223
409
|
tools/
|
|
224
|
-
read.ts
|
|
225
|
-
write.ts
|
|
226
|
-
tags.ts
|
|
227
|
-
links.ts
|
|
228
|
-
canvas.ts
|
|
410
|
+
read.ts # search_notes, get_note, list_notes, daily, frontmatter
|
|
411
|
+
write.ts # create, append, prepend, update_frontmatter, move, delete
|
|
412
|
+
tags.ts # get_tags, search_by_tag
|
|
413
|
+
links.ts # backlinks, outlinks, orphans, broken, graph_neighbors
|
|
414
|
+
canvas.ts # list, read, add_node, add_edge
|
|
415
|
+
__tests__/
|
|
416
|
+
vault.test.ts markdown.test.ts tools.test.ts
|
|
417
|
+
security.test.ts http-server.test.ts semantics.test.ts
|
|
418
|
+
logger.test.ts
|
|
229
419
|
```
|
|
230
420
|
|
|
231
421
|
---
|
|
@@ -236,13 +426,24 @@ src/
|
|
|
236
426
|
npm test
|
|
237
427
|
```
|
|
238
428
|
|
|
239
|
-
|
|
429
|
+
173 tests covering vault operations, atomic writes + concurrent-mutation races, markdown parsing (frontmatter, wikilinks, tags, code-block detection), moment-token date formatting, canvas round-trip fidelity, HTTP transport (Bearer auth, oversize-body, CORS allowlist with `Vary: Origin`, per-IP rate limiting, `/version`), leveled logger (text + JSON output), and security regression guards (symlink escape, case-only rename, path-leak sanitization, cross-process exclusive-create). Runs against Node 20 + 22 on Ubuntu, macOS, and Windows in CI.
|
|
240
430
|
|
|
241
431
|
---
|
|
242
432
|
|
|
243
|
-
##
|
|
433
|
+
## What's New
|
|
244
434
|
|
|
245
|
-
|
|
435
|
+
**v1.5.0** — production hardening pass:
|
|
436
|
+
|
|
437
|
+
- **Atomic writes** on every mutating tool (temp file + rename). Crashes, kills, or OOMs mid-write can no longer leave a truncated note.
|
|
438
|
+
- **`create_note` exclusive mode uses OS-level `wx`** so an out-of-process writer (Obsidian itself, a sync client) can't slip between the check and the write.
|
|
439
|
+
- **Parallel vault scans** — `search_notes` and the `obsidian://tags` resource fan out 8-way. Order-of-magnitude latency drop on 10K+ note vaults.
|
|
440
|
+
- **HTTP hardening** — per-IP `--rate-limit`, `--allow-origin` CORS allowlist (with `Vary: Origin`), POST request timeout, `GET /version` endpoint.
|
|
441
|
+
- **Structured logger** with `LOG_LEVEL` / `LOG_FORMAT` env vars (text or JSON, stderr-only).
|
|
442
|
+
- **Process supervision** — `uncaughtException` exits cleanly for systemd/Docker; `unhandledRejection` logs without killing the process.
|
|
443
|
+
|
|
444
|
+
Full version history in [CHANGELOG.md](./CHANGELOG.md).
|
|
445
|
+
|
|
446
|
+
---
|
|
246
447
|
|
|
247
448
|
## License
|
|
248
449
|
|
package/build/http-server.d.ts
CHANGED
|
@@ -8,6 +8,16 @@ export interface HttpServerOptions {
|
|
|
8
8
|
* `true` for CLI use. Set `false` when embedding (e.g. inside an Obsidian
|
|
9
9
|
* plugin) so stopping the server doesn't kill the host process. */
|
|
10
10
|
installSignalHandlers?: boolean;
|
|
11
|
+
/** Reported on `/health` and `/version`. Defaults to empty string. */
|
|
12
|
+
version?: string;
|
|
13
|
+
/** Allowed CORS origins. Defaults to `["*"]` to match prior behavior. Use
|
|
14
|
+
* an explicit list (e.g. `["https://claude.ai"]`) to tighten for
|
|
15
|
+
* browser-facing deployments. Requests from other origins still succeed
|
|
16
|
+
* (CORS is a browser-only restriction) but the browser will reject the
|
|
17
|
+
* response. */
|
|
18
|
+
allowedOrigins?: string[];
|
|
19
|
+
/** Max requests per minute per client IP. 0 or undefined disables. */
|
|
20
|
+
rateLimitPerMinute?: number;
|
|
11
21
|
}
|
|
12
22
|
export interface HttpServerHandle {
|
|
13
23
|
host: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http-server.d.ts","sourceRoot":"","sources":["../src/http-server.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"http-server.d.ts","sourceRoot":"","sources":["../src/http-server.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAKpE,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,SAAS,CAAC;IAChC;;wEAEoE;IACpE,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,sEAAsE;IACtE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;oBAIgB;IAChB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,sEAAsE;IACtE,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3B;AAsJD,wBAAsB,eAAe,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAqNxF"}
|
package/build/http-server.js
CHANGED
|
@@ -2,9 +2,16 @@ import { createServer } from "node:http";
|
|
|
2
2
|
import { randomUUID, timingSafeEqual } from "node:crypto";
|
|
3
3
|
import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js";
|
|
4
4
|
import { isInitializeRequest } from "@modelcontextprotocol/sdk/types.js";
|
|
5
|
+
import { log } from "./lib/logger.js";
|
|
5
6
|
const MAX_BODY_BYTES = 4 * 1024 * 1024;
|
|
6
7
|
const SESSION_IDLE_TIMEOUT_MS = 60 * 60 * 1000; // 1 hour
|
|
7
8
|
const SESSION_SWEEP_INTERVAL_MS = 5 * 60 * 1000; // 5 minutes
|
|
9
|
+
// Per-request wall-clock cap. A hung tool handler (e.g. a stuck filesystem
|
|
10
|
+
// or an infinite-loop plugin) would otherwise pin the socket forever — idle
|
|
11
|
+
// session sweep is 1h and doesn't help while the request is still "active".
|
|
12
|
+
// Streamable HTTP responses stay open for the duration of a tool call, so
|
|
13
|
+
// this must be generous enough for large vault scans (search, link graph).
|
|
14
|
+
const REQUEST_TIMEOUT_MS = 2 * 60 * 1000; // 2 minutes
|
|
8
15
|
class BodyTooLargeError extends Error {
|
|
9
16
|
constructor() {
|
|
10
17
|
super("Request body too large");
|
|
@@ -65,17 +72,93 @@ function constantTimeEqual(a, b) {
|
|
|
65
72
|
}
|
|
66
73
|
return timingSafeEqual(aBuf, bBuf);
|
|
67
74
|
}
|
|
68
|
-
function setCors(res) {
|
|
69
|
-
|
|
75
|
+
function setCors(req, res, allowedOrigins) {
|
|
76
|
+
// Reflect the request origin only when it matches the allowlist; fall back
|
|
77
|
+
// to the first allowlist entry otherwise. `*` short-circuits to the
|
|
78
|
+
// permissive default.
|
|
79
|
+
const requestOrigin = req.headers.origin;
|
|
80
|
+
const allowAny = allowedOrigins.includes("*");
|
|
81
|
+
let allowOrigin = "*";
|
|
82
|
+
if (!allowAny) {
|
|
83
|
+
// Always set `Vary: Origin` when the ACAO value depends on the request
|
|
84
|
+
// origin — otherwise a shared cache may serve a response with one origin
|
|
85
|
+
// pinned to a different origin's request. This must fire regardless of
|
|
86
|
+
// whether *this particular* origin matched the allowlist.
|
|
87
|
+
res.setHeader("Vary", "Origin");
|
|
88
|
+
if (requestOrigin && allowedOrigins.includes(requestOrigin)) {
|
|
89
|
+
allowOrigin = requestOrigin;
|
|
90
|
+
}
|
|
91
|
+
else {
|
|
92
|
+
allowOrigin = allowedOrigins[0] ?? "";
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
if (allowOrigin)
|
|
96
|
+
res.setHeader("Access-Control-Allow-Origin", allowOrigin);
|
|
70
97
|
res.setHeader("Access-Control-Allow-Headers", "Content-Type, Authorization, Mcp-Session-Id, Mcp-Protocol-Version");
|
|
71
98
|
res.setHeader("Access-Control-Expose-Headers", "Mcp-Session-Id, Mcp-Protocol-Version, WWW-Authenticate");
|
|
72
99
|
res.setHeader("Access-Control-Allow-Methods", "GET, POST, DELETE, OPTIONS");
|
|
73
100
|
}
|
|
101
|
+
// Sliding-window rate limiter keyed by client IP. In-memory only — fine for
|
|
102
|
+
// a single-node deployment, not shared across replicas. Intentionally simple:
|
|
103
|
+
// no dep on `express-rate-limit`, no bucket refill math, just an array of
|
|
104
|
+
// request timestamps per IP pruned on read.
|
|
105
|
+
class RateLimiter {
|
|
106
|
+
limit;
|
|
107
|
+
windowMs;
|
|
108
|
+
windows = new Map();
|
|
109
|
+
constructor(limit, windowMs = 60_000) {
|
|
110
|
+
this.limit = limit;
|
|
111
|
+
this.windowMs = windowMs;
|
|
112
|
+
}
|
|
113
|
+
check(ip) {
|
|
114
|
+
const now = Date.now();
|
|
115
|
+
const floor = now - this.windowMs;
|
|
116
|
+
const times = this.windows.get(ip) ?? [];
|
|
117
|
+
// Prune expired entries in place (amortized O(1) per request).
|
|
118
|
+
let i = 0;
|
|
119
|
+
while (i < times.length && times[i] <= floor)
|
|
120
|
+
i++;
|
|
121
|
+
const live = i === 0 ? times : times.slice(i);
|
|
122
|
+
if (live.length >= this.limit) {
|
|
123
|
+
this.windows.set(ip, live);
|
|
124
|
+
return false;
|
|
125
|
+
}
|
|
126
|
+
live.push(now);
|
|
127
|
+
this.windows.set(ip, live);
|
|
128
|
+
return true;
|
|
129
|
+
}
|
|
130
|
+
sweep() {
|
|
131
|
+
const floor = Date.now() - this.windowMs;
|
|
132
|
+
for (const [ip, times] of this.windows) {
|
|
133
|
+
const kept = times.filter((t) => t > floor);
|
|
134
|
+
if (kept.length === 0)
|
|
135
|
+
this.windows.delete(ip);
|
|
136
|
+
else
|
|
137
|
+
this.windows.set(ip, kept);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
function clientIp(req) {
|
|
142
|
+
// No X-Forwarded-For trust here: the server binds to localhost by default
|
|
143
|
+
// and does not know whether a reverse proxy is terminating TLS. Operators
|
|
144
|
+
// running behind a proxy should configure rate limiting at the proxy layer.
|
|
145
|
+
const addr = req.socket.remoteAddress ?? "unknown";
|
|
146
|
+
// On dual-stack systems a client connecting via IPv4 is surfaced as
|
|
147
|
+
// `::ffff:1.2.3.4` — normalize so the v4 and v4-mapped-v6 paths share a
|
|
148
|
+
// single rate-limit bucket instead of letting a client double its quota.
|
|
149
|
+
return addr.startsWith("::ffff:") ? addr.slice(7) : addr;
|
|
150
|
+
}
|
|
74
151
|
export async function startHttpServer(opts) {
|
|
75
152
|
const transports = new Map();
|
|
76
153
|
const lastActivity = new Map();
|
|
77
154
|
const touch = (sid) => { lastActivity.set(sid, Date.now()); };
|
|
78
155
|
const mcpServer = opts.buildMcpServer();
|
|
156
|
+
const allowedOrigins = opts.allowedOrigins && opts.allowedOrigins.length > 0
|
|
157
|
+
? opts.allowedOrigins
|
|
158
|
+
: ["*"];
|
|
159
|
+
const rateLimiter = opts.rateLimitPerMinute && opts.rateLimitPerMinute > 0
|
|
160
|
+
? new RateLimiter(opts.rateLimitPerMinute)
|
|
161
|
+
: null;
|
|
79
162
|
// Evict sessions that have been idle past the timeout so dropped clients
|
|
80
163
|
// (crash, network loss, no DELETE) don't leak transports forever.
|
|
81
164
|
const sweeper = setInterval(() => {
|
|
@@ -90,6 +173,7 @@ export async function startHttpServer(opts) {
|
|
|
90
173
|
lastActivity.delete(sid);
|
|
91
174
|
}
|
|
92
175
|
}
|
|
176
|
+
rateLimiter?.sweep();
|
|
93
177
|
}, SESSION_SWEEP_INTERVAL_MS);
|
|
94
178
|
sweeper.unref?.();
|
|
95
179
|
// DNS rebinding protection: restrict Host header to the bound interface +
|
|
@@ -102,16 +186,46 @@ export async function startHttpServer(opts) {
|
|
|
102
186
|
`[::1]:${opts.port}`,
|
|
103
187
|
];
|
|
104
188
|
const httpServer = createServer(async (req, res) => {
|
|
105
|
-
|
|
189
|
+
// Cap wall-clock time for POST requests only. GET is used by the
|
|
190
|
+
// Streamable HTTP transport for long-lived SSE streams that intentionally
|
|
191
|
+
// go write-silent between events — `socket.setTimeout` would reap them
|
|
192
|
+
// as "idle" after 2 minutes and break valid clients. DELETE is a
|
|
193
|
+
// fire-and-forget session teardown and doesn't need a timeout.
|
|
194
|
+
if (req.method === "POST") {
|
|
195
|
+
req.setTimeout(REQUEST_TIMEOUT_MS);
|
|
196
|
+
res.setTimeout(REQUEST_TIMEOUT_MS);
|
|
197
|
+
}
|
|
198
|
+
setCors(req, res, allowedOrigins);
|
|
106
199
|
if (req.method === "OPTIONS") {
|
|
107
200
|
res.writeHead(204);
|
|
108
201
|
res.end();
|
|
109
202
|
return;
|
|
110
203
|
}
|
|
204
|
+
// Rate-limit before any other work (auth, body read) so abusive clients
|
|
205
|
+
// can't waste CPU or memory. Health/version endpoints are exempt — they
|
|
206
|
+
// need to stay reachable for monitoring even under load.
|
|
207
|
+
if (rateLimiter) {
|
|
208
|
+
const ip = clientIp(req);
|
|
209
|
+
const url = new URL(req.url ?? "/", `http://${req.headers.host ?? "localhost"}`);
|
|
210
|
+
const exempt = url.pathname === "/health" || url.pathname === "/version";
|
|
211
|
+
if (!exempt && !rateLimiter.check(ip)) {
|
|
212
|
+
res.setHeader("Retry-After", "60");
|
|
213
|
+
sendJson(res, 429, { error: "Too many requests" });
|
|
214
|
+
return;
|
|
215
|
+
}
|
|
216
|
+
}
|
|
111
217
|
const url = new URL(req.url ?? "/", `http://${req.headers.host ?? "localhost"}`);
|
|
112
218
|
if (url.pathname !== "/mcp") {
|
|
113
219
|
if (url.pathname === "/health") {
|
|
114
|
-
sendJson(res, 200, {
|
|
220
|
+
sendJson(res, 200, {
|
|
221
|
+
status: "ok",
|
|
222
|
+
sessions: transports.size,
|
|
223
|
+
version: opts.version ?? "",
|
|
224
|
+
});
|
|
225
|
+
return;
|
|
226
|
+
}
|
|
227
|
+
if (url.pathname === "/version") {
|
|
228
|
+
sendJson(res, 200, { version: opts.version ?? "" });
|
|
115
229
|
return;
|
|
116
230
|
}
|
|
117
231
|
sendJson(res, 404, { error: "Not found" });
|
|
@@ -184,7 +298,7 @@ export async function startHttpServer(opts) {
|
|
|
184
298
|
sendJson(res, 405, { error: "Method not allowed" });
|
|
185
299
|
}
|
|
186
300
|
catch (err) {
|
|
187
|
-
|
|
301
|
+
log.error("HTTP error", { err: err });
|
|
188
302
|
if (!res.headersSent) {
|
|
189
303
|
// Do not forward internal error messages to HTTP clients — they may
|
|
190
304
|
// contain file paths or SDK internals. Full detail is logged above.
|
|
@@ -195,12 +309,19 @@ export async function startHttpServer(opts) {
|
|
|
195
309
|
await new Promise((resolve) => {
|
|
196
310
|
httpServer.listen(opts.port, opts.host, () => resolve());
|
|
197
311
|
});
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
312
|
+
// When port 0 is passed (OS-assigned port, used by tests and embedders
|
|
313
|
+
// that don't care about a specific port), surface the actual bound port
|
|
314
|
+
// so callers can build URLs that work.
|
|
315
|
+
const addr = httpServer.address();
|
|
316
|
+
const boundPort = typeof addr === "object" && addr ? addr.port : opts.port;
|
|
317
|
+
log.info(`HTTP server listening`, {
|
|
318
|
+
url: `http://${opts.host}:${boundPort}/mcp`,
|
|
319
|
+
bearerAuth: Boolean(opts.bearerToken),
|
|
320
|
+
allowedOrigins: allowedOrigins.join(","),
|
|
321
|
+
rateLimitPerMinute: opts.rateLimitPerMinute ?? 0,
|
|
322
|
+
});
|
|
202
323
|
const stop = async () => {
|
|
203
|
-
|
|
324
|
+
log.info(`Shutting down HTTP server`);
|
|
204
325
|
clearInterval(sweeper);
|
|
205
326
|
for (const t of transports.values()) {
|
|
206
327
|
try {
|
|
@@ -223,8 +344,8 @@ export async function startHttpServer(opts) {
|
|
|
223
344
|
}
|
|
224
345
|
return {
|
|
225
346
|
host: opts.host,
|
|
226
|
-
port:
|
|
227
|
-
url: `http://${opts.host}:${
|
|
347
|
+
port: boundPort,
|
|
348
|
+
url: `http://${opts.host}:${boundPort}/mcp`,
|
|
228
349
|
stop,
|
|
229
350
|
};
|
|
230
351
|
}
|
package/build/http-server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http-server.js","sourceRoot":"","sources":["../src/http-server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAA6C,MAAM,WAAW,CAAC;AACpF,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE1D,OAAO,EAAE,6BAA6B,EAAE,MAAM,oDAAoD,CAAC;AACnG,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAoBzE,MAAM,cAAc,GAAG,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC;AACvC,M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HANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAMA,OAAO,EAAE,SAAS,EAAoB,MAAM,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAMA,OAAO,EAAE,SAAS,EAAoB,MAAM,yCAAyC,CAAC;AAmKtF,wBAAgB,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CA+HvE;AAoED,OAAO,EAAE,eAAe,EAAE,KAAK,gBAAgB,EAAE,KAAK,iBAAiB,EAAE,MAAM,kBAAkB,CAAC"}
|