@selfagency/beans-mcp 0.1.3 → 0.4.2
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 +63 -6
- package/{dist/beans-mcp-server.cjs → beans-mcp-server.cjs} +269 -34
- package/{dist/index.cjs → index.cjs} +269 -34
- package/{dist/index.d.ts → index.d.ts} +19 -1
- package/{dist/index.js → index.js} +269 -34
- package/package.json +28 -64
- package/.beans.yml +0 -6
- package/.claude/settings.local.json +0 -18
- package/.editorconfig +0 -13
- package/.github/dependabot.yml +0 -11
- package/.github/workflows/release.yml +0 -235
- package/.github/workflows/test.yml +0 -84
- package/.husky/pre-commit +0 -1
- package/.nvmrc +0 -1
- package/.oxfmtrc.json +0 -11
- package/.oxlintrc.json +0 -37
- package/.vscode/settings.json +0 -3
- package/CHANGELOG.md +0 -160
- package/CONTRIBUTING.md +0 -139
- package/LICENSE.txt +0 -21
- package/codeql/codeql-custom-queries-actions/README.md +0 -14
- package/codeql/codeql-custom-queries-actions/codeql-pack.lock.yml +0 -32
- package/codeql/codeql-custom-queries-actions/codeql-pack.yml +0 -7
- package/codeql/codeql-custom-queries-actions/qlpack.yml +0 -6
- package/codeql/codeql-custom-queries-actions/queries/github-script-without-tojson.ql +0 -18
- package/codeql/codeql-custom-queries-actions/queries/strict-external-action-pinning.ql +0 -18
- package/codeql/codeql-custom-queries-javascript/README.md +0 -14
- package/codeql/codeql-custom-queries-javascript/codeql-pack.lock.yml +0 -30
- package/codeql/codeql-custom-queries-javascript/codeql-pack.yml +0 -7
- package/codeql/codeql-custom-queries-javascript/qlpack.yml +0 -6
- package/codeql/codeql-custom-queries-javascript/queries/child-process-shell-apis.ql +0 -26
- package/codeql/codeql-custom-queries-javascript/queries/innerhtml-assignment.ql +0 -24
- package/dist/README.md +0 -307
- package/dist/beans-mcp-server.cjs.map +0 -1
- package/dist/index.cjs.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/package.json +0 -43
- package/pnpm-workspace.yaml +0 -2
- package/scripts/release.js +0 -433
- package/scripts/write-dist-package.js +0 -53
- package/src/cli.ts +0 -14
- package/src/index.ts +0 -21
- package/src/internal/graphql.ts +0 -33
- package/src/internal/queryHelpers.ts +0 -157
- package/src/server/BeansMcpServer.ts +0 -623
- package/src/server/backend.ts +0 -364
- package/src/test/BeansMcpServer.test.ts +0 -514
- package/src/test/handlers.unit.test.ts +0 -201
- package/src/test/parseCliArgs.test.ts +0 -69
- package/src/test/protocol.e2e.test.ts +0 -884
- package/src/test/queryHelpers.test.ts +0 -524
- package/src/test/startBeansMcpServer.test.ts +0 -146
- package/src/test/tools-integration.test.ts +0 -912
- package/src/test/utils.test.ts +0 -81
- package/src/types.ts +0 -46
- package/src/utils.ts +0 -20
- package/tsconfig.json +0 -24
- package/tsup.config.ts +0 -42
- package/vitest.config.ts +0 -18
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
# Custom CodeQL Queries (GitHub Actions)
|
|
2
|
-
|
|
3
|
-
This pack adds repository-specific hardening checks for workflow security.
|
|
4
|
-
|
|
5
|
-
## Queries
|
|
6
|
-
|
|
7
|
-
- `queries/strict-external-action-pinning.ql`
|
|
8
|
-
- Flags external `uses:` steps that are not pinned to a full 40-character commit SHA.
|
|
9
|
-
- `queries/github-script-without-tojson.ql`
|
|
10
|
-
- Flags `actions/github-script` steps whose `script` argument does not appear to use `toJson(...)`.
|
|
11
|
-
|
|
12
|
-
## Why these checks
|
|
13
|
-
|
|
14
|
-
These checks focus on practical workflow hardening against supply-chain and interpolation risks while keeping alerts actionable.
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
lockVersion: 1.0.0
|
|
3
|
-
dependencies:
|
|
4
|
-
codeql/actions-all:
|
|
5
|
-
version: 0.4.27
|
|
6
|
-
codeql/concepts:
|
|
7
|
-
version: 0.0.15
|
|
8
|
-
codeql/controlflow:
|
|
9
|
-
version: 2.0.25
|
|
10
|
-
codeql/dataflow:
|
|
11
|
-
version: 2.0.25
|
|
12
|
-
codeql/javascript-all:
|
|
13
|
-
version: 2.6.21
|
|
14
|
-
codeql/mad:
|
|
15
|
-
version: 1.0.41
|
|
16
|
-
codeql/regex:
|
|
17
|
-
version: 1.0.41
|
|
18
|
-
codeql/ssa:
|
|
19
|
-
version: 2.0.17
|
|
20
|
-
codeql/threat-models:
|
|
21
|
-
version: 1.0.41
|
|
22
|
-
codeql/tutorial:
|
|
23
|
-
version: 1.0.41
|
|
24
|
-
codeql/typetracking:
|
|
25
|
-
version: 2.0.25
|
|
26
|
-
codeql/util:
|
|
27
|
-
version: 2.0.28
|
|
28
|
-
codeql/xml:
|
|
29
|
-
version: 1.0.41
|
|
30
|
-
codeql/yaml:
|
|
31
|
-
version: 1.0.41
|
|
32
|
-
compiled: false
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @name github-script step without toJson hardening
|
|
3
|
-
* @description Inline scripts passed to actions/github-script should use toJson when handling expression values.
|
|
4
|
-
* @kind problem
|
|
5
|
-
* @problem.severity recommendation
|
|
6
|
-
* @precision medium
|
|
7
|
-
* @id actions/custom/github-script-without-tojson
|
|
8
|
-
* @tags actions
|
|
9
|
-
* security
|
|
10
|
-
* external/cwe/cwe-116
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
import actions
|
|
14
|
-
|
|
15
|
-
from UsesStep step
|
|
16
|
-
where step.getCallee() = "actions/github-script"
|
|
17
|
-
select step,
|
|
18
|
-
"Review this github-script step for safe interpolation, validation, and least-privilege token use."
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @name Uses step not pinned to a full commit SHA
|
|
3
|
-
* @description Detects workflow/action `uses:` steps that are not pinned to a 40-character commit SHA.
|
|
4
|
-
* @kind problem
|
|
5
|
-
* @problem.severity warning
|
|
6
|
-
* @precision high
|
|
7
|
-
* @id actions/custom/strict-external-action-pinning
|
|
8
|
-
* @tags actions
|
|
9
|
-
* security
|
|
10
|
-
* external/cwe/cwe-829
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
import actions
|
|
14
|
-
|
|
15
|
-
from UsesStep uses
|
|
16
|
-
where not uses.getVersion().regexpMatch("^[A-Fa-f0-9]{40}$")
|
|
17
|
-
select uses,
|
|
18
|
-
"Action version is not pinned to a full commit SHA; review and pin to an immutable revision."
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
# Custom CodeQL Queries (JavaScript / TypeScript)
|
|
2
|
-
|
|
3
|
-
This pack adds repository-specific hardening checks for Node.js/TypeScript code.
|
|
4
|
-
|
|
5
|
-
## Queries
|
|
6
|
-
|
|
7
|
-
- `queries/child-process-shell-apis.ql`
|
|
8
|
-
- Flags `exec`/`execSync` usage outside tests.
|
|
9
|
-
- `queries/innerhtml-assignment.ql`
|
|
10
|
-
- Flags assignment to `innerHTML` outside tests.
|
|
11
|
-
|
|
12
|
-
## Why these checks
|
|
13
|
-
|
|
14
|
-
These checks focus on high-signal security hotspots that often benefit from stricter review in extensions and tooling codebases.
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
lockVersion: 1.0.0
|
|
3
|
-
dependencies:
|
|
4
|
-
codeql/concepts:
|
|
5
|
-
version: 0.0.15
|
|
6
|
-
codeql/controlflow:
|
|
7
|
-
version: 2.0.25
|
|
8
|
-
codeql/dataflow:
|
|
9
|
-
version: 2.0.25
|
|
10
|
-
codeql/javascript-all:
|
|
11
|
-
version: 2.6.21
|
|
12
|
-
codeql/mad:
|
|
13
|
-
version: 1.0.41
|
|
14
|
-
codeql/regex:
|
|
15
|
-
version: 1.0.41
|
|
16
|
-
codeql/ssa:
|
|
17
|
-
version: 2.0.17
|
|
18
|
-
codeql/threat-models:
|
|
19
|
-
version: 1.0.41
|
|
20
|
-
codeql/tutorial:
|
|
21
|
-
version: 1.0.41
|
|
22
|
-
codeql/typetracking:
|
|
23
|
-
version: 2.0.25
|
|
24
|
-
codeql/util:
|
|
25
|
-
version: 2.0.28
|
|
26
|
-
codeql/xml:
|
|
27
|
-
version: 1.0.41
|
|
28
|
-
codeql/yaml:
|
|
29
|
-
version: 1.0.41
|
|
30
|
-
compiled: false
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @name Use of shell-based child_process APIs
|
|
3
|
-
* @description Calls to exec/execSync run through a shell and are riskier than argument-array alternatives.
|
|
4
|
-
* @kind problem
|
|
5
|
-
* @problem.severity warning
|
|
6
|
-
* @precision high
|
|
7
|
-
* @id js/custom/child-process-shell-apis
|
|
8
|
-
* @tags security
|
|
9
|
-
* external/cwe/cwe-078
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
import javascript
|
|
13
|
-
|
|
14
|
-
private predicate inUserSource(InvokeExpr call) {
|
|
15
|
-
not call.getTopLevel().getFile().getRelativePath().regexpMatch("(^|.*/)(test|tests|__tests__|mocks?)/.*")
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
from CallExpr call
|
|
19
|
-
where
|
|
20
|
-
inUserSource(call) and
|
|
21
|
-
not call.getCallee() instanceof PropAccess and
|
|
22
|
-
call.getCalleeName() = ["exec", "execSync"]
|
|
23
|
-
select call,
|
|
24
|
-
"Shell-based process execution ($@) is harder to secure. Prefer execFile/spawn with argument arrays and strict input validation.",
|
|
25
|
-
call,
|
|
26
|
-
call.getCalleeName()
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @name Assignment to innerHTML
|
|
3
|
-
* @description Assigning to innerHTML can introduce XSS risk if any untrusted content reaches the sink.
|
|
4
|
-
* @kind problem
|
|
5
|
-
* @problem.severity warning
|
|
6
|
-
* @precision medium
|
|
7
|
-
* @id js/custom/innerhtml-assignment
|
|
8
|
-
* @tags security
|
|
9
|
-
* external/cwe/cwe-079
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
import javascript
|
|
13
|
-
|
|
14
|
-
private predicate inUserSource(AssignExpr assign) {
|
|
15
|
-
not assign.getTopLevel().getFile().getRelativePath().regexpMatch("(^|.*/)(test|tests|__tests__|mocks?)/.*")
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
from AssignExpr assign, PropAccess lhs
|
|
19
|
-
where
|
|
20
|
-
inUserSource(assign) and
|
|
21
|
-
lhs = assign.getLhs() and
|
|
22
|
-
lhs.getPropertyName() = "innerHTML"
|
|
23
|
-
select assign,
|
|
24
|
-
"Assignment to innerHTML can be unsafe. Prefer textContent or sanitization before rendering HTML."
|
package/dist/README.md
DELETED
|
@@ -1,307 +0,0 @@
|
|
|
1
|
-
# @selfagency/beans-mcp 🫘
|
|
2
|
-
|
|
3
|
-
[](https://github.com/selfagency/beans-mcp/actions/workflows/test.yml) [](https://codecov.io/gh/selfagency/beans-mcp)
|
|
4
|
-
|
|
5
|
-
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
|
-
|
|
7
|
-
> 🤖 **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
|
-
|
|
9
|
-
## Usage
|
|
10
|
-
|
|
11
|
-
```bash
|
|
12
|
-
npx @selfagency/beans-mcp /path/to/workspace
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
### Parameters
|
|
16
|
-
|
|
17
|
-
- `--workspace-root` or positional arg: Workspace root path
|
|
18
|
-
- `--cli-path`: Path to Beans CLI
|
|
19
|
-
- `--port`: MCP server port (default: 39173)
|
|
20
|
-
- `--log-dir`: Log directory
|
|
21
|
-
- `-h`, `--help`: Print usage and exit
|
|
22
|
-
|
|
23
|
-
## Summary of public MCP tools
|
|
24
|
-
|
|
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.
|
|
34
|
-
|
|
35
|
-
### Notes
|
|
36
|
-
|
|
37
|
-
- 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.
|
|
39
|
-
- `beans_update` replaces many fine-grained update tools; callers should use it to keep the public tool surface small and predictable.
|
|
40
|
-
|
|
41
|
-
## Examples
|
|
42
|
-
|
|
43
|
-
### beans_init
|
|
44
|
-
|
|
45
|
-
Request:
|
|
46
|
-
|
|
47
|
-
```json
|
|
48
|
-
{ "prefix": "project" }
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
Response (structuredContent):
|
|
52
|
-
|
|
53
|
-
```json
|
|
54
|
-
{ "initialized": true }
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
### beans_view
|
|
58
|
-
|
|
59
|
-
Request:
|
|
60
|
-
|
|
61
|
-
```json
|
|
62
|
-
{ "beanId": "bean-abc" }
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
Response (structuredContent):
|
|
66
|
-
|
|
67
|
-
```json
|
|
68
|
-
{
|
|
69
|
-
"bean": {
|
|
70
|
-
"id": "bean-abc",
|
|
71
|
-
"title": "Fix login timeout",
|
|
72
|
-
"status": "todo",
|
|
73
|
-
"type": "bug",
|
|
74
|
-
"priority": "critical",
|
|
75
|
-
"body": "...markdown...",
|
|
76
|
-
"createdAt": "2025-12-01T12:00:00Z",
|
|
77
|
-
"updatedAt": "2025-12-02T08:00:00Z"
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
### beans_create
|
|
83
|
-
|
|
84
|
-
Request:
|
|
85
|
-
|
|
86
|
-
```json
|
|
87
|
-
{
|
|
88
|
-
"title": "Add dark mode",
|
|
89
|
-
"type": "feature",
|
|
90
|
-
"status": "todo",
|
|
91
|
-
"priority": "normal",
|
|
92
|
-
"description": "Implement theme toggle and styles"
|
|
93
|
-
}
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
Response (structuredContent):
|
|
97
|
-
|
|
98
|
-
```json
|
|
99
|
-
{
|
|
100
|
-
"bean": {
|
|
101
|
-
"id": "new-1",
|
|
102
|
-
"title": "Add dark mode",
|
|
103
|
-
"status": "todo",
|
|
104
|
-
"type": "feature"
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
### beans_update
|
|
110
|
-
|
|
111
|
-
Request (change status and add blocking):
|
|
112
|
-
|
|
113
|
-
```json
|
|
114
|
-
{
|
|
115
|
-
"beanId": "bean-abc",
|
|
116
|
-
"status": "in-progress",
|
|
117
|
-
"blocking": ["bean-def"]
|
|
118
|
-
}
|
|
119
|
-
```
|
|
120
|
-
|
|
121
|
-
Response (structuredContent):
|
|
122
|
-
|
|
123
|
-
```json
|
|
124
|
-
{
|
|
125
|
-
"bean": {
|
|
126
|
-
"id": "bean-abc",
|
|
127
|
-
"status": "in-progress",
|
|
128
|
-
"blockingIds": ["bean-def"]
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
```
|
|
132
|
-
|
|
133
|
-
### beans_delete
|
|
134
|
-
|
|
135
|
-
Request:
|
|
136
|
-
|
|
137
|
-
```json
|
|
138
|
-
{ "beanId": "bean-old", "force": false }
|
|
139
|
-
```
|
|
140
|
-
|
|
141
|
-
Response:
|
|
142
|
-
|
|
143
|
-
```json
|
|
144
|
-
{ "deleted": true, "beanId": "bean-old" }
|
|
145
|
-
```
|
|
146
|
-
|
|
147
|
-
### beans_reopen
|
|
148
|
-
|
|
149
|
-
Request:
|
|
150
|
-
|
|
151
|
-
```json
|
|
152
|
-
{
|
|
153
|
-
"beanId": "bean-closed",
|
|
154
|
-
"requiredCurrentStatus": "completed",
|
|
155
|
-
"targetStatus": "todo"
|
|
156
|
-
}
|
|
157
|
-
```
|
|
158
|
-
|
|
159
|
-
Response:
|
|
160
|
-
|
|
161
|
-
```json
|
|
162
|
-
{ "bean": { "id": "bean-closed", "status": "todo" } }
|
|
163
|
-
```
|
|
164
|
-
|
|
165
|
-
### beans_query — examples
|
|
166
|
-
|
|
167
|
-
Refresh (list all beans):
|
|
168
|
-
|
|
169
|
-
```json
|
|
170
|
-
{ "operation": "refresh" }
|
|
171
|
-
```
|
|
172
|
-
|
|
173
|
-
Response (partial):
|
|
174
|
-
|
|
175
|
-
```json
|
|
176
|
-
{ "count": 12, "beans": [] }
|
|
177
|
-
```
|
|
178
|
-
|
|
179
|
-
Filter (statuses/types/tags):
|
|
180
|
-
|
|
181
|
-
```json
|
|
182
|
-
{
|
|
183
|
-
"operation": "filter",
|
|
184
|
-
"statuses": ["in-progress", "todo"],
|
|
185
|
-
"types": ["bug", "feature"],
|
|
186
|
-
"tags": ["auth"]
|
|
187
|
-
}
|
|
188
|
-
```
|
|
189
|
-
|
|
190
|
-
Search (full-text):
|
|
191
|
-
|
|
192
|
-
```json
|
|
193
|
-
{ "operation": "search", "search": "authentication", "includeClosed": false }
|
|
194
|
-
```
|
|
195
|
-
|
|
196
|
-
Sort (modes: `status-priority-type-title`, `updated`, `created`, `id`):
|
|
197
|
-
|
|
198
|
-
```json
|
|
199
|
-
{ "operation": "sort", "mode": "updated" }
|
|
200
|
-
```
|
|
201
|
-
|
|
202
|
-
LLM context (generate Copilot instructions; optional write-to-workspace):
|
|
203
|
-
|
|
204
|
-
```json
|
|
205
|
-
{ "operation": "llm_context", "writeToWorkspaceInstructions": true }
|
|
206
|
-
```
|
|
207
|
-
|
|
208
|
-
Response (structuredContent):
|
|
209
|
-
|
|
210
|
-
```json
|
|
211
|
-
{
|
|
212
|
-
"graphqlSchema": "...",
|
|
213
|
-
"generatedInstructions": "...",
|
|
214
|
-
"instructionsPath": "/workspace/.github/instructions/tasks.instructions.md"
|
|
215
|
-
}
|
|
216
|
-
```
|
|
217
|
-
|
|
218
|
-
### beans_bean_file
|
|
219
|
-
|
|
220
|
-
Request (read):
|
|
221
|
-
|
|
222
|
-
```json
|
|
223
|
-
{ "operation": "read", "path": "beans-vscode-123--title.md" }
|
|
224
|
-
```
|
|
225
|
-
|
|
226
|
-
Response:
|
|
227
|
-
|
|
228
|
-
```json
|
|
229
|
-
{
|
|
230
|
-
"path": "/workspace/.beans/beans-vscode-123--title.md",
|
|
231
|
-
"content": "---\n...frontmatter...\n---\n# Title\n"
|
|
232
|
-
}
|
|
233
|
-
```
|
|
234
|
-
|
|
235
|
-
### beans_output
|
|
236
|
-
|
|
237
|
-
Request (read last 200 lines):
|
|
238
|
-
|
|
239
|
-
```json
|
|
240
|
-
{ "operation": "read", "lines": 200 }
|
|
241
|
-
```
|
|
242
|
-
|
|
243
|
-
Response:
|
|
244
|
-
|
|
245
|
-
```json
|
|
246
|
-
{
|
|
247
|
-
"path": "/workspace/.vscode/logs/beans-output.log",
|
|
248
|
-
"content": "...log lines...",
|
|
249
|
-
"linesReturned": 200
|
|
250
|
-
}
|
|
251
|
-
```
|
|
252
|
-
|
|
253
|
-
## Programmatic usage
|
|
254
|
-
|
|
255
|
-
### Installation
|
|
256
|
-
|
|
257
|
-
```bash
|
|
258
|
-
npm install beans-mcp
|
|
259
|
-
```
|
|
260
|
-
|
|
261
|
-
### Example
|
|
262
|
-
|
|
263
|
-
```typescript
|
|
264
|
-
import { createBeansMcpServer, parseCliArgs } from "@selfagency/beans-mcp";
|
|
265
|
-
|
|
266
|
-
const server = await createBeansMcpServer({
|
|
267
|
-
workspaceRoot: "/path/to/workspace",
|
|
268
|
-
cliPath: "beans", // or path to beans CLI
|
|
269
|
-
});
|
|
270
|
-
|
|
271
|
-
// Connect to stdio transport or your own transport
|
|
272
|
-
```
|
|
273
|
-
|
|
274
|
-
### API
|
|
275
|
-
|
|
276
|
-
#### createBeansMcpServer(opts)
|
|
277
|
-
|
|
278
|
-
Creates and initializes a Beans MCP server instance.
|
|
279
|
-
|
|
280
|
-
**Options:**
|
|
281
|
-
|
|
282
|
-
- `workspaceRoot` (string): Path to the Beans workspace
|
|
283
|
-
- `cliPath` (string, optional): Path to Beans CLI executable (default: 'beans')
|
|
284
|
-
- `name` (string, optional): Server name (default: 'beans-mcp-server')
|
|
285
|
-
- `version` (string, optional): Server version
|
|
286
|
-
- `logDir` (string, optional): Directory for server logs
|
|
287
|
-
- `backend` (BackendInterface, optional): Custom backend implementation
|
|
288
|
-
|
|
289
|
-
**Returns:** `{ server: McpServer; backend: BackendInterface }`
|
|
290
|
-
|
|
291
|
-
#### startBeansMcpServer(argv)
|
|
292
|
-
|
|
293
|
-
CLI-compatible entrypoint for launching the server.
|
|
294
|
-
|
|
295
|
-
### Utility Functions
|
|
296
|
-
|
|
297
|
-
- `parseCliArgs(argv: string[])`: Parse CLI arguments
|
|
298
|
-
- `isPathWithinRoot(root: string, target: string): boolean`: Check if path is contained within root
|
|
299
|
-
- `sortBeans(beans, mode)`: Sort beans by specified mode
|
|
300
|
-
|
|
301
|
-
### Types & Schemas
|
|
302
|
-
|
|
303
|
-
Export of GraphQL schema, Zod validation schemas, and TypeScript types for Beans records and operations.
|
|
304
|
-
|
|
305
|
-
## License
|
|
306
|
-
|
|
307
|
-
MIT
|