@formstr/mcp 0.7.1 → 0.7.2

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/AGENTS.md +60 -5
  2. package/README.md +4 -2
  3. package/package.json +3 -3
package/AGENTS.md CHANGED
@@ -10,6 +10,52 @@ first write. Then jump to the module you need.
10
10
 
11
11
  ---
12
12
 
13
+ ## Before you can do anything
14
+
15
+ You almost certainly cannot change this yourself — it is a one-time, human, out-of-band step.
16
+ But you should know what it is so you can tell the user exactly what's wrong if a tool is
17
+ missing or a command fails.
18
+
19
+ **1. A human signs in once** (interactive terminal; never in the chat):
20
+
21
+ ```bash
22
+ npx -y @formstr/mcp login
23
+ ```
24
+
25
+ They pick **Bunker URI (NIP-46)** for the best setup — the private key stays in their signer
26
+ app (Amber, nsec.app), only a session is stored, and no passphrase is ever needed in a config
27
+ file. The alternative, an `ncryptsec` key, unlocks with a passphrase supplied via the
28
+ `FORMSTR_MCP_NCRYPTSEC_PASSPHRASE` env var in the host config. Either way **the key never
29
+ reaches you**.
30
+
31
+ **2. The host starts the server.** The user adds an entry to their MCP host config
32
+ (`claude_desktop_config.json`, Cursor's `~/.cursor/mcp.json`, Goose, …):
33
+
34
+ ```json
35
+ {
36
+ "mcpServers": {
37
+ "formstr": {
38
+ "command": "npx",
39
+ "args": ["-y", "@formstr/mcp", "--allow-writes"]
40
+ }
41
+ }
42
+ }
43
+ ```
44
+
45
+ - **`--allow-writes` is what registers the gated tools.** Without it, tools like `send_mail`,
46
+ `delete_form`, `update_page`, `share_form` are **absent from your tool list entirely** — not
47
+ disabled, just not there. If a write tool the user expects is missing, this is why: tell them
48
+ to add the flag and restart the host.
49
+ - The flag does **not** make anything automatic — every gated tool still requires you to pass
50
+ `confirm: true`, and you should only do that after the user agrees (see
51
+ [the confirm gate](#the-confirm-gate)).
52
+ - Add `"--relays", "wss://a,wss://b"` to override the relay set if the user asks.
53
+
54
+ That's the whole setup. If the tools are present and `list_*` calls work, you're good — the
55
+ sections below are everything else.
56
+
57
+ ---
58
+
13
59
  ## Golden rules
14
60
 
15
61
  1. **Never invent an id.** Every tool that acts on existing data takes an id, pubkey, or
@@ -292,9 +338,18 @@ read_mail { mailId: "<id from list>" }
292
338
 
293
339
  ---
294
340
 
295
- ## For the operator (setup, not for the agent)
341
+ ## Pointing other agents here
342
+
343
+ This guide is the single entry point. Canonical source is the ngit repository; GitHub is a
344
+ read-only mirror.
345
+
346
+ - **Agent-readable (raw Markdown — what you want to feed a model):**
347
+ `https://raw.githubusercontent.com/formstr-hq/common-packages/main/packages/mcp/AGENTS.md`
348
+ - **Human-readable (rendered):**
349
+ `https://github.com/formstr-hq/common-packages/blob/main/packages/mcp/AGENTS.md`
350
+ - **Shipped in the package too:** `AGENTS.md` is included in the `@formstr/mcp` npm tarball, so
351
+ `node_modules/@formstr/mcp/AGENTS.md` exists after any install.
352
+
353
+ For deeper operator detail — keystore internals, the full environment-variable and CLI-flag
354
+ reference, Ollama/Goose setup, troubleshooting — see [`README.md`](./README.md).
296
355
 
297
- See [`README.md`](./README.md) for installation, `formstr-mcp login`, host configuration
298
- (`claude_desktop_config.json`, Cursor, Goose/Ollama), the passphrase env var, and the full
299
- environment-variable and CLI-flag reference. In short: `npx -y @formstr/mcp`; add
300
- `"--allow-writes"` to enable gated tools.
package/README.md CHANGED
@@ -13,8 +13,10 @@ the same login engine the Formstr web app uses. Local keys are stored **NIP-49 e
13
13
  persisted. Remote keys stay in your NIP-46 signer.
14
14
 
15
15
  > **Driving this from an AI agent?** Read [`AGENTS.md`](./AGENTS.md) — a task-oriented guide to
16
- > every tool, the `confirm` gate, id/coordinate formats, and worked recipes. This README is the
17
- > operator's setup guide.
16
+ > every tool, the `confirm` gate, id/coordinate formats, and worked recipes. It is
17
+ > self-contained (setup included), so you can point a model straight at the raw file:
18
+ > `https://raw.githubusercontent.com/formstr-hq/common-packages/main/packages/mcp/AGENTS.md`.
19
+ > This README is the operator's setup guide.
18
20
 
19
21
  ## Quick start
20
22
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@formstr/mcp",
3
- "version": "0.7.1",
3
+ "version": "0.7.2",
4
4
  "description": "Model Context Protocol server for the Formstr super-app — drive Nostr forms (and more) from any MCP host, with secure keychain/NIP-46 login.",
5
5
  "keywords": [
6
6
  "mcp",
@@ -49,9 +49,9 @@
49
49
  "vitest": "^3.2.4",
50
50
  "ws": "^8.18.0",
51
51
  "zod": "^3.24.0",
52
- "@formstr/agent": "^0.3.1",
53
52
  "@formstr/core": "^0.1.1",
54
- "@formstr/signer": "^0.3.2"
53
+ "@formstr/signer": "^0.3.2",
54
+ "@formstr/agent": "^0.3.1"
55
55
  },
56
56
  "scripts": {
57
57
  "build": "tsup",