@pipeworx/mcp-bold-systems 0.1.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Mojibake Inc.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,171 @@
1
+ # @pipeworx/bold-systems
2
+
3
+ The global DNA barcode reference library from BOLD Systems (Barcode of Life Data System, Centre for
4
+ Biodiversity Genomics, University of Guelph) — specimen vouchers with locality, institution and
5
+ taxonomy, the COI/rbcL/matK barcode sequences themselves, and BIN species-proxy clusters.
6
+
7
+ Part of [Pipeworx](https://pipeworx.io) — an MCP gateway connecting AI agents to 1679+ live data sources.
8
+
9
+ ## Tools
10
+
11
+ - `bold_specimens(taxon?, country?, bin?, institution?, query?, limit?, offset?)` — specimen records:
12
+ process ID, full taxonomy, BIN, collection date, locality with coordinates, holding institution,
13
+ marker and GenBank accession. Filters AND together.
14
+ - `bold_sequences(taxon?, country?, bin?, institution?, marker?, query?, limit?, offset?)` — the
15
+ barcode sequences, with primers, base count, INSDC accession and a ready-to-paste FASTA block.
16
+ - `bold_taxonomy(name, rank?)` — resolve a name against BOLD's own index: lineage, record/species/BIN
17
+ counts at each rank above it, a plain-language description, and alternative matches with counts.
18
+
19
+ ## Auth
20
+
21
+ Keyless.
22
+
23
+ ## Data sources
24
+
25
+ - <https://portal.boldsystems.org/api/terms> — term index; resolves a plain name to a query triplet.
26
+ - <https://portal.boldsystems.org/api/query> — turns a triplet query into a `query_id`.
27
+ - <https://portal.boldsystems.org/api/documents/{query_id}> — the records, `nuc` sequence inline.
28
+ - <https://portal.boldsystems.org/api/taxonomy/{description,hierarchy}> — lineage, counts, prose.
29
+ - Swagger: <https://portal.boldsystems.org/api/docs> (the spec itself is at
30
+ <https://portal.boldsystems.org/openapi.json>, NOT under `/api/`).
31
+
32
+ ## Traps
33
+
34
+ **The v4 API is dead.** `v4.boldsystems.org/index.php/API_Public/{specimen,sequence,combined}` — what
35
+ every tutorial and most R packages still point at — answers with a "BOLD Public Offline" HTML page,
36
+ not JSON, so a naive client reports a parse error rather than a retirement. Everything here is the
37
+ v5 portal API.
38
+
39
+ **The query language is `scope:field:value` triplets and the scope/field pair is not guessable from
40
+ the value.** `Canada` is `geo:country/ocean`, `Danaus` is `tax:genus`, `BOLD:AAA9566` is `bin:uri`,
41
+ `Smithsonian Institution` is `inst:name`. Free text gets a 400 `{"detail":"Invalid triplet token"}`.
42
+ The pack resolves every typed argument through `/api/terms` first, which is what turns a plain name
43
+ into a query that matches instead of a 400 or a silent zero.
44
+
45
+ **`/api/counts` reports the SUM of the per-term counts, not the size of the intersection.** For
46
+ `tax:species:Danaus plexippus;geo:country/ocean:Canada` it says **2,520,553** records; the actual
47
+ match set is **7**. That is a clean 200 carrying a number wrong by five orders of magnitude, and it
48
+ is the number a naive integration would quote. The pack does not use it — `matchingRecords` comes
49
+ from `recordsTotal` on the document query, which is the real count. (Semicolon-separated triplets
50
+ AND on `/documents` even though they sum on `/counts`.)
51
+
52
+ **`/api/query/preprocessor` falls back to ID-field matching on a multi-word string.** Feeding it
53
+ "Danaus plexippus Canada" returns `ids:processid:...;ids:sampleid:...;ids:insdcacs:...` — a query
54
+ that matches nothing and errors nowhere. Resolve each filter separately, which is what
55
+ `resolveTriplet` does.
56
+
57
+ **BOLD holds specimen records that were never sequenced.** `bold_sequences` filters to records with a
58
+ `nuc` field and says so in `note` when the result is empty, so "this taxon has no barcodes" is
59
+ distinguishable from "this taxon has no records".
60
+
61
+ **The marker filter is applied to the returned page, not upstream** (BOLD's term index has no entry
62
+ for `COI-5P`). The pack over-fetches 5× when a marker is set and reports which markers were actually
63
+ present in the page it scanned, so an empty result names the markers you could have asked for.
64
+
65
+ **`identifier_email` is dropped before anything leaves the pack** — it is a contact address on a
66
+ person, not specimen data. Collector and identifier NAMES are kept: those are the published
67
+ attribution on a museum voucher and appear on every biodiversity record.
68
+
69
+ ## Quick Start
70
+
71
+ Add to your MCP client (Claude Desktop, Cursor, Windsurf, etc.):
72
+
73
+ ```json
74
+ {
75
+ "mcpServers": {
76
+ "bold-systems": {
77
+ "url": "https://gateway.pipeworx.io/bold-systems/mcp"
78
+ }
79
+ }
80
+ }
81
+ ```
82
+
83
+ ### What this endpoint actually serves
84
+
85
+ `tools/list` at `https://gateway.pipeworx.io/bold-systems/mcp` returns the tools in the table
86
+ above **plus the shared Pipeworx meta-tools** — `ask_pipeworx`,
87
+ `discover_tools`, `search_within`, `remember`/`recall` and the rest of the
88
+ gateway-wide set. So the tool count you see is larger than this table: a
89
+ single-pack endpoint currently lists roughly 30 shared tools alongside the
90
+ pack's own. The connection's `initialize` response states its exact scope, and
91
+ is the authoritative answer for a given day.
92
+
93
+ This is deliberate, not multiplexing by accident. The meta-tools are what let a
94
+ scoped connection answer a question this pack does not cover — via
95
+ `ask_pipeworx`, which routes across the whole catalog — without you adding a
96
+ second MCP server. There is currently no way to mount a pack endpoint without
97
+ them; if the extra schemas cost you more context than the routing is worth,
98
+ connect to the full gateway once rather than to several pack endpoints.
99
+
100
+ Or connect to the full Pipeworx gateway to get every pack's tools listed
101
+ directly, instead of just this one's:
102
+
103
+ ```json
104
+ {
105
+ "mcpServers": {
106
+ "pipeworx": {
107
+ "url": "https://gateway.pipeworx.io/mcp"
108
+ }
109
+ }
110
+ }
111
+ ```
112
+
113
+ Both URLs reach the same gateway and the same 1679+ data sources. The
114
+ only difference is which pack's tools are listed **directly**; `ask_pipeworx`
115
+ reaches all of them from either one.
116
+
117
+ ## No MCP client? Call it over HTTP
118
+
119
+ ```bash
120
+ curl -X POST https://gateway.pipeworx.io/v1/tools/bold_specimens \
121
+ -H 'Content-Type: application/json' \
122
+ -d '{"taxon":"Danaus plexippus","country":"Canada","limit":3}'
123
+ ```
124
+
125
+ No account needed for the first calls. Inspect any tool: `GET https://gateway.pipeworx.io/v1/tools/bold_specimens`. Find one: `POST https://gateway.pipeworx.io/v1/tools/search_packs` with `{"query":"..."}`.
126
+
127
+ ## Standalone (no gateway account)
128
+
129
+ This package also runs as a local stdio MCP server — no Pipeworx account, no
130
+ gateway round-trip:
131
+
132
+ ```json
133
+ {
134
+ "mcpServers": {
135
+ "bold-systems": {
136
+ "command": "npx",
137
+ "args": ["-y", "@pipeworx/mcp-bold-systems"]
138
+ }
139
+ }
140
+ }
141
+ ```
142
+
143
+ Or run it directly to confirm it starts:
144
+
145
+ ```bash
146
+ npx -y @pipeworx/mcp-bold-systems
147
+ ```
148
+
149
+ It speaks MCP over stdin/stdout and answers `initialize`/`tools/list`/`tools/call`
150
+ for **only** this pack's tools — none of the shared meta-tools the gateway
151
+ connection above adds. Same source, same tools, no ask_pipeworx routing.
152
+
153
+ ## Using with ask_pipeworx
154
+
155
+ Instead of calling tools directly, you can ask questions in plain English —
156
+ this works on the pack endpoint above as well as on the full gateway:
157
+
158
+ ```
159
+ ask_pipeworx({ question: "your question about Bold Systems data" })
160
+ ```
161
+
162
+ The gateway picks the right tool and fills the arguments automatically.
163
+
164
+ ## More
165
+
166
+ - [Docs and guides](https://pipeworx.io/docs)
167
+ - [pipeworx.io](https://pipeworx.io)
168
+
169
+ ## License
170
+
171
+ MIT
package/bin/cli.js ADDED
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env node
2
+ //
3
+ // Entry point for `npx @pipeworx/mcp-<slug>`.
4
+ //
5
+ // Packs ship as raw TypeScript (no build step — see publish-pack.sh for why:
6
+ // tsx sidesteps every extensionless-import / bare-JSON-import edge case a
7
+ // per-pack tsc build would have to solve one pack at a time). This file
8
+ // registers tsx's ESM loader programmatically, then hands off to src/server.ts,
9
+ // which wraps the pack's {tools, callTool} export in a stdio MCP server.
10
+ //
11
+ // Copied verbatim into every published pack repo by scripts/publish-pack.sh —
12
+ // edit this file, not a per-pack copy.
13
+ import { register } from 'tsx/esm/api';
14
+
15
+ register();
16
+
17
+ await import('../src/server.ts');
package/package.json ADDED
@@ -0,0 +1,32 @@
1
+ {
2
+ "name": "@pipeworx/mcp-bold-systems",
3
+ "version": "0.1.0",
4
+ "description": "BOLD Systems (Barcode of Life Data System, University of Guelph) — the global DNA barcode reference library: specimen records with collection locality, institution and taxonomy, the COI/rbcL/matK barcode sequences themselves, and BIN (species-proxy cluster) assignments. Keyless.",
5
+ "type": "module",
6
+ "main": "src/index.ts",
7
+ "types": "src/index.ts",
8
+ "bin": {
9
+ "mcp-bold-systems": "bin/cli.js"
10
+ },
11
+ "keywords": ["mcp", "mcp-server", "model-context-protocol", "pipeworx", "bold-systems"],
12
+ "license": "MIT",
13
+ "repository": {
14
+ "type": "git",
15
+ "url": "git+https://github.com/pipeworx-io/mcp-bold-systems.git"
16
+ },
17
+ "scripts": {
18
+ "typecheck": "tsc --noEmit"
19
+ },
20
+ "dependencies": {
21
+ "@modelcontextprotocol/sdk": "^1.30.0",
22
+ "tsx": "^4.19.0"
23
+ },
24
+ "devDependencies": {
25
+ "typescript": "^5.9.3",
26
+ "@cloudflare/workers-types": "^4.20260405.1"
27
+ },
28
+ "pipeworx": {
29
+ "sourceHash": "v1-d794cb2800cc6d4646f1705662ed070740c13309d2d4ccb407a8f63c7b12c8d6",
30
+ "sourceCommit": "60f04b68c347e970c6be94a53439d1364061fc06"
31
+ }
32
+ }
package/server.json ADDED
@@ -0,0 +1,18 @@
1
+ {
2
+ "$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
3
+ "name": "io.github.pipeworx-io/bold-systems",
4
+ "title": "Bold Systems",
5
+ "description": "BOLD Systems (Barcode of Life Data System, University of Guelph) — the global DNA barcode…",
6
+ "version": "0.1.0",
7
+ "websiteUrl": "https://pipeworx.io/packs/bold-systems",
8
+ "repository": {
9
+ "url": "https://github.com/pipeworx-io/mcp-bold-systems",
10
+ "source": "github"
11
+ },
12
+ "remotes": [
13
+ {
14
+ "type": "streamable-http",
15
+ "url": "https://gateway.pipeworx.io/bold-systems/mcp"
16
+ }
17
+ ]
18
+ }