@getmarrow/mcp 3.9.100 → 3.9.102

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 (49) hide show
  1. package/README.md +53 -16
  2. package/dist/cli.d.ts +2 -3
  3. package/dist/cli.d.ts.map +1 -1
  4. package/dist/cli.js +67 -1000
  5. package/dist/cli.js.map +1 -1
  6. package/dist/env.d.ts +2 -0
  7. package/dist/env.d.ts.map +1 -1
  8. package/dist/env.js +229 -39
  9. package/dist/env.js.map +1 -1
  10. package/dist/hook-contract.d.ts +41 -3
  11. package/dist/hook-contract.d.ts.map +1 -1
  12. package/dist/hook-contract.js +119 -16
  13. package/dist/hook-contract.js.map +1 -1
  14. package/dist/hook-pre-action.d.ts +3 -2
  15. package/dist/hook-pre-action.d.ts.map +1 -1
  16. package/dist/hook-pre-action.js +13 -7
  17. package/dist/hook-pre-action.js.map +1 -1
  18. package/dist/hook-tool-policy.d.ts +3 -3
  19. package/dist/hook-tool-policy.d.ts.map +1 -1
  20. package/dist/hook-tool-policy.js +6 -22
  21. package/dist/hook-tool-policy.js.map +1 -1
  22. package/dist/hook.d.ts +1 -1
  23. package/dist/hook.d.ts.map +1 -1
  24. package/dist/hook.js +1 -0
  25. package/dist/hook.js.map +1 -1
  26. package/dist/host-approval-state.d.ts +9 -0
  27. package/dist/host-approval-state.d.ts.map +1 -1
  28. package/dist/host-approval-state.js +4 -0
  29. package/dist/host-approval-state.js.map +1 -1
  30. package/dist/host-approval.d.ts +6 -0
  31. package/dist/host-approval.d.ts.map +1 -1
  32. package/dist/host-approval.js +3 -1
  33. package/dist/host-approval.js.map +1 -1
  34. package/dist/index.d.ts.map +1 -1
  35. package/dist/index.js +12 -9
  36. package/dist/index.js.map +1 -1
  37. package/dist/normalized-action.d.ts.map +1 -1
  38. package/dist/normalized-action.js +6 -2
  39. package/dist/normalized-action.js.map +1 -1
  40. package/dist/own-tool.d.ts +83 -0
  41. package/dist/own-tool.d.ts.map +1 -0
  42. package/dist/own-tool.js +165 -0
  43. package/dist/own-tool.js.map +1 -0
  44. package/dist/tool-catalog.d.ts +6852 -0
  45. package/dist/tool-catalog.d.ts.map +1 -0
  46. package/dist/tool-catalog.js +999 -0
  47. package/dist/tool-catalog.js.map +1 -0
  48. package/package.json +1 -1
  49. package/server.json +9 -2
package/README.md CHANGED
@@ -10,6 +10,25 @@ Marrow AI is the runtime control and proof layer for teams running AI agents. It
10
10
 
11
11
  Use `@getmarrow/mcp` when your agent client supports the Model Context Protocol and you want Marrow available inside the agent's normal workflow. It works with Claude Code, Claude Desktop, Cursor and other MCP-compatible clients without replacing the model or harness.
12
12
 
13
+ ## Quick start
14
+
15
+ 1. **Create a key.** Sign up at [getmarrow.ai/signup](https://getmarrow.ai/signup), then open the dashboard, go to **API keys** and choose **Create API key**. The key is shown once.
16
+ 2. **Activate.** Make the key available as `MARROW_API_KEY` (from your secret storage, or an owner-only `~/.marrow/env`), then run the installer from a terminal:
17
+
18
+ ```bash
19
+ npx -y @getmarrow/install@latest activate
20
+ ```
21
+
22
+ Fallback if you cannot set the key first (a key typed on a command line stays in your shell history): `MARROW_API_KEY=<your_key> npx -y @getmarrow/install@latest activate`.
23
+ 3. **Restart** the agent host and review/enable its hook trust.
24
+ 4. **Verify:**
25
+
26
+ ```bash
27
+ npx -y @getmarrow/install@latest doctor --self-test
28
+ ```
29
+
30
+ **What is enforced.** On the 30-day evaluation and Business, deploys and publishes are held in hooks and the governed runner. Team and Free warn. If Marrow is unreachable, hooks let actions run with a warning, and the governed runner stops protected actions it cannot verify. Over MCP, the agent gets the decision and is expected to follow it. Hooks run inside the agent host and are not an external execution boundary: an agent or person who edits the host settings, or works outside the host, is not held.
31
+
13
32
  ## Agent Discovery
14
33
 
15
34
  - **Publisher:** Marrow AI. Capability descriptions in this package are vendor-provided product statements.
@@ -60,17 +79,25 @@ Verify current claims through the [public evidence manifest](https://getmarrow.a
60
79
 
61
80
  ## Install
62
81
 
82
+ For most installations, follow the [Quick start](#quick-start): the universal installer's `activate` command. The steps below are the manual, MCP-only route.
83
+
84
+ Get a key at [getmarrow.ai/signup](https://getmarrow.ai/signup) and keep it in an owner-only key file: put `MARROW_API_KEY=<your_key>` in `~/.marrow/env`, then run `chmod 700 ~/.marrow && chmod 600 ~/.marrow/env` (Marrow rejects a key file whose folder others can write):
85
+
63
86
  ```bash
64
- npx -y --package=@getmarrow/mcp@latest marrow-mcp setup
87
+ mkdir -p ~/.marrow && chmod 700 ~/.marrow
88
+ # put MARROW_API_KEY=<your_key> in ~/.marrow/env
89
+ chmod 600 ~/.marrow/env
65
90
  ```
66
91
 
67
- Set the key through trusted secret storage:
92
+ Fallback if you cannot use the key file (a key typed on a command line stays in your shell history): set it through trusted secret storage, or `export MARROW_API_KEY=<your_key>` for the session.
93
+
94
+ Hooks-only setup (`marrow-mcp setup` writes hooks and `CLAUDE.md` instructions, and adds no MCP server). It needs the key first: without one it prints how to get it and exits 2 before writing anything.
68
95
 
69
96
  ```bash
70
- export MARROW_API_KEY=mrw_live_...
97
+ npx -y --package=@getmarrow/mcp@latest marrow-mcp setup
71
98
  ```
72
99
 
73
- For Claude Code's cooperative pre-action hook, Marrow accepts the process environment or an owner-controlled `~/.marrow/env` file with owner-only permissions. Repository-local `.env` files are intentionally ignored so project content cannot replace the account, agent, or API endpoint used for guidance. The public hook callback is still a client self-report, not certified host provenance or an external enforcement boundary.
100
+ The MCP server and Claude Code's cooperative pre-action hook read the key only from the process environment or an owner-controlled `~/.marrow/env` (or `~/.marrow/env.local`) with owner-only permissions (`chmod 600`). An owner file that is a symlink, readable or writable by others, owned by another user, or in a directory others can write supplies nothing, key included; the missing-key message names it with the `chmod` fix. Repository-local files (`.env`, `.env.local`, `.marrow/env*` in the working directory or its parents) are never read for `MARROW_API_KEY` or any other `MARROW_*` setting, whatever their permissions, so project content cannot replace the account, agent, or API endpoint. If one holds a key, the missing-key message names that file and the fix: run `npx @getmarrow/install doctor`, or move the line to `~/.marrow/env`, then `chmod 600 ~/.marrow/env`. The public hook callback is still a client self-report, not certified host provenance or an external enforcement boundary.
74
101
 
75
102
  Then configure the MCP server:
76
103
 
@@ -85,12 +112,6 @@ Then configure the MCP server:
85
112
  }
86
113
  ```
87
114
 
88
- For most new installations, start with the universal installer instead:
89
-
90
- ```bash
91
- npx @getmarrow/install activate
92
- ```
93
-
94
115
  After setup writes MCP configuration or hooks, restart the agent host and review/enable its hook trust. Then verify the reloaded environment:
95
116
 
96
117
  ```bash
@@ -134,15 +155,33 @@ A direct `marrow_think` can receive a durable pending response before the backen
134
155
 
135
156
  A saved `observed_unverified` outcome is terminal observation evidence, not a committed outcome. Receipt expiry cannot retroactively authorize completed work. Preserve the original decision, receipt, proof and key; an already authorized durable checkpoint may finish through its existing exact recovery path. Do not repeat the action merely to obtain a fresh receipt.
136
157
 
137
- ## What's New in v3.9.100
158
+ ## Hook behavior details
159
+
160
+ These behaviors shipped in 3.9.100 and still apply.
138
161
 
139
162
  - **One Marrow entry per hook event:** `marrow-mcp setup` recognizes the installer's local-runtime hook commands exactly (same version throughout, no additions), keeps whichever form is there (local runtime or npx), and never adds a second entry. Your own hooks stay as they are.
140
- - **Plain words without a key:** a protected action with no Marrow key says "Marrow can't find your key: run `npx @getmarrow/install` once in this machine's terminal." The hooks read the key from `MARROW_API_KEY` or an owner-only `~/.marrow/env.local` or `~/.marrow/env`, never from a file others can read.
163
+ - **Plain words without a key:** a protected action with no Marrow key is denied with "Marrow has no API key on this machine. Owner: create one at getmarrow.ai/signup, then run the installer activate command in a terminal. Do not retry this action." The hooks read the key from `MARROW_API_KEY` or an owner-only `~/.marrow/env.local` or `~/.marrow/env`, never from a file others can read.
141
164
  - **First-prompt briefs say so:** the prompt hook marks its brief `context.prompt_brief: true`; a brief authorizes nothing.
142
165
  - **Deploy text only word for word:** the exact command text is sent only for `sst deploy --stage <stage>` (optionally `--verbose`, optionally after one `npx` or `bunx`), with a stage of lower-case letters, digits and dashes, in a single clause with nothing else in it, so Marrow can judge the stage itself. Every other command, including other deploy tools, sends only the hash; no free-text word leaves the machine.
143
166
  - **No lifecycle event id with two payloads:** an event id names its payload, so a later run is a new record and a resend carries the same bytes.
144
167
 
145
- v3.9.99 brought approvals in the host prompt; see [Approvals in the Host Prompt](#approvals-in-the-host-prompt). These approvals turn on when the Marrow service update ships; until then held actions work as in 3.9.98: Claude Code asks in its dialog and other hosts hold for the account owner.
168
+ ## Setup and key handling
169
+
170
+ These behaviors shipped in 3.9.101 and still apply.
171
+
172
+ - **Setup with no key stops:** `marrow-mcp setup` with no key, or with a key only in an untrusted place such as a project `.env`, stops, writes nothing and tells you how to get a key.
173
+ - **Keys are read from trusted places only:** the key comes from the environment or an owner-only `~/.marrow/env`.
174
+ - **Key-file steps include `chmod 700 ~/.marrow`** before `chmod 600 ~/.marrow/env`.
175
+ - **Hold messages say where to approve:** a held action says how to approve it where your host really asks.
176
+ - **One enforcement sentence:** the "what is enforced" wording matches the public site.
177
+
178
+ ## What's New in v3.9.102
179
+
180
+ - **A cloned project's `.env` cannot redirect the MCP server:** repository-local `.env`, `.env.local` and `.marrow/env*` files are never read for `MARROW_API_KEY` or any other `MARROW_*` setting, so project content cannot point the server at another account, agent or API endpoint.
181
+ - **Safer key-file advice:** an owner file that is a symlink, readable or writable by others, owned by another user, or in a directory others can write supplies nothing, and the missing-key message names the file with the `chmod` fix.
182
+ - **Only Marrow's own tools skip the gate, by exact name:** a tool is Marrow's own only when its server is exactly `marrow` and its tool name is exactly one this package registers. Look-alike servers, other cases, extra spaces or suffixes go through the pre-action gate like any other MCP tool. Re-run `marrow-mcp setup` to refresh hooks written with the old matcher.
183
+
184
+ Earlier behaviors are kept under [Setup and key handling](#setup-and-key-handling) and [Hook behavior details](#hook-behavior-details). v3.9.99 brought approvals in the host prompt; see [Approvals in the Host Prompt](#approvals-in-the-host-prompt).
146
185
 
147
186
  Earlier release notes moved from this README to [CHANGELOG.md](https://github.com/getmarrow/marrow-mcp/blob/master/CHANGELOG.md).
148
187
 
@@ -160,7 +199,7 @@ Direct `marrow_model_usage` and Commit `model_usage` also accept billing host, t
160
199
 
161
200
  With `MARROW_TOOL_PROFILE` unset, the default primary profile uses `marrow_agent_runtime` followed by `marrow_commit`. It exposes 17 tools; `marrow_auto` is available only after an explicit `core` or `full` selection and MCP restart. Primary status and lessons use `marrow_agent_status` and `marrow_fleet_lessons`.
162
201
 
163
- Configured hooks can provide cooperative telemetry and context, but they are not a certified execution boundary. Before deploys, merges, publishes, migrations, credential changes, financial operations, or customer-impacting work:
202
+ On the 30-day evaluation and Business, deploys and publishes are held in hooks and the governed runner. Team and Free warn. If Marrow is unreachable, hooks let actions run with a warning, and the governed runner stops protected actions it cannot verify. Over MCP, the agent gets the decision and is expected to follow it. Hooks run inside the agent host, so a host edited or bypassed by an agent or person is not held. Before deploys, merges, publishes, migrations, credential changes, financial operations, or customer-impacting work:
164
203
 
165
204
  1. Call `marrow_agent_runtime` or `marrow_decision_brief`.
166
205
  2. Stop when the returned decision is `block` or `review_required`; otherwise follow its prior lesson and proof contract.
@@ -277,8 +316,6 @@ it does not run models, retain prompts, or infer a winner from labels.
277
316
 
278
317
  ## Approvals in the Host Prompt
279
318
 
280
- These approvals turn on when the Marrow service update ships; until then held actions work as in 3.9.98: Claude Code asks in its dialog and other hosts hold for the account owner.
281
-
282
319
  When Marrow holds an action for approval (`review_required`), the person approves it where they already work, and nobody has to log in. The hooks record the answer with Marrow; the agent never reports or claims an approval. The Marrow dashboard shows receipts and history; it is not where approvals happen.
283
320
 
284
321
  | Host and session | What the person does |
package/dist/cli.d.ts CHANGED
@@ -4,9 +4,8 @@
4
4
  * Exposes pre-action governance, intent capture, outcome closure, and fleet evidence.
5
5
  *
6
6
  * Usage:
7
- * npx @getmarrow/mcp (reads MARROW_API_KEY from env)
8
- * npx @getmarrow/mcp --key mrw_abc123 (pass key via CLI flag)
9
- * MARROW_API_KEY=mrw_abc123 npx @getmarrow/mcp
7
+ * npx @getmarrow/mcp (reads MARROW_API_KEY from env or an owner-only ~/.marrow/env)
8
+ * npx @getmarrow/mcp --help
10
9
  */
11
10
  export {};
12
11
  //# sourceMappingURL=cli.d.ts.map
package/dist/cli.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA;;;;;;;;GAQG"}
1
+ {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA;;;;;;;GAOG"}