wontopos-mcp 1.0.13 → 1.0.14

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.
Files changed (3) hide show
  1. package/README.md +38 -2
  2. package/index.mjs +13 -2
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -79,8 +79,12 @@ Create a key in the [console](https://wontopos.com). Optional env:
79
79
  this to the agent explicitly. Don't store untrusted third-party text as
80
80
  memories in a store an autonomous agent obeys.
81
81
  - **Never store secrets as memories** - anything stored is recallable by every
82
- tool holding the key. Runs locally over stdio: the key stays in your
83
- environment and never passes through a third-party server.
82
+ tool holding the key.
83
+ - **This package runs locally over stdio**, so your key stays in your environment and
84
+ is never sent to us as part of an MCP session — it only rides the API calls the
85
+ server makes on your behalf. The hosted endpoint below is the other trade: your host
86
+ sends the key to us on every call, exactly like any API request. Neither is wrong;
87
+ pick the one whose exposure you prefer.
84
88
 
85
89
  ## Tools
86
90
 
@@ -96,6 +100,38 @@ Create a key in the [console](https://wontopos.com). Optional env:
96
100
  | `stats` | Memory counts for a store. |
97
101
  | `create_store` | Creates the pinned store after asking the user (any store with `ALLOW_STORE_OVERRIDE=1`). |
98
102
 
103
+ ## Hosted endpoint (for hosts that can't run a local process)
104
+
105
+ Some MCP hosts only speak remote MCP — they cannot spawn `npx` on your machine. Those
106
+ connect to the hosted endpoint instead. Same memory, same stores, same account:
107
+
108
+ ```json
109
+ {
110
+ "mcpServers": {
111
+ "wontopos": {
112
+ "url": "https://api.wontopos.com/mcp",
113
+ "headers": {
114
+ "X-API-Key": "wos-live-...",
115
+ "X-WOS-Store": "my-project"
116
+ }
117
+ }
118
+ }
119
+ }
120
+ ```
121
+
122
+ `X-WOS-Store` pins the connection to one store (omit it for the seeded `default`), and
123
+ `X-WOS-Read-Only: 1` registers no write tools. The store is named by the CONNECTION, not
124
+ by the model — the tools take no store argument, so a prompt-injected model cannot move
125
+ to a sibling store.
126
+
127
+ It offers `recall` · `search` · `remember` · `list_memories` · `stats` · `engram` — the
128
+ retrieval and write core. The curation tools (`update`, `forget`, `create_store`) are
129
+ local-only for now.
130
+
131
+ The endpoint is a protocol adapter, not a second way in: every tool call re-enters the
132
+ ordinary `/api/v1/memory` routes carrying your key, so the same authentication, rate
133
+ limits, billing gates and tenant isolation apply — the same code, not a copy of it.
134
+
99
135
  ## One memory, many tools
100
136
 
101
137
  Same `WONTOPOS_API_KEY` + same store id ⇒ the memory follows you:
package/index.mjs CHANGED
@@ -124,7 +124,13 @@ if (!apiKey) {
124
124
  // non-numeric value, 0, negative) falls back to the default rather than being
125
125
  // passed through as a broken timeout — mirrors the SDK's NaN guard.
126
126
  const timeoutRaw = Number(process.env.WONTOPOS_TIMEOUT_MS);
127
- const timeoutMs = Number.isFinite(timeoutRaw) && timeoutRaw > 0 ? timeoutRaw : 20000;
127
+ // Upper bound as well as lower. `2147483648` is finite and positive, so it passed the
128
+ // old check — and then Node's timer overflows a signed 32-bit millisecond field and
129
+ // clamps it to ~1ms, so the boot check and every tool call failed almost instantly.
130
+ // A value meant to be generous became the shortest possible timeout.
131
+ const TIMEOUT_MAX_MS = 2_147_483_647; // Node's ceiling; above it, timers wrap to 1ms
132
+ const timeoutMs =
133
+ Number.isFinite(timeoutRaw) && timeoutRaw > 0 ? Math.min(timeoutRaw, TIMEOUT_MAX_MS) : 20000;
128
134
 
129
135
  // Model: default tablet-1 (lean and fast). Reach for a fuller engine ONLY by
130
136
  // setting WONTOPOS_MODEL=scroll-1 explicitly — it costs more, so it is opt-in and
@@ -225,7 +231,12 @@ function fitToCap(result) {
225
231
  // SILENT — the model would read a short list as the whole answer. Append a
226
232
  // sentinel entry instead: still valid JSON, still an array, and the reader
227
233
  // is told what is missing. A truncation nobody can see is the worse bug.
228
- return Array.isArray(clone) ? ser([...clone, { _truncated: note }]) : ser({ ...clone, _truncated: note });
234
+ // Re-measure WITH the note attached. The loop above checked the payload before
235
+ // this sentinel existed, so appending it could carry the reply back over the
236
+ // hard cap (measured: 131,162 bytes against a 131,072 limit). If it still does
237
+ // not fit, drop to the last-resort form below rather than ship an oversized one.
238
+ const withNote = Array.isArray(clone) ? ser([...clone, { _truncated: note }]) : ser({ ...clone, _truncated: note });
239
+ if (byteLen(withNote) <= MAX_RESULT_BYTES) return withNote;
229
240
  }
230
241
  }
231
242
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wontopos-mcp",
3
- "version": "1.0.13",
3
+ "version": "1.0.14",
4
4
  "mcpName": "com.wontopos/mcp",
5
5
  "description": "(beta) Wontopos (WOS) long-term memory as an MCP server — one memory across Claude Code, Claude Desktop, Cursor, ChatGPT, and your own agents.",
6
6
  "keywords": [