@cyanheads/brapi-mcp-server 0.3.5 → 0.3.7

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/CLAUDE.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # Agent Protocol
2
2
 
3
3
  **Server:** brapi-mcp-server
4
- **Version:** 0.3.5
4
+ **Version:** 0.3.7
5
5
  **Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core)
6
6
 
7
7
  > **Read the framework docs first:** `node_modules/@cyanheads/mcp-ts-core/CLAUDE.md` contains the full API reference — builders, Context, error codes, exports, patterns. This file covers server-specific conventions only.
@@ -319,7 +319,7 @@ When you complete a skill's checklist, check the boxes and add a completion time
319
319
 
320
320
  ## Commands
321
321
 
322
- **Runtime:** Scripts use `tsx` both `npm run <cmd>` and `bun run <cmd>` work. Prefer `bun` (declared in `packageManager`).
322
+ **Runtime:** Scripts and the production entry point use Bun directly Bun executes TypeScript natively, no `tsx` shim. The `packageManager` field pins the version.
323
323
 
324
324
  | Command | Purpose |
325
325
  |:--------|:--------|
package/README.md CHANGED
@@ -7,7 +7,7 @@
7
7
 
8
8
  <div align="center">
9
9
 
10
- [![npm](https://img.shields.io/npm/v/@cyanheads/brapi-mcp-server?style=flat-square&logo=npm&logoColor=white)](https://www.npmjs.com/package/@cyanheads/brapi-mcp-server) [![Version](https://img.shields.io/badge/Version-0.3.5-blue.svg?style=flat-square)](./CHANGELOG.md) [![Framework](https://img.shields.io/badge/Built%20on-@cyanheads/mcp--ts--core-259?style=flat-square)](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) [![MCP SDK](https://img.shields.io/badge/MCP%20SDK-^1.29.0-green.svg?style=flat-square)](https://modelcontextprotocol.io/)
10
+ [![npm](https://img.shields.io/npm/v/@cyanheads/brapi-mcp-server?style=flat-square&logo=npm&logoColor=white)](https://www.npmjs.com/package/@cyanheads/brapi-mcp-server) [![Version](https://img.shields.io/badge/Version-0.3.7-blue.svg?style=flat-square)](./CHANGELOG.md) [![Framework](https://img.shields.io/badge/Built%20on-@cyanheads/mcp--ts--core-259?style=flat-square)](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) [![MCP SDK](https://img.shields.io/badge/MCP%20SDK-^1.29.0-green.svg?style=flat-square)](https://modelcontextprotocol.io/)
11
11
 
12
12
  [![License](https://img.shields.io/badge/License-Apache%202.0-orange.svg?style=flat-square)](./LICENSE) [![TypeScript](https://img.shields.io/badge/TypeScript-^6.0.3-3178C6.svg?style=flat-square)](https://www.typescriptlang.org/) [![Bun](https://img.shields.io/badge/Bun-v1.3.11-blueviolet.svg?style=flat-square)](https://bun.sh/) [![Status](https://img.shields.io/badge/Status-Beta-yellow.svg?style=flat-square)](./CHANGELOG.md)
13
13
 
@@ -54,7 +54,7 @@ Nineteen tools grouped by shape — connection tools bootstrap a session, `find_
54
54
 
55
55
  | Tool Name | Description |
56
56
  |:----------|:------------|
57
- | `brapi_submit_observations` | Submit new (POST) or updated (PUT) observation rows for a study. Default `mode: preview` validates only; `mode: apply` elicits confirmation, fans POST + PUT in parallel, and reports the post-write count. Additive — no observation is destroyed. |
57
+ | `brapi_submit_observations` | Submit new (POST) or updated (PUT) observation rows for a study. Default `mode: preview` validates only; `mode: apply` elicits confirmation, fans POST + PUT in parallel, and reports the post-write count. Additive — no observation is destroyed. **Opt-in via `BRAPI_ENABLE_WRITES=true`** — omitted from `tools/list` otherwise. |
58
58
 
59
59
  ### Escape hatches
60
60
 
@@ -253,6 +253,8 @@ Last-resort passthrough to any BrAPI `POST /search/{noun}`. Handles the 202 / as
253
253
 
254
254
  Two-phase write for observation rows. Default `mode: preview` validates rows against the study's variables and returns a routing breakdown; `mode: apply` elicits user confirmation when the client supports it, then POSTs new rows and PUTs rows carrying `observationDbId` in parallel.
255
255
 
256
+ > **Off by default.** Registered only when the operator sets `BRAPI_ENABLE_WRITES=true`; omitted from the surface otherwise. Operator-level deploy-time consent for the only mutation tool — the in-tool preview default, `ctx.elicit` confirmation, `force: true` bypass, and `brapi:write:observations` auth scope all continue to apply when registration is on.
257
+
256
258
  - POST/PUT routing keyed on per-row `observationDbId` presence — mixed batches in one call
257
259
  - Pre-flight pulls `/studies/{id}/observationvariables` to flag rows whose variable isn't exposed by the study (warning, not rejection — the upstream is the source of truth)
258
260
  - Apply mode requires `ctx.elicit` confirmation OR an explicit `force: true` flag (rejected with `Forbidden` otherwise)
@@ -443,6 +445,7 @@ Every variable is optional — agents can configure connections entirely at runt
443
445
  | `BRAPI_DATASET_STORE_DIR` | Filesystem path for `DatasetStore` payloads when filesystem storage is active. | — |
444
446
  | `BRAPI_REFERENCE_CACHE_TTL_SECONDS` | TTL for reference-data cache entries (programs, trials, locations, crops). | `3600` |
445
447
  | `BRAPI_ALLOW_PRIVATE_IPS` | Allow connecting to RFC 1918 / loopback targets. Dev-only. | `false` |
448
+ | `BRAPI_ENABLE_WRITES` | Opt-in flag for the write surface (`brapi_submit_observations`). Off by default — the tool is omitted from `tools/list` unless the operator opts in for this deployment. | `false` |
446
449
  | `MCP_TRANSPORT_TYPE` | Transport: `stdio` or `http`. | `stdio` |
447
450
  | `MCP_HTTP_PORT` | Port for HTTP server. | `3010` |
448
451
  | `MCP_AUTH_MODE` | Auth mode: `none`, `jwt`, or `oauth`. | `none` |
@@ -494,11 +497,11 @@ Then the agent calls `brapi_connect({ alias: 'cassava' })` — no `baseUrl`, no
494
497
 
495
498
  ### Local development
496
499
 
497
- - **Hot-reload dev mode** (run `tsx --watch` directly):
500
+ - **Hot-reload dev mode** (Bun runs TypeScript directly):
498
501
 
499
502
  ```sh
500
- MCP_TRANSPORT_TYPE=stdio bunx tsx --watch src/index.ts
501
- MCP_TRANSPORT_TYPE=http bunx tsx --watch src/index.ts
503
+ MCP_TRANSPORT_TYPE=stdio bun --watch src/index.ts
504
+ MCP_TRANSPORT_TYPE=http bun --watch src/index.ts
502
505
  ```
503
506
 
504
507
  - **Build and run the production version:**
@@ -0,0 +1,23 @@
1
+ ---
2
+ summary: "Drop the tsx runtime shim — package scripts and the production entry point invoke Bun directly. Fixes a Docker linux/arm64 build failure (tsx + Bun 1.3.13 in oven/bun:1) and aligns the script execution model with the cyanheads MCP fleet."
3
+ breaking: false
4
+ ---
5
+
6
+ # 0.3.6 — 2026-04-30
7
+
8
+ A toolchain alignment release with no behavior change. Local builds continue to work exactly as before; the visible difference is that the Dockerfile now builds against `linux/arm64` again, and `tsx` is no longer a dependency.
9
+
10
+ ## Changed
11
+
12
+ - **`package.json` scripts run TypeScript via Bun directly** — `build`, `rebuild`, `clean`, `devcheck`, `tree`, `lint:mcp`, `changelog:build`, `changelog:check` switched from `tsx scripts/<name>.ts` to `bun run scripts/<name>.ts`. Bun executes TypeScript natively, so the tsx loader is no longer needed.
13
+ - **`start`, `start:stdio`, `start:http` invoke the production bundle via Bun** — switched from `node dist/index.js` to `bun ./dist/index.js`. Matches the runtime declared by `packageManager` and the `bun` runtimeHint surfaced via `server.json`.
14
+ - **`server.json` `runtimeHint` flipped from `node` to `bun`** on both the stdio and http package entries — reflects the actual runtime the start scripts now use, and matches the rest of the cyanheads MCP fleet.
15
+ - **CLAUDE.md and README dev-mode snippet updated** — `bunx tsx --watch src/index.ts` is now `bun --watch src/index.ts`. The Commands section no longer claims scripts depend on tsx.
16
+
17
+ ## Removed
18
+
19
+ - **`tsx` removed from `devDependencies`.** No code in the repo still references it.
20
+
21
+ ## Fixed
22
+
23
+ - **Multi-arch Docker build no longer fails on linux/arm64** — `RUN bun run build` previously routed through `tsx scripts/build.ts`, which surfaced `Cannot find module './cjs/index.cjs' from ''` inside the upstream `oven/bun:1` image (Bun 1.3.13). Routing through Bun directly avoids the tsx-loading path entirely. Surfaced during the v0.3.5 release attempt; the npm + MCP Registry publishes succeeded but the GHCR image push aborted. v0.3.6 ships the same surface plus the toolchain fix.
@@ -0,0 +1,18 @@
1
+ ---
2
+ summary: "Add `BRAPI_ENABLE_WRITES` env-var gate for the write surface — `brapi_submit_observations` is omitted from `tools/list` unless the operator opts in for the deployment. Mirrors obsidian-mcp-server's `OBSIDIAN_ENABLE_COMMANDS` pattern."
3
+ breaking: false
4
+ ---
5
+
6
+ # 0.3.7 — 2026-04-29
7
+
8
+ A consent-layer release with no behavior change for opted-in deployments. The only mutation tool (`brapi_submit_observations`) is now gated behind an explicit deploy-time env flag, so a hosted instance never exposes writes unless the operator deliberately turns them on. The in-tool preview default, `ctx.elicit` confirmation, `force: true` bypass, and `brapi:write:observations` auth scope all continue to apply when the gate is open. Closes [#2](https://github.com/cyanheads/brapi-mcp-server/issues/2).
9
+
10
+ ## Added
11
+
12
+ - **`BRAPI_ENABLE_WRITES` env var (default `false`)** — opt-in flag for the write surface. When unset or `false`, `brapi_submit_observations` is **not registered** on `createApp()` — it doesn't appear in `tools/list`, agents never see the description, the apply path is structurally unreachable. When `true`, it registers normally and existing in-tool gating layers stay in place. Surfaces as a configured env var on both `stdio` and `streamable-http` packages in `server.json` so the registry shows the flag to operators.
13
+ - **`src/mcp-server/tools/definitions/index.ts`** — new barrel exporting `readOnlyToolDefinitions` (18 tools) and `writeToolDefinitions` (`[brapiSubmitObservations]`). Pure exports — no eager `getServerConfig()` call, so reflective tooling (lint script, future tests) can import the arrays without env-parsing side effects.
14
+ - **`tests/registration-gate.test.ts`** — verifies `readOnlyToolDefinitions` excludes `brapi_submit_observations`, `writeToolDefinitions` contains exactly that tool, the env var parses to the right `enableWrites` value across stub variants, and the entry-point composition produces the expected tool list at both flag positions.
15
+
16
+ ## Changed
17
+
18
+ - **`src/index.ts` registers tools via conditional spread** — `serverConfig.enableWrites ? [...readOnlyToolDefinitions, ...writeToolDefinitions] : readOnlyToolDefinitions`. All other call sites untouched. The 18 individual `import` lines for tools are gone — they live in the new barrel now.
@@ -30,6 +30,10 @@ declare const ServerConfigSchema: z.ZodObject<{
30
30
  true: "true";
31
31
  false: "false";
32
32
  }>>, z.ZodTransform<boolean, "true" | "false">>;
33
+ enableWrites: z.ZodPipe<z.ZodDefault<z.ZodEnum<{
34
+ true: "true";
35
+ false: "false";
36
+ }>>, z.ZodTransform<boolean, "true" | "false">>;
33
37
  }, z.core.$strip>;
34
38
  export type ServerConfig = z.infer<typeof ServerConfigSchema>;
35
39
  export declare function getServerConfig(): ServerConfig;
@@ -1 +1 @@
1
- {"version":3,"file":"server-config.d.ts","sourceRoot":"","sources":["../../src/config/server-config.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAG3C,QAAA,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;iBA0FtB,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAI9D,wBAAgB,eAAe,IAAI,YAAY,CAsB9C;AAED,uDAAuD;AACvD,wBAAgB,iBAAiB,IAAI,IAAI,CAExC"}
1
+ {"version":3,"file":"server-config.d.ts","sourceRoot":"","sources":["../../src/config/server-config.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAG3C,QAAA,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;iBAiGtB,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAI9D,wBAAgB,eAAe,IAAI,YAAY,CAuB9C;AAED,uDAAuD;AACvD,wBAAgB,iBAAiB,IAAI,IAAI,CAExC"}
@@ -96,6 +96,11 @@ const ServerConfigSchema = z.object({
96
96
  .default('false')
97
97
  .transform((v) => v === 'true')
98
98
  .describe('Allow connecting to RFC 1918 / loopback targets. Dev-only.'),
99
+ enableWrites: z
100
+ .enum(['true', 'false'])
101
+ .default('false')
102
+ .transform((v) => v === 'true')
103
+ .describe('Opt-in flag for the write surface (`brapi_submit_observations`). Off by default — the tool is omitted from `tools/list` unless the operator opts in for this deployment.'),
99
104
  });
100
105
  let _config;
101
106
  export function getServerConfig() {
@@ -118,6 +123,7 @@ export function getServerConfig() {
118
123
  searchPollTimeoutMs: 'BRAPI_SEARCH_POLL_TIMEOUT_MS',
119
124
  searchPollIntervalMs: 'BRAPI_SEARCH_POLL_INTERVAL_MS',
120
125
  allowPrivateIps: 'BRAPI_ALLOW_PRIVATE_IPS',
126
+ enableWrites: 'BRAPI_ENABLE_WRITES',
121
127
  });
122
128
  return _config;
123
129
  }
@@ -1 +1 @@
1
- {"version":3,"file":"server-config.js","sourceRoot":"","sources":["../../src/config/server-config.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAE/D,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IAClC,cAAc,EAAE,CAAC;SACd,MAAM,EAAE;SACR,GAAG,EAAE;SACL,QAAQ,EAAE;SACV,QAAQ,CAAC,yEAAyE,CAAC;IACtF,eAAe,EAAE,CAAC;SACf,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,qDAAqD,CAAC;IAClE,eAAe,EAAE,CAAC;SACf,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,qDAAqD,CAAC;IAClE,oBAAoB,EAAE,CAAC;SACpB,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,uDAAuD,CAAC;IACpE,wBAAwB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,+BAA+B,CAAC;IACzF,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,yBAAyB,CAAC;IACxE,mBAAmB,EAAE,CAAC;SACnB,MAAM,EAAE;SACR,OAAO,CAAC,eAAe,CAAC;SACxB,QAAQ,CAAC,0CAA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 import { brapiFiltersResource } from './mcp-server/resources/definitions/brapi-f
22
22
  import { brapiGermplasmResource } from './mcp-server/resources/definitions/brapi-germplasm.resource.js';
23
23
  import { brapiServerInfoResource } from './mcp-server/resources/definitions/brapi-server-info.resource.js';
24
24
  import { brapiStudyResource } from './mcp-server/resources/definitions/brapi-study.resource.js';
25
- import { brapiConnect } from './mcp-server/tools/definitions/brapi-connect.tool.js';
26
- import { brapiDescribeFilters } from './mcp-server/tools/definitions/brapi-describe-filters.tool.js';
27
- import { brapiFindGenotypeCalls } from './mcp-server/tools/definitions/brapi-find-genotype-calls.tool.js';
28
- import { brapiFindGermplasm } from './mcp-server/tools/definitions/brapi-find-germplasm.tool.js';
29
- import { brapiFindImages } from './mcp-server/tools/definitions/brapi-find-images.tool.js';
30
- import { brapiFindLocations } from './mcp-server/tools/definitions/brapi-find-locations.tool.js';
31
- import { brapiFindObservations } from './mcp-server/tools/definitions/brapi-find-observations.tool.js';
32
- import { brapiFindStudies } from './mcp-server/tools/definitions/brapi-find-studies.tool.js';
33
- import { brapiFindVariables } from './mcp-server/tools/definitions/brapi-find-variables.tool.js';
34
- import { brapiFindVariants } from './mcp-server/tools/definitions/brapi-find-variants.tool.js';
35
- import { brapiGetGermplasm } from './mcp-server/tools/definitions/brapi-get-germplasm.tool.js';
36
- import { brapiGetImage } from './mcp-server/tools/definitions/brapi-get-image.tool.js';
37
- import { brapiGetStudy } from './mcp-server/tools/definitions/brapi-get-study.tool.js';
38
- import { brapiManageDataset } from './mcp-server/tools/definitions/brapi-manage-dataset.tool.js';
39
- import { brapiRawGet } from './mcp-server/tools/definitions/brapi-raw-get.tool.js';
40
- import { brapiRawSearch } from './mcp-server/tools/definitions/brapi-raw-search.tool.js';
41
- import { brapiServerInfo } from './mcp-server/tools/definitions/brapi-server-info.tool.js';
42
- import { brapiSubmitObservations } from './mcp-server/tools/definitions/brapi-submit-observations.tool.js';
43
- import { brapiWalkPedigree } from './mcp-server/tools/definitions/brapi-walk-pedigree.tool.js';
25
+ import { readOnlyToolDefinitions, writeToolDefinitions, } from './mcp-server/tools/definitions/index.js';
26
+ const serverConfig = getServerConfig();
27
+ const tools = serverConfig.enableWrites
28
+ ? [...readOnlyToolDefinitions, ...writeToolDefinitions]
29
+ : readOnlyToolDefinitions;
44
30
  await createApp({
45
- tools: [
46
- brapiConnect,
47
- brapiServerInfo,
48
- brapiDescribeFilters,
49
- brapiFindStudies,
50
- brapiGetStudy,
51
- brapiFindGermplasm,
52
- brapiGetGermplasm,
53
- brapiWalkPedigree,
54
- brapiFindVariables,
55
- brapiFindObservations,
56
- brapiFindImages,
57
- brapiGetImage,
58
- brapiFindLocations,
59
- brapiFindVariants,
60
- brapiFindGenotypeCalls,
61
- brapiManageDataset,
62
- brapiSubmitObservations,
63
- brapiRawGet,
64
- brapiRawSearch,
65
- ],
31
+ tools,
66
32
  resources: [
67
33
  brapiServerInfoResource,
68
34
  brapiCallsResource,
@@ -73,7 +39,6 @@ await createApp({
73
39
  ],
74
40
  prompts: [brapiEdaStudy, brapiMetaAnalysis],
75
41
  setup() {
76
- const serverConfig = getServerConfig();
77
42
  initBrapiClient(serverConfig);
78
43
  initCapabilityRegistry(serverConfig);
79
44
  initReferenceDataCache(serverConfig);
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;GAMG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACnE,OAAO,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAC;AACjF,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAC7E,OAAO,EAAE,sBAAsB,EAAE,MAAM,0CAA0C,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