@engramx/mcp 0.16.0-rc.2 → 0.16.0-rc.20

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 CHANGED
@@ -10,7 +10,7 @@ EngramX speaks MCP from two places, and installing the wrong one is the most com
10
10
  |---|---|---|
11
11
  | Where it runs | On-chain, at the engram's `/mcp` HTTPS endpoint | On the machine the agent runs on, spawned over stdin/stdout |
12
12
  | Credential | OAuth 2.1 bearer token, installed once (an agent connected by sign-in) | The Ed25519 key for this engram, on disk (a paired agent) |
13
- | Install | Nothing to install — point the MCP client at the URL | `npx @engramx/mcp` |
13
+ | Install | Nothing to install — point the MCP client at the URL | `npx @engramx/mcp@0.16.0-rc.20` |
14
14
  | Tools | 10 | 19 |
15
15
  | Has money tools | No — payment vouchers are signed with a client-held key, which a canister cannot hold ⟨corrected 2026-09-30: no voucher is signed; paying is a ledger approval plus a call made as the buyer's own key, which a canister cannot make on the agent's behalf⟩ | Yes |
16
16
  | Docs | [engramx.ai/docs](https://engramx.ai/docs) | this file |
@@ -19,7 +19,7 @@ EngramX speaks MCP from two places, and installing the wrong one is the most com
19
19
  package can print the config for it without starting a server:
20
20
 
21
21
  ```bash
22
- npx @engramx/mcp connect --canister xxxxx-xxxxx-xxxxx-xxxxx-xxx
22
+ npx @engramx/mcp@0.16.0-rc.20 connect --canister xxxxx-xxxxx-xxxxx-xxxxx-xxx
23
23
  ```
24
24
 
25
25
  That prints the engram's remote MCP URL plus per-client setup for 14 supported MCP clients (11
@@ -44,12 +44,12 @@ tools, the profile/session helpers, or a client-held key you control.
44
44
  ## Prerequisites
45
45
 
46
46
  - Node.js >= 22.12 (inherited from `@engramx/client`, which this package depends on)
47
- - An engram your agent is paired with (the key for this engram, from `npx @engramx/client@0.16.0-rc.2 pair`)
47
+ - An engram your agent is paired with (the key for this engram, from `npx @engramx/client@0.16.0-rc.20 pair`)
48
48
 
49
49
  ## Quick Start
50
50
 
51
51
  ```bash
52
- ENGRAM_CANISTER_ID=xxxxx-xxxxx-xxxxx-xxxxx-xxx npx @engramx/mcp
52
+ ENGRAM_CANISTER_ID=xxxxx-xxxxx-xxxxx-xxxxx-xxx npx @engramx/mcp@0.16.0-rc.20
53
53
  ```
54
54
 
55
55
  ## Configuration
@@ -69,7 +69,7 @@ Add to your Claude Desktop config (`~/Library/Application Support/Claude/claude_
69
69
  "mcpServers": {
70
70
  "engramx": {
71
71
  "command": "npx",
72
- "args": ["@engramx/mcp"],
72
+ "args": ["@engramx/mcp@0.16.0-rc.20"],
73
73
  "env": {
74
74
  "ENGRAM_CANISTER_ID": "xxxxx-xxxxx-xxxxx-xxxxx-xxx",
75
75
  "ENGRAM_SESSION_KEY_PATH": "/Users/you/.engramx/session.key"
@@ -88,7 +88,7 @@ Add to `.cursor/mcp.json` in your project root:
88
88
  "mcpServers": {
89
89
  "engramx": {
90
90
  "command": "npx",
91
- "args": ["@engramx/mcp"],
91
+ "args": ["@engramx/mcp@0.16.0-rc.20"],
92
92
  "env": {
93
93
  "ENGRAM_CANISTER_ID": "xxxxx-xxxxx-xxxxx-xxxxx-xxx",
94
94
  "ENGRAM_SESSION_KEY_PATH": "/Users/you/.engramx/session.key"
@@ -106,7 +106,7 @@ from mcp.client.stdio import stdio_client
106
106
 
107
107
  server = StdioServerParameters(
108
108
  command="npx",
109
- args=["@engramx/mcp"],
109
+ args=["@engramx/mcp@0.16.0-rc.20"],
110
110
  env={
111
111
  "ENGRAM_CANISTER_ID": "xxxxx-xxxxx-xxxxx-xxxxx-xxx",
112
112
  "ENGRAM_SESSION_KEY_PATH": "/path/to/session.key",
@@ -125,7 +125,7 @@ Any MCP-compatible client can spawn the server over stdio:
125
125
  ```bash
126
126
  ENGRAM_CANISTER_ID=xxxxx-xxxxx-xxxxx-xxxxx-xxx \
127
127
  ENGRAM_SESSION_KEY_PATH=/path/to/session.key \
128
- npx @engramx/mcp
128
+ npx @engramx/mcp@0.16.0-rc.20
129
129
  ```
130
130
 
131
131
  The server communicates over stdin/stdout using the MCP protocol. Set environment variables for authentication.
@@ -142,12 +142,13 @@ behind the catalog; the source is private during the beta, so it names none.⟩
142
142
  | Tool | Parameters | Description |
143
143
  |------|-----------|-------------|
144
144
  | `engram_read_memory` | `path` | Read one memory file by exact path — content, version, timestamp |
145
- | `engram_append_memory` | `path`, `content`, `source?` | Append to a memory file (created if missing). Returns the write receipt `{path, version, seq, head}` — `head` is the audit-chain head this write advanced to, and is what you hand a verifier |
145
+ | `engram_append_memory` | `path`, `content`, `source?` | Append to a memory file (created if missing). Returns the write receipt `{path, version, seq, head}` — `head` is the memory file's chain head after this write, and is what you hand a verifier. It is not the audit-chain head: this write's audit-log entry records it, and the certified audit head covers that entry ⟨2026-10-13: this called `head` the audit-chain head⟩ |
146
146
  | `engram_list_memory_files` | _(none)_ | List all memory files (paths, versions, timestamps — no content) |
147
147
  | `engram_read_memory_batch` | `paths` | Read up to 50 files in one call; per-file success or error |
148
148
  | `engram_memory_history` | `path` | Version history of one file — commitments and eviction disclosures, not content |
149
149
  | `engram_read_audit_log` | `fromIndex?`, `limit?` | Read audit-log entries (timestamped, attributed operations) |
150
150
  | `engram_status` | _(none)_ | Canister health and stats |
151
+ | `engram_my_grant` | _(none)_ | ⟨2026-10-21⟩ Your OWN grant on this engram: what you may read, your write folders, your rate and your payment limits. Read it before appending or paying. This server only — the engram's HTTP surface serves sign-in tokens, whose grant is the token's |
151
152
  | `engram_wallet_balance` | _(none)_ | Engram canister **cycles** balance — infrastructure fuel, not token money |
152
153
 
153
154
  `source` on append is an optional self-declaration of what produced the content: `human`,
@@ -164,7 +165,9 @@ claim; it records it in the record beside your principal, which makes a false on
164
165
  | `engram_confirm_job` | `jobId` | **SPENDS.** Irreversibly releases escrow to the seller (BuyerConfirm services) |
165
166
  | `engram_dispute_job` | `jobId`, `reason` | Blocks payout on a completed job instead of releasing it |
166
167
 
167
- `engram_list_services` and `engram_get_job_result` also exist on the remote surface. The three
168
+ `engram_list_services` and `engram_get_job_result` also exist on the remote surface. ⟨2026-10-13: no
169
+ longer — they left the remote surface, where they could only refuse (services and jobs live on the
170
+ market); all five commerce tools are stdio-only.⟩ The three
168
171
  money tools — `submit_service_request`, `confirm_job`, `dispute_job` — are **stdio-only, and
169
172
  structurally so**: submitting signs a payment voucher with the key the agent holds, and the
170
173
  canister cannot sign as the buyer.
@@ -207,11 +210,13 @@ what else the credential carries.
207
210
 
208
211
  ## Pairing Your Agent (the key for this engram)
209
212
 
210
- 1. Create an engram at [engramx.ai](https://engramx.ai) or via the CLI
213
+ 1. Create an engram at [engramx.ai](https://engramx.ai) ⟨2026-10-13: it said "or via the CLI"; creating
214
+ an engram from the CLI was retired on 2026-10-05 — a person creates one on the set-up page, an agent
215
+ opens its own with `open-engram`⟩
211
216
  2. Generate an agent invite in the engram dashboard
212
217
  3. Pair your agent:
213
218
  ```bash
214
- npx @engramx/client@0.16.0-rc.2 pair <invite-code> --engram <canister-id>
219
+ npx @engramx/client@0.16.0-rc.20 pair <invite-code> --engram <canister-id>
215
220
  ```
216
221
  ⟨2026-10-03⟩ Every pairing command in this README names the package and the version it ships
217
222
  with. Before, it called the globally installed `engramx` command, which runs whatever version is
@@ -227,7 +232,7 @@ Point the published server at a local replica:
227
232
  ```bash
228
233
  ENGRAM_CANISTER_ID=<local-canister-id> \
229
234
  ENGRAM_HOST=http://localhost:4943 \
230
- npx @engramx/mcp
235
+ npx @engramx/mcp@0.16.0-rc.20
231
236
  ```
232
237
 
233
238
  ⟨2026-09-30: this section began with building the server from a clone of its source, and the
@@ -237,7 +242,7 @@ came out; the published package is all you need to run or test the server.⟩
237
242
  Inspect with the MCP Inspector:
238
243
 
239
244
  ```bash
240
- npx @modelcontextprotocol/inspector -- npx @engramx/mcp
245
+ npx @modelcontextprotocol/inspector -- npx @engramx/mcp@0.16.0-rc.20
241
246
  ```
242
247
 
243
248
  ## Troubleshooting
@@ -246,7 +251,7 @@ npx @modelcontextprotocol/inspector -- npx @engramx/mcp
246
251
  The server exits with a clear error. Set the environment variable to your engram canister ID.
247
252
 
248
253
  **The key for this engram was not found**
249
- Generate one with `npx @engramx/client@0.16.0-rc.2 pair`. The default path is `~/.engramx/session.key`. Override with `ENGRAM_SESSION_KEY_PATH`.
254
+ Generate one with `npx @engramx/client@0.16.0-rc.20 pair`. The default path is `~/.engramx/session.key`. Override with `ENGRAM_SESSION_KEY_PATH`.
250
255
 
251
256
  **Canister unreachable**
252
257
  Check that `ENGRAM_HOST` is correct (default: `https://ic0.app` for mainnet). For local development, use `http://localhost:4943`. Verify network connectivity.
package/dist/connect.js CHANGED
@@ -1,10 +1,13 @@
1
1
  // `npx @engramx/mcp connect` — print ready-to-use config for connecting any MCP client to an
2
2
  // engram's remote MCP endpoint, and optionally write the Claude Desktop config file. Uses the
3
- // shared connect-config module (connect-config.ts) so every consumer emits identical config.
4
- import { writeFileSync, mkdirSync, existsSync, readFileSync } from 'node:fs';
5
- import { dirname, join } from 'node:path';
6
- import { homedir, platform } from 'node:os';
7
- import { connectInfo, claudeDesktopConfig } from './connect-config.js';
3
+ // shared connect-config module (`@engramx/client/connect-config`) so every consumer emits identical
4
+ // config.
5
+ //
6
+ // ⟨2026-10-13, the bloat audit⟩ The config generator moved into @engramx/client, and `--write` uses
7
+ // the client's one writer (`installMcpConfig`: atomic, and it refuses a config it cannot parse);
8
+ // this file's own writer and per-OS path went with the merge (claude-setup.ts says what had drifted).
9
+ import { connectInfo } from '@engramx/client/connect-config';
10
+ import { claudeConfigPaths, installMcpConfig } from '@engramx/client';
8
11
  import { VERSION } from './version.js';
9
12
  function parseFlags(argv) {
10
13
  const f = {};
@@ -24,47 +27,24 @@ function parseFlags(argv) {
24
27
  }
25
28
  return f;
26
29
  }
27
- /** Default claude_desktop_config.json path per OS. */
28
- function defaultClaudeDesktopPath() {
29
- const home = homedir();
30
- switch (platform()) {
31
- case 'darwin':
32
- return join(home, 'Library', 'Application Support', 'Claude', 'claude_desktop_config.json');
33
- case 'win32':
34
- return join(process.env['APPDATA'] || join(home, 'AppData', 'Roaming'), 'Claude', 'claude_desktop_config.json');
35
- default:
36
- return join(home, '.config', 'Claude', 'claude_desktop_config.json');
37
- }
38
- }
39
- /** Merge the engramx server into an existing claude_desktop_config.json without clobbering others. */
40
- function writeClaudeDesktopConfig(path, p) {
41
- let existing = {};
42
- if (existsSync(path)) {
43
- try {
44
- existing = JSON.parse(readFileSync(path, 'utf-8'));
45
- }
46
- catch {
47
- throw new Error(`${path} exists but is not valid JSON — fix or remove it, then retry.`);
48
- }
49
- }
50
- existing.mcpServers = existing.mcpServers || {};
51
- existing.mcpServers.engramx = claudeDesktopConfig(p).mcpServers.engramx;
52
- mkdirSync(dirname(path), { recursive: true });
53
- writeFileSync(path, JSON.stringify(existing, null, 2) + '\n');
54
- }
30
+ /**
31
+ * ⟨2026-10-13⟩ Names this tool at its own version (`npx @engramx/mcp@<version> connect …`); it said the
32
+ * bare `npx @engramx/mcp connect …` until then, which runs npm's `latest` — the last final release,
33
+ * the previous one while a release candidate soaks. version.ts says why this package's own version.
34
+ */
35
+ const USAGE = `Usage: npx @engramx/mcp@${VERSION} connect --canister <id> [--host <url>] [--write [path]]`;
55
36
  export async function runConnect(argv) {
56
37
  const f = parseFlags(argv);
57
38
  if (f['help'] || f['h']) {
58
- console.log('Usage: npx @engramx/mcp connect --canister <id> [--host <url>] [--write [path]]');
39
+ console.log(USAGE);
59
40
  return;
60
41
  }
61
- const canisterId = f['canister'] ||
62
- process.env['ENGRAM_CANISTER_ID'] ||
63
- process.env['VAULT_CANISTER_ID'];
42
+ // ⟨2026-10-13⟩ The retired VAULT_CANISTER_ID alias is gone (server.ts says why).
43
+ const canisterId = f['canister'] || process.env['ENGRAM_CANISTER_ID'];
64
44
  const host = f['host'] || process.env['ENGRAM_HOST'] || 'https://icp0.io';
65
45
  if (!canisterId) {
66
46
  console.error('Error: --canister <id> (or ENGRAM_CANISTER_ID) is required.');
67
- console.error('Usage: npx @engramx/mcp connect --canister <id> [--host <url>] [--write [path]]');
47
+ console.error(USAGE);
68
48
  process.exit(2);
69
49
  }
70
50
  // The pairing commands in the guides name this tool's own version (the packages share one).
@@ -80,8 +60,8 @@ export async function runConnect(argv) {
80
60
  console.log(` ${line}`);
81
61
  }
82
62
  if (f['write']) {
83
- const path = typeof f['write'] === 'string' ? f['write'] : defaultClaudeDesktopPath();
84
- writeClaudeDesktopConfig(path, { canisterId, host });
63
+ const path = typeof f['write'] === 'string' ? f['write'] : claudeConfigPaths().claudeDesktop;
64
+ installMcpConfig(path, { canisterId, host, version: VERSION });
85
65
  console.log(`\n✓ Wrote the engramx MCP server to ${path}. Restart Claude Desktop to load it.`);
86
66
  }
87
67
  else {
@@ -1 +1 @@
1
- {"version":3,"file":"connect.js","sourceRoot":"","sources":["../src/connect.ts"],"names":[],"mappings":"AAAA,6FAA6F;AAC7F,8FAA8F;AAC9F,6FAA6F;AAE7F,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAsB,MAAM,qBAAqB,CAAC;AAC3F,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,SAAS,UAAU,CAAC,IAAc;IAChC,MAAM,CAAC,GAAqC,EAAE,CAAC;IAC/C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACrC,MAAM,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;QACpB,IAAI,GAAG,IAAI,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;YAChC,MAAM,CAAC,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YACvB,MAAM,I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C;QAC7F,gBAAgB,CAAC,IAAI,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC;QAC/D,OAAO,CAAC,GAAG,CAAC,uCAAuC,IAAI,sCAAsC,CAAC,CAAC;IACjG,CAAC;SAAM,CAAC;QACN,OAAO,CAAC,GAAG,CACT,oFAAoF,CACrF,CAAC;IACJ,CAAC;AACH,CAAC"}
@@ -7,16 +7,12 @@ function jsonText(value) {
7
7
  * Render what a save actually did.
8
8
  *
9
9
  * The ProfileManager/SessionManager methods hand back the write RECEIPT as of the 2026-08-16
10
- * canister release, or null when the SDK deferred the call to its offline queue instead of
11
- * committing it. These tools used to report `{saved: true, version}` for both outcomes: a queued
12
- * write was announced as saved, and once the return became a record the same field would have
13
- * handed the model a receipt OBJECT where it had been reading a number. `saved` here means
14
- * COMMITTED; `head` is the hex audit-chain head after the write, the value the agent hands a
15
- * third party who wants to verify it without trusting the agent.
10
+ * canister release, and throw on every failure. `saved` here means COMMITTED; `head` is the hex
11
+ * audit-chain head after the write, the value the agent hands a third party who wants to verify it
12
+ * without trusting the agent. ⟨2026-10-13, the owner's 4A⟩ The `{saved: false, queued: true}` arm
13
+ * for a null receipt went with the SDK's offline queue.
16
14
  */
17
15
  function saveResult(receipt, extra = {}) {
18
- if (receipt === null)
19
- return { saved: false, queued: true, ...extra };
20
16
  return { saved: true, version: receipt.version, seq: receipt.seq, head: receipt.head, ...extra };
21
17
  }
22
18
  // MCP ToolAnnotations for the profile/session convenience tools. These have no entry in
@@ -1 +1 @@
1
- {"version":3,"file":"profile-tools.js","sourceRoot":"","sources":["../src/profile-tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,KAAK,CAAC,EAA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rD,MAAM,GAAG,EAAE,CAAC;gBACZ,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;oBAC3B,MAAM,OAAO,GAAG,MAAM,QAAQ,CAAC,WAAW,CAAC,KAAK,CAAC,QAAQ,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;oBACvE,IAAI,OAAO,EAAE,CAAC;wBACZ,MAAM,CAAC,IAAI,CAAC,EAAE,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC;oBACvE,CAAC;gBACH,CAAC;YACH,CAAC;iBAAM,CAAC;gBACN,MAAM,GAAG,MAAM,QAAQ,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;YAC5C,CAAC;YACD,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC;QACjE,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO;gBACL,OAAO,EAAE;oBACP,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,EAAE;iBACrF;gBACD,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
package/dist/server.js CHANGED
@@ -10,20 +10,22 @@ import { HttpAgent } from '@icp-sdk/core/agent';
10
10
  import { registerTools } from './tools.js';
11
11
  import { registerProfileTools } from './profile-tools.js';
12
12
  import { registerResources } from './resources.js';
13
- import { pairCommand } from './connect-config.js';
13
+ import { pairCommand } from '@engramx/client/connect-config';
14
14
  import { VERSION } from './version.js';
15
15
  // --- Environment variables ---
16
- const canisterId = process.env['ENGRAM_CANISTER_ID'] || process.env['VAULT_CANISTER_ID'];
16
+ // ⟨2026-10-13⟩ ENGRAM_* names only. The retired pre-launch VAULT_CANISTER_ID / VAULT_SESSION_KEY_PATH
17
+ // aliases and the undocumented second session-key name ENGRAMX_SESSION_KEY_PATH went in the bloat
18
+ // audit: no doc names them and nothing in this repo, the platform or the Medivox checkouts sets them
19
+ // (the same class as the Vault* export aliases removed 2026-08-17).
20
+ const canisterId = process.env['ENGRAM_CANISTER_ID'];
17
21
  if (!canisterId) {
18
22
  console.error('Error: ENGRAM_CANISTER_ID environment variable is required.\n' +
19
23
  'Set it to your engram canister ID (e.g. "xxxxx-xxxxx-xxxxx-xxxxx-xxx").\n' +
20
- 'To connect a client instead, run: npx @engramx/mcp connect --canister <id>');
24
+ // ⟨2026-10-13⟩ At this server's own version; it named the bare package until then.
25
+ `To connect a client instead, run: npx @engramx/mcp@${VERSION} connect --canister <id>`);
21
26
  process.exit(1);
22
27
  }
23
- const sessionKeyPath = process.env['ENGRAM_SESSION_KEY_PATH'] ||
24
- process.env['ENGRAMX_SESSION_KEY_PATH'] ||
25
- process.env['VAULT_SESSION_KEY_PATH'] ||
26
- join(homedir(), '.engramx', 'session.key');
28
+ const sessionKeyPath = process.env['ENGRAM_SESSION_KEY_PATH'] || join(homedir(), '.engramx', 'session.key');
27
29
  if (!existsSync(sessionKeyPath)) {
28
30
  console.error(`Error: the key for this engram was not found at ${sessionKeyPath}.\n` +
29
31
  `Generate one with: ${pairCommand(VERSION, '<invite-code>', '<canister-id>')}`);
@@ -71,8 +73,10 @@ const market = marketCanisterId
71
73
  marketCanisterId)
72
74
  : null;
73
75
  // --- MCP Server ---
74
- const server = new McpServer({ name: 'engramx', version: '0.1.0' }, {
75
- instructions: 'engramx gives this agent persistent memory in a user-owned canister (an engram) plus an ic402 paid-services marketplace. Agent sessions are APPEND-ONLY: memory can be read and appended to, never overwritten or deleted. Memory flow: engram_list_memory_files (discover paths) -> engram_read_memory or engram_read_memory_batch (fetch content) -> engram_append_memory (add content; memory.append scope; config/ and secrets/ paths are owner-only). engram_memory_history shows prior versions of one file; engram_read_audit_log shows the record of this engram: all of it to the owner or a guardian, only its own entries to an agent, with a count of those withheld. Free reads: engram_status and engram_list_services. engram_wallet_balance reports canister cycles (infrastructure fuel), NOT token money. MONEY: engram_submit_service_request SPENDS ckUSDC (settles a payment at the quoted service price into escrow at submit time) and engram_confirm_job irreversibly releases that escrow to the seller; call these only when the user intends to pay. engram_dispute_job blocks payout instead. engram_get_job_result is a free read.',
76
+ // ⟨2026-10-13⟩ The server announces this package's own version. It said a hard-coded '0.1.0' until
77
+ // then, while every command it prints already named VERSION. Held by test/server-version.test.ts.
78
+ const server = new McpServer({ name: 'engramx', version: VERSION }, {
79
+ instructions: 'engramx gives this agent persistent memory in a user-owned canister (an engram) plus an ic402 paid-services marketplace. Agent sessions are APPEND-ONLY: memory can be read and appended to, never overwritten or deleted. Memory flow: engram_list_memory_files (discover paths) -> engram_read_memory or engram_read_memory_batch (fetch content) -> engram_append_memory (add content; memory.append scope; config/ and secrets/ paths are owner-only). engram_memory_history shows prior versions of one file; engram_read_audit_log shows the record of this engram: all of it to the owner or a guardian, only its own entries in full to an agent, every other entry as a hash-only row. Free reads: engram_status and engram_list_services. engram_wallet_balance reports canister cycles (infrastructure fuel), NOT token money. MONEY: engram_submit_service_request SPENDS ckUSDC (settles a payment at the quoted service price into escrow at submit time) and engram_confirm_job irreversibly releases that escrow to the seller; call these only when the user intends to pay. engram_dispute_job blocks payout instead. engram_get_job_result is a free read.',
76
80
  });
77
81
  const profile = new ProfileManager(engram);
78
82
  const sessions = new SessionManager(engram);
@@ -1 +1 @@
1
- {"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,gGAAgG;AAChG,yFAAyF;AAEzF,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,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CHANGED
@@ -128,7 +128,13 @@ market = null) {
128
128
  // are append-only. Owner uses the dashboard at engramx.ai or the canister IDL
129
129
  // directly via Internet Identity.)
130
130
  // 2. engram_append_memory
131
- server.tool('engram_append_memory', 'Append text to a memory file; the file is created if it does not exist. APPEND-ONLY: never overwrites or deletes, and this is the ONLY mutating memory tool on this surface (no write/delete/rollback exists here). Requires the memory.append scope (agent with canAppendMemory, or owner). Rejected: config/ and secrets/ paths (owner-only), owner-protected paths, and while guardian writes are paused. Returns JSON {path, version, seq, head} — the write receipt: version is the file version after this write, seq its position in the engram event sequence, and head the hex audit-chain head, which is what you hand a third party who wants to verify this write without trusting you.', {
131
+ // ⟨2026-10-13⟩ The description called head "the hex audit-chain head". It is the memory file's own
132
+ // chain head after the write (src/ledgerfs/Chain.mo `commit`); the write's audit-log entry records
133
+ // it (`receiptSuffix` in src/engram/main.mo), and the certified audit head (getCertifiedAuditHead)
134
+ // and the registry's anchor cover that entry. Neither equals head, so a verifier told to compare
135
+ // them saw a mismatch that is not a defect. tool-schemas.json, the canister's HTTP catalog, already
136
+ // said it right. test/tools.test.ts holds these words.
137
+ server.tool('engram_append_memory', 'Append text to a memory file; the file is created if it does not exist. APPEND-ONLY: never overwrites or deletes, and this is the ONLY mutating memory tool on this surface (no write/delete/rollback exists here). Requires the memory.append scope (agent with canAppendMemory, or owner). Rejected: config/ and secrets/ paths (owner-only), owner-protected paths, and while guardian writes are paused. Returns JSON {path, version, seq, head} — the write receipt: version is the file version after this write, seq its position in the engram event sequence, and head the hex chain head of this memory file after this write. head is not the audit-chain head: it is recorded in the audit-log entry for this write, which the certified audit head and the registry anchor cover, so it is what you hand a third party who wants to verify this write without trusting you.', {
132
138
  path: z
133
139
  .string()
134
140
  .describe(`Target file path to append to; created if absent. Max ${MAX_PATH_LENGTH} characters, no ".."; agents cannot use the config/ or secrets/ prefixes (owner-only).`),
@@ -144,19 +150,11 @@ market = null) {
144
150
  if (pathErr)
145
151
  return { content: [{ type: 'text', text: pathErr }], isError: true };
146
152
  try {
147
- // The SDK returns the RECEIPT now; null is its "deferred to the offline queue" answer.
148
- // This server never sets offlineQueuePath (server.ts constructs the client without it),
149
- // so null is unreachable here — the branch exists only because the SDK type is
150
- // MemoryReceipt | null, and the tool description deliberately does not advertise it:
151
- // describing an outcome no configuration of this server can produce is the fabrication
152
- // class this product refuses. Surfacing `head` is the point — it is what an agent hands
153
- // a verifier.
153
+ // The SDK returns the write RECEIPT, and throws on every failure. Surfacing `head` is the
154
+ // point — it is what an agent hands a verifier. ⟨2026-10-13, the owner's 4A⟩ The `queued`
155
+ // branch for a null receipt went with the SDK's offline queue, which this server never
156
+ // configured.
154
157
  const receipt = await engram.appendMemory(path, content, source);
155
- if (receipt === null) {
156
- return {
157
- content: [{ type: 'text', text: jsonText({ path, queued: true }) }],
158
- };
159
- }
160
158
  return {
161
159
  content: [
162
160
  {
@@ -325,7 +323,7 @@ market = null) {
325
323
  // record and carries none of the three, so an agent was being taught to read fields that never
326
324
  // arrive. It now says what the reply carries, and agrees with the HTTP catalog's entry in
327
325
  // tool-schemas.json, which was already right.
328
- server.tool('engram_status', 'FREE health snapshot of the engram canister; no auth or scope needed, and every caller gets the same answer. Returns version, memoryFileCount, auditLogSize, agentCount, guardianCount, paymentsFrozen, writesPaused, backup and read/write counters, encryptionEnabled. It does NOT carry the owner or the cycles balance, and it has no field saying whether this session is authorized. Check paymentsFrozen/writesPaused before paying or appending. For the cycles fuel number use engram_wallet_balance.', READ_ONLY, async () => {
326
+ server.tool('engram_status', 'FREE health snapshot of the engram canister; no auth or scope needed, and every caller gets the same answer. Returns version, memoryFileCount, auditLogSize, agentCount, activeAgentCount, endedAgentCount, guardianCount, paymentsFrozen, writesPaused, backup and read/write counters, encryptionEnabled. agentCount is every agent on the roster: activeAgentCount (may act now) plus endedAgentCount (revoked or resigned). It does NOT carry the owner or the cycles balance, and it has no field saying whether this session is authorized. Check paymentsFrozen/writesPaused before paying or appending. For the cycles fuel number use engram_wallet_balance.', READ_ONLY, async () => {
329
327
  try {
330
328
  const status = await engram.status();
331
329
  return {
@@ -344,8 +342,32 @@ market = null) {
344
342
  };
345
343
  }
346
344
  });
345
+ // engram_my_grant ⟨2026-10-21, the owner's round-11 answer g⟩ — an agent reads its OWN grant
346
+ // (`myGrant`, to the calling key only), so it can correct itself before a write or a payment is
347
+ // refused rather than after the owner explains the refusal by hand. stdio only: the engram's HTTP
348
+ // surface serves sign-in tokens, whose grant is the token's, and the canister method answers an
349
+ // agent's key. The description is the catalog's (tool-schemas.json), word for word.
350
+ server.tool('engram_my_grant', "FREE read of YOUR OWN grant on this engram — the rules the engram enforces against the key this session signs with. Returns JSON {key, name, permissions, paymentLimits, paymentsFrozen, paymentsNow, paymentsStoppedBy}: permissions holds canReadMemory, canAppendMemory, canReadWallet, canReadBackup, callsPerMinute (0 = no limit) and scopes (your write folders as memory.append:<path> rules; none = you may write anywhere you could before); paymentLimits holds your own caps, maxPerTransaction and maxPerDay, in the payment token's smallest units (for USDC, 5000000 = $5.00; null = no limit) — caps, not money you can spend now. paymentsFrozen true means the payments brake is on and the engram signs no payment for anyone. paymentsNow is what you can pay right now without the owner's approval, after the brake, your caps and the engram-wide daily ceiling: largestPayment (one payment) and leftToday (in total today; the ceiling's part is shared with every other caller); 0 = nothing; null = no limit. paymentsStoppedBy names what stops every payment of yours now, before any limit: paymentsBrake, signingFloor (the engram's compute is too low to sign until the owner tops it up) or dailySignatureLimit (200 payment signatures per agent per UTC day); absent = none of them. paymentsFrozen, paymentsNow and paymentsStoppedBy arrive as options ([] or [value]); all three are [] on an engram older than them. Read it BEFORE appending or paying, so a write outside your folders or a payment over your limit never reaches the engram. It answers only your own grant, never another agent's, and spends nothing. An error (not an empty grant) means you are not an active agent here: the owner, a revoked or resigned agent, a guardian and a stranger are all refused.", READ_ONLY, async () => {
351
+ try {
352
+ const grant = await engram.myGrant();
353
+ return {
354
+ content: [{ type: 'text', text: jsonText(grant) }],
355
+ };
356
+ }
357
+ catch (err) {
358
+ return {
359
+ content: [
360
+ {
361
+ type: 'text',
362
+ text: `Error: ${err instanceof Error ? err.message : String(err)}\n[The canister message above is authoritative — follow its embedded next-action guidance. If it says a settlement/payment is pending confirmation, funds may be in flight: do NOT re-pay or resubmit.]`,
363
+ },
364
+ ],
365
+ isError: true,
366
+ };
367
+ }
368
+ });
347
369
  // engram_read_audit_log
348
- server.tool('engram_read_audit_log', "Read the engram's chained record. An agent reads only the entries it caused; the owner and guardians read all of it. Returns a page {items, total, withheld}: items are entries {id, timestamp, caller, callerRole, operation, details, success}; total is how many entries the record has ever held; withheld is how many entries in the window you were not shown because another party caused them. A window with withheld > 0 is NOT the whole record. For content changes of ONE file use engram_memory_history instead. Requires an authenticated owner/agent/guardian session; an unauthorized call is REFUSED with an error naming the method, never an empty page.", {
370
+ server.tool('engram_read_audit_log', "Read the engram's chained record. An agent reads only the entries it caused; the owner and guardians read all of it. Returns a page {items, sealed, total, ringFloor, hashFirstFrom}: items are the entries you may read in full {id, timestamp, caller, callerRole, operation, details, success}; sealed are hash-only rows {id, digest, entryHash} for every other entry in the window (another party caused them) — enough to walk the chain through them, never their content; items + sealed is the window examined. total is how many entries the record has ever held; ringFloor is the oldest id still retained (a window below it starts there); hashFirstFrom is the first id hashed under the hash-first rule. For content changes of ONE file use engram_memory_history instead. Requires an authenticated owner/agent/guardian session; an unauthorized call is REFUSED with an error naming the method, never an empty page.", {
349
371
  fromIndex: z
350
372
  .number()
351
373
  .optional()
@@ -356,10 +378,11 @@ market = null) {
356
378
  .max(1000)
357
379
  .optional()
358
380
  .default(100)
359
- .describe('How many record ids the window spans (default 100, max 1000; the canister caps a single window at 500); items + withheld = the entries examined'),
381
+ .describe('How many record ids the window spans (default 100, max 1000; the canister caps a single window at 500); items + sealed = the entries examined'),
360
382
  }, READ_ONLY, async ({ fromIndex, limit }) => {
361
383
  try {
362
- // ⟨2026-09-29, follow-up 16⟩ the whole page, so `withheld` reaches the agent
384
+ // ⟨2026-09-29, follow-up 16⟩ the whole page, so `withheld` reaches the agent ⟨2026-10-18: since
385
+ // ruling 6B the page carries `sealed` hash-only rows in place of `withheld`; the whole page still passes⟩
363
386
  const page = await engram.readAuditLog(fromIndex ?? 0, limit);
364
387
  // ⟨2026-10-02⟩ The SDK's entry carries `timestampNs` (the canister's spelling since the
365
388
  // 0.16.0 cut); this tool's JSON keeps `timestamp`, the key its description names.
package/dist/tools.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"tools.js","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;AACxD,CAAC;AAED,+FAA+F;AAC/F,kGAAkG;AAClG,gGAAgG;AAChG,kGAAkG;AAClG,gGAAgG;AAChG,8FAA8F;AAC9F,+FAA+F;AAC/F,kBAAkB;AAClB,MAAM,eAAe,GAAG,GAAG,CAAC;AAC5B,MAAM,WAAW,GAAG,WAAW,CAAC;AAEhC,gGAAgG;AAChG,gGAAgG;AAChG,6FAA6F;AAC7F,6CAA6C;AAC7C,EAAE;AACF,mGAAmG;AACnG,kGAAkG;AAClG,gGAAgG;AAChG,iDAAiD;AACjD,EAAE;AACF,oGAAoG;AACpG,oGAAoG;AACpG,iGAAiG;AACjG,mGAAmG;AACnG,8BAA8B;AAC9B,MAAM,SAAS,GAAG,EAAE,YAAY,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,EAAW,CAAC;AAExE,yFAAyF;AACzF,kGAAkG;AAClG,oGAAoG;AACpG,oGAAoG;AACpG,sEAAsE;AACtE,MAAM,MAAM,GAAG;IACb,YAAY,EAAE,KAAK;IACnB,eAAe,EAAE,KAAK;IACtB,cAAc,EAAE,KAAK;IACrB,aAAa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P,iFAAiF;IACnF,CAAC;IACD,OAAO,cAAc,CAAC;AACxB,CAAC;AAED,uFAAuF;AACvF,MAAM,CAAC,MAAM,OAAO,GAAW,cAAc,EAAE,CAAC"}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA,0DAA0D;AAC1D,EAAE;AACF,gGAAgG;AAChG,qGAAqG;AACrG,mGAAmG;AACnG,kGAAkG;AAClG,qGAAqG;AACrG,oGAAoG;AACpG,6BAA6B;AAC7B,EAAE;AACF,8FAA8F;AAC9F,2FAA2F;AAC3F,gGAAgG;AAChG,gGAAgG;AAChG,6EAA6E;AAC7E,EAAE;AACF,qGAAqG;AACrG,mGAAmG;AACnG,qGAAqG;AACrG,2FAA2F;AAC3F,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,MAAM,IAAI,GAAG,cAAc,CAAC;AAE5B,iFAAiF;AACjF,MAAM,eAAe,GAAG,2CAA2C,CAAC;AAEpE,sGAAsG;AACtG,MAAM,CAAC,MAAM,cAAc,GAAG,WAAW,CAAC;AAE1C,SAAS,cAAc;IACrB,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,aAAa,CAAC,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,iBAAiB,CAG3D,CAAC;QACF,IAAI,GAAG,CAAC,IAAI,KAAK,IAAI,IAAI,OAAO,GAAG,CAAC,OAAO,KAAK,QAAQ,IAAI,eAAe,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC;YAC3F,OAAO,GAAG,CAAC,OAAO,CAAC;IACvB,CAAC;IAAC,MAAM,CAAC;QACP,iFAAiF;IACnF,CAAC;IACD,OAAO,cAAc,CAAC;AACxB,CAAC;AAED,uFAAuF;AACvF,MAAM,CAAC,MAAM,OAAO,GAAW,cAAc,EAAE,CAAC"}
package/package.json CHANGED
@@ -1,12 +1,10 @@
1
1
  {
2
2
  "name": "@engramx/mcp",
3
- "version": "0.16.0-rc.2",
3
+ "version": "0.16.0-rc.20",
4
4
  "description": "MCP server for EngramX — persistent, decentralized agent memory",
5
5
  "license": "Apache-2.0",
6
6
  "author": "EngramX <developer@engramx.ai>",
7
7
  "type": "module",
8
- "main": "dist/index.js",
9
- "types": "dist/index.d.ts",
10
8
  "bin": {
11
9
  "engramx-mcp": "./dist/index.js"
12
10
  },
@@ -18,14 +16,14 @@
18
16
  "access": "public"
19
17
  },
20
18
  "dependencies": {
21
- "@icp-sdk/core": "^5.4.0",
22
- "@modelcontextprotocol/sdk": "^1.29.0",
23
- "zod": "^4.4.3",
24
- "@engramx/client": "^0.16.0-rc.2"
19
+ "@engramx/client": "^0.16.0-rc.20",
20
+ "@icp-sdk/core": "^6.1.1",
21
+ "@modelcontextprotocol/sdk": "^1.32.2",
22
+ "zod": "^4.6.7"
25
23
  },
26
24
  "devDependencies": {
27
- "@types/node": "^26.1.1",
28
- "typescript": "^6.0.3"
25
+ "@types/node": "^26.6.5",
26
+ "typescript": "^7.0.2"
29
27
  },
30
28
  "scripts": {
31
29
  "build": "tsc",
@@ -1,76 +0,0 @@
1
- export interface ConnectParams {
2
- canisterId: string;
3
- /** IC gateway host. Defaults to mainnet (icp0.io). Local replica: http://localhost:4943 */
4
- host?: string;
5
- }
6
- export declare const MAINNET_HOST = "https://icp0.io";
7
- /** What a surface that prints the per-client guides passes: the engram, and the build's version. */
8
- export interface GuideParams extends ConnectParams {
9
- /**
10
- * The @engramx/client version the surface printing these guides was BUILT with — its own
11
- * package.json's version, which the release's version change stamps (X.Y.Z-rc.N while a release
12
- * candidate soaks, X.Y.Z once the final release is cut). Every pairing command in the guides
13
- * names it.
14
- */
15
- clientVersion: string;
16
- }
17
- /**
18
- * The pairing command, pinned to the version the surface printing it was built with.
19
- *
20
- * WHY (the owner's ruling of 2026-10-03: print the exact version each page was built with).
21
- * A bare `npx @engramx/client pair …` installs npm's default (`latest`), which is the last FINAL
22
- * release: while a release candidate soaks under the `next` tag, every surface built from it would
23
- * hand out a command that installs the previous release, and a previous release cannot pair with
24
- * this release's engram (the 0.15.0 → 0.16.0 enrolment change). Pinned to the build's own version,
25
- * the command names the final version once the final release is cut — through that release's own
26
- * version change, with nothing to undo. WHAT WOULD MAKE THIS WRONG: a surface that prints the guides
27
- * for a different release than the one it was built from (then `clientVersion` must be that
28
- * release's), or a published version being withdrawn from npm (a pinned command then fails loudly,
29
- * where a bare one would quietly install another release).
30
- */
31
- export declare function pairCommand(clientVersion: string, inviteCode: string, canisterId: string): string;
32
- /** The remote MCP endpoint URL for an engram canister (boundary-node subdomain routing). */
33
- export declare function mcpUrl({ canisterId, host }: ConnectParams): string;
34
- /** Claude Desktop / Cursor STDIO server entry (local @engramx/mcp, session-key auth). */
35
- export declare function stdioServerConfig({ canisterId, host }: ConnectParams): {
36
- command: string;
37
- args: string[];
38
- env: Record<string, string>;
39
- };
40
- /** The claude_desktop_config.json fragment with the engramx server under mcpServers. */
41
- export declare function claudeDesktopConfig(p: ConnectParams): {
42
- mcpServers: {
43
- engramx: {
44
- command: string;
45
- args: string[];
46
- env: Record<string, string>;
47
- };
48
- };
49
- };
50
- export interface ClientGuide {
51
- id: string;
52
- name: string;
53
- /** 'remote' = canister-hosted HTTP MCP + OAuth; 'stdio' = local @engramx/mcp + session key */
54
- transport: 'remote' | 'stdio';
55
- steps: string[];
56
- /** Optional copy-paste install snippet (CLI command, YAML, or JSON). */
57
- snippet?: string;
58
- }
59
- /** Per-client connection guides — identical wording in the CLI and the web page. */
60
- export declare function clientGuides(p: GuideParams): ClientGuide[];
61
- /** Everything a consumer needs in one call. */
62
- export declare function connectInfo(p: GuideParams): {
63
- canisterId: string;
64
- host: string;
65
- mcpUrl: string;
66
- claudeDesktopConfig: {
67
- mcpServers: {
68
- engramx: {
69
- command: string;
70
- args: string[];
71
- env: Record<string, string>;
72
- };
73
- };
74
- };
75
- guides: ClientGuide[];
76
- };
@@ -1,207 +0,0 @@
1
- // Canonical config generation for connecting AI clients (Claude.ai web, Claude Desktop, Cursor, …)
2
- // to an engram's remote MCP endpoint. Used by the `@engramx/mcp connect` CLI.
3
- //
4
- // Dependency-free and free of Node/browser-only APIs so any consumer (this CLI, or a web UI) can
5
- // import it unchanged. The contract test (connect-config.test.ts) pins the output — downstream UIs
6
- // that re-render this config should reuse this module + that test so every surface stays identical.
7
- //
8
- // ⟨2026-10-03⟩ Every pairing command this module prints names the exact @engramx/client version the
9
- // surface printing it was built with (`npx @engramx/client@<version> pair …`), so the caller passes
10
- // that version in (`GuideParams.clientVersion`): this module cannot read a package.json and stay
11
- // usable in a browser. This CLI passes its own package.json's version; a web UI passes the version
12
- // it was built with. See `pairCommand` below for why.
13
- export const MAINNET_HOST = 'https://icp0.io';
14
- /**
15
- * The pairing command, pinned to the version the surface printing it was built with.
16
- *
17
- * WHY (the owner's ruling of 2026-10-03: print the exact version each page was built with).
18
- * A bare `npx @engramx/client pair …` installs npm's default (`latest`), which is the last FINAL
19
- * release: while a release candidate soaks under the `next` tag, every surface built from it would
20
- * hand out a command that installs the previous release, and a previous release cannot pair with
21
- * this release's engram (the 0.15.0 → 0.16.0 enrolment change). Pinned to the build's own version,
22
- * the command names the final version once the final release is cut — through that release's own
23
- * version change, with nothing to undo. WHAT WOULD MAKE THIS WRONG: a surface that prints the guides
24
- * for a different release than the one it was built from (then `clientVersion` must be that
25
- * release's), or a published version being withdrawn from npm (a pinned command then fails loudly,
26
- * where a bare one would quietly install another release).
27
- */
28
- export function pairCommand(clientVersion, inviteCode, canisterId) {
29
- return `npx @engramx/client@${clientVersion} pair ${inviteCode} --engram ${canisterId}`;
30
- }
31
- function isLocal(host) {
32
- return host.includes('localhost') || host.includes('127.0.0.1');
33
- }
34
- /** The remote MCP endpoint URL for an engram canister (boundary-node subdomain routing). */
35
- export function mcpUrl({ canisterId, host = MAINNET_HOST }) {
36
- if (isLocal(host))
37
- return `http://${canisterId}.localhost:4943/mcp`;
38
- return `https://${canisterId}.icp0.io/mcp`;
39
- }
40
- /** Claude Desktop / Cursor STDIO server entry (local @engramx/mcp, session-key auth). */
41
- export function stdioServerConfig({ canisterId, host = MAINNET_HOST }) {
42
- const env = { ENGRAM_CANISTER_ID: canisterId };
43
- // Only pin a non-default host (e.g. local replica); mainnet is the @engramx/mcp default.
44
- if (host !== MAINNET_HOST && host !== 'https://ic0.app')
45
- env['ENGRAM_HOST'] = host;
46
- return { command: 'npx', args: ['-y', '@engramx/mcp'], env };
47
- }
48
- /** The claude_desktop_config.json fragment with the engramx server under mcpServers. */
49
- export function claudeDesktopConfig(p) {
50
- return { mcpServers: { engramx: stdioServerConfig(p) } };
51
- }
52
- /** Per-client connection guides — identical wording in the CLI and the web page. */
53
- export function clientGuides(p) {
54
- const url = mcpUrl(p);
55
- const pair = pairCommand(p.clientVersion, '<invite-code>', p.canisterId);
56
- return [
57
- {
58
- id: 'claude-web',
59
- name: 'Claude (claude.ai)',
60
- transport: 'remote',
61
- steps: [
62
- 'Open claude.ai → Settings → Connectors → Add custom connector.',
63
- `Paste the MCP URL: ${url}`,
64
- 'Sign in with the wallet that owns this engram, then approve.',
65
- 'Your engram tools (read/append/list memory, audit log, wallet) appear in new chats.',
66
- ],
67
- },
68
- {
69
- id: 'claude-code',
70
- name: 'Claude Code (CLI)',
71
- transport: 'remote',
72
- snippet: `claude mcp add engramx-memory ${url}`,
73
- steps: [
74
- 'Run the command, then restart claude-code — OAuth opens in your browser on first use.',
75
- ],
76
- },
77
- {
78
- id: 'claude-desktop',
79
- name: 'Claude Desktop (remote)',
80
- transport: 'remote',
81
- steps: [
82
- 'Claude Desktop → Settings → Connectors → Add custom connector.',
83
- `Paste the MCP URL: ${url}`,
84
- 'Authorize with your wallet.',
85
- ],
86
- },
87
- {
88
- id: 'cursor',
89
- name: 'Cursor',
90
- transport: 'remote',
91
- steps: [
92
- 'Cursor → Settings → MCP → Add new MCP server.',
93
- `Paste the remote URL ${url}; the OAuth flow opens in your browser.`,
94
- ],
95
- },
96
- {
97
- id: 'copilot',
98
- name: 'GitHub Copilot (VS Code, agent mode)',
99
- transport: 'remote',
100
- snippet: `{\n "servers": {\n "engramx-memory": { "type": "http", "url": "${url}" }\n }\n}`,
101
- steps: [
102
- 'VS Code → Command Palette → "MCP: Add Server" → HTTP → paste the URL; or add the JSON above to .vscode/mcp.json (workspace) or your user mcp.json.',
103
- 'Open Copilot Chat in Agent mode and authorize with the wallet that owns this engram; your engram tools appear in the tool picker.',
104
- 'Note: the GitHub Copilot CLI is a separate surface (gh copilot) — this flow is for Copilot Chat in VS Code.',
105
- ],
106
- },
107
- {
108
- id: 'continue',
109
- name: 'Continue.dev',
110
- transport: 'remote',
111
- snippet: `mcpServers:\n - name: engramx-memory\n transport: streamable-http\n url: ${url}`,
112
- steps: ['Add this YAML to .continue/mcpServers/engramx.yaml.'],
113
- },
114
- {
115
- id: 'chatgpt',
116
- name: 'ChatGPT (developer mode)',
117
- transport: 'remote',
118
- steps: [
119
- 'ChatGPT → Settings → Apps & Connectors → enable Developer mode → New connector.',
120
- `Add the MCP server URL: ${url}, then authorize with the wallet that owns this engram.`,
121
- 'Web + paid tiers only (Plus/Pro/Business); the desktop/mobile apps and free tier cannot add a custom MCP.',
122
- 'Our connector handshake with ChatGPT is still being verified — if the authorize step fails, seed via a paste prompt for now.',
123
- ],
124
- },
125
- {
126
- id: 'gemini-cli',
127
- name: 'Gemini CLI',
128
- transport: 'remote',
129
- snippet: `gemini mcp add --transport http engramx-memory ${url}`,
130
- steps: [
131
- 'Run the command, then restart gemini-cli.',
132
- 'If the OAuth handshake misbehaves, add an auth header (the key for this engram) or use the local stdio proxy instead.',
133
- 'The consumer Gemini app has no custom-MCP support — use gemini-cli, or seed the app’s Saved Info via a paste prompt.',
134
- ],
135
- },
136
- {
137
- id: 'grok',
138
- name: 'Grok',
139
- transport: 'remote',
140
- steps: [
141
- 'Grok → Settings → Connectors → Bring your own MCP → add a custom connector.',
142
- `Paste the MCP URL: ${url} and authorize. Paid tier.`,
143
- ],
144
- },
145
- {
146
- id: 'perplexity',
147
- name: 'Perplexity',
148
- transport: 'remote',
149
- steps: [
150
- 'Perplexity → Settings → Connectors → Add → Custom MCP (Pro / Max / Enterprise).',
151
- `Paste the remote URL: ${url}; authorize with your wallet.`,
152
- ],
153
- },
154
- {
155
- id: 'lechat',
156
- name: 'Mistral Le Chat',
157
- transport: 'remote',
158
- steps: [
159
- 'Le Chat → + Add Connector → Custom MCP.',
160
- `Name it "engramx" and paste the server URL: ${url}. Available on all tiers, including free.`,
161
- ],
162
- },
163
- {
164
- id: 'openclaw',
165
- name: 'OpenClaw (self-hosted)',
166
- transport: 'stdio',
167
- snippet: pair,
168
- steps: [
169
- 'Run the command; it auto-detects OpenClaw and installs the engramx memory plugin.',
170
- 'The engram becomes OpenClaw’s memory backend — it reads at session start and syncs new memories automatically.',
171
- 'Get <invite-code> from the engram’s owner — you, if this is your engram — who creates it under Access → Agents; it works for thirty minutes.',
172
- ],
173
- },
174
- {
175
- id: 'sdk',
176
- name: 'Your own agent (@engramx/client SDK)',
177
- transport: 'stdio',
178
- snippet: pair,
179
- steps: [
180
- 'Pair a key for this engram once with the command; get <invite-code> from the engram’s owner — you, if this is your engram — who creates it under Access → Agents. It works for thirty minutes.',
181
- `In your agent: new EngramClient({ canisterId: '${p.canisterId}', sessionKeyPath: '~/.engramx/session.key' }), then startSession() to read this owner's memory back and appendMemory() as it learns.`,
182
- 'This grant is append-only for writes — your agent can read and add memory, and cannot delete it. Overwriting existing content requires a separate grant the owner issues deliberately, per path: only on paths the owner lists for agents, and never on paths the owner has locked.',
183
- ],
184
- },
185
- {
186
- id: 'claude-desktop-stdio',
187
- name: 'Claude Desktop / Cursor (local stdio)',
188
- transport: 'stdio',
189
- snippet: JSON.stringify(claudeDesktopConfig(p), null, 2),
190
- steps: [
191
- `Pair a key for this engram once: ${pair}`,
192
- 'Add the JSON to claude_desktop_config.json under "mcpServers", then restart the app.',
193
- ],
194
- },
195
- ];
196
- }
197
- /** Everything a consumer needs in one call. */
198
- export function connectInfo(p) {
199
- return {
200
- canisterId: p.canisterId,
201
- host: p.host ?? MAINNET_HOST,
202
- mcpUrl: mcpUrl(p),
203
- claudeDesktopConfig: claudeDesktopConfig(p),
204
- guides: clientGuides(p),
205
- };
206
- }
207
- //# sourceMappingURL=connect-config.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"connect-config.js","sourceRoot":"","sources":["../src/connect-config.ts"],"names":[],"mappings":"AAAA,mGAAmG;AACnG,8EAA8E;AAC9E,EAAE;AACF,iGAAiG;AACjG,mGAAmG;AACnG,oGAAoG;AACpG,EAAE;AACF,oGAAoG;AACpG,oGAAoG;AACpG,iGAAiG;AACjG,mGAAmG;AACnG,sDAAsD;AAQtD,MAAM,CAAC,MAAM,YAAY,GAAG,iBAAiB,CAAC;AAa9C;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,WAAW,CAAC,aAAqB,EAAE,UAAkB,EAAE,UAAkB;IACvF,OAAO,uBAAuB,aAAa,SAAS,UAAU,aAAa,UAAU,EAAE,CAAC;AAC1F,CAAC;AAED,SAAS,OAAO,CAAC,IAAY;IAC3B,OAAO,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;AAClE,CAAC;AAED,4FAA4F;AAC5F,MAAM,UAAU,MAAM,CAAC,EAAE,UAAU,EAAE,IAAI,GAAG,YAAY,EAAiB;IACvE,IAAI,OAAO,CAAC,IAAI,CAAC;QAAE,OAAO,UAAU,UAAU,qBAAqB,CAAC;IACpE,OAAO,WAAW,UAAU,cAAc,CAAC;AAC7C,CAAC;AAED,yFAAyF;AACzF,MAAM,UAAU,iBAAiB,CAAC,EAAE,UAAU,EAAE,IAAI,GAAG,YAAY,EAAiB;IAClF,MAAM,GAAG,GAA2B,EAAE,kBAAkB,EAAE,UAAU,EAAE,CAAC;IACvE,yFAAyF;IACzF,IAAI,IAAI,KAAK,YAAY,IAAI,IAAI,KAAK,iBAAiB;QAAE,GAAG,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC;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