@mnemoverse/mcp-memory-server 0.10.1 → 0.11.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 +89 -13
- package/dist/errors.d.ts +36 -0
- package/dist/errors.js +136 -2
- package/dist/errors.js.map +1 -1
- package/dist/index.d.ts +0 -21
- package/dist/index.js +42 -1474
- package/dist/index.js.map +1 -1
- package/dist/limits.d.ts +68 -0
- package/dist/limits.js +69 -0
- package/dist/limits.js.map +1 -0
- package/dist/names.d.ts +42 -0
- package/dist/names.js +70 -0
- package/dist/names.js.map +1 -1
- package/dist/prompts.d.ts +25 -0
- package/dist/prompts.js +110 -0
- package/dist/prompts.js.map +1 -0
- package/dist/render.d.ts +50 -1
- package/dist/render.js +71 -6
- package/dist/render.js.map +1 -1
- package/dist/requests.d.ts +44 -0
- package/dist/requests.js +66 -0
- package/dist/requests.js.map +1 -1
- package/dist/resources.d.ts +28 -0
- package/dist/resources.js +94 -0
- package/dist/resources.js.map +1 -0
- package/dist/shared.d.ts +31 -0
- package/dist/shared.js +32 -0
- package/dist/shared.js.map +1 -0
- package/dist/time.d.ts +10 -21
- package/dist/time.js +19 -1
- package/dist/time.js.map +1 -1
- package/dist/tools.d.ts +71 -0
- package/dist/tools.js +1915 -0
- package/dist/tools.js.map +1 -0
- package/package.json +24 -5
package/README.md
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
# Mnemoverse Memory
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**Persistent memory for AI agents over MCP.** Tell it a recalled memory helped or misled, and it re-ranks what comes back next. Shared rooms let several agents work from one memory. One key or OAuth across Claude Code, Cursor, VS Code and ChatGPT.
|
|
4
|
+
|
|
5
|
+
`@mnemoverse/mcp-memory-server` is the MIT-licensed MCP server for the hosted Mnemoverse memory engine.
|
|
4
6
|
|
|
5
7
|
[](https://www.npmjs.com/package/@mnemoverse/mcp-memory-server)
|
|
6
8
|
[](https://www.npmjs.com/package/@mnemoverse/mcp-memory-server)
|
|
@@ -11,11 +13,13 @@
|
|
|
11
13
|
|
|
12
14
|
## What is Mnemoverse Memory?
|
|
13
15
|
|
|
14
|
-
Mnemoverse is a hosted memory engine for AI agents, reached over the Model Context Protocol. Mnemoverse stores what your agents learn — decisions, preferences, lessons — and returns it in any connected tool, so one memory follows you across Claude Code, Cursor, VS Code and ChatGPT with
|
|
16
|
+
Mnemoverse is a hosted memory engine for AI agents, reached over the Model Context Protocol. Mnemoverse stores what your agents learn — decisions, preferences, lessons — and returns it in any connected tool, so one memory follows you across Claude Code, Cursor, VS Code and ChatGPT with one account: an API key in a local config, or an OAuth sign-in on the hosted endpoint. Mnemoverse re-ranks recall from outcomes: report that a recalled memory helped and a Rescorla-Wagner update on the prediction error raises it, report that it misled and it sinks — a different mechanism from similarity scoring, usable alongside it.
|
|
17
|
+
|
|
18
|
+
**What is open source here, and what is not.** This repository, the MCP server, is MIT, and so is the Python SDK. The memory engine they talk to is a hosted service with a free tier. Self-hosting the engine is available on Enterprise plans by agreement, when security or compliance requirements call for it; by default we run it for you.
|
|
15
19
|
|
|
16
20
|
## How it compares
|
|
17
21
|
|
|
18
|
-
Most agent memory today lives in one of three places. Per-tool instruction files — `CLAUDE.md`, `.cursorrules`, `AGENTS.md` — are versioned and readable, but each copy belongs to one repo and one tool, and nothing follows you to the next window. A vector store behind RAG retrieves by similarity, and similarity never changes because advice helped or misled. Local-first memory servers win on privacy and latency, and ask you to run and update the infrastructure yourself. Mnemoverse is the managed, cross-tool option in that landscape: nothing to deploy, one
|
|
22
|
+
Most agent memory today lives in one of three places. Per-tool instruction files — `CLAUDE.md`, `.cursorrules`, `AGENTS.md` — are versioned and readable, but each copy belongs to one repo and one tool, and nothing follows you to the next window. A vector store behind RAG retrieves by similarity, and similarity never changes because advice helped or misled. Local-first memory servers win on privacy and latency, and ask you to run and update the infrastructure yourself. Mnemoverse is the managed, cross-tool option in that landscape: nothing to deploy, one account everywhere, and ranking that moves with reported outcomes. If you need memory inside your own perimeter, a local-first server is the better choice; this one is hosted by default, with Enterprise self-hosting by agreement.
|
|
19
23
|
|
|
20
24
|
The consolidation stage of the engine — HDBSCAN clustering with Von Restorff protection, so distinctive memories are not absorbed into the average — is designed in and currently switched off on the hosted service; our docs say so rather than hide it.
|
|
21
25
|
|
|
@@ -23,9 +27,52 @@ The consolidation stage of the engine — HDBSCAN clustering with Von Restorff p
|
|
|
23
27
|
|
|
24
28
|
## Quick Start
|
|
25
29
|
|
|
30
|
+
### No key: the hosted endpoint
|
|
31
|
+
|
|
32
|
+
If your client signs in over OAuth, you do not need a key at all. Create a free account at [console.mnemoverse.com](https://console.mnemoverse.com/sign-up?utm_source=npm&utm_medium=readme&utm_campaign=mcp-memory-server) (no credit card), then connect the hosted endpoint.
|
|
33
|
+
|
|
34
|
+
Claude Code:
|
|
35
|
+
```bash
|
|
36
|
+
claude mcp add -s user --transport http mnemoverse https://mcp.mnemoverse.com/mcp
|
|
37
|
+
```
|
|
38
|
+
Then run `/mcp` in a session, select `mnemoverse` and choose **Authenticate**.
|
|
39
|
+
|
|
40
|
+
Cursor, in `.cursor/mcp.json`:
|
|
41
|
+
```json
|
|
42
|
+
{ "mcpServers": { "mnemoverse": { "url": "https://mcp.mnemoverse.com/mcp" } } }
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Claude Desktop, Windsurf, VS Code and ChatGPT: [Remote MCP setup](https://mnemoverse.com/docs/api/remote-mcp-server). The local server below is the other path: it runs on your machine and reads an API key.
|
|
46
|
+
|
|
26
47
|
### 1. Get a free API key
|
|
27
48
|
|
|
28
|
-
Sign up at [console.mnemoverse.com](https://console.mnemoverse.com?utm_source=npm&utm_medium=readme&utm_campaign=mcp-memory-server) — takes 30 seconds, no credit card.
|
|
49
|
+
Sign up at [console.mnemoverse.com](https://console.mnemoverse.com/sign-up?utm_source=npm&utm_medium=readme&utm_campaign=mcp-memory-server) — takes 30 seconds, no credit card.
|
|
50
|
+
|
|
51
|
+
**Check the key before you put it in a config.** Both forms ask for the key at a masked prompt and never pass it as a command argument, so it lands neither in your shell history nor in the process list.
|
|
52
|
+
|
|
53
|
+
macOS, Linux, Git Bash:
|
|
54
|
+
```bash
|
|
55
|
+
printf 'Mnemoverse API key: '; read -rs KEY; echo
|
|
56
|
+
printf 'X-Api-Key: %s\n' "$KEY" | curl -s -H @- https://core.mnemoverse.com/api/v1/memory/stats; unset KEY
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Windows PowerShell 5.1 and PowerShell 7:
|
|
60
|
+
```powershell
|
|
61
|
+
$k = [Net.NetworkCredential]::new('', (Read-Host 'Mnemoverse API key' -AsSecureString)).Password
|
|
62
|
+
try { (Invoke-WebRequest https://core.mnemoverse.com/api/v1/memory/stats -Headers @{ 'X-Api-Key' = $k } -UseBasicParsing).Content }
|
|
63
|
+
catch { if ($_.ErrorDetails.Message) { $_.ErrorDetails.Message } else { (New-Object IO.StreamReader($_.Exception.Response.GetResponseStream())).ReadToEnd() } }; Remove-Variable k
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
| The output contains | What it means |
|
|
67
|
+
|---|---|
|
|
68
|
+
| JSON that includes `"total_atoms"` | The key works. |
|
|
69
|
+
| `"reason":"placeholder_key"` | That is the example key from these docs. Create a real one at the console. |
|
|
70
|
+
| `"reason":"malformed_key"` | Not the shape of a key: cut short in the paste, wrapped in quotes, or a different token entirely. |
|
|
71
|
+
| `"reason":"invalid_key"` | The shape is right and no such key exists. Copy it again from the console. |
|
|
72
|
+
| `"reason":"revoked_key"` | The key was revoked and will not work again. Create a new one. |
|
|
73
|
+
| `"reason":"missing_key"` | No key reached the API: what you entered was empty. |
|
|
74
|
+
|
|
75
|
+
In the JSON, `reason` sits inside the `details` object (`details.reason`), next to `details.keys_url`, the console page where keys are created.
|
|
29
76
|
|
|
30
77
|
### 2. Connect to your AI tool
|
|
31
78
|
|
|
@@ -52,7 +99,7 @@ claude mcp add mnemoverse -s user -e MNEMOVERSE_API_KEY=mk_live_YOUR_KEY -e MNEM
|
|
|
52
99
|
|
|
53
100
|
[](https://cursor.com/en/install-mcp?name=mnemoverse&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkBtbmVtb3ZlcnNlL21jcC1tZW1vcnktc2VydmVyQGxhdGVzdCJdLCJlbnYiOnsiTU5FTU9WRVJTRV9BUElfS0VZIjoibWtfbGl2ZV9ZT1VSX0tFWSIsIk1ORU1PVkVSU0VfQVBJX1VSTCI6Imh0dHBzOi8vY29yZS5tbmVtb3ZlcnNlLmNvbS9hcGkvdjEifX0%3D)
|
|
54
101
|
|
|
55
|
-
The install button carries the placeholder key `mk_live_YOUR_KEY`, not yours, so the shortest path is to skip the button: add the JSON below to `~/.cursor/mcp.json`, merging it with any servers already there, and put your own key in place. Get one at [console.mnemoverse.com](https://console.mnemoverse.com?utm_source=npm&utm_medium=readme&utm_campaign=mcp-memory-server). If you did click the button, edit the same key in the `mcp.json` it wrote; Cursor keeps MCP environment values in that file, not in a settings form. Until the key is real the server starts and lists its tools, but every tool call is refused.
|
|
102
|
+
The install button carries the placeholder key `mk_live_YOUR_KEY`, not yours, so the shortest path is to skip the button: add the JSON below to `~/.cursor/mcp.json`, merging it with any servers already there, and put your own key in place. Get one at [console.mnemoverse.com](https://console.mnemoverse.com/sign-up?utm_source=npm&utm_medium=readme&utm_campaign=mcp-memory-server). If you did click the button, edit the same key in the `mcp.json` it wrote; Cursor keeps MCP environment values in that file, not in a settings form. Until the key is real the server starts and lists its tools, but every tool call is refused.
|
|
56
103
|
|
|
57
104
|
```json
|
|
58
105
|
{
|
|
@@ -230,6 +277,8 @@ Your agent should call `memory_read`, find the entry, and answer "Hono". If it d
|
|
|
230
277
|
|
|
231
278
|
If it doesn't remember: check that the client was fully restarted and the config has your real `mk_live_...` key, not the placeholder.
|
|
232
279
|
|
|
280
|
+
> ⭐ If the second session remembered, [star the repo](https://github.com/mnemoverse/mcp-memory-server). It helps other builders find it.
|
|
281
|
+
|
|
233
282
|
## Tools
|
|
234
283
|
|
|
235
284
|
| Tool | What it does |
|
|
@@ -240,11 +289,25 @@ If it doesn't remember: check that the client was fully restarted and the config
|
|
|
240
289
|
| `memory_feedback` | Rate memories as helpful or not (improves future recall) |
|
|
241
290
|
| `memory_stats` | Check how many memories stored, which domains exist |
|
|
242
291
|
| `memory_create_room` | Create a shared memory room; its address works as a `domain` on write/read |
|
|
243
|
-
| `memory_invite_to_room` | Mint
|
|
292
|
+
| `memory_invite_to_room` | Mint an invite (code + link) for a room you own; single-use unless `max_uses` allows more |
|
|
244
293
|
| `memory_join_room` | Join a shared room with an invite code (`mnvr_...`) |
|
|
245
294
|
| `memory_list_rooms` | List rooms you own or joined, with each room's address to use as `domain` |
|
|
246
295
|
| `vault_list` | List Vault secrets by alias and purpose — the secret value is never returned |
|
|
247
296
|
|
|
297
|
+
### Prompts
|
|
298
|
+
|
|
299
|
+
Three named shortcuts for clients that show MCP prompts as commands (Claude Code as `/mcp__mnemoverse__<name>`). Each one only asks the model to use the tools above; none of them calls the API itself.
|
|
300
|
+
|
|
301
|
+
| Prompt | Arguments | What it asks for |
|
|
302
|
+
|------|------|-------------|
|
|
303
|
+
| `recall` | `topic` | Search memory for a topic with `memory_read` and summarize only what comes back |
|
|
304
|
+
| `save_insight` | `insight`, optional `domain` | Store an insight with `memory_write` and confirm what was stored |
|
|
305
|
+
| `what_do_you_know` | `subject` | A briefing from `memory_read` that flags what is not stored |
|
|
306
|
+
|
|
307
|
+
### Resources
|
|
308
|
+
|
|
309
|
+
`memory://item/{memory_id}` opens one saved memory by its id (the `id:` line of a `memory_read` result) for clients that attach MCP resources. It returns the memory's `memory_id`, `content` and `domain` as JSON. It reads your own store only: a memory read from a shared room cannot be opened by id.
|
|
310
|
+
|
|
248
311
|
### Tool surface stability
|
|
249
312
|
|
|
250
313
|
`tools/list` is frozen per released version, so a client can save the list it
|
|
@@ -256,11 +319,22 @@ saw and diff it against what the server serves today, by version.
|
|
|
256
319
|
and what a tool returns, as the CHANGELOG rules state.
|
|
257
320
|
- **Within a MINOR** (x.Y.0): tools and annotation fields may be added, never
|
|
258
321
|
removed or renamed, and no declared annotation field disappears or flips
|
|
259
|
-
silently. Every addition has a line in the CHANGELOG under that version.
|
|
260
|
-
|
|
261
|
-
|
|
322
|
+
silently. Every addition has a line in the CHANGELOG under that version. A
|
|
323
|
+
MINOR may also add an output schema (`outputSchema`, with
|
|
324
|
+
`structuredContent` returned alongside the same text) to a tool that did
|
|
325
|
+
not have one; once declared, that schema's fields are add-only under this
|
|
326
|
+
same rule. Where this server's output schema deliberately differs from the
|
|
327
|
+
hosted connector's, the CHANGELOG entry says so; today that is
|
|
328
|
+
`memory_list_recent`'s `next_cursor`, optional here (absent when the
|
|
329
|
+
service sent a continuation token this client will not pass on) and
|
|
330
|
+
required there.
|
|
331
|
+
- **Removing or renaming a tool or a tool's input parameter, or dropping or
|
|
332
|
+
renaming a declared annotation field,** is announced one MINOR ahead: the
|
|
333
|
+
tool (or parameter) stays, its description says
|
|
262
334
|
`deprecated since x.y, removed in x.z`, and the change lands only in the
|
|
263
|
-
announced version, with its CHANGELOG line. A
|
|
335
|
+
announced version, with its CHANGELOG line. A renamed parameter is accepted
|
|
336
|
+
under both names until then (0.11: `memory_feedback`'s `atom_ids` became
|
|
337
|
+
`memory_ids`). A rename is announced by naming
|
|
264
338
|
both the old and the new name; the version pair alone does not say what a
|
|
265
339
|
client should look for. Because a MINOR may add a field but not remove one, a
|
|
266
340
|
renamed annotation field is declared under both names until the announced
|
|
@@ -268,9 +342,11 @@ saw and diff it against what the server serves today, by version.
|
|
|
268
342
|
- Any difference between two servers of the same version is a bug. Report it
|
|
269
343
|
with both `tools/list` outputs.
|
|
270
344
|
|
|
271
|
-
The list above is the 0.
|
|
345
|
+
The list above is the 0.11 surface: ten tools, each declaring all four hints.
|
|
272
346
|
The hosted connector at `mcp.mnemoverse.com/mcp` serves the same ten.
|
|
273
347
|
|
|
348
|
+
**If the hosted connector stops answering in a session.** A client can keep showing the connector as connected while every call in that session fails with "not connected". Reconnecting it on claude.ai does not revive a session that is already stuck; reconnect from inside the session instead (in Claude Code, `/mcp`, then sign in again). Meanwhile this local server, set up with an API key from the same account as in the Quick Start, reaches the same memory and does not depend on that session's sign-in.
|
|
349
|
+
|
|
274
350
|
## Use cases
|
|
275
351
|
|
|
276
352
|
The pattern that pays off first is cross-tool continuity: a decision made while pairing in Claude Code is there when you open Cursor an hour later, and the preference you stated in VS Code holds in a ChatGPT session that evening. Teams use shared rooms the same way — one place where an agent's lessons about a codebase accumulate instead of being re-taught per seat. And because recall re-ranks from feedback, the memories that keep proving useful surface first, which matters once a store grows past what anyone curates by hand.
|
|
@@ -316,7 +392,7 @@ The retrieval model is published: [arXiv:2603.08965](https://arxiv.org/abs/2603.
|
|
|
316
392
|
- [Cursor](https://mnemoverse.com/docs/api/cursor) · [VS Code](https://mnemoverse.com/docs/api/vs-code) · [Claude Code](https://mnemoverse.com/docs/api/claude) · [ChatGPT](https://mnemoverse.com/docs/api/chatgpt)
|
|
317
393
|
- [Python SDK](https://mnemoverse.com/docs/api/python-sdk)
|
|
318
394
|
- [API Reference](https://mnemoverse.com/docs/api/reference)
|
|
319
|
-
- [Console (get API key)](https://console.mnemoverse.com?utm_source=npm&utm_medium=readme&utm_campaign=mcp-memory-server)
|
|
395
|
+
- [Console (get API key)](https://console.mnemoverse.com/sign-up?utm_source=npm&utm_medium=readme&utm_campaign=mcp-memory-server)
|
|
320
396
|
|
|
321
397
|
**Background reading**
|
|
322
398
|
|
|
@@ -363,7 +439,7 @@ What each tool sends:
|
|
|
363
439
|
| `memory_write` | the `content`, `concepts`, and `domain` you pass |
|
|
364
440
|
| `memory_read` | the `query`, plus any filters: `domain`, `since`/`until`, `exclude_author`, `top_k`, `order_by` |
|
|
365
441
|
| `memory_list_recent` | the feed filters: `domain`, `since`/`until`, `exclude_author`, `limit`, `cursor` |
|
|
366
|
-
| `memory_feedback` | the `
|
|
442
|
+
| `memory_feedback` | the `memory_ids` being rated (sent to the API as `atom_ids`), the `outcome` score, and the `domain` when you pass one (a shared room's address) |
|
|
367
443
|
| `memory_create_room` | the room `name` and `description` |
|
|
368
444
|
| `memory_invite_to_room` | the `room_id`, invite `scope`, and expiry |
|
|
369
445
|
| `memory_join_room` | the invite `code` |
|
package/dist/errors.d.ts
CHANGED
|
@@ -30,6 +30,10 @@
|
|
|
30
30
|
* folklore. The distinctions below are the entire point of this file:
|
|
31
31
|
*
|
|
32
32
|
* 401 auth.py — "Invalid or revoked API key." / "Missing API key." The key.
|
|
33
|
+
* (Read on 2026-08-16. Since 2026-09-20 the engine answers a sentence
|
|
34
|
+
* per cause and adds `details.reason` and `details.keys_url`; the old
|
|
35
|
+
* sentence is what an engine without that change still sends, which is
|
|
36
|
+
* why explain401 keeps the substring branch as its fallback.)
|
|
33
37
|
* 403 routes.py, rooms_routes.py, auth.py — "Room is archived", "Not an
|
|
34
38
|
* active member of this room", "Read-only membership cannot write to
|
|
35
39
|
* this room", "Invalid room address", "You do not own this room", plus
|
|
@@ -64,6 +68,14 @@
|
|
|
64
68
|
* "unified" by a later reader. They agree where it matters: same `Mnemoverse:`
|
|
65
69
|
* opener, same `MNEMOVERSE_API_KEY` variable name, same console origin.
|
|
66
70
|
*/
|
|
71
|
+
/** The console page that issues keys — the one place a user fixes a 401.
|
|
72
|
+
* Exported so src/requests.ts can point at the same URL from
|
|
73
|
+
* `refusePlaceholderKey` instead of repeating the literal (the engine is
|
|
74
|
+
* becoming a second producer of this same URL, `details.keys_url` on a 401
|
|
75
|
+
* body, which is validated against an allow-list rather than trusted
|
|
76
|
+
* outright, see `validatedKeysUrl` below, but this constant stays the
|
|
77
|
+
* fallback for both). */
|
|
78
|
+
export declare const KEYS_URL = "https://console.mnemoverse.com/dashboard/keys";
|
|
67
79
|
/** Everything known about one failed call, at the moment it failed. */
|
|
68
80
|
export interface ApiFailure {
|
|
69
81
|
/** HTTP status. */
|
|
@@ -92,6 +104,24 @@ export interface ErrorEnvelope {
|
|
|
92
104
|
code?: string;
|
|
93
105
|
message?: string;
|
|
94
106
|
retryable?: boolean;
|
|
107
|
+
/**
|
|
108
|
+
* `details.reason` on a 401 (an engine change not yet released as of
|
|
109
|
+
* this one): missing_key | placeholder_key | revoked_key | invalid_key |
|
|
110
|
+
* malformed_key. Absent on every 401 a currently-released engine sends, and
|
|
111
|
+
* absent whenever `details` was not an object carrying a string `reason`.
|
|
112
|
+
* Never defaulted, for the same reason nothing else in this interface is:
|
|
113
|
+
* a made-up reason is a wrong instruction with a confident source.
|
|
114
|
+
*/
|
|
115
|
+
reason?: string;
|
|
116
|
+
/**
|
|
117
|
+
* `details.keys_url` on the same 401, already validated by
|
|
118
|
+
* {@link validatedKeysUrl}: present only when it was an https URL whose
|
|
119
|
+
* host is exactly console.mnemoverse.com. A response body must not be able
|
|
120
|
+
* to point a reader at an arbitrary site, so an untrusted value never
|
|
121
|
+
* reaches this field at all; a caller that wants the URL for a reason
|
|
122
|
+
* branch falls back to {@link KEYS_URL} when this is undefined.
|
|
123
|
+
*/
|
|
124
|
+
keysUrl?: string;
|
|
95
125
|
}
|
|
96
126
|
/**
|
|
97
127
|
* Read the engine's envelope out of a response body.
|
|
@@ -101,6 +131,12 @@ export interface ErrorEnvelope {
|
|
|
101
131
|
* as a FastAPI `HTTPException` arrives wrapped as `{"detail": …}` — where the
|
|
102
132
|
* detail is sometimes a string and sometimes the envelope again. The feed's
|
|
103
133
|
* 404-vs-404 test in this repo pins the nested form, so both are real.
|
|
134
|
+
*
|
|
135
|
+
* `details` (plural, a sibling of `code`/`message`/`retryable`) is read here
|
|
136
|
+
* too, for `reason` and `keys_url`. Anything else inside
|
|
137
|
+
* it is ignored silently: this parser reads a fixed, named set of fields and
|
|
138
|
+
* has no way to tell a future field the engine adds from noise, so silence is
|
|
139
|
+
* the only honest answer for either one.
|
|
104
140
|
*/
|
|
105
141
|
export declare function parseErrorEnvelope(body: string): ErrorEnvelope;
|
|
106
142
|
/** `Retry-After` as whole seconds, when it is a plain number. The HTTP-date
|
package/dist/errors.js
CHANGED
|
@@ -30,6 +30,10 @@
|
|
|
30
30
|
* folklore. The distinctions below are the entire point of this file:
|
|
31
31
|
*
|
|
32
32
|
* 401 auth.py — "Invalid or revoked API key." / "Missing API key." The key.
|
|
33
|
+
* (Read on 2026-08-16. Since 2026-09-20 the engine answers a sentence
|
|
34
|
+
* per cause and adds `details.reason` and `details.keys_url`; the old
|
|
35
|
+
* sentence is what an engine without that change still sends, which is
|
|
36
|
+
* why explain401 keeps the substring branch as its fallback.)
|
|
33
37
|
* 403 routes.py, rooms_routes.py, auth.py — "Room is archived", "Not an
|
|
34
38
|
* active member of this room", "Read-only membership cannot write to
|
|
35
39
|
* this room", "Invalid room address", "You do not own this room", plus
|
|
@@ -69,8 +73,14 @@
|
|
|
69
73
|
* first few hundred characters are where the useful part of any real error
|
|
70
74
|
* body lives. Truncation is announced, never silent. */
|
|
71
75
|
const MAX_BODY_CHARS = 800;
|
|
72
|
-
/** The console page that issues keys — the one place a user fixes a 401.
|
|
73
|
-
|
|
76
|
+
/** The console page that issues keys — the one place a user fixes a 401.
|
|
77
|
+
* Exported so src/requests.ts can point at the same URL from
|
|
78
|
+
* `refusePlaceholderKey` instead of repeating the literal (the engine is
|
|
79
|
+
* becoming a second producer of this same URL, `details.keys_url` on a 401
|
|
80
|
+
* body, which is validated against an allow-list rather than trusted
|
|
81
|
+
* outright, see `validatedKeysUrl` below, but this constant stays the
|
|
82
|
+
* fallback for both). */
|
|
83
|
+
export const KEYS_URL = "https://console.mnemoverse.com/dashboard/keys";
|
|
74
84
|
/** The console page that shows quota and upgrades — where a 429 that waiting
|
|
75
85
|
* cannot fix is resolved. Same URL the engine puts in its own 429 bodies. */
|
|
76
86
|
const USAGE_URL = "https://console.mnemoverse.com/dashboard/usage";
|
|
@@ -79,6 +89,52 @@ const USAGE_URL = "https://console.mnemoverse.com/dashboard/usage";
|
|
|
79
89
|
* module is imported BY index.ts, so reading the value from there would be a
|
|
80
90
|
* cycle. Change one, grep for the other. */
|
|
81
91
|
const DEFAULT_API_URL = "https://core.mnemoverse.com/api/v1";
|
|
92
|
+
/**
|
|
93
|
+
* Is `details.keys_url` safe to put in front of a user?
|
|
94
|
+
*
|
|
95
|
+
* The body is server-controlled, or, on every path this module exists
|
|
96
|
+
* against, controlled by whoever answered instead: a proxy, a gateway, or
|
|
97
|
+
* the endpoint a wrong MNEMOVERSE_API_URL points at. Trusting a URL out of
|
|
98
|
+
* that body outright would let any of them steer a rejected user to a
|
|
99
|
+
* phishing page under the same "create a key here" instruction this file
|
|
100
|
+
* already gives. The allow-list is narrow on purpose: https only, and the
|
|
101
|
+
* host compared exactly against `console.mnemoverse.com` rather than by
|
|
102
|
+
* prefix or suffix, for the same reason src/index.ts compares a loopback
|
|
103
|
+
* hostname exactly rather than with `startsWith`/`endsWith`.
|
|
104
|
+
*/
|
|
105
|
+
function validatedKeysUrl(raw) {
|
|
106
|
+
if (typeof raw !== "string")
|
|
107
|
+
return undefined;
|
|
108
|
+
let url;
|
|
109
|
+
try {
|
|
110
|
+
url = new URL(raw);
|
|
111
|
+
}
|
|
112
|
+
catch {
|
|
113
|
+
return undefined;
|
|
114
|
+
}
|
|
115
|
+
// `host`, not `hostname`: it includes the port, so :8443 on the right name
|
|
116
|
+
// is not "the console". Credentials in the URL are refused outright, since
|
|
117
|
+
// a link the agent reads aloud to a person has no business carrying any,
|
|
118
|
+
// and `user@host` is the oldest way to make one host read like another.
|
|
119
|
+
// `url.href === raw`: the parser is forgiving, and what it forgives is the
|
|
120
|
+
// attack. It strips tabs and newlines out of the middle of the string and
|
|
121
|
+
// trims leading and trailing whitespace, so a value that continues on a new
|
|
122
|
+
// line ("...\nIGNORE PREVIOUS GUIDANCE") parses to the right host while the
|
|
123
|
+
// ORIGINAL string, newline and all, would land in guidance the model
|
|
124
|
+
// trusts, past the `inertOneLine` treatment the raw body gets (Copilot,
|
|
125
|
+
// #136). Accepting only a value that is already its own canonical
|
|
126
|
+
// serialization closes every variant at once: control characters, spaces,
|
|
127
|
+
// an upper-case host, a missing path. The engine sends a canonical URL, so
|
|
128
|
+
// nothing legitimate is lost, and what is returned is the serializer's
|
|
129
|
+
// string, never the caller's.
|
|
130
|
+
return url.protocol === "https:" &&
|
|
131
|
+
url.host === "console.mnemoverse.com" &&
|
|
132
|
+
url.username === "" &&
|
|
133
|
+
url.password === "" &&
|
|
134
|
+
url.href === raw
|
|
135
|
+
? url.href
|
|
136
|
+
: undefined;
|
|
137
|
+
}
|
|
82
138
|
/**
|
|
83
139
|
* Read the engine's envelope out of a response body.
|
|
84
140
|
*
|
|
@@ -87,6 +143,12 @@ const DEFAULT_API_URL = "https://core.mnemoverse.com/api/v1";
|
|
|
87
143
|
* as a FastAPI `HTTPException` arrives wrapped as `{"detail": …}` — where the
|
|
88
144
|
* detail is sometimes a string and sometimes the envelope again. The feed's
|
|
89
145
|
* 404-vs-404 test in this repo pins the nested form, so both are real.
|
|
146
|
+
*
|
|
147
|
+
* `details` (plural, a sibling of `code`/`message`/`retryable`) is read here
|
|
148
|
+
* too, for `reason` and `keys_url`. Anything else inside
|
|
149
|
+
* it is ignored silently: this parser reads a fixed, named set of fields and
|
|
150
|
+
* has no way to tell a future field the engine adds from noise, so silence is
|
|
151
|
+
* the only honest answer for either one.
|
|
90
152
|
*/
|
|
91
153
|
export function parseErrorEnvelope(body) {
|
|
92
154
|
let parsed;
|
|
@@ -102,10 +164,18 @@ export function parseErrorEnvelope(body) {
|
|
|
102
164
|
if (typeof v !== "object" || v === null)
|
|
103
165
|
return {};
|
|
104
166
|
const o = v;
|
|
167
|
+
const details = typeof o.details === "object" && o.details !== null
|
|
168
|
+
? o.details
|
|
169
|
+
: undefined;
|
|
105
170
|
return {
|
|
106
171
|
...(typeof o.code === "string" ? { code: o.code } : {}),
|
|
107
172
|
...(typeof o.message === "string" ? { message: o.message } : {}),
|
|
108
173
|
...(typeof o.retryable === "boolean" ? { retryable: o.retryable } : {}),
|
|
174
|
+
...(typeof details?.reason === "string" ? { reason: details.reason } : {}),
|
|
175
|
+
...(() => {
|
|
176
|
+
const keysUrl = validatedKeysUrl(details?.keys_url);
|
|
177
|
+
return keysUrl !== undefined ? { keysUrl } : {};
|
|
178
|
+
})(),
|
|
109
179
|
};
|
|
110
180
|
};
|
|
111
181
|
const top = pick(parsed);
|
|
@@ -155,6 +225,13 @@ function has(message, needle) {
|
|
|
155
225
|
* FIRST because its sentence itself contains "API key": a naive key-mention
|
|
156
226
|
* test would misroute it. A message naming neither gets the honest generic
|
|
157
227
|
* form; silence is the same unknown-refuser case the 403 branch handles.
|
|
228
|
+
*
|
|
229
|
+
* A fourth source arrived after the above was written: `details.reason`
|
|
230
|
+
* on the engine's 401, which names the key problem outright instead of
|
|
231
|
+
* leaving this file to guess from prose. It is checked second, still after
|
|
232
|
+
* "caller org not identified" for the same reason that clause runs first at
|
|
233
|
+
* all (a valid key must never be told to replace itself), and still before
|
|
234
|
+
* the substring guess, since a named reason needs no guessing.
|
|
158
235
|
*/
|
|
159
236
|
function explain401(env) {
|
|
160
237
|
const m = env.message;
|
|
@@ -166,6 +243,63 @@ function explain401(env) {
|
|
|
166
243
|
"deployment does not have. Quote the detail below, and do not retry " +
|
|
167
244
|
"the same call against this deployment.");
|
|
168
245
|
}
|
|
246
|
+
// `details.reason` (an engine change not yet released as of this
|
|
247
|
+
// one): the engine's own diagnosis of WHICH key problem this is, five
|
|
248
|
+
// named values. Checked here, after "caller org not identified" and before
|
|
249
|
+
// the substring guess right below, because a named reason is a strictly
|
|
250
|
+
// better source than sniffing the message text for "api key": this branch
|
|
251
|
+
// makes that guess unnecessary for every engine new enough to send one.
|
|
252
|
+
// AN UNKNOWN REASON, OR NO REASON AT ALL, every engine released today,
|
|
253
|
+
// falls straight through the switch below to the existing clauses, byte
|
|
254
|
+
// for byte: `reason` is additive, never a replacement for a message this
|
|
255
|
+
// parser cannot yet interpret.
|
|
256
|
+
if (env.reason !== undefined) {
|
|
257
|
+
const keysUrl = env.keysUrl ?? KEYS_URL;
|
|
258
|
+
switch (env.reason) {
|
|
259
|
+
case "placeholder_key":
|
|
260
|
+
return ("Mnemoverse: your API key was rejected (401). The engine itself " +
|
|
261
|
+
"recognises the configured value as the example key from the " +
|
|
262
|
+
"documentation, not one anyone created. Tell the user to replace " +
|
|
263
|
+
`MNEMOVERSE_API_KEY with a real key from ${keysUrl}. Do not retry ` +
|
|
264
|
+
"until they replace it.");
|
|
265
|
+
case "revoked_key":
|
|
266
|
+
return ("Mnemoverse: your API key was rejected (401). This key was " +
|
|
267
|
+
"revoked and will never work again, no matter how many times the " +
|
|
268
|
+
`call is retried. Tell the user to create a new one at ${keysUrl} ` +
|
|
269
|
+
"and put it in their MCP client config in place of this one. Do " +
|
|
270
|
+
"not retry with the same key.");
|
|
271
|
+
case "invalid_key":
|
|
272
|
+
return ("Mnemoverse: your API key was rejected (401). The engine does " +
|
|
273
|
+
"not recognise this key at all, most often because it was pasted " +
|
|
274
|
+
"incompletely. Tell the user to check that the whole key was " +
|
|
275
|
+
`copied from ${keysUrl}, with nothing missing from either end, or ` +
|
|
276
|
+
"to create a new one there. Do not retry until it is fixed.");
|
|
277
|
+
case "malformed_key":
|
|
278
|
+
return ("Mnemoverse: your API key was rejected (401). The configured " +
|
|
279
|
+
"value does not have the shape of a Mnemoverse key at all " +
|
|
280
|
+
"(mk_live_ followed by 32 lower-case hex characters). Common " +
|
|
281
|
+
"causes are pasting something else entirely, such as an OAuth " +
|
|
282
|
+
"token, a key cut short in the paste, or a key wrapped in " +
|
|
283
|
+
// Not "surrounding spaces": `fetch` trims whitespace around a header
|
|
284
|
+
// value (and so does HTTP), so a padded key reaches the engine
|
|
285
|
+
// intact and is judged on its own. Probed live on 2026-09-20: a
|
|
286
|
+
// quoted key is malformed_key, a key with a trailing space is not.
|
|
287
|
+
`quotes. Tell the user to check MNEMOVERSE_API_KEY against a real ` +
|
|
288
|
+
`key from ${keysUrl}. Do not retry until it is fixed.`);
|
|
289
|
+
case "missing_key":
|
|
290
|
+
return ("Mnemoverse: your API key was rejected (401). The X-Api-Key " +
|
|
291
|
+
"header did not arrive at all, so the engine never saw a key to " +
|
|
292
|
+
"check. Tell the user to set MNEMOVERSE_API_KEY in their MCP " +
|
|
293
|
+
`client config to a real key from ${keysUrl}, then restart the ` +
|
|
294
|
+
"MCP server. Do not retry until it is set.");
|
|
295
|
+
default:
|
|
296
|
+
// Not one of the five named values. Fall through: an engine that
|
|
297
|
+
// adds a sixth reason before this client learns it must not get a
|
|
298
|
+
// worse answer than the one it would have gotten with no reason at
|
|
299
|
+
// all.
|
|
300
|
+
break;
|
|
301
|
+
}
|
|
302
|
+
}
|
|
169
303
|
if (has(m, "api key") || has(m, "x-api-key")) {
|
|
170
304
|
// Wording endorsed by the founder, kept verbatim — this is the sentence
|
|
171
305
|
// the whole change was commissioned for. One widening, grounded in the
|
package/dist/errors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiEG;AAEH;;;yDAGyD;AACzD,MAAM,cAAc,GAAG,GAAG,CAAC;AAE3B,4EAA4E;AAC5E,MAAM,QAAQ,GAAG,+CAA+C,CAAC;AAEjE;8EAC8E;AAC9E,MAAM,SAAS,GAAG,gDAAgD,CAAC;AAEnE;;;6CAG6C;AAC7C,MAAM,eAAe,GAAG,oCAAoC,CAAC;AAiC7D;;;;;;;;GAQG;AACH,MAAM,UAAU,kBAAkB,CAAC,IAAY;IAC7C,IAAI,MAAe,CAAC;IACpB,IAAI,CAAC;QACH,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC5B,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,MAAM,IAAI,GAAG,CAAC,CAAU,EAAiB,EAAE;QACzC,IAAI,OAAO,CAAC,KAAK,QA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QAAQ,GAAG,kBAAkB,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IAC7C,CAAC;IAED;;;;;;;;;;;;;;;;OAgBG;IACH,IAAI,SAAS;QACX,OAAO,IAAI,CAAC,MAAM,KAAK,GAAG,IAAI,iBAAiB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACjE,CAAC;CACF"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,24 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
3
|
-
/**
|
|
4
|
-
* Two renderers, and which one a value gets is a decision, not a style choice.
|
|
5
|
-
*
|
|
6
|
-
* `safeInline` (src/render.ts) SANITISES an untrusted display string for inline
|
|
7
|
-
* rendering in tool output that a DIFFERENT principal's LLM will read (CN-032
|
|
8
|
-
* anti-injection): strip to a conservative charset, collapse whitespace, cap
|
|
9
|
-
* the length. The treatment `formatAuthorTag` applies to a server-stamped
|
|
10
|
-
* author, and the defensive second pass the machine-shaped room fields
|
|
11
|
-
* (address, room_id, role, scope — all charset-validated or enum-shaped in
|
|
12
|
-
* core) get here. It is lossy on purpose, and everything it still renders is a
|
|
13
|
-
* value the reader looks at and never has to retype or compare.
|
|
14
|
-
*
|
|
15
|
-
* `exactLiteral` / `domainPhrase` / `roomNamePhrase` (src/names.ts) print a
|
|
16
|
-
* value as a JSON string literal, or refuse to print it. Domain names because
|
|
17
|
-
* the engine matches them byte-for-byte, so the reader must be able to send
|
|
18
|
-
* the exact bytes back. Room NAMES (0.8.1) because the sanitiser did not make
|
|
19
|
-
* them harmless so much as it made them WRONG: "проект" echoed back as `""` on
|
|
20
|
-
* create, "Zoë" as "Zo" inside quotes that claim to be the name. The literal
|
|
21
|
-
* is one line with quotes, backslashes and invisibles escaped, so it is as
|
|
22
|
-
* injection-safe as the sanitised spelling was — without the renaming.
|
|
23
|
-
*/
|
|
24
3
|
export declare const server: McpServer;
|