@safekb/mcp 0.5.0 → 0.7.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.
Files changed (3) hide show
  1. package/README.md +75 -2
  2. package/dist/safekb-mcp.js +3860 -819
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -107,12 +107,14 @@ every tool that keeps a key this way; see [Where secrets are kept](#where-secret
107
107
  | `--rotate-key <ref>` | | Replace a seal root's secret with a new generated key; takes `--store`. |
108
108
  | `--move-key <ref>` | | Move a seal root's current key to `--store system\|file`. |
109
109
  | `--delete-key <ref>` | | Remove a seal root's keys from this machine, after a typed confirmation. |
110
+ | `--export <file>` | | Write what this token reaches to a new passphrase-protected file. Takes `--space`, `--doc`, `--compress`, `--skip-locked`. See [Export and import](#export-and-import). |
111
+ | `--import <file>` | | Create what such a file holds in this token's account, as new things. Takes `--into-space`, `--store`, `--keys`. |
110
112
  | | `SAFEKB_SEALED_IDLE_TTL` | Seconds an unlocked seal root may stay idle. Default 900. `unlock_sealed` can set it per root with `idle_ttl_seconds` (60 to 3600). |
111
113
  | | `SAFEKB_HOSTED_TIMEOUT` | Seconds a hosted tool call may take. Default 300. |
112
114
  | | `SAFEKB_MCP_NO_BROWSER` | Set to anything: never start a browser, only show the authorize link. |
113
115
 
114
- Exactly one mode is given: `--mcp`, `--setup`, `--authorize`, `--configure`, `--sidecar`, or one of the
115
- key modes. A flag that only modifies a mode (`--sealed-only`, `--keyring`, …) without one is an error;
116
+ Exactly one mode is given: `--mcp`, `--setup`, `--authorize`, `--configure`, `--sidecar`, `--export`,
117
+ `--import`, or one of the key modes. A flag that only modifies a mode (`--sealed-only`, `--keyring`, …) without one is an error;
116
118
  it never starts the server by itself. A flag the given mode does not take is an error too, as is a
117
119
  mode without the value or the modifier it needs, and any flag given an empty value.
118
120
 
@@ -310,6 +312,75 @@ irreversible per credential: the server drops its own encrypted secrets and that
310
312
 
311
313
  Old database and storage backups keep the server-encrypted copies until they age out.
312
314
 
315
+ ## Export and import
316
+
317
+ ```sh
318
+ npx -y @safekb/mcp --export all.safekb --compress # everything this token reaches
319
+ npx -y @safekb/mcp --export work.safekb --space <space id> --doc <document id>
320
+ npx -y @safekb/mcp --import all.safekb # into the account of this token
321
+ npx -y @safekb/mcp --import work.safekb --into-space <space id>
322
+ npx -y @safekb/mcp --import all.safekb --keys pc-a.keys --keys pc-b.keys # keys of locked roots
323
+ ```
324
+
325
+ Both need a terminal: the passphrase of the file is typed there (twice for an export) and is never an
326
+ argument. The file is encrypted with AES-256-GCM under a key derived from the passphrase with Argon2id,
327
+ in parts that cannot be dropped, swapped or cut off unnoticed; `--compress` gzips before encrypting.
328
+ Attachments are streamed, so the file may be large. **The file holds every secret in plaintext under
329
+ that one passphrase**: passwords, TOTP seeds and the content of sealed documents.
330
+
331
+ What an export holds:
332
+
333
+ - Spaces, folders, documents (Markdown, rich text and canvas blocks) with their tags, external
334
+ references, workflow status and due date, and their attachments.
335
+ - Databases with columns, indexes, views, rows, row pages and the rows' files.
336
+ - Credentials with every secret field. Each secret of a server-encrypted credential is one audited
337
+ reveal on the server.
338
+ - Sealed folders, documents, attachments and credentials of every seal root that opens with a secret
339
+ this machine keeps or its sidecar holds (`safekb-mcp --sidecar`, then `add <name or id>` for a
340
+ passphrase root), decrypted on this machine.
341
+ - Every other seal root as the server stores it, still sealed: the machine that makes the backup needs
342
+ none of their keys. The export names these roots before it writes. Pending deposits in them are left
343
+ out. `--skip-locked` leaves such roots out entirely instead.
344
+ - Projects, tasks, decisions, and the links between exported things.
345
+
346
+ What is selected:
347
+
348
+ - No `--space` and no `--doc`: everything the token reaches.
349
+ - `--space <id>` (repeatable): that space with its documents, credentials, projects and tasks.
350
+ - `--doc <id>` (repeatable): that document, or that folder with everything in it and the credentials
351
+ filed in it. Its parent is not exported, so on import it is at the top of its space.
352
+ - A link to something outside the selection is left out and counted.
353
+
354
+ What an import does:
355
+
356
+ - It creates new things with new ids and changes nothing that exists, so it works for a restore, for
357
+ another account or server, and twice in a row. References between imported things (links, relations,
358
+ ids in text, attachments shown in a page, the task of a checklist item) follow the new ids.
359
+ - Every exported space becomes a new space, also where one of that name exists. `--into-space` puts
360
+ everything into one existing space instead. A token limited to some spaces is given the spaces it
361
+ creates (this needs a SafeKB server of October 2026 or newer).
362
+ - A seal root the file holds still sealed is opened with its key: from a key export given with
363
+ `--keys <file>` (repeatable; made with `--export-keys` on any machine that keeps the key; its
364
+ passphrase is asked and its keys are used for this import only), or from a store of this machine.
365
+ A key of another account, or one replaced since by a key or passphrase change, does not open it.
366
+ Without a key everything in that root is left out, and the root is named with the reason; import
367
+ the file again with its key to restore it (that creates everything else again too).
368
+ - Every seal root becomes a new seal root with a newly generated key, kept in the default key store
369
+ or the one named by `--store`; a passphrase root therefore becomes a key root. A seal root whose
370
+ name is taken on this machine gets ` (imported)` appended. **Back the new keys up**
371
+ (`--export-keys`).
372
+ - A project whose slug is taken gets a numbered one. A task keeps its assignee only in the account
373
+ the export came from.
374
+ - When a step fails the import stops, says at which record, and leaves what it had created; nothing
375
+ is rolled back.
376
+
377
+ A file written by 0.7.0 or newer is not read by 0.6.0; 0.7.0 reads files of 0.6.0.
378
+
379
+ Not in an export: version history, creation and change times and authors, shares, public links, space
380
+ members, and the account's settings. A vault document (encrypted in the browser to its owner's vault)
381
+ is exported as ciphertext and can only go back into the account it came from, while its id is free
382
+ there. Merged tasks are left out.
383
+
313
384
  ## What sealing does not protect
314
385
 
315
386
  - Whatever a tool returns enters the local conversation transcript and is sent to the model provider.
@@ -317,6 +388,8 @@ Old database and storage backups keep the server-encrypted copies until they age
317
388
  - A program running as your user can read a key file, ask the system keyring or the sidecar for a
318
389
  secret, and read the memory of this client while a root is unlocked.
319
390
  - A session that has unlocked a root can be tricked by content it reads into copying it elsewhere.
391
+ - An export file: it holds the sealed content of every root that opened under the passphrase of the
392
+ file, not under its seal roots.
320
393
  - A compromised local machine, or a malicious server serving stale data.
321
394
  - Metadata: existence, sizes, timestamps, tree position.
322
395