@selfagency/beans-mcp 0.1.4 → 0.5.0

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
@@ -12,6 +12,14 @@ MCP (Model Context Protocol) server for [Beans](https://github.com/hmans/beans)
12
12
  npx @selfagency/beans-mcp /path/to/workspace
13
13
  ```
14
14
 
15
+ ### Versioning
16
+
17
+ `@selfagency/beans-mcp` tracks upstream [Beans](https://github.com/hmans/beans) versions.
18
+ For example, Beans `v0.4.2` maps to `@selfagency/beans-mcp@0.4.2`.
19
+
20
+ At startup, the server compares its own package version against the installed `beans`
21
+ CLI version. If they differ, it prints a warning to stderr and continues startup.
22
+
15
23
  ### Parameters
16
24
 
17
25
  - `--workspace-root` or positional arg: Workspace root path
@@ -22,21 +30,29 @@ npx @selfagency/beans-mcp /path/to/workspace
22
30
 
23
31
  ## Summary of public MCP tools
24
32
 
25
- - `beans_init` — Initialize the workspace (optional `prefix`).
26
- - `beans_view` Fetch full bean details by `beanId`.
27
- - `beans_create` Create a new bean (title/type + optional fields).
28
- - `beans_update` Consolidated metadata updates (status/type/priority/parent/clearParent/blocking/blockedBy).
29
- - `beans_delete` Delete a bean (`beanId`, optional `force`).
30
- - `beans_reopen` Reopen a completed or scrapped bean to an active status.
31
- - `beans_query` Unified list/search/filter/sort/llm_context/open_config operations.
32
- - `beans_bean_file` Read/edit/create/delete files under `.beans`.
33
- - `beans_output` Read extension output logs or show guidance.
33
+ | Tool | Description |
34
+ | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
35
+ | `beans_init` | Initialize the workspace (optional `prefix`). |
36
+ | `beans_view` | Fetch full bean details by `beanId` or `beanIds`. |
37
+ | `beans_create` | Create a new bean (title/type + optional body/parent). |
38
+ | `beans_bulk_create` | Create multiple beans in one call, optionally under a shared parent. |
39
+ | `beans_update` | Consolidated metadata + body updates (status/type/priority/parent/clearParent/blocking/blockedBy/body/bodyAppend/bodyReplace) plus optional optimistic concurrency hint (`ifMatch`). |
40
+ | `beans_bulk_update` | Update multiple beans in one call, optionally reassigning them to a shared parent. |
41
+ | `beans_delete` | Delete one or many beans (`beanId` or `beanIds`, optional `force`). |
42
+ | `beans_reopen` | Reopen a completed or scrapped bean to an active status. |
43
+ | `beans_query` | Unified list/search/filter/sort/ready/llm_context/open_config operations. |
44
+ | `beans_bean_file` | Read/edit/create/delete files under `.beans`. |
45
+ | `beans_output` | Read extension output logs or show guidance. |
34
46
 
35
47
  ### Notes
36
48
 
37
49
  - The `beans_query` tool is intentionally broad: prefer it for listing, searching, filtering or sorting beans, and for generating Copilot instructions (`operation: 'llm_context'`).
38
- - All file and log operations validate paths to keep them within the workspace or the VS Code log directory.
50
+ - All file and log operations validate paths to keep them within the workspace or the VS Code log directory. The `.beans/` prefix is automatically stripped from paths — you can pass either `some-bean.md` or `.beans/some-bean.md` and the result is the same.
39
51
  - `beans_update` replaces many fine-grained update tools; callers should use it to keep the public tool surface small and predictable.
52
+ - `beans_bulk_create` and `beans_bulk_update` are best-effort: they process each item sequentially and return a per-item result array with success/error entries rather than failing atomically.
53
+ - Frontmatter `title:` values are automatically double-quoted on write. Pass raw titles — quoting and escaping is handled for you.
54
+ - Unfiltered list results are cached with a short burst TTL and a timestamp-probe refresh strategy. Mutation tools (`beans_create`, `beans_update`, `beans_delete`, etc.) invalidate the cache immediately.
55
+ - Version mismatches between `beans-mcp` and the Beans CLI are warning-only and non-blocking by design.
40
56
 
41
57
  ## Examples
42
58
 
@@ -62,6 +78,12 @@ Request:
62
78
  { "beanId": "bean-abc" }
63
79
  ```
64
80
 
81
+ Request (multiple beans):
82
+
83
+ ```json
84
+ { "beanIds": ["bean-abc", "bean-def"] }
85
+ ```
86
+
65
87
  Response (structuredContent):
66
88
 
67
89
  ```json
@@ -89,10 +111,13 @@ Request:
89
111
  "type": "feature",
90
112
  "status": "todo",
91
113
  "priority": "normal",
92
- "description": "Implement theme toggle and styles"
114
+ "body": "Implement theme toggle and styles",
115
+ "parent": "epic-123"
93
116
  }
94
117
  ```
95
118
 
119
+ > `description` is accepted as a deprecated alias for `body`.
120
+
96
121
  Response (structuredContent):
97
122
 
98
123
  ```json
@@ -106,6 +131,70 @@ Response (structuredContent):
106
131
  }
107
132
  ```
108
133
 
134
+ ### beans_bulk_create
135
+
136
+ Request:
137
+
138
+ ```json
139
+ {
140
+ "parent": "epic-123",
141
+ "beans": [
142
+ { "title": "Design mockups", "type": "task" },
143
+ { "title": "Implement API", "type": "task", "priority": "high" },
144
+ { "title": "Write tests", "type": "task", "parent": "epic-456" }
145
+ ]
146
+ }
147
+ ```
148
+
149
+ The top-level `parent` is applied as a default to any bean that does not specify its own `parent`. Here `Design mockups` and `Implement API` are assigned to `epic-123`; `Write tests` overrides with `epic-456`.
150
+
151
+ Response (structuredContent):
152
+
153
+ ```json
154
+ {
155
+ "requestedCount": 3,
156
+ "successCount": 3,
157
+ "failedCount": 0,
158
+ "results": [
159
+ { "bean": { "id": "task-1", "title": "Design mockups" } },
160
+ { "bean": { "id": "task-2", "title": "Implement API" } },
161
+ { "bean": { "id": "task-3", "title": "Write tests" } }
162
+ ]
163
+ }
164
+ ```
165
+
166
+ ### beans_bulk_update
167
+
168
+ Request (move a batch of tasks to in-progress and assign them to a parent):
169
+
170
+ ```json
171
+ {
172
+ "parent": "epic-123",
173
+ "beans": [
174
+ { "beanId": "task-1", "status": "in-progress" },
175
+ { "beanId": "task-2", "status": "in-progress" },
176
+ { "beanId": "task-3", "status": "in-progress", "parent": "epic-456" }
177
+ ]
178
+ }
179
+ ```
180
+
181
+ Response (structuredContent):
182
+
183
+ ```json
184
+ {
185
+ "requestedCount": 3,
186
+ "successCount": 3,
187
+ "failedCount": 0,
188
+ "results": [
189
+ { "beanId": "task-1", "bean": { "id": "task-1", "status": "in-progress" } },
190
+ { "beanId": "task-2", "bean": { "id": "task-2", "status": "in-progress" } },
191
+ { "beanId": "task-3", "bean": { "id": "task-3", "status": "in-progress" } }
192
+ ]
193
+ }
194
+ ```
195
+
196
+ > Both bulk tools are best-effort: partial failures are reported per-item rather than aborting the whole batch.
197
+
109
198
  ### beans_update
110
199
 
111
200
  Request (change status and add blocking):
@@ -114,10 +203,26 @@ Request (change status and add blocking):
114
203
  {
115
204
  "beanId": "bean-abc",
116
205
  "status": "in-progress",
117
- "blocking": ["bean-def"]
206
+ "blocking": ["bean-def"],
207
+ "ifMatch": "etag-value"
208
+ }
209
+ ```
210
+
211
+ Request (atomic body modifications):
212
+
213
+ ```json
214
+ {
215
+ "beanId": "bean-abc",
216
+ "bodyReplace": [
217
+ { "old": "- [ ] Task 1", "new": "- [x] Task 1" },
218
+ { "old": "- [ ] Task 2", "new": "- [x] Task 2" }
219
+ ],
220
+ "bodyAppend": "## Summary\n\nAll checklist items completed."
118
221
  }
119
222
  ```
120
223
 
224
+ > Note: `body` (full replacement) cannot be combined with `bodyAppend` or `bodyReplace` in the same request.
225
+
121
226
  Response (structuredContent):
122
227
 
123
228
  ```json
@@ -144,6 +249,26 @@ Response:
144
249
  { "deleted": true, "beanId": "bean-old" }
145
250
  ```
146
251
 
252
+ Batch request:
253
+
254
+ ```json
255
+ { "beanIds": ["bean-old", "bean-older"], "force": false }
256
+ ```
257
+
258
+ Batch response (summary):
259
+
260
+ ```json
261
+ {
262
+ "requestedCount": 2,
263
+ "deletedCount": 2,
264
+ "failedCount": 0,
265
+ "results": [
266
+ { "beanId": "bean-old", "deleted": true },
267
+ { "beanId": "bean-older", "deleted": true }
268
+ ]
269
+ }
270
+ ```
271
+
147
272
  ### beans_reopen
148
273
 
149
274
  Request:
@@ -199,6 +324,12 @@ Sort (modes: `status-priority-type-title`, `updated`, `created`, `id`):
199
324
  { "operation": "sort", "mode": "updated" }
200
325
  ```
201
326
 
327
+ Ready (actionable beans only):
328
+
329
+ ```json
330
+ { "operation": "ready" }
331
+ ```
332
+
202
333
  LLM context (generate Copilot instructions; optional write-to-workspace):
203
334
 
204
335
  ```json
@@ -211,7 +342,7 @@ Response (structuredContent):
211
342
  {
212
343
  "graphqlSchema": "...",
213
344
  "generatedInstructions": "...",
214
- "instructionsPath": "/workspace/.github/instructions/tasks.instructions.md"
345
+ "instructionsPath": "/workspace/.github/instructions/beans-prime.instructions.md"
215
346
  }
216
347
  ```
217
348