@getmarrow/mcp 2.3.4 → 2.3.5

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 (2) hide show
  1. package/README.md +258 -18
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,54 +1,294 @@
1
- # marrow-mcp
1
+ # @getmarrow/mcp
2
2
 
3
- MCP server for [Marrow](https://getmarrow.ai) — decision intelligence for AI agents.
3
+ > **Memory and decision intelligence for MCP-compatible agents.**
4
+
5
+ Marrow gives your agent a memory that compounds.
6
+
7
+ With `@getmarrow/mcp`, any MCP-compatible client can log intent before acting, inspect live loop state during work, and commit outcomes back to the hive when the work is done. That means your agent stops operating like an amnesiac and starts carrying forward real decision history.
8
+
9
+ **Your agent stops repeating the same mistakes. It learns from prior sessions — and from the wider Marrow hive — through a clean MCP tool surface.**
10
+
11
+ ---
4
12
 
5
13
  ## What's New in v2.3.4
6
14
 
7
- ### Loop-enforcement tools for real agent operating discipline
15
+ ### Loop enforcement is now part of the MCP workflow
8
16
 
9
- This release adds the MCP surface for Marrow's live loop workflow so agents can orient, think, act, check, and commit inside a single session instead of treating memory as an afterthought.
17
+ This release adds the MCP-side loop workflow so agents can operate through a real decision cycle instead of dumping disconnected thoughts into memory.
10
18
 
11
- New/updated tool flow:
19
+ New / updated tools:
12
20
  - `marrow_orient` / `orient` — start the session with loop state, recent lessons, and a recommended next step
13
21
  - `marrow_think` / `think` — log intent and get pattern intelligence + loop metadata back
14
- - `marrow_check` / `check` — inspect current loop state and recommended next step mid-session
22
+ - `marrow_check` / `check` — inspect loop state mid-session before handoff or completion
15
23
  - `marrow_commit` / `commit` — close the loop cleanly with outcome logging
16
24
 
17
25
  What changed in practice:
18
- - session-local loop state now persists across MCP tool calls
26
+ - session-local loop state persists across MCP tool calls
19
27
  - agents get a canonical session-start nudge toward `marrow_think`
20
- - commit now correctly returns a closed-loop state (`done` / `outcome_logged`)
21
- - package is publish-ready as `@getmarrow/mcp`
28
+ - `commit` now correctly returns a closed-loop state (`done` / `outcome_logged`)
29
+ - the MCP package now lines up properly with the newer SDK loop-enforcement model
30
+
31
+ ---
32
+
33
+ ## Install
34
+
35
+ Run it directly with `npx`:
36
+
37
+ ```bash
38
+ npx @getmarrow/mcp
39
+ ```
40
+
41
+ Or register it in your MCP client config.
42
+
43
+ ---
44
+
45
+ ## The Problem
46
+
47
+ Most agents still operate with shallow memory.
48
+
49
+ They might keep a short context window, maybe write a note or two, then lose the important part:
50
+ - what they were trying to do
51
+ - what they actually did
52
+ - whether it worked
53
+ - what pattern that should teach the next run
54
+
55
+ That creates a familiar failure loop:
56
+ - the same mistakes repeat
57
+ - work gets marked done without structured outcome memory
58
+ - agents drift between sessions
59
+ - hosts have no clean way to inspect whether the work loop is actually closed
60
+
61
+ **Marrow fixes this.**
62
+
63
+ Through MCP, your agent can:
64
+ - orient at session start
65
+ - log intent before meaningful action
66
+ - inspect loop state before handoff or completion
67
+ - commit outcomes back to memory cleanly
68
+
69
+ ---
70
+
71
+ ## How It Works
72
+
73
+ Marrow exposes a simple operating loop through MCP:
74
+
75
+ ```text
76
+ orient -> think -> act -> check -> commit
77
+ ```
78
+
79
+ That gives agents an actual memory discipline:
80
+ - **orient** → pick up recent lessons and current loop state
81
+ - **think** → log intent and receive decision intelligence
82
+ - **act** → perform the meaningful work
83
+ - **check** → inspect whether the loop is still open or missing something
84
+ - **commit** → log the outcome and close the loop
85
+
86
+ The result is memory that is useful during execution, not just after the fact.
87
+
88
+ ---
22
89
 
23
90
  ## Quick Start
24
91
 
92
+ ### Claude Desktop
93
+
25
94
  ```json
26
- // claude_desktop_config.json
27
95
  {
28
96
  "mcpServers": {
29
97
  "marrow": {
30
98
  "command": "npx",
31
99
  "args": ["@getmarrow/mcp"],
32
- "env": { "MARROW_API_KEY": "mrw_your_key_here" }
100
+ "env": {
101
+ "MARROW_API_KEY": "mrw_your_key_here"
102
+ }
33
103
  }
34
104
  }
35
105
  }
36
106
  ```
37
107
 
108
+ ### Generic MCP host
109
+
110
+ If your MCP host supports command-based servers, point it at:
111
+
112
+ - command: `npx`
113
+ - args: `@getmarrow/mcp`
114
+ - env: `MARROW_API_KEY=...`
115
+
116
+ ---
117
+
118
+ ## When to Use MCP vs SDK
119
+
120
+ Use **`@getmarrow/mcp`** when:
121
+ - your agent already speaks MCP
122
+ - you want Marrow exposed as tools
123
+ - you want loop state visible during the session
124
+ - you want hosts/orchestrators to inspect whether work is ready for completion
125
+
126
+ Use **`@getmarrow/sdk`** when:
127
+ - you are integrating Marrow directly into application/runtime code
128
+ - you want wrapper-level enforcement around deploy, publish, outbound sends, or external writes
129
+ - you want programmatic control through `beforeAction()`, `afterAction()`, `wrap()`, and `check()`
130
+
131
+ In short:
132
+ - **MCP** = tool-driven integration for agents
133
+ - **SDK** = code-level integration for runtimes and apps
134
+
135
+ ---
136
+
38
137
  ## Tools
39
138
 
40
- - **marrow_orient** / `orient` — Start the session with loop state, recent lessons, and a recommended next step
41
- - **marrow_think** / `think` Log a decision and get pattern intelligence, loop metadata, and useful next-step guidance back
42
- - **marrow_commit** / `commit` — Commit task outcome to the hive and close the loop
43
- - **marrow_check** / `check` — Inspect current loop state for this MCP session
44
- - **patterns** — Get accumulated decision patterns
139
+ ### `marrow_orient` / `orient`
140
+ Start the session with Marrow context.
141
+
142
+ Returns:
143
+ - loop state
144
+ - recommended next step
145
+ - recent lessons (when available)
146
+ - canonical session-start nudge
147
+
148
+ Typical use:
149
+ - first meaningful step in a session
150
+ - before planning or execution begins
151
+
152
+ ### `marrow_think` / `think`
153
+ Log intent and get decision intelligence back.
45
154
 
46
- ## Session hint
155
+ Returns:
156
+ - `decision_id`
157
+ - pattern intelligence
158
+ - loop metadata
159
+ - warnings / next-step guidance
160
+
161
+ Typical use:
162
+ - before meaningful action
163
+ - before deploy / publish / send / external write work
164
+ - when shifting from planning into execution
165
+
166
+ ### `marrow_check` / `check`
167
+ Inspect the current loop state.
168
+
169
+ Returns:
170
+ - whether the loop is still open
171
+ - current recommended next step
172
+ - whether the session looks ready for completion
173
+ - warnings if outcome/context is still missing
174
+
175
+ Typical use:
176
+ - before handoff
177
+ - before “done”
178
+ - before outbound updates after meaningful work
179
+
180
+ ### `marrow_commit` / `commit`
181
+ Commit outcome to the hive and close the loop.
182
+
183
+ Returns:
184
+ - committed / accepted state
185
+ - updated loop state
186
+ - recommended next step after closure
187
+
188
+ Typical use:
189
+ - after meaningful work finishes
190
+ - after a deploy / publish / send / write succeeds or fails
191
+ - before a clean handoff or completion
192
+
193
+ ### `patterns`
194
+ Inspect accumulated decision patterns.
195
+
196
+ Typical use:
197
+ - identifying repeated failures
198
+ - learning what tends to work for a task type
199
+ - orienting around recent drift or recurring mistakes
200
+
201
+ ---
202
+
203
+ ## Example Workflow
204
+
205
+ ### Example: deployment task
206
+
207
+ 1. Call `marrow_orient`
208
+ 2. Call `marrow_think` with something like:
209
+ - action: `Deploy auth refactor to staging`
210
+ - type: `implementation`
211
+ 3. Perform the deploy
212
+ 4. Call `marrow_check`
213
+ 5. Call `marrow_commit` with outcome:
214
+ - success: `true`
215
+ - outcome: `Staging deploy passed smoke tests`
216
+
217
+ This gives the next session or next agent real context:
218
+ - what was attempted
219
+ - whether it worked
220
+ - what patterns Marrow saw around it
221
+ - whether the loop was actually closed
222
+
223
+ ---
224
+
225
+ ## What Your Agent Gets Back
226
+
227
+ Marrow MCP tools expose more than a raw ID.
228
+
229
+ Depending on the tool, agents can receive:
230
+ - recent lessons
231
+ - similar past outcomes
232
+ - warnings about recurring failure patterns
233
+ - current loop state
234
+ - recommended next step
235
+ - session guidance to close the loop cleanly
236
+
237
+ That makes the MCP server useful during execution, not just as a logging endpoint.
238
+
239
+ ---
240
+
241
+ ## Why Marrow Through MCP?
242
+
243
+ Without Marrow:
244
+ - the agent starts every session half-amnesiac
245
+ - failures repeat because there is no durable decision trail
246
+ - completion gets declared without structured outcome memory
247
+ - hosts cannot easily inspect whether the work loop is actually closed
248
+
249
+ With Marrow MCP:
250
+ - the agent can orient before acting
251
+ - meaningful work can be tracked in-session
252
+ - hosts can inspect loop state before completion or handoff
253
+ - outcomes become structured memory instead of vague summaries
254
+ - memory becomes operational, not decorative
255
+
256
+ ---
257
+
258
+ ## Session Hint
47
259
 
48
260
  At session start, Marrow nudges clients with the canonical reminder:
49
261
 
50
262
  > Tip: log plans, decisions, and outcomes to Marrow so your agent improves over time.
51
263
 
52
- ## Get an API key
264
+ For agents that have not logged any decisions yet this session, Marrow can also steer them toward `marrow_think` before acting.
265
+
266
+ ---
267
+
268
+ ## Security / Key Handling
269
+
270
+ Use environment variables for your API key.
271
+
272
+ Correct:
273
+ - `MARROW_API_KEY` passed through MCP host config or runtime environment
274
+
275
+ Do not:
276
+ - hardcode production API keys into source files
277
+ - commit real keys into config
278
+ - paste secrets into README examples
279
+
280
+ Placeholder examples like `mrw_your_key_here` are documentation only.
281
+
282
+ ---
283
+
284
+ ## Get an API Key
53
285
 
54
286
  Sign up at [getmarrow.ai](https://getmarrow.ai)
287
+
288
+ ---
289
+
290
+ ## Related Package
291
+
292
+ If you want direct runtime integration instead of MCP tools:
293
+
294
+ - [`@getmarrow/sdk`](https://www.npmjs.com/package/@getmarrow/sdk)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getmarrow/mcp",
3
- "version": "2.3.4",
3
+ "version": "2.3.5",
4
4
  "description": "MCP server for Marrow — decision intelligence for AI agents",
5
5
  "main": "dist/index.js",
6
6
  "bin": {