@safekb/mcp 0.5.0 → 0.6.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 +63 -2
- package/dist/safekb-mcp.js +3167 -516
- package/package.json +2 -2
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`. |
|
|
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`,
|
|
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,64 @@ 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
|
+
```
|
|
323
|
+
|
|
324
|
+
Both need a terminal: the passphrase of the file is typed there (twice for an export) and is never an
|
|
325
|
+
argument. The file is encrypted with AES-256-GCM under a key derived from the passphrase with Argon2id,
|
|
326
|
+
in parts that cannot be dropped, swapped or cut off unnoticed; `--compress` gzips before encrypting.
|
|
327
|
+
Attachments are streamed, so the file may be large. **The file holds every secret in plaintext under
|
|
328
|
+
that one passphrase**: passwords, TOTP seeds and the content of sealed documents.
|
|
329
|
+
|
|
330
|
+
What an export holds:
|
|
331
|
+
|
|
332
|
+
- Spaces, folders, documents (Markdown, rich text and canvas blocks) with their tags, external
|
|
333
|
+
references, workflow status and due date, and their attachments.
|
|
334
|
+
- Databases with columns, indexes, views, rows, row pages and the rows' files.
|
|
335
|
+
- Credentials with every secret field. Each secret of a server-encrypted credential is one audited
|
|
336
|
+
reveal on the server.
|
|
337
|
+
- Sealed folders, documents, attachments and credentials, decrypted on this machine. Every seal root
|
|
338
|
+
in the selection must open with a secret this machine keeps or its sidecar holds
|
|
339
|
+
(`safekb-mcp --sidecar`, then `add <name or id>` for a passphrase root); otherwise the export
|
|
340
|
+
stops before it writes anything. `--skip-locked` exports without those roots and says so.
|
|
341
|
+
- Projects, tasks, decisions, and the links between exported things.
|
|
342
|
+
|
|
343
|
+
What is selected:
|
|
344
|
+
|
|
345
|
+
- No `--space` and no `--doc`: everything the token reaches.
|
|
346
|
+
- `--space <id>` (repeatable): that space with its documents, credentials, projects and tasks.
|
|
347
|
+
- `--doc <id>` (repeatable): that document, or that folder with everything in it and the credentials
|
|
348
|
+
filed in it. Its parent is not exported, so on import it is at the top of its space.
|
|
349
|
+
- A link to something outside the selection is left out and counted.
|
|
350
|
+
|
|
351
|
+
What an import does:
|
|
352
|
+
|
|
353
|
+
- It creates new things with new ids and changes nothing that exists, so it works for a restore, for
|
|
354
|
+
another account or server, and twice in a row. References between imported things (links, relations,
|
|
355
|
+
ids in text, attachments shown in a page, the task of a checklist item) follow the new ids.
|
|
356
|
+
- Every exported space becomes a new space, also where one of that name exists. `--into-space` puts
|
|
357
|
+
everything into one existing space instead. A token limited to some spaces is given the spaces it
|
|
358
|
+
creates (this needs a SafeKB server of October 2026 or newer).
|
|
359
|
+
- Every seal root becomes a new seal root with a newly generated key, kept in the default key store
|
|
360
|
+
or the one named by `--store`; a passphrase root therefore becomes a key root. A seal root whose
|
|
361
|
+
name is taken on this machine gets ` (imported)` appended. **Back the new keys up**
|
|
362
|
+
(`--export-keys`).
|
|
363
|
+
- A project whose slug is taken gets a numbered one. A task keeps its assignee only in the account
|
|
364
|
+
the export came from.
|
|
365
|
+
- When a step fails the import stops, says at which record, and leaves what it had created; nothing
|
|
366
|
+
is rolled back.
|
|
367
|
+
|
|
368
|
+
Not in an export: version history, creation and change times and authors, shares, public links, space
|
|
369
|
+
members, and the account's settings. A vault document (encrypted in the browser to its owner's vault)
|
|
370
|
+
is exported as ciphertext and can only go back into the account it came from, while its id is free
|
|
371
|
+
there. Merged tasks are left out.
|
|
372
|
+
|
|
313
373
|
## What sealing does not protect
|
|
314
374
|
|
|
315
375
|
- Whatever a tool returns enters the local conversation transcript and is sent to the model provider.
|
|
@@ -317,6 +377,7 @@ Old database and storage backups keep the server-encrypted copies until they age
|
|
|
317
377
|
- A program running as your user can read a key file, ask the system keyring or the sidecar for a
|
|
318
378
|
secret, and read the memory of this client while a root is unlocked.
|
|
319
379
|
- A session that has unlocked a root can be tricked by content it reads into copying it elsewhere.
|
|
380
|
+
- An export file: it holds sealed content under the passphrase of the file, not under its seal roots.
|
|
320
381
|
- A compromised local machine, or a malicious server serving stale data.
|
|
321
382
|
- Metadata: existence, sizes, timestamps, tree position.
|
|
322
383
|
|