@selfagency/beans-mcp 0.4.2 → 0.6.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 +251 -27
- package/beans-mcp-server.cjs +957 -163
- package/index.cjs +959 -163
- package/index.d.ts +154 -2
- package/index.js +959 -164
- package/package.json +10 -9
package/README.md
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
# @selfagency/beans-mcp 🫘
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
<img src="docs/assets/icon.png" alt="beans-mcp icon" width="300" />
|
|
4
|
+
|
|
5
|
+
[](https://github.com/selfagency/beans-mcp/actions/workflows/test.yml) [](https://codecov.io/gh/selfagency/beans-mcp) 
|
|
4
6
|
|
|
5
7
|
MCP (Model Context Protocol) server for [Beans](https://github.com/hmans/beans) issue tracker. Provides programmatic and CLI interfaces for AI-powered interactions with Beans workspaces.
|
|
6
8
|
|
|
9
|
+
Documentation: [beans-mcp.self.agency](https://beans-mcp.self.agency)
|
|
10
|
+
|
|
7
11
|
> 🤖 **Try Beans fully-integrated with GitHub Copilot in VS Code! Install the <a href="https://marketplace.visualstudio.com/items?itemName=selfagency.beans-vscode">selfagency.beans-vscode</a> extension.**
|
|
8
12
|
|
|
9
13
|
## Usage
|
|
@@ -30,26 +34,44 @@ CLI version. If they differ, it prints a warning to stderr and continues startup
|
|
|
30
34
|
|
|
31
35
|
## Summary of public MCP tools
|
|
32
36
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
37
|
+
| Tool | Description |
|
|
38
|
+
| ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
39
|
+
| `beans_init` | Initialize the workspace (optional `prefix`). |
|
|
40
|
+
| `beans_archive` | Archive completed/scrapped beans. |
|
|
41
|
+
| `beans_view` | Fetch full bean details by `beanId` or `beanIds`. |
|
|
42
|
+
| `beans_create` | Create a new bean (title/type + optional body/parent). |
|
|
43
|
+
| `beans_bulk_create` | Create multiple beans in one call, optionally under a shared parent. |
|
|
44
|
+
| `beans_update` | Consolidated metadata + body updates (status/type/priority/parent/clearParent/blocking/blockedBy/body/bodyAppend/bodyReplace) plus optional optimistic concurrency hint (`ifMatch`). |
|
|
45
|
+
| `beans_bulk_update` | Update multiple beans in one call, optionally reassigning them to a shared parent. |
|
|
46
|
+
| `beans_complete_tasks` | Mark all markdown checklist tasks within a bean as complete. |
|
|
47
|
+
| `beans_delete` | Delete one or many beans (`beanId` or `beanIds`, optional `force`). |
|
|
48
|
+
| `beans_reopen` | Reopen a completed or scrapped bean to an active status. |
|
|
49
|
+
| `beans_query` | Unified list/search/filter/sort/ready operations, with GraphQL passthrough. |
|
|
50
|
+
| `beans_bean_file` | Read/edit/create/delete files under `.beans`. |
|
|
51
|
+
| `beans_output` | Read extension output logs or show guidance. |
|
|
52
|
+
|
|
53
|
+
<details>
|
|
54
|
+
<summary>Notes</summary>
|
|
44
55
|
|
|
45
56
|
- The `beans_query` tool is intentionally broad: prefer it for listing, searching, filtering or sorting beans, and for generating Copilot instructions (`operation: 'llm_context'`).
|
|
46
|
-
- All file and log operations validate paths to keep them within the workspace or the VS Code log directory.
|
|
57
|
+
- 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.
|
|
47
58
|
- `beans_update` replaces many fine-grained update tools; callers should use it to keep the public tool surface small and predictable.
|
|
48
|
-
-
|
|
59
|
+
- `beans_archive` provides CLI parity for archiving completed/scrapped beans.
|
|
60
|
+
- Closing a parent bean via `beans_update` (`status: completed` or `status: scrapped`) cascades the same status to all descendants.
|
|
61
|
+
- Reopening a parent bean via `beans_reopen` cascades the target status to closed descendants (`completed` / `scrapped`).
|
|
62
|
+
- `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.
|
|
63
|
+
- Frontmatter `title:` values are automatically double-quoted on write. Pass raw titles — quoting and escaping is handled for you.
|
|
64
|
+
- `beans_bean_file` supports `update_frontmatter` for atomic frontmatter-only writes; supported fields include `pr` and `branch`.
|
|
65
|
+
- 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.
|
|
66
|
+
- Version mismatches between `beans-mcp` and the Beans CLI are warning-only and non-blocking by design.
|
|
67
|
+
- When `beanId` is missing in tool input, validation errors include a hint: `Did you mean \`beanId\`?`.
|
|
68
|
+
|
|
69
|
+
</details>
|
|
49
70
|
|
|
50
71
|
## Examples
|
|
51
72
|
|
|
52
|
-
|
|
73
|
+
<details>
|
|
74
|
+
<summary>beans_init</summary>
|
|
53
75
|
|
|
54
76
|
Request:
|
|
55
77
|
|
|
@@ -63,7 +85,10 @@ Response (structuredContent):
|
|
|
63
85
|
{ "initialized": true }
|
|
64
86
|
```
|
|
65
87
|
|
|
66
|
-
|
|
88
|
+
</details>
|
|
89
|
+
|
|
90
|
+
<details>
|
|
91
|
+
<summary>beans_view</summary>
|
|
67
92
|
|
|
68
93
|
Request:
|
|
69
94
|
|
|
@@ -94,7 +119,27 @@ Response (structuredContent):
|
|
|
94
119
|
}
|
|
95
120
|
```
|
|
96
121
|
|
|
97
|
-
|
|
122
|
+
</details>
|
|
123
|
+
|
|
124
|
+
<details>
|
|
125
|
+
<summary>beans_archive</summary>
|
|
126
|
+
|
|
127
|
+
Request:
|
|
128
|
+
|
|
129
|
+
```json
|
|
130
|
+
{}
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
Response (example):
|
|
134
|
+
|
|
135
|
+
```json
|
|
136
|
+
{ "archived": true, "archivedCount": 3 }
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
</details>
|
|
140
|
+
|
|
141
|
+
<details>
|
|
142
|
+
<summary>beans_create</summary>
|
|
98
143
|
|
|
99
144
|
Request:
|
|
100
145
|
|
|
@@ -104,10 +149,13 @@ Request:
|
|
|
104
149
|
"type": "feature",
|
|
105
150
|
"status": "todo",
|
|
106
151
|
"priority": "normal",
|
|
107
|
-
"
|
|
152
|
+
"body": "Implement theme toggle and styles",
|
|
153
|
+
"parent": "epic-123"
|
|
108
154
|
}
|
|
109
155
|
```
|
|
110
156
|
|
|
157
|
+
> `description` is accepted as a deprecated alias for `body`.
|
|
158
|
+
|
|
111
159
|
Response (structuredContent):
|
|
112
160
|
|
|
113
161
|
```json
|
|
@@ -121,7 +169,80 @@ Response (structuredContent):
|
|
|
121
169
|
}
|
|
122
170
|
```
|
|
123
171
|
|
|
124
|
-
|
|
172
|
+
</details>
|
|
173
|
+
|
|
174
|
+
<details>
|
|
175
|
+
<summary>beans_bulk_create</summary>
|
|
176
|
+
|
|
177
|
+
Request:
|
|
178
|
+
|
|
179
|
+
```json
|
|
180
|
+
{
|
|
181
|
+
"parent": "epic-123",
|
|
182
|
+
"beans": [
|
|
183
|
+
{ "title": "Design mockups", "type": "task" },
|
|
184
|
+
{ "title": "Implement API", "type": "task", "priority": "high" },
|
|
185
|
+
{ "title": "Write tests", "type": "task", "parent": "epic-456" }
|
|
186
|
+
]
|
|
187
|
+
}
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
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`.
|
|
191
|
+
|
|
192
|
+
Response (structuredContent):
|
|
193
|
+
|
|
194
|
+
```json
|
|
195
|
+
{
|
|
196
|
+
"requestedCount": 3,
|
|
197
|
+
"successCount": 3,
|
|
198
|
+
"failedCount": 0,
|
|
199
|
+
"results": [
|
|
200
|
+
{ "bean": { "id": "task-1", "title": "Design mockups" } },
|
|
201
|
+
{ "bean": { "id": "task-2", "title": "Implement API" } },
|
|
202
|
+
{ "bean": { "id": "task-3", "title": "Write tests" } }
|
|
203
|
+
]
|
|
204
|
+
}
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
</details>
|
|
208
|
+
|
|
209
|
+
<details>
|
|
210
|
+
<summary>beans_bulk_update</summary>
|
|
211
|
+
|
|
212
|
+
Request (move a batch of tasks to in-progress and assign them to a parent):
|
|
213
|
+
|
|
214
|
+
```json
|
|
215
|
+
{
|
|
216
|
+
"parent": "epic-123",
|
|
217
|
+
"beans": [
|
|
218
|
+
{ "beanId": "task-1", "status": "in-progress" },
|
|
219
|
+
{ "beanId": "task-2", "status": "in-progress" },
|
|
220
|
+
{ "beanId": "task-3", "status": "in-progress", "parent": "epic-456" }
|
|
221
|
+
]
|
|
222
|
+
}
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
Response (structuredContent):
|
|
226
|
+
|
|
227
|
+
```json
|
|
228
|
+
{
|
|
229
|
+
"requestedCount": 3,
|
|
230
|
+
"successCount": 3,
|
|
231
|
+
"failedCount": 0,
|
|
232
|
+
"results": [
|
|
233
|
+
{ "beanId": "task-1", "bean": { "id": "task-1", "status": "in-progress" } },
|
|
234
|
+
{ "beanId": "task-2", "bean": { "id": "task-2", "status": "in-progress" } },
|
|
235
|
+
{ "beanId": "task-3", "bean": { "id": "task-3", "status": "in-progress" } }
|
|
236
|
+
]
|
|
237
|
+
}
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
> Both bulk tools are best-effort: partial failures are reported per-item rather than aborting the whole batch.
|
|
241
|
+
|
|
242
|
+
</details>
|
|
243
|
+
|
|
244
|
+
<details>
|
|
245
|
+
<summary>beans_update</summary>
|
|
125
246
|
|
|
126
247
|
Request (change status and add blocking):
|
|
127
248
|
|
|
@@ -161,7 +282,10 @@ Response (structuredContent):
|
|
|
161
282
|
}
|
|
162
283
|
```
|
|
163
284
|
|
|
164
|
-
|
|
285
|
+
</details>
|
|
286
|
+
|
|
287
|
+
<details>
|
|
288
|
+
<summary>beans_delete</summary>
|
|
165
289
|
|
|
166
290
|
Request:
|
|
167
291
|
|
|
@@ -195,7 +319,10 @@ Batch response (summary):
|
|
|
195
319
|
}
|
|
196
320
|
```
|
|
197
321
|
|
|
198
|
-
|
|
322
|
+
</details>
|
|
323
|
+
|
|
324
|
+
<details>
|
|
325
|
+
<summary>beans_reopen</summary>
|
|
199
326
|
|
|
200
327
|
Request:
|
|
201
328
|
|
|
@@ -213,7 +340,35 @@ Response:
|
|
|
213
340
|
{ "bean": { "id": "bean-closed", "status": "todo" } }
|
|
214
341
|
```
|
|
215
342
|
|
|
216
|
-
|
|
343
|
+
</details>
|
|
344
|
+
|
|
345
|
+
<details>
|
|
346
|
+
<summary>beans_complete_tasks</summary>
|
|
347
|
+
|
|
348
|
+
Request:
|
|
349
|
+
|
|
350
|
+
```json
|
|
351
|
+
{ "beanId": "bean-abc" }
|
|
352
|
+
```
|
|
353
|
+
|
|
354
|
+
Response:
|
|
355
|
+
|
|
356
|
+
```json
|
|
357
|
+
{
|
|
358
|
+
"bean": {
|
|
359
|
+
"id": "bean-abc",
|
|
360
|
+
"status": "todo"
|
|
361
|
+
},
|
|
362
|
+
"totalTaskCount": 5,
|
|
363
|
+
"updatedTaskCount": 3,
|
|
364
|
+
"unchangedTaskCount": 2
|
|
365
|
+
}
|
|
366
|
+
```
|
|
367
|
+
|
|
368
|
+
</details>
|
|
369
|
+
|
|
370
|
+
<details>
|
|
371
|
+
<summary>beans_query examples</summary>
|
|
217
372
|
|
|
218
373
|
Refresh (list all beans):
|
|
219
374
|
|
|
@@ -272,7 +427,29 @@ Response (structuredContent):
|
|
|
272
427
|
}
|
|
273
428
|
```
|
|
274
429
|
|
|
275
|
-
|
|
430
|
+
Raw GraphQL passthrough (CLI parity with `beans query`):
|
|
431
|
+
|
|
432
|
+
```json
|
|
433
|
+
{
|
|
434
|
+
"operation": "graphql",
|
|
435
|
+
"graphql": "{ beans(filter: { type: [\"bug\"] }) { id title status } }"
|
|
436
|
+
}
|
|
437
|
+
```
|
|
438
|
+
|
|
439
|
+
With variables:
|
|
440
|
+
|
|
441
|
+
```json
|
|
442
|
+
{
|
|
443
|
+
"operation": "graphql",
|
|
444
|
+
"graphql": "query($q: String!) { beans(filter: { search: $q }) { id title } }",
|
|
445
|
+
"variables": { "q": "authentication" }
|
|
446
|
+
}
|
|
447
|
+
```
|
|
448
|
+
|
|
449
|
+
</details>
|
|
450
|
+
|
|
451
|
+
<details>
|
|
452
|
+
<summary>beans_bean_file</summary>
|
|
276
453
|
|
|
277
454
|
Request (read):
|
|
278
455
|
|
|
@@ -289,7 +466,39 @@ Response:
|
|
|
289
466
|
}
|
|
290
467
|
```
|
|
291
468
|
|
|
292
|
-
|
|
469
|
+
Request (atomic frontmatter update):
|
|
470
|
+
|
|
471
|
+
```json
|
|
472
|
+
{
|
|
473
|
+
"operation": "update_frontmatter",
|
|
474
|
+
"path": "beans-vscode-123--title.md",
|
|
475
|
+
"fields": {
|
|
476
|
+
"status": "in-progress",
|
|
477
|
+
"pr": "123",
|
|
478
|
+
"branch": "feature/cascade-status-and-skills-npm"
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
```
|
|
482
|
+
|
|
483
|
+
Response:
|
|
484
|
+
|
|
485
|
+
```json
|
|
486
|
+
{
|
|
487
|
+
"path": "/workspace/.beans/beans-vscode-123--title.md",
|
|
488
|
+
"bytes": 256,
|
|
489
|
+
"updatedFields": ["status", "pr", "branch"],
|
|
490
|
+
"frontmatter": {
|
|
491
|
+
"status": "in-progress",
|
|
492
|
+
"pr": "123",
|
|
493
|
+
"branch": "feature/cascade-status-and-skills-npm"
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
```
|
|
497
|
+
|
|
498
|
+
</details>
|
|
499
|
+
|
|
500
|
+
<details>
|
|
501
|
+
<summary>beans_output</summary>
|
|
293
502
|
|
|
294
503
|
Request (read last 200 lines):
|
|
295
504
|
|
|
@@ -307,6 +516,8 @@ Response:
|
|
|
307
516
|
}
|
|
308
517
|
```
|
|
309
518
|
|
|
519
|
+
</details>
|
|
520
|
+
|
|
310
521
|
## Programmatic usage
|
|
311
522
|
|
|
312
523
|
### Installation
|
|
@@ -318,11 +529,11 @@ npm install beans-mcp
|
|
|
318
529
|
### Example
|
|
319
530
|
|
|
320
531
|
```typescript
|
|
321
|
-
import { createBeansMcpServer, parseCliArgs } from
|
|
532
|
+
import { createBeansMcpServer, parseCliArgs } from '@selfagency/beans-mcp';
|
|
322
533
|
|
|
323
534
|
const server = await createBeansMcpServer({
|
|
324
|
-
workspaceRoot:
|
|
325
|
-
cliPath:
|
|
535
|
+
workspaceRoot: '/path/to/workspace',
|
|
536
|
+
cliPath: 'beans', // or path to beans CLI
|
|
326
537
|
});
|
|
327
538
|
|
|
328
539
|
// Connect to stdio transport or your own transport
|
|
@@ -359,6 +570,19 @@ CLI-compatible entrypoint for launching the server.
|
|
|
359
570
|
|
|
360
571
|
Export of GraphQL schema, Zod validation schemas, and TypeScript types for Beans records and operations.
|
|
361
572
|
|
|
573
|
+
## Agent Skills (`skills-npm`, `skills.sh`)
|
|
574
|
+
|
|
575
|
+
This package ships a built-in Agent Skill under `skills/` and also publishes that skill in a format that fits the broader open skills ecosystem surfaced by [skills.sh](https://skills.sh/).
|
|
576
|
+
|
|
577
|
+
- Skill path in package: `skills/beans-mcp/SKILL.md`
|
|
578
|
+
- Published skill artifact: `https://beans-mcp.self.agency/.well-known/agent-skills/beans-mcp/SKILL.md`
|
|
579
|
+
- Published discovery index: `https://beans-mcp.self.agency/.well-known/agent-skills/index.json`
|
|
580
|
+
- Compatible with discovery tools that scan: `node_modules/**/skills/*/SKILL.md`
|
|
581
|
+
|
|
582
|
+
That means you can use it with npm-based workflows such as `skills-npm`, while also pointing ecosystem tooling at the published skill artifact and discovery index used by skills catalogs like `skills.sh`.
|
|
583
|
+
|
|
584
|
+
To symlink installed npm-packaged skills into your agent workspace, you can use `skills-npm` in your consuming project.
|
|
585
|
+
|
|
362
586
|
## License
|
|
363
587
|
|
|
364
588
|
MIT
|