@formstr/mcp 0.1.1 → 0.3.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 +17 -5
- package/dist/index.js +2013 -611
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -21,7 +21,9 @@ npx -y @formstr/mcp login
|
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
Subcommands: `formstr-mcp login` · `formstr-mcp whoami` · `formstr-mcp accounts` ·
|
|
24
|
-
`formstr-mcp
|
|
24
|
+
`formstr-mcp switch <npub>` · `formstr-mcp logout` · `formstr-mcp help` ·
|
|
25
|
+
`formstr-mcp` (run the stdio server, the default). Run `formstr-mcp help` (or `-h`) for
|
|
26
|
+
the full usage.
|
|
25
27
|
|
|
26
28
|
## Sign-in
|
|
27
29
|
|
|
@@ -39,7 +41,11 @@ offers four methods:
|
|
|
39
41
|
Linux Secret Service via `@napi-rs/keyring`). On hosts without a keychain (e.g. headless
|
|
40
42
|
Linux), set `FORMSTR_MCP_PASSPHRASE` to use an AES-256-GCM encrypted file at
|
|
41
43
|
`~/.config/formstr-mcp/keystore.enc` (mode `0600`). Multiple identities are supported
|
|
42
|
-
(`formstr-mcp accounts` lists them)
|
|
44
|
+
(`formstr-mcp accounts` lists them). Change the persisted active account with
|
|
45
|
+
`formstr-mcp switch <npub>`, or pick one for a single boot with `--account <npub>`; the
|
|
46
|
+
server follows the active account when neither is given, so switching accounts just works.
|
|
47
|
+
Both `switch` and `--account` accept either the `npub` (as shown by `accounts`) or the hex
|
|
48
|
+
pubkey.
|
|
43
49
|
|
|
44
50
|
**Defense in depth:** even on the encrypted-file fallback the stored key is _also_ NIP-49
|
|
45
51
|
encrypted, so recovering it needs **both** the keystore **and** the unlock passphrase.
|
|
@@ -71,8 +77,13 @@ Run `formstr-mcp login` once interactively to populate the keystore, then run th
|
|
|
71
77
|
unattended. At boot the active account is unlocked headlessly:
|
|
72
78
|
|
|
73
79
|
- **ncryptsec accounts** decrypt using `FORMSTR_MCP_NCRYPTSEC_PASSPHRASE` (the passphrase
|
|
74
|
-
you set during `login`).
|
|
75
|
-
|
|
80
|
+
you set during `login`). On an **interactive terminal** the server instead **prompts**
|
|
81
|
+
for it (and re-prompts up to 3× on a typo) — so the env var is only _required_ when an
|
|
82
|
+
MCP host spawns the server, since then stdin is the JSON-RPC channel and there's nobody
|
|
83
|
+
to prompt. Each account has its own passphrase.
|
|
84
|
+
- **NIP-46 accounts** reconnect from their stored session — no passphrase needed. This is
|
|
85
|
+
the simplest setup for a host: `formstr-mcp switch <npub>` to a bunker account and the
|
|
86
|
+
config needs no secret at all.
|
|
76
87
|
|
|
77
88
|
| Variable | Meaning |
|
|
78
89
|
| ---------------------------------- | ----------------------------------------------------------------- |
|
|
@@ -81,8 +92,9 @@ unattended. At boot the active account is unlocked headlessly:
|
|
|
81
92
|
| `FORMSTR_MCP_KEYSTORE` | force `file` or `keychain` backend (optional) |
|
|
82
93
|
| `FORMSTR_MCP_CONFIG_DIR` | keystore directory (default `~/.config/formstr-mcp`) |
|
|
83
94
|
| `FORMSTR_RELAYS` | comma-separated relay override (optional) |
|
|
95
|
+
| `FORMSTR_MCP_DEBUG` | print full stack traces on fatal errors (set to `1`) |
|
|
84
96
|
|
|
85
|
-
CLI flags: `--relays <wss://a,wss://b>`, `--allow-writes`, `--account <
|
|
97
|
+
CLI flags: `--relays <wss://a,wss://b>`, `--allow-writes`, `--account <npub|hex>`.
|
|
86
98
|
There is no plaintext-nsec path — a raw key is never read from env, flags, or a config file.
|
|
87
99
|
|
|
88
100
|
## Forms tools
|