@getmarrow/mcp 2.8.0 → 2.9.1

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
@@ -10,51 +10,45 @@ With `@getmarrow/mcp`, any MCP-compatible client can log intent before acting, i
10
10
 
11
11
  ---
12
12
 
13
- ## What's New in v2.6.0
14
-
15
- - **Portability audit** — zero workspace coupling confirmed. No `OPENCLAW_*` env vars, no private paths, no agent-name assumptions.
16
- - **Session identity** — `MARROW_SESSION_ID` and `X-Marrow-Session-Id` header for multi-agent/multi-user setups
17
- - **`marrow-always-on` prompt** — install once in your MCP client for automatic orient → think → commit behavior
18
- - **TypeScript clean** `tsc --noEmit` zero errors
19
-
20
- ## What's New in v2.5.0
21
-
22
- - **`marrow_run` tool** — single-call memory logging. Pass description + success + outcome. Marrow handles orient → think → commit internally.
23
- - **`MARROW_SESSION_ID` env var** — tag all requests with a session identifier
24
- - **Auto-commit on session close** if session ends with an open loop, Marrow commits automatically
25
- - **Orient warnings in think response** startup warnings now surface in `marrow_think` intelligence, not just stderr
26
-
27
- ---
28
-
29
- ## What's New in v2.3.4
30
-
31
- ### Loop enforcement is now part of the MCP workflow
32
-
33
- This release adds the MCP-side loop workflow so agents can operate through a real decision cycle instead of dumping disconnected thoughts into memory.
34
-
35
- New / updated tools:
36
- - `marrow_orient` / `orient` start the session with loop state, recent lessons, and a recommended next step
37
- - `marrow_think` / `think` log intent and get pattern intelligence + loop metadata back
38
- - `marrow_check` / `check` inspect loop state mid-session before handoff or completion
39
- - `marrow_commit` / `commit` close the loop cleanly with outcome logging
40
-
41
- What changed in practice:
42
- - session-local loop state persists across MCP tool calls
43
- - agents get a canonical session-start nudge toward `marrow_think`
44
- - `commit` now correctly returns a closed-loop state (`done` / `outcome_logged`)
45
- - the MCP package now lines up properly with the newer SDK loop-enforcement model
46
-
47
- ---
48
-
49
- ## Install
50
-
51
- Run it directly with `npx`:
52
-
53
- ```bash
54
- npx @getmarrow/mcp
55
- ```
56
-
57
- Or register it in your MCP client config.
13
+ ## What's New in v2.8.0
14
+
15
+ **Backend API Enhancements** — New MCP tools for memory lifecycle management:
16
+
17
+ ### Cross-Agent Memory Sharing
18
+ Share memories across agents in your account:
19
+ - `marrow_share_memory` — Share a memory with specific agents
20
+ - Memories shared with your agents automatically appear in `marrow_list_memories`
21
+
22
+ ### Memory Export/Import
23
+ Backup and restore memories:
24
+ - `marrow_export_memories`Export to JSON or CSV format
25
+ - `marrow_import_memories`Import with merge (dedup) or replace mode
26
+
27
+ ### Advanced FTS Filters
28
+ Precision search in `marrow_retrieve_memories`:
29
+ - `from` / `to` — Date range filters
30
+ - `tags` — Filter by tags (AND logic)
31
+ - `source` Filter by source (e.g., `session_bootstrap`, `think`)
32
+ - `status` — Filter by status (`active`, `outdated`, `deleted`)
33
+
34
+ ### New MCP Tools
35
+ - `marrow_list_memories` List memories with pagination
36
+ - `marrow_get_memory` — Get single memory by ID
37
+ - `marrow_update_memory` — Update memory text, tags, or metadata
38
+ - `marrow_mark_outdated` — Mark memory as outdated
39
+ - `marrow_supersede_memory` — Atomically replace memory with new version
40
+ - `marrow_delete_memory` — Soft delete memory
41
+ - `marrow_export_memories` Export to JSON or CSV
42
+ - `marrow_import_memories` Import memories
43
+ - `marrow_share_memory` Share with agents
44
+ - `marrow_retrieve_memories` FTS search with filters
45
+
46
+ ### Security Hardening
47
+ - Account isolation enforced (no cross-account leakage)
48
+ - Agent ID validation on all tools
49
+ - Audit logging for export/import operations
50
+ - Rate limiting on export (5/hour)
51
+ - SHA-256 dedup on import
58
52
 
59
53
  ---
60
54
 
@@ -99,290 +93,152 @@ That gives agents an actual memory discipline:
99
93
  - **check** → inspect whether the loop is still open or missing something
100
94
  - **commit** → log the outcome and close the loop
101
95
 
102
- The result is memory that is useful during execution, not just after the fact.
103
-
104
96
  ---
105
97
 
106
- ## Quick Start
98
+ ## Install
107
99
 
108
- ### Claude Desktop
100
+ Run it directly with `npx`:
109
101
 
110
- ```json
111
- {
112
- "mcpServers": {
113
- "marrow": {
114
- "command": "npx",
115
- "args": ["@getmarrow/mcp"],
116
- "env": {
117
- "MARROW_API_KEY": "mrw_your_key_here"
118
- }
119
- }
120
- }
121
- }
102
+ ```bash
103
+ npx @getmarrow/mcp
122
104
  ```
123
105
 
124
- ### Generic MCP host
125
-
126
- If your MCP host supports command-based servers, point it at:
127
-
128
- - command: `npx`
129
- - args: `@getmarrow/mcp`
130
- - env: `MARROW_API_KEY=...`
131
-
132
- ---
133
-
134
- ## Automatic Prompts (Zero-Config)
135
-
136
- When added to a compatible MCP client, Marrow automatically exposes a `marrow-always-on` prompt that instructs your agent to use the memory loop without any manual setup.
137
-
138
- In Claude Desktop — the prompt appears in the prompt picker. Select it once and your agent orients, thinks, and commits automatically every session.
139
-
140
- In compatible clients — the prompt can be auto-injected into the system context so the loop fires without the user doing anything.
141
-
142
- This is how Marrow works right after install with zero user instruction.
106
+ Or register it in your MCP client config.
143
107
 
144
108
  ---
145
109
 
146
- ## When to Use MCP vs SDK
147
-
148
- Use **`@getmarrow/mcp`** when:
149
- - your agent already speaks MCP
150
- - you want Marrow exposed as tools
151
- - you want loop state visible during the session
152
- - you want hosts/orchestrators to inspect whether work is ready for completion
153
-
154
- Use **`@getmarrow/sdk`** when:
155
- - you are integrating Marrow directly into application/runtime code
156
- - you want wrapper-level enforcement around deploy, publish, outbound sends, or external writes
157
- - you want programmatic control through `beforeAction()`, `afterAction()`, `wrap()`, and `check()`
158
-
159
- In short:
160
- - **MCP** = tool-driven integration for agents
161
- - **SDK** = code-level integration for runtimes and apps
162
-
163
- ---
110
+ ## MCP Tools
164
111
 
165
- ## Tools
112
+ ### Core Loop Tools
166
113
 
167
- ### `marrow_orient` / `orient`
168
- Start the session with Marrow context.
114
+ #### `marrow_orient`
115
+ **Call this first** at session start. Returns failure warnings from your history so you avoid known mistakes immediately.
169
116
 
170
- Returns:
171
- - loop state
172
- - recommended next step
173
- - recent lessons (when available)
174
- - canonical session-start nudge
117
+ #### `marrow_think`
118
+ Log intent before meaningful action. Returns pattern insights, similar past decisions, and a recommended next step.
175
119
 
176
- Typical use:
177
- - first meaningful step in a session
178
- - before planning or execution begins
120
+ #### `marrow_commit`
121
+ Log the outcome after acting. Closes the decision loop.
179
122
 
180
- ### `marrow_think` / `think`
181
- Log intent and get decision intelligence back.
123
+ #### `marrow_run`
124
+ Zero-ceremony wrapper. Handles orient think → commit in a single call.
182
125
 
183
- Returns:
184
- - `decision_id`
185
- - pattern intelligence
186
- - loop metadata
187
- - warnings / next-step guidance
126
+ #### `marrow_auto`
127
+ Fire-and-forget logging. Pass what you're about to do (and optionally the outcome). Marrow handles everything in the background.
188
128
 
189
- Typical use:
190
- - before meaningful action
191
- - before deploy / publish / send / external write work
192
- - when shifting from planning into execution
129
+ ### Memory Management Tools
193
130
 
194
- ### `marrow_check` / `check`
195
- Inspect the current loop state.
131
+ #### `marrow_list_memories`
132
+ List memories with optional filters:
133
+ - `status` — Filter by status (active, outdated, deleted)
134
+ - `query` — Search query
135
+ - `limit` — Max results
136
+ - `agentId` — Include memories shared with this agent
196
137
 
197
- Returns:
198
- - whether the loop is still open
199
- - current recommended next step
200
- - whether the session looks ready for completion
201
- - warnings if outcome/context is still missing
138
+ #### `marrow_get_memory`
139
+ Get a single memory by ID.
202
140
 
203
- Typical use:
204
- - before handoff
205
- - before "done"
206
- - before outbound updates after meaningful work
141
+ #### `marrow_update_memory`
142
+ Update memory text, tags, or metadata.
207
143
 
208
- ### `marrow_commit` / `commit`
209
- Commit outcome to the hive and close the loop.
144
+ #### `marrow_delete_memory`
145
+ Soft delete a memory.
210
146
 
211
- Returns:
212
- - committed / accepted state
213
- - updated loop state
214
- - recommended next step after closure
147
+ #### `marrow_mark_outdated`
148
+ Mark a memory as outdated.
215
149
 
216
- Typical use:
217
- - after meaningful work finishes
218
- - after a deploy / publish / send / write succeeds or fails
219
- - before a clean handoff or completion
150
+ #### `marrow_supersede_memory`
151
+ Atomically replace a memory with a new version.
220
152
 
221
- ### `marrow_run` — Zero-ceremony wrapper
153
+ #### `marrow_share_memory`
154
+ Share a memory with specific agents.
222
155
 
223
- Single call. Handles orient → think → commit automatically.
156
+ #### `marrow_export_memories`
157
+ Export memories to JSON or CSV format.
224
158
 
225
- Input:
226
- ```json
227
- {
228
- "description": "What the agent did",
229
- "success": true,
230
- "outcome": "One-line summary of what happened",
231
- "type": "implementation"
232
- }
233
- ```
159
+ #### `marrow_import_memories`
160
+ Import memories with merge (dedup) or replace mode.
234
161
 
235
- Returns: `{ decision_id, success_rate, insight, intelligence }`
162
+ #### `marrow_retrieve_memories`
163
+ Full-text search with filters:
164
+ - `query` — Search query (required)
165
+ - `limit` — Max results
166
+ - `from` / `to` — Date range (ISO-8601)
167
+ - `tags` — Comma-separated tags
168
+ - `source` — Source filter
169
+ - `status` — Status filter
170
+ - `shared` — Include shared memories
236
171
 
237
- Use this when you want memory logging without managing the loop manually.
172
+ ### Query Tools
238
173
 
239
- ### `patterns`
240
- Inspect accumulated decision patterns.
174
+ #### `marrow_ask`
175
+ Query the collective hive in plain English. Ask about failure patterns, what worked, what broke, or get a recommendation.
241
176
 
242
- Typical use:
243
- - identifying repeated failures
244
- - learning what tends to work for a task type
245
- - orienting around recent drift or recurring mistakes
177
+ #### `marrow_status`
178
+ Check Marrow platform health and status.
246
179
 
247
180
  ---
248
181
 
249
- ## Zero-Ceremony Mode
250
-
251
- Use `marrow_run` instead of chaining `marrow_think` + `marrow_commit`:
182
+ ## Claude Desktop Config
252
183
 
253
184
  ```json
254
185
  {
255
- "tool": "marrow_run",
256
- "input": {
257
- "description": "Refactored auth service to add retry logic",
258
- "success": true,
259
- "outcome": "Auth refactored. Exponential backoff added. Tests passing.",
260
- "type": "implementation"
186
+ "mcpServers": {
187
+ "marrow": {
188
+ "command": "npx",
189
+ "args": ["@getmarrow/mcp"],
190
+ "env": {
191
+ "MARROW_API_KEY": "mrw_your_api_key"
192
+ }
193
+ }
261
194
  }
262
195
  }
263
196
  ```
264
197
 
265
- Marrow handles the full loop internally.
266
-
267
198
  ---
268
199
 
269
200
  ## Environment Variables
270
201
 
271
202
  | Variable | Required | Description |
272
203
  |----------|----------|-------------|
273
- | `MARROW_API_KEY` | Yes | Your Marrow API key (starts with `mrw_`) |
274
- | `MARROW_BASE_URL` | No | Override API base URL (default: `https://api.getmarrow.ai`) |
275
- | `MARROW_SESSION_ID` | No | Session identifier sent as `X-Marrow-Session-Id` on all requests |
276
-
277
- ---
278
-
279
- ## Example Workflow
280
-
281
- ### Example: deployment task
282
-
283
- 1. Call `marrow_orient`
284
- 2. Call `marrow_think` with something like:
285
- - action: `Deploy auth refactor to staging`
286
- - type: `implementation`
287
- 3. Perform the deploy
288
- 4. Call `marrow_check`
289
- 5. Call `marrow_commit` with outcome:
290
- - success: `true`
291
- - outcome: `Staging deploy passed smoke tests`
292
-
293
- This gives the next session or next agent real context:
294
- - what was attempted
295
- - whether it worked
296
- - what patterns Marrow saw around it
297
- - whether the loop was actually closed
204
+ | `MARROW_API_KEY` | Yes | Your API key from getmarrow.ai |
205
+ | `MARROW_BASE_URL` | No | Custom API URL (default: `https://api.getmarrow.ai`) |
206
+ | `MARROW_SESSION_ID` | No | Session identifier for multi-agent setups |
298
207
 
299
208
  ---
300
209
 
301
- ## What Your Agent Gets Back
302
-
303
- Marrow MCP tools expose more than a raw ID.
210
+ ## The Always-On Prompt
304
211
 
305
- Depending on the tool, agents can receive:
306
- - recent lessons
307
- - similar past outcomes
308
- - warnings about recurring failure patterns
309
- - current loop state
310
- - recommended next step
311
- - session guidance to close the loop cleanly
212
+ Marrow includes a built-in prompt called `marrow-always-on` that instructs agents to use Marrow automatically. Install it once and it works for every session.
312
213
 
313
- That makes the MCP server useful during execution, not just as a logging endpoint.
214
+ **To use:** In your MCP client, request the `marrow-always-on` prompt and include it in your system instructions.
314
215
 
315
216
  ---
316
217
 
317
- ## Why Marrow Through MCP?
218
+ ## Why This Matters
318
219
 
319
220
  Without Marrow:
320
- - the agent starts every session half-amnesiac
321
- - failures repeat because there is no durable decision trail
322
- - completion gets declared without structured outcome memory
323
- - hosts cannot easily inspect whether the work loop is actually closed
324
-
325
- With Marrow MCP:
326
- - the agent can orient before acting
327
- - meaningful work can be tracked in-session
328
- - hosts can inspect loop state before completion or handoff
329
- - outcomes become structured memory instead of vague summaries
330
- - memory becomes operational, not decorative
331
-
332
- ---
333
-
334
- ## Privacy, Sanitization, and Data Ownership
335
-
336
- Marrow should make agents smarter **without turning user sessions into careless raw-data collection**.
221
+ - Agents repeat the same failures session after session
222
+ - Successful patterns get lost when the context window clears
223
+ - There's no structured trail of what was tried and what worked
224
+ - Every new session starts from zero
337
225
 
338
- Key trust properties:
339
- - sensitive inputs can be sanitized before storage when possible
340
- - privacy-preserving learning matters more than retaining raw personal data forever
341
- - MCP hosts should pass API keys through environment variables, not embed them in source or config blobs committed to git
342
- - the product direction is anonymized pattern learning, not exposing private user context across the hive
343
- - users should be able to export and own their memory data instead of being trapped in a closed system
226
+ With Marrow:
227
+ - Failure patterns surface before you repeat them
228
+ - Successful outcomes compound across sessions
229
+ - Every decision has a trail: intent action outcome
230
+ - The hive gets smarter with every logged decision
344
231
 
345
- In short:
346
- - better agent memory
347
- - stronger privacy posture
348
- - clearer user ownership
232
+ **Marrow tells you what went wrong last time before you do it again.**
349
233
 
350
234
  ---
351
235
 
352
- ## Session Hint
236
+ ## License
353
237
 
354
- At session start, Marrow nudges clients with the canonical reminder:
355
-
356
- > Tip: log plans, decisions, and outcomes to Marrow so your agent improves over time.
357
-
358
- For agents that have not logged any decisions yet this session, Marrow can also steer them toward `marrow_think` before acting.
238
+ MIT
359
239
 
360
240
  ---
361
241
 
362
- ## Security / Key Handling
363
-
364
- Use environment variables for your API key.
365
-
366
- Correct:
367
- - `MARROW_API_KEY` passed through MCP host config or runtime environment
368
-
369
- Do not:
370
- - hardcode production API keys into source files
371
- - commit real keys into config
372
- - paste secrets into README examples
373
-
374
- Placeholder examples like `mrw_your_key_here` are documentation only.
375
-
376
- ---
377
-
378
- ## Get an API Key
379
-
380
- Sign up at [getmarrow.ai](https://getmarrow.ai)
381
-
382
- ---
383
-
384
- ## Related Package
385
-
386
- If you want direct runtime integration instead of MCP tools:
242
+ ## Related Packages
387
243
 
388
- - [`@getmarrow/sdk`](https://www.npmjs.com/package/@getmarrow/sdk)
244
+ - **[@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.
package/dist/cli.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAEA;;;GAGG"}
1
+ {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA;;;GAGG"}