@getmarrow/mcp 3.9.41 → 3.9.43

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 CHANGED
@@ -1,769 +1,177 @@
1
1
  # @getmarrow/mcp
2
2
 
3
- > **Governance, proof, and decision intelligence for MCP-compatible agent fleets.**
3
+ > MCP-native runtime control, proof, and fleet intelligence for AI agents.
4
4
 
5
- ![npm](https://img.shields.io/npm/v/@getmarrow/mcp)
6
- ![npm](https://img.shields.io/npm/dw/@getmarrow/mcp)
7
- ![npm bundle size](https://img.shields.io/bundlephobia/minzip/@getmarrow/mcp)
8
- ![GitHub](https://img.shields.io/github/license/getmarrow/marrow-mcp)
9
- ![TypeScript](https://img.shields.io/badge/TypeScript-5.3%2B-blue)
10
- ![Node.js](https://img.shields.io/badge/Node.js-18%2B-green)
5
+ Marrow is the runtime control and proof layer for teams running AI agents. It applies policy and prior lessons before consequential actions, then records the evidence and outcome afterward.
11
6
 
12
- Marrow gives your agent a governance loop that compounds.
7
+ 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.
13
8
 
14
- With `@getmarrow/mcp`, any MCP-compatible client can ask Marrow before risky work, inspect live loop state during work, collect required proof, and commit outcomes when the work is done. That means your agent stops operating without accountability and starts carrying forward real decision history.
15
-
16
- **Your agent stops repeating the same mistakes. It learns from prior sessions, authorized fleet history, and sanitized shared signals while staying inside proof, policy, and tenant boundaries.**
17
-
18
- ## Trust and Data Boundaries
19
-
20
- Marrow is tenant-aware by design. Private account, fleet, workflow, proof-pack, and agent data stays scoped to the authenticated account and authorized agent-bound keys.
21
-
22
- Enterprise tenants receive a strong private governance baseline from day one: risk gates, proof requirements, workflow templates, private/account learning, and exact next actions. Teams that enable sanitized aggregate contribution unlock richer k-anonymous collective workflow guidance. Contribution never means raw prompts, decisions, proof packs, code, secrets, account identifiers, agent identifiers, or customer identities.
23
-
24
- For business pilots, review the live trust notes before production rollout: https://getmarrow.ai/docs#trust-boundaries
25
-
26
- ## What's New in v3.9.40
27
-
28
- v3.9.40 adds MCP tools for Marrow's governance-control layer.
29
-
30
- - `marrow_governance_control_plane` returns Marrow's cross-harness control-plane contract.
31
- - `marrow_hermes_integration` maps Hermes `/goal`, verification evidence, `/learn`, `/journey`, and background subagents into Marrow proof/outcome workflows.
32
- - `marrow_completion_contracts` lists built-in proof contracts for deploy, merge, publish, migration, security, support, and Hermes goal workflows.
33
- - `marrow_evaluate_completion_contract` checks whether an agent has enough proof to mark work complete.
34
- - `marrow_governance_timeline` returns a fleet journey timeline across decisions, gates, and proof packs.
35
- - `marrow_buyer_proof` returns owner/procurement-ready value proof: failures avoided, risky actions reviewed, proofs completed, token/time saved, failure classes, and reliability score.
36
-
37
- ---
38
-
39
- ## Current Backend Surfaces
40
-
41
- The Marrow API also exposes two agent-facing surfaces that help MCP clients and operators verify whether passive capture is producing useful fleet data:
42
-
43
- - `GET /v1/agent/data-quality` returns an authenticated attribution scorecard for the current account or bound agent, including `agent_id`, `source_meta`, harness/client, workflow type, outcome closure, and non-trivial data coverage.
44
- - `GET /v1/agent/integrations/{client}` returns a per-harness setup guide for supported clients such as Codex, Claude Code, Cursor, Composer, Windsurf, Cline, OpenCode, Hermes, OpenClaw, Gemini, Grok, DeepSeek, Qwen, Kimi, MiniMax, GLM, MCP clients, CI runners, and custom harnesses.
45
-
46
- These endpoints are protected by Marrow API-key or agent-bound-key auth and are documented in the source-of-truth docs at [getmarrow.ai/docs](https://getmarrow.ai/docs/).
47
-
48
- ---
49
-
50
- ## Start Here
51
-
52
- For most agents and new users, start with the universal installer:
9
+ ## Install
53
10
 
54
11
  ```bash
55
- npx @getmarrow/install --yes
56
- ```
57
-
58
- The installer detects your MCP client, agent instructions, Node project, and runtime surfaces, then wires the safest passive setup automatically.
59
- It now also includes a governed runner: `npx @getmarrow/install run --agent <agent-id> -- <command>`, which gives MCP and non-MCP agents the same pre-action Marrow risk gate and automatic outcome closure for existing shell, deploy, publish, merge, and migration commands.
60
- MCP clients can also call `marrow_first_value` to show the first five-minute proof payload directly inside the agent.
61
-
62
- Use this MCP package directly when you want manual MCP server/hook setup for Claude Code, Claude Desktop, Cursor, or another MCP-compatible client. Use `@getmarrow/sdk` when you are building a custom Node/TypeScript integration in code.
63
-
64
- ## Auto-Logging
65
-
66
- Marrow auto-logs at three layers — transparent to your agent, invisible to you:
67
-
68
- | Layer | How | Agent effort |
69
- |-------|-----|-------------|
70
- | Server-side | Every authenticated API call auto-logged as a decision | Zero |
71
- | Governed runner | `npx @getmarrow/install run --agent <id> -- <command>` — pre-action gate + outcome proof around existing commands | Minimal |
72
- | SDK | `marrow.think()` / `marrow.commit()` — explicit control | Minimal |
73
- | MCP hooks | `npx @getmarrow/mcp setup` — PostToolUse + UserPromptSubmit hooks | Zero |
74
-
75
- **Passive mode in action:** Run `npx @getmarrow/mcp setup` once. Every tool call your agent makes (Bash, file edits, MCP calls) is auto-logged in the background. Marrow intelligence is auto-injected into your agent's context. Fail-silent, 2-second timeout, never blocks your prompt.
76
-
77
- Disable: `MARROW_AUTO_HOOK=false`. Debug: `MARROW_HOOK_DEBUG=true`.
78
-
79
- ---
80
-
81
- ## Improvement Since Onboarding
82
-
83
- `marrow_dashboard` and `marrow_digest` now return an `improvement` block comparing your agents' current performance against their day-1 baseline — a frozen snapshot of the first week of activity. Baseline captures automatically once an account reaches 7 days OR 20 decisions (whichever first).
84
-
85
- Four measured deltas, all from real decision data:
86
-
87
- - `attempts_per_success` — baseline week vs current week
88
- - `time_to_success_seconds` — median think → successful commit
89
- - `drift_rate` — % of decisions without a matching prior pattern
90
- - `success_rate` — baseline vs current outcome fraction
91
-
92
- Sample response:
93
-
94
- ```json
95
- {
96
- "improvement": {
97
- "status": "active",
98
- "days_since_baseline": 20,
99
- "decisions_since_baseline": 2124,
100
- "baseline_captured_at": "2026-04-23T15:07:41.919Z",
101
- "trigger_reason": "time_7d",
102
- "time_to_success_seconds": { "baseline": 244, "current": 24, "delta_pct": -90.16 }
103
- }
104
- }
105
- ```
106
-
107
- Accounts with <7 days of activity AND <20 decisions get an onboarding payload showing days/decisions until baseline fires. Token-value proof is also available now: MCP agents can call `marrow_model_usage` or attach `model_usage` to `marrow_commit` so Marrow reports observed model calls, tokens, estimated savings, trend direction, and top models without storing raw prompts or completions.
108
-
109
- ---
110
-
111
- ## What's New in v3.9.37
112
-
113
- v3.9.37 adds MCP token-value proof status parity.
114
-
115
- - `marrow_model_usage` records compact provider/model token counts through `/v1/agent/model-usage`.
116
- - `marrow_commit` accepts optional `model_usage` and returns `token_value_signal` from the backend.
117
- - `marrow_runtime_status` calls `/v1/agent/status?fast=1` for live passive hook, token-capture, outcome-closure, and exact repair-command diagnostics.
118
- - Token usage data is counts and labels only: provider, model, input/output/cached/total tokens, cost, latency, outcome linkage, and optional saved-token estimates.
119
- - Do not send raw prompts, completions, tool logs, secrets, or customer content.
120
-
121
- ## What's New in v3.9.33
122
-
123
- v3.9.33 adds MCP tools for adaptive governance recommendations and explicit policy profiles, while keeping the enterprise readiness contract documented for business pilots.
124
-
125
- - `marrow_mode_recommend` returns an explainable `passive`, `pilot`, or `enforce` recommendation for the current project/workflow.
126
- - `marrow_policy_profiles` lists saved account policy profiles, including the default business starter profile.
127
- - `marrow_create_policy_profile` creates or updates explicit rules such as local=passive, staging=pilot, production deploys=enforce.
128
- - `marrow_assign_project_policy_profile` binds an active profile to a project key so future resolves use it automatically.
129
- - `marrow_policy_resolve` resolves the current workflow mode from saved policy profiles, falling back to recommendation.
130
- - Marrow does not silently auto-switch modes. The agent/user must accept or override the recommendation.
131
- - MCP agents can call `GET /v1/agent/enterprise-readiness?agents=20` when an owner asks whether Marrow is ready for a fleet rollout.
132
- - The response is owner-safe and covers tenant isolation, data boundaries, fail behavior, policy controls, scale proof, and a 30-day pilot package.
133
- - The source-of-truth docs include the enterprise trust and scale readiness page at [getmarrow.ai/docs](https://getmarrow.ai/docs/).
134
-
135
- ```json
136
- {
137
- "project": {
138
- "name": "agent-api",
139
- "type": "node",
140
- "frameworks": ["edge-service"],
141
- "signals": ["package_json", "platform_config", "github_actions"]
142
- },
143
- "workflow": {
144
- "action": "deploy production service",
145
- "type": "deploy",
146
- "environment": "production"
147
- }
148
- }
149
- ```
150
-
151
- ## What's New in v3.9.38
152
-
153
- v3.9.38 improves passive attribution quality for external/customer decisions.
154
-
155
- - MCP requests now send `X-Marrow-Client` from `MARROW_CLIENT`, `MARROW_HARNESS`, or `MARROW_AGENT_CLIENT`.
156
- - `marrow_think`, `marrow_auto`, PostToolUse hooks, and passive prompt workflows attach safe `agent_id`, source channel, client/harness, and inferred workflow intent metadata.
157
- - Supported client labels now include `codex`, `gemini`, `grok`, `deepseek`, `qwen`, `kimi`, `minimax`, `cline`, `opencode`, `hermes`, `glm`, `claude-code`, `cursor`, `windsurf`, `openclaw`, and `custom`.
158
- - Invalid client labels fall back to the MCP default; Marrow still rejects malformed structured `source_meta` instead of storing bad metadata.
159
-
160
- Business value: Marrow dashboards and reports can show which agents, harnesses, and workflow types are improving instead of grouping too much work into `unknown`.
161
-
162
- ## Previous Release Notes
163
-
164
- ### v3.9.31
165
-
166
- v3.9.31 is a docs-sync release. It keeps npm and GitHub README copy aligned with Marrow's current backend-first runtime contract and proof/gate enforcement loop. Runtime behavior is unchanged from v3.9.30.
167
-
168
- v3.9.30 brings MCP tools and passive prompt hooks up to Marrow's current backend-first runtime contract and proof/gate enforcement loop:
169
-
170
- - UserPromptSubmit context now prefers `intervention.agent_copy`, so agents see the strongest `before you act` instruction before legacy runtime text.
171
- - `marrow_agent_runtime` types now expose `intervention`, `runtime_contract`, `risk_gate_event`, and `behavior_governance` for `/v1/agent/runtime`.
172
- - MCP now supports the backend-first contracts `marrow.before-action-intervention.v1` and `agent-runtime-contract.v3`.
173
- - `marrow_commit` exposes `proof`, `gate_receipt_id`, `action`, `surfaces`, and `auto_gate` fields for gated work.
174
- - MCP commit paths preserve the same fleet agent identity used by `marrow_think`, preventing agent-bound key commit mismatches.
175
- - `marrow_run` and `marrow_auto` attach standard proof packs when they close outcomes automatically.
176
-
177
- First-run value proof remains current:
178
-
179
- - `marrow_first_value` returns the five-minute proof payload: capture status, runtime gate, first useful lesson, value proof, and the exact try-this-now prompt.
180
- - UserPromptSubmit hook context still shows runtime interruption state, why Marrow is interrupting, required proof, and the quiet/noise policy.
181
- - Legacy `before_you_act_injection` types still expose `state`, `why_now`, `noise_policy`, `required_proof`, `missing_proof`, and `owner_approval_required`.
182
-
183
- Previous agent-native runtime behavior remains current:
184
-
185
- - UserPromptSubmit hooks call the one-call runtime by default, so agents receive status, risk gate, lessons, proof requirements, and exact next action before acting.
186
- - When Marrow marks `before_you_act_injection.must_use_before_action=true`, the prompt injection labels the Marrow action gate as required and tells the agent to stop if the lesson/proof cannot be applied.
187
- - `marrow_agent_runtime` now includes structured `before_you_act_injection` data for fleet lessons and deployment playbooks.
188
- - PostToolUse continues to close outcomes automatically for successful and failed tool calls.
189
- - Degraded passive capture points agents to exact installer/MCP/SDK repair commands.
190
-
191
- ```json
192
- {
193
- "action": "deploy edge service to production",
194
- "type": "deploy",
195
- "surfaces": ["github", "deployment-platform", "production"]
196
- }
197
- ```
198
-
199
- Full feature history, examples, and API reference live at [getmarrow.ai/docs](https://getmarrow.ai/docs/).
200
-
201
- ---
202
-
203
- ### Gated Commit Proof
204
-
205
- For risky actions, call `marrow_agent_runtime` before acting and pass the receipt plus proof into `marrow_commit`:
206
-
207
- ```json
208
- {
209
- "decision_id": "...",
210
- "success": true,
211
- "outcome": "Deploy succeeded and production smoke passed",
212
- "gate_receipt_id": "runtime.gate_receipt.id",
213
- "proof": {
214
- "summary": "Production deploy completed",
215
- "checks": ["tests passed", "smoke passed"],
216
- "outcome": "success",
217
- "blockers": "none",
218
- "commits_prs_shas": "abc123",
219
- "rollback_target": "previous release version",
220
- "handoff_result_file": "/tmp/marrow-handoffs/release/result.md",
221
- "deployment_and_smoke": "production smoke passed"
222
- }
223
- }
224
- ```
225
-
226
- If you provide `action` and omit `gate_receipt_id`, `marrow_commit` can fetch a matching runtime gate receipt automatically.
227
-
228
- ## Human-Directed Attribution Status
229
-
230
- The Marrow API supports privacy-preserving provenance fields on direct `POST /v1/decisions` calls: `source_kind`, `human_directed`, `source_confidence`, `instruction_ref`, `instruction_hash`, and `source_meta`. These fields classify instruction source class without identifying the human or storing raw prompts/PII.
231
-
232
- MCP tools and passive hooks now attach structured attribution by default. Marrow sends `X-Marrow-Agent-Id` when `MARROW_FLEET_AGENT_ID` or `MARROW_AGENT_ID` is configured, and it fills `source_meta.channel`, `source_meta.client`, `source_meta.agent_id`, and `source_meta.user_intent` where safe. Set `MARROW_CLIENT`, `MARROW_HARNESS`, or `MARROW_AGENT_CLIENT` to one of the supported client labels (`codex`, `claude-code`, `cursor`, `gemini`, `grok`, `deepseek`, `qwen`, `kimi`, `minimax`, `cline`, `opencode`, `hermes`, `glm`, `openclaw`, `windsurf`, or `custom`) for cleaner per-harness reporting.
233
-
234
- ---
235
-
236
- ## Agent Value Report
237
-
238
- `marrow_value_report` lets MCP agents pull owner-ready proof of Marrow value without a dashboard. The existing passive hooks remain the default install path: `PostToolUse` logs meaningful tool outcomes and `UserPromptSubmit` injects relevant context plus decision briefs for risky prompts.
239
-
240
- ### Value Report Tool
241
-
242
- MCP tool: `marrow_value_report`.
243
-
244
- Use it when an agent needs to explain whether Marrow is active, useful, and improving the fleet.
245
-
246
- ```json
247
- {
248
- "period": "7d",
249
- "agentId": "jarvis-agent"
250
- }
251
- ```
252
-
253
- The response includes summary, decisions, success rate, saves, active agents, top risks, recommendations, and improvement data. It does not expose raw action, context, or outcome text.
254
-
255
- ### Passive Decision Briefs
256
-
257
- Agents no longer need to remember to call `marrow_decision_brief` for common deploy, publish, merge, audit, patch, secret, or production prompts. They still can call it explicitly when they need stronger control.
258
-
259
- ### Decision Brief Tool
260
-
261
- MCP tool: `marrow_decision_brief`.
262
-
263
- Use it before deploys, publishes, merges, audits, patches, secret changes, or production work. One call returns the agent's operating brief: risk, workflow/playbook steps, handoff requirements, freshness/source-of-truth checks, minimum verification checks, proof-pack fields, and next actions.
264
-
265
- ```json
266
- {
267
- "action": "publish SDK and MCP packages to npm and update docs",
268
- "type": "deploy",
269
- "role": "deploy",
270
- "surfaces": ["github", "npm", "docs", "production"]
271
- }
12
+ npx @getmarrow/mcp setup
272
13
  ```
273
14
 
274
- Marrow returns aggregated prior failure categories only. It does not expose raw action, context, or outcome text from past decisions.
275
-
276
- `marrow_decision_brief` is additive. It gives the pre-action operating brief, then the agent still logs intent with `marrow_think`/passive auto-logging and commits the verified outcome with `marrow_commit`.
277
-
278
- Passive decision briefs are enabled by default. Set `MARROW_PASSIVE_BRIEF=false` to disable them, or `MARROW_PASSIVE_BRIEF=always` to brief every prompt.
279
-
280
- ### Workflow Gate Tool
15
+ Set the key through trusted secret storage:
281
16
 
282
- MCP tool: `marrow_workflow_gate`.
283
-
284
- Use it before deploys, publishes, merges, DB migrations, key rotation, destructive commands, or production work.
285
-
286
- ```json
287
- {
288
- "action": "rotate deployment token and verify production",
289
- "riskTolerance": "medium",
290
- "requiresApproval": true
291
- }
17
+ ```bash
18
+ export MARROW_API_KEY=mrw_live_...
292
19
  ```
293
20
 
294
- The response returns `allow`, `warn`, `review_required`, or `block`, plus prior lessons and deployment playbooks when available.
295
-
296
- Passive value summaries are enabled by default in auto mode. Set `MARROW_PASSIVE_VALUE_SUMMARY=false` to disable them, or `MARROW_PASSIVE_VALUE_SUMMARY=always` to include them on every prompt hook.
297
-
298
- Full feature history, examples, and API reference live at [getmarrow.ai/docs](https://getmarrow.ai/docs/).
299
-
300
- ---
301
-
302
- ## Agent-Narrated Marrow Contribution
303
-
304
- Marrow now tells the agent exactly what it contributed to each decision, so the agent can surface that contribution to the user in plain English — no dashboard required.
305
-
306
- Three new fields:
307
-
308
- - `marrow_think` returns `marrow_contributed` describing what intelligence Marrow surfaced for this decision (warnings consulted, shared patterns, similar decisions, workflow templates, loop detection, collective insight).
309
- - `marrow_commit` returns `marrow_contributed` describing concrete signals on the commit itself (pattern reused, warning avoided, workflow step).
310
- - `marrow_session_end` returns `session_summary` aggregating Marrow's contribution across the session, plus a one-line `narrative` for the agent to surface as it wraps up.
311
-
312
- Each object includes `has_signal: boolean` — when true, the agent narrates Marrow's role in 1 sentence; when false, it stays quiet. The built-in `marrow-always-on` system prompt now instructs agents on tone and timing for these narrations.
313
-
314
- Sample think response:
21
+ Then configure the MCP server:
315
22
 
316
23
  ```json
317
24
  {
318
- "decision_id": "...",
319
- "intelligence": { "...": "..." },
320
- "marrow_contributed": {
321
- "warnings_consulted": 2,
322
- "hive_patterns_surfaced": 12,
323
- "similar_decisions_found": 8,
324
- "workflow_templates_available": 1,
325
- "loop_detected": false,
326
- "collective_intelligence": true,
327
- "team_context_present": false,
328
- "has_signal": true
25
+ "mcpServers": {
26
+ "marrow": {
27
+ "command": "npx",
28
+ "args": ["-y", "@getmarrow/mcp"]
29
+ }
329
30
  }
330
31
  }
331
32
  ```
332
33
 
333
- The user installed Marrow to make their agent better. They should hear, in plain English, what Marrow actually did. Their agent's reply IS the dashboard.
334
-
335
- ---
336
-
337
- ## Agent-Narrated Milestones
34
+ For most new installations, start with the universal installer instead:
338
35
 
339
- `marrow_commit` returns a `narrative` field. When a milestone fires (first commit, baseline capture, decision 100/500/1000/5000, weekly recap), the backend returns a human-readable string the agent relays to the user. Otherwise it returns `null`.
340
-
341
- ```json
342
- {
343
- "committed": true,
344
- "narrative": "Baseline captured. Your first-week averages: 42s per task, 1.3 attempts per success."
345
- }
346
- ```
347
-
348
- Narratives are aggregated metrics only — no user data, no decision content, no heuristics.
349
-
350
- ---
351
-
352
- ## Velocity Metrics
353
-
354
- `marrow_dashboard` and `marrow_digest` include three measured velocity metrics:
355
-
356
- - `attempts_per_success` — avg decisions before an agent lands a success
357
- - `time_to_success_seconds` — median seconds from `marrow_think` to successful `marrow_commit`
358
- - `drift_rate` — % of decisions that didn't link to a known pattern
359
-
360
- Each reports `{current, previous, delta_pct, direction}` so operators see whether agents are trending toward or away from improvement.
361
-
362
- All metrics are computed from real decision data — no estimates, no heuristics.
363
-
364
- ---
365
-
366
- ## Passive Mode
367
-
368
- Running `npx @getmarrow/mcp setup` installs a PostToolUse hook into `.claude/settings.json`. After setup, every tool call your agent makes (Bash, file edits, MCP calls) is auto-logged to Marrow in the background — no agent discipline required.
369
-
370
- Disable via: `MARROW_AUTO_HOOK=false`
371
-
372
- For troubleshooting hook behavior, set `MARROW_HOOK_DEBUG=true` to re-enable one-line stderr diagnostics.
373
-
374
- PostToolUse now marks automatic outcome closure explicitly. Successful tool calls commit success, tool errors commit failure, and `/v1/agent/status` can tell the agent whether the outcome hook is missing. If status is degraded, run `npx @getmarrow/install --yes` or `npx @getmarrow/mcp setup` to repair passive capture.
375
-
376
- MCP write paths now keep a bounded in-process retry queue for temporary network/server failures on `think` and `commit`. Auth failures, policy blocks, proof-pack failures, and validation errors are not retried blindly; status returns exact failure reasons and fix commands instead.
377
-
378
- **Operator visibility + auto-intelligence tools.**
379
-
380
- ## Operator Tools
381
-
382
- ### marrow_dashboard
383
-
384
- Operator dashboard in one call. Account health, top failures, workflow status, recent activity, Marrow's saves metric. Now includes velocity metrics (see v3.3.0 section above).
385
-
386
- ### marrow_digest
387
-
388
- Periodic summary with success rate trend vs previous period. Optional `period` parameter (default `7d`). Now includes velocity summary (see v3.3.0 section above).
389
-
390
- ### marrow_agent_status
391
-
392
- Agent-native proof that Marrow is connected and collecting useful signal. Optional `period` and `agentId` parameters; when omitted, the tool filters by `MARROW_AGENT_ID`. Returns `active`, `state`, `signals`, `quality`, `proof`, `failure_reasons`, `agent_warnings`, `diagnostics`, and `next_actions` without exposing raw decision text. Common failure reasons include `missing_key`, `invalid_key`, `wrong_agent_id`, `network_blocked`, and `proof_required`.
393
-
394
- ### marrow_decision_brief
395
-
396
- One pre-action call before meaningful work. Returns `risk`, `workflow`, `handoff`, `freshness`, `quality`, `role_playbook`, `failure_alerts`, `proof_pack`, `source_of_truth`, `fleet_reliability`, and `next_actions`.
397
-
398
- Use this before risky work so the agent does not need to stitch together multiple backend calls. It does not replace outcome logging.
399
-
400
- ### marrow_session_end
401
-
402
- Explicitly end a session and optionally auto-commit any open decision. Prevents orphaned decisions.
403
-
404
- ### marrow_accept_detected
405
-
406
- Convert a detected recurring pattern into an enforced workflow. Pattern ID comes from `orient()` response's `suggested_workflows`.
407
-
408
- ## Intelligence Fields in marrow_think Response
409
-
410
- `marrow_think` surfaces three additional fields when the backend provides them:
411
- - `onboarding_hint` — contextual tip for new accounts
412
- - `intelligence.collective` — entitlement-gated, k-anonymous aggregate patterns when the tenant contributes sanitized aggregate signals and the minimum-account threshold is met
413
- - `curated_baseline_guidance` — strong private baseline guidance for private or non-contributing tenants
414
- - `intelligence.team_context` — recent decisions from other sessions in the same account, so multi-agent teams stay aware of each other's work
415
-
416
- ---
417
-
418
- ## Available Templates
419
-
420
- 24 pre-built workflow templates across 8 industries. Browse via `marrow_list_templates` and install with `marrow_install_template`.
421
-
422
- - **Insurance (4):** `claims-triage`, `fraud-review`, `underwriting-decision`, `complaint-escalation`
423
- - **Healthcare (4):** `patient-triage`, `clinical-documentation`, `prior-authorization`, `coding-audit`
424
- - **E-commerce (3):** `order-fulfillment`, `refund-approval`, `return-processing`
425
- - **Legal (3):** `contract-review`, `case-triage`, `document-discovery`
426
- - **SaaS (6):** `code-review-deploy`, `incident-response`, `feature-rollout`, `ticket-triage`, `escalation-flow`, `lead-qualify`
427
- - **Fintech (2):** `etl-pipeline`, `approval-flow`
428
- - **Media (1):** `content-publish`
429
- - **Enterprise (1):** `change-management`
430
-
431
- Full catalog with descriptions: [https://getmarrow.ai/docs/#template-marketplace](https://getmarrow.ai/docs/#template-marketplace)
432
-
433
- ```
434
- marrow_list_templates({ industry: 'insurance' })
435
- marrow_install_template({ slug: 'claims-triage' })
36
+ ```bash
37
+ npx @getmarrow/install --yes
436
38
  ```
437
39
 
438
- ## Claude Code Compatibility
40
+ ## What's New in v3.9.43
439
41
 
440
- Marrow MCP works natively with Claude Code. The server runs as a long-running process and handles the full MCP protocol correctly.
42
+ v3.9.43 aligns the package entry point with Marrow's business product contract:
441
43
 
442
- ## One-Command Agent Setup
44
+ - runtime control before consequential actions;
45
+ - proof and outcome closure afterward;
46
+ - tenant-scoped fleet improvement across interchangeable agents and harnesses;
47
+ - context, lessons, and workflow examples presented as supporting controls rather than a separate memory product.
443
48
 
444
- Inject Marrow instructions directly into your project's `CLAUDE.md`:
49
+ This patch changes package documentation and positioning. Existing MCP tool behavior and names remain compatible.
445
50
 
446
- ```bash
447
- npx @getmarrow/mcp setup
448
- ```
449
-
450
- After setup, your agent uses Marrow automatically every session, and Claude Code PostToolUse hooks auto-log tool calls in the background — no human prompting required.
51
+ ## Governed Action Flow
451
52
 
452
- ## Auto-Enroll by Default
453
- The `marrow-always-on` prompt is served to all MCP clients automatically. Set `MARROW_AUTO_ENROLL=false` to opt out.
53
+ Before deploys, merges, publishes, migrations, credential changes, financial operations, or customer-impacting work:
454
54
 
455
- ## Security Hardening
456
- - **Input validation** — all URL path parameters are sanitized to prevent path traversal
457
- - **SSRF protection** — `MARROW_BASE_URL` must use HTTPS
458
- - **Crash protection** — malformed JSON on stdin no longer kills the server
459
- - **Error handling** — proper error logging throughout
460
- - **HTTP status checking** — API errors return clear messages
55
+ 1. Call `marrow_agent_runtime` or `marrow_decision_brief`.
56
+ 2. Stop when the returned decision is `block` or `review_required`; otherwise follow its prior lesson and proof contract.
57
+ 3. Call `marrow_think` to record intent and obtain the `decision_id` that will be closed.
58
+ 4. Perform the action only when its gate allows it.
59
+ 5. Call `marrow_commit` with that `decision_id`, the outcome, gate receipt, and required proof.
461
60
 
462
- ### Auto-Warn on Orient
463
- The `marrow_orient` tool now accepts `autoWarn: true` and warns you BEFORE you start a task that recently failed:
61
+ Example pre-action request:
464
62
 
465
63
  ```json
466
64
  {
467
- "name": "marrow_orient",
65
+ "tool": "marrow_agent_runtime",
468
66
  "arguments": {
469
- "autoWarn": true,
470
- "task": "Fix authentication error"
67
+ "action": "deploy the production worker",
68
+ "type": "deploy",
69
+ "role": "deploy",
70
+ "surfaces": ["repository", "deployment", "production"]
471
71
  }
472
72
  }
473
73
  ```
474
74
 
475
- **Response includes warnings:**
476
- ```
477
- ⚠️ HIGH: This task type failed 4x with approach='retry-without-fix'.
478
- Try approach='apply-patch-first' (89% success rate)
479
- ```
480
-
481
- ### Loop Detection on Think
482
- The `marrow_think` tool now accepts `checkLoop: true` and detects if you're about to retry a failed approach:
75
+ Example closeout:
483
76
 
484
77
  ```json
485
78
  {
486
- "name": "marrow_think",
79
+ "tool": "marrow_think",
487
80
  "arguments": {
488
- "action": "Retry auth with method='internal'",
81
+ "action": "deploy the production worker",
82
+ "type": "process",
489
83
  "checkLoop": true
490
84
  }
491
85
  }
492
86
  ```
493
87
 
494
- **Response includes loop warnings:**
495
- ```
496
- 🚨 LOOP DETECTED: You're retrying a failed approach.
497
- Previous failure: 'retry-without-fix' approach not supported.
498
- Suggested: Use 'apply-patch-first' approach instead.
499
- ```
500
-
501
- ### Rate Limiting
502
- - `marrow_orient`: 30 requests/minute per account
503
- - `marrow_think`: 60 requests/minute per account
504
- - Automatic 429 responses when limit exceeded
505
-
506
- ### Enhanced PII Protection
507
- - Automatic stripping of emails, phone numbers, API keys from all responses
508
- - Applied to `recentLessons`, `warnings`, and `outcome` fields
509
- - Deep object stripping for complex data structures
510
-
511
- ---
512
-
513
- ## The Problem
514
-
515
- Most agents still operate with shallow governance.
516
-
517
- They might keep a short context window, maybe write a note or two, then lose the important part:
518
- - what they were trying to do
519
- - what they actually did
520
- - whether it worked
521
- - what pattern that should teach the next run
522
-
523
- That creates a familiar failure loop:
524
- - the same mistakes repeat
525
- - work gets marked done without structured outcome proof
526
- - agents drift between sessions
527
- - hosts have no clean way to inspect whether the work loop is actually closed
528
-
529
- **Marrow fixes this.**
530
-
531
- Through MCP, your agent can:
532
- - orient at session start
533
- - log intent before meaningful action
534
- - inspect loop state before handoff or completion
535
- - commit outcomes back to Marrow with proof cleanly
536
-
537
- ---
538
-
539
- ## How It Works
540
-
541
- Marrow exposes a simple operating loop through MCP:
542
-
543
- ```text
544
- orient -> think -> act -> check -> commit
545
- ```
546
-
547
- That gives agents an actual governance discipline:
548
- - **orient** → pick up recent lessons and current loop state
549
- - **think** → log intent and receive decision intelligence
550
- - **act** → perform the meaningful work
551
- - **check** → inspect whether the loop is still open or missing something
552
- - **commit** → log the outcome and close the loop
553
-
554
- The value compounds with use. Each decision your agent logs makes the fleet safer — failure rates drop, patterns emerge, proof requirements get clearer, and the next session starts with real intelligence instead of a blank slate. Teams running multiple agents see this compound fastest, but even a single agent builds meaningful history within a few sessions.
555
-
556
- ---
557
-
558
- ## Install
559
-
560
- Default path for new users:
561
-
562
- ```bash
563
- npx @getmarrow/install --yes
564
- ```
565
-
566
- Manual MCP path for MCP-native clients:
567
-
568
- ### Quick Start (Claude Code)
569
-
570
- ```bash
571
- # 1. Add the MCP server
572
- claude mcp add marrow -e MARROW_API_KEY="$MARROW_API_KEY" -- npx @getmarrow/mcp
573
-
574
- # 2. Set up auto-enrollment (agent uses Marrow automatically)
575
- npx @getmarrow/mcp setup
576
- ```
577
-
578
- That's it. Your agent will use Marrow automatically in every session.
579
-
580
- ### Manual Setup
581
-
582
- Run it directly with `npx`:
583
-
584
- ```bash
585
- MARROW_API_KEY="$MARROW_API_KEY" npx @getmarrow/mcp
586
- ```
587
-
588
- Or register it in your MCP client config using environment variables or your client's secret storage. Avoid putting API keys in command arguments or static config files.
589
-
590
- ---
591
-
592
- ## MCP Tools
593
-
594
- ### Core Loop Tools
595
-
596
- #### `marrow_orient`
597
- **Call this first** at session start. Returns failure warnings from your history so you avoid known mistakes immediately.
598
-
599
- #### `marrow_think`
600
- Log intent before meaningful action. Returns pattern insights, similar past decisions, and a recommended next step.
601
-
602
- #### `marrow_commit`
603
- Log the outcome after acting. Closes the decision loop. Can include `model_usage` so Marrow returns token-value proof after work completes.
604
-
605
- #### `marrow_model_usage`
606
- Record compact model token/cost/latency counts when your harness exposes them. This powers token savings proof in `/v1/agent/value/proof` and owner reports.
607
-
608
- #### `marrow_run`
609
- Zero-ceremony wrapper. Handles orient → think → commit in a single call.
610
-
611
- #### `marrow_auto`
612
- Fire-and-forget logging. Pass what you're about to do (and optionally the outcome). Marrow handles everything in the background.
613
-
614
- ### Memory Management Tools
615
-
616
- #### `marrow_list_memories`
617
- List memories with optional filters:
618
- - `status` — Filter by status (active, outdated, deleted)
619
- - `query` — Search query
620
- - `limit` — Max results
621
- - `agentId` — Include memories shared with this agent
622
-
623
- #### `marrow_get_memory`
624
- Get a single memory by ID.
625
-
626
- #### `marrow_update_memory`
627
- Update memory text, tags, or metadata.
628
-
629
- #### `marrow_delete_memory`
630
- Soft delete a memory.
631
-
632
- #### `marrow_mark_outdated`
633
- Mark a memory as outdated.
634
-
635
- #### `marrow_supersede_memory`
636
- Atomically replace a memory with a new version.
637
-
638
- #### `marrow_share_memory`
639
- Share a memory with specific agents.
640
-
641
- #### `marrow_export_memories`
642
- Export memories to JSON or CSV format.
643
-
644
- #### `marrow_import_memories`
645
- Import memories with merge (dedup) or replace mode.
646
-
647
- #### `marrow_retrieve_memories`
648
- Full-text search with filters:
649
- - `query` — Search query (required)
650
- - `limit` — Max results
651
- - `from` / `to` — Date range (ISO-8601)
652
- - `tags` — Comma-separated tags
653
- - `source` — Source filter
654
- - `status` — Status filter
655
- - `shared` — Include shared memories
656
-
657
- ### Query Tools
658
-
659
- #### `marrow_ask`
660
- Query the collective hive in plain English. Ask about failure patterns, what worked, what broke, or get a recommendation.
661
-
662
- #### `marrow_status`
663
- Check Marrow platform health and status.
664
-
665
- ---
666
-
667
- ## Claude Code Config
668
-
669
- ```bash
670
- claude mcp add marrow -e MARROW_API_KEY="$MARROW_API_KEY" -- npx @getmarrow/mcp
671
- ```
672
-
673
- ## Claude Desktop Config
674
-
675
88
  ```json
676
89
  {
677
- "mcpServers": {
678
- "marrow": {
679
- "command": "npx",
680
- "args": ["@getmarrow/mcp"],
681
- "env": {
682
- "MARROW_API_KEY": "${MARROW_API_KEY}"
683
- }
90
+ "tool": "marrow_commit",
91
+ "arguments": {
92
+ "decision_id": "decision_id returned by marrow_think",
93
+ "gate_receipt_id": "receipt id returned by marrow_agent_runtime",
94
+ "success": true,
95
+ "outcome": "Production deploy succeeded and smoke checks passed.",
96
+ "proof": {
97
+ "checks": ["tests passed", "secret scan passed", "production smoke passed"],
98
+ "rollback_target": "previous release"
684
99
  }
685
100
  }
686
101
  }
687
102
  ```
688
103
 
689
- ---
104
+ High-risk work can be allowed, warned, held for review, or blocked according to account policy. Low-risk work can use passive guidance and bounded cached state where the runtime contract permits it.
690
105
 
691
- ## Environment Variables
106
+ ## Passive Use
692
107
 
693
- | Variable | Required | Description |
694
- |----------|----------|-------------|
695
- | `MARROW_API_KEY` | Yes | Your API key from getmarrow.ai. Prefer environment variables or client secret storage. MCP also auto-loads `.marrow/env`, `.marrow/env.local`, `.env`, `.env.local`, `~/.marrow/env`, and `~/.marrow/env.local`. |
696
- | `MARROW_KEY` | No | Alias accepted by MCP for fleet runners and secret managers. |
697
- | `MARROW_BASE_URL` | No | Custom API URL (default: `https://api.getmarrow.ai`). Must use HTTPS. |
698
- | `MARROW_SESSION_ID` | No | Session identifier for multi-agent setups |
699
- | `MARROW_FLEET_AGENT_ID` | No | Agent identifier sent as `X-Marrow-Agent-Id` for fleet attribution |
700
- | `MARROW_CLIENT` / `MARROW_HARNESS` / `MARROW_AGENT_CLIENT` | No | Harness/client label used for per-client reporting, such as `codex`, `claude-code`, `cursor`, `gemini`, `qwen`, `opencode`, or `custom` |
701
- | `MARROW_AUTO_ENROLL` | No | Auto-enrollment prompt (default: `true`). Set to `false` to disable. |
702
- | `MARROW_AUTO_HOOK` | No | PostToolUse auto-logging kill switch. Set to `false` to disable the hook without editing settings. |
703
- | `MARROW_PASSIVE_BRIEF` | No | Passive decision-brief mode for the prompt hook. Defaults to `auto`; set `false` to disable or `always` to brief every prompt. |
704
- | `MARROW_HOOK_DEBUG` | No | When set to `true`, write-side and prompt-context hooks emit one-line stderr diagnostics. |
705
- | `MARROW_CONTEXT_HOOK_DEBUG` | No | When set to `true`, only the UserPromptSubmit context hook emits one-line stderr diagnostics. |
108
+ `npx @getmarrow/mcp setup` installs supported hooks so the agent can receive before-action context and record meaningful tool outcomes without the owner repeatedly prompting it to use Marrow.
706
109
 
707
- If hooks are installed but no decisions are being logged, run:
110
+ Check the installed runtime:
708
111
 
709
- ```bash
710
- npx @getmarrow/install doctor
112
+ ```text
113
+ marrow_agent_status
711
114
  ```
712
115
 
713
- Deep doctor with harmless write/outcome verification:
714
-
715
- ```bash
716
- MARROW_API_KEY=<your_marrow_key> npx @getmarrow/install doctor --self-test
717
- ```
116
+ Status diagnostics distinguish missing keys, invalid keys, wrong bound-agent identity, network limits, missing hooks, and incomplete proof. They include an exact repair action without exposing secrets.
718
117
 
719
- Healthy output should confirm `key valid: yes`, `account active: yes`, `agent identity accepted: yes`, `write test event: passed`, and `outcome closed: passed`. If it fails, Marrow returns the exact reason and fix command.
118
+ ## Primary MCP Tools
720
119
 
721
- Stable project-local key file:
120
+ | Tool | Purpose |
121
+ | --- | --- |
122
+ | `marrow_agent_runtime` | One-call pre-action status, policy gate, relevant lessons, proof requirements, and exact next action |
123
+ | `marrow_decision_brief` | Compact operating brief for meaningful work |
124
+ | `marrow_think` | Record intent and retrieve relevant governance intelligence |
125
+ | `marrow_commit` | Close an action with outcome, receipt, and proof |
126
+ | `marrow_workflow_gate` | Evaluate a workflow action against policy |
127
+ | `marrow_completion_contracts` | List proof contracts for consequential action types |
128
+ | `marrow_evaluate_completion_contract` | Check whether evidence is sufficient to call work complete |
129
+ | `marrow_agent_status` | Verify capture, identity, outcome coverage, and hook health |
130
+ | `marrow_value_report` | Return account/agent value evidence without requiring a dashboard |
131
+ | `marrow_buyer_proof` | Return owner-ready governance and reliability evidence |
132
+ | `marrow_governance_timeline` | Inspect decisions, gates, proof packs, and outcomes over time |
133
+ | `marrow_fleet_lessons` | Retrieve proven lessons authorized for the current account or agent |
134
+ | `marrow_model_usage` | Record compact token, cost, and latency counts when the harness exposes them |
722
135
 
723
- ```bash
724
- mkdir -p .marrow
725
- printf "MARROW_API_KEY=<your_marrow_key>\\n" > .marrow/env
726
- chmod 600 .marrow/env
727
- npx @getmarrow/mcp setup
728
- ```
136
+ The package also exposes key management, fleet handoff, deployment history, adaptive policy, context/lesson, query, and workflow-example tools. See the [complete source-of-truth documentation](https://getmarrow.ai/docs/) for every tool and field.
729
137
 
730
- ---
138
+ ## Context and Workflow Examples
731
139
 
732
- ## The Always-On Prompt
140
+ The stable `marrow_*memory*` tools manage authorized context and prior lessons used by governance decisions. They are advanced supporting APIs, not a separate product category.
733
141
 
734
- Marrow includes a built-in prompt called `marrow-always-on` that instructs agents to use Marrow automatically. It's served by default — no configuration needed.
142
+ The template tools expose 24 configurable workflow examples. They are starting points for policy design, not customer case studies, regulatory validation, legal advice, or proof of production use in each listed industry.
735
143
 
736
- **To use:** In your MCP client, request the `marrow-always-on` prompt and include it in your system instructions. For Claude Code, run `npx @getmarrow/mcp setup` instead — it handles this automatically.
144
+ ## Trust and Data Boundaries
737
145
 
738
- ---
146
+ - Private account, fleet, workflow, proof, and agent data remains tenant-scoped by default.
147
+ - Agent-bound keys can be restricted to an allowed identity and permission set.
148
+ - Sanitized aggregate contribution is optional and never means sharing raw prompts, code, secrets, proof packs, account identifiers, agent identifiers, or customer identities.
149
+ - Existing API keys are never returned after creation; key material should be supplied through the client's secret store.
150
+ - Marrow returns guidance and policy data. Agents must not execute returned text as shell input.
739
151
 
740
- ## Why This Matters
152
+ See the [Trust Center](https://getmarrow.ai/trust/) for implemented controls, current limits, and roadmap status.
741
153
 
742
- Without Marrow:
743
- - Agents repeat the same failures session after session
744
- - Successful patterns get lost when the context window clears
745
- - There's no structured trail of what was tried and what worked
746
- - Every new session starts from zero
154
+ ## Environment
747
155
 
748
- With Marrow:
749
- - Failure patterns surface before you repeat them
750
- - Successful outcomes compound across sessions
751
- - Every decision has a trail: intent → action → outcome
752
- - The hive gets smarter with every logged decision
156
+ | Variable | Required | Purpose |
157
+ | --- | --- | --- |
158
+ | `MARROW_API_KEY` | Yes | Account or agent-bound API key |
159
+ | `MARROW_BASE_URL` | No | API base override |
160
+ | `MARROW_AGENT_ID` | No | Bound agent identity for MCP tools |
161
+ | `MARROW_FLEET_AGENT_ID` | No | Fleet agent identity used by passive setup |
753
162
 
754
- **Marrow tells you what went wrong last time before you do it again.**
163
+ ## Documentation
755
164
 
756
- ---
165
+ - [Source-of-truth docs](https://getmarrow.ai/docs/)
166
+ - [Trust Center](https://getmarrow.ai/trust/)
167
+ - [Status](https://getmarrow.ai/status/)
168
+ - [GitHub](https://github.com/getmarrow/marrow-mcp)
757
169
 
758
170
  ## License
759
171
 
760
172
  MIT
761
173
 
762
- ---
763
-
764
174
  ## Related Packages
765
175
 
766
- - **[@getmarrow/install](https://www.npmjs.com/package/@getmarrow/install)** — Default front door for new users. Detects local agent/runtime surfaces, writes safe config, runs self-tests, and reports first-value proof.
767
- - **[@getmarrow/sdk](https://www.npmjs.com/package/@getmarrow/sdk)** — TypeScript/Node.js SDK for programmatic access to Marrow. Use this for custom agent integrations outside of MCP.
768
-
769
- **📖 Full API reference with all endpoints:** [https://getmarrow.ai/docs/#api-reference](https://getmarrow.ai/docs/#api-reference)
176
+ - [@getmarrow/install](https://www.npmjs.com/package/@getmarrow/install) - default installer, self-test, governed runner, and operator TUI
177
+ - [@getmarrow/sdk](https://www.npmjs.com/package/@getmarrow/sdk) - Node.js and TypeScript integration for owned agent runtimes