@pipeworx/mcp-catalogueoflife 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 Pipeworx
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,63 @@
1
+ # mcp-catalogueoflife
2
+
3
+ Catalogue of Life — global taxonomic index of known species (~2.2M accepted names)
4
+
5
+ Part of [Pipeworx](https://pipeworx.io) — an MCP gateway connecting AI agents to 250+ live data sources.
6
+
7
+ ## Tools
8
+
9
+ | Tool | Description |
10
+ |------|-------------|
11
+ | `search` | Name-usage search. |
12
+ | `name_match` | Exact scientific-name match (0 or 1 hit + alternatives). |
13
+ | `usage` | Single name-usage by id. |
14
+ | `taxon` | Taxon by id. |
15
+ | `classification` | Taxonomic classification chain (kingdom → species) for a taxon id. |
16
+ | `vernacular` | Vernacular (common) names for a taxon. |
17
+ | `synonyms` | Synonyms of a taxon. |
18
+ | `children` | Direct child taxa. |
19
+
20
+ ## Quick Start
21
+
22
+ Add to your MCP client (Claude Desktop, Cursor, Windsurf, etc.):
23
+
24
+ ```json
25
+ {
26
+ "mcpServers": {
27
+ "catalogueoflife": {
28
+ "url": "https://gateway.pipeworx.io/catalogueoflife/mcp"
29
+ }
30
+ }
31
+ }
32
+ ```
33
+
34
+ Or connect to the full Pipeworx gateway for access to all 250+ data sources:
35
+
36
+ ```json
37
+ {
38
+ "mcpServers": {
39
+ "pipeworx": {
40
+ "url": "https://gateway.pipeworx.io/mcp"
41
+ }
42
+ }
43
+ }
44
+ ```
45
+
46
+ ## Using with ask_pipeworx
47
+
48
+ Instead of calling tools directly, you can ask questions in plain English:
49
+
50
+ ```
51
+ ask_pipeworx({ question: "your question about Catalogueoflife data" })
52
+ ```
53
+
54
+ The gateway picks the right tool and fills the arguments automatically.
55
+
56
+ ## More
57
+
58
+ - [All tools and guides](https://github.com/pipeworx-io/examples)
59
+ - [pipeworx.io](https://pipeworx.io)
60
+
61
+ ## License
62
+
63
+ MIT
package/package.json ADDED
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "@pipeworx/mcp-catalogueoflife",
3
+ "version": "0.1.0",
4
+ "description": "Catalogue of Life — global taxonomic index of known species (~2.2M accepted names)",
5
+ "type": "module",
6
+ "main": "src/index.ts",
7
+ "types": "src/index.ts",
8
+ "keywords": ["mcp", "mcp-server", "model-context-protocol", "pipeworx", "catalogueoflife"],
9
+ "license": "MIT",
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "https://github.com/pipeworx-io/mcp-catalogueoflife"
13
+ },
14
+ "scripts": {
15
+ "typecheck": "tsc --noEmit"
16
+ },
17
+ "devDependencies": {
18
+ "typescript": "^5.7.0"
19
+ }
20
+ }
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/catalogueoflife",
4
+ "title": "Catalogueoflife",
5
+ "description": "Catalogue of Life — global taxonomic index of known species (~2.2M accepted names)",
6
+ "version": "0.1.0",
7
+ "websiteUrl": "https://pipeworx.io/packs/catalogueoflife",
8
+ "repository": {
9
+ "url": "https://github.com/pipeworx-io/mcp-catalogueoflife",
10
+ "source": "github"
11
+ },
12
+ "remotes": [
13
+ {
14
+ "type": "streamable-http",
15
+ "url": "https://gateway.pipeworx.io/catalogueoflife/mcp"
16
+ }
17
+ ]
18
+ }
package/src/index.ts ADDED
@@ -0,0 +1,181 @@
1
+ interface McpToolDefinition {
2
+ name: string;
3
+ description: string;
4
+ inputSchema: {
5
+ type: 'object';
6
+ properties: Record<string, unknown>;
7
+ required?: string[];
8
+ };
9
+ }
10
+
11
+ interface McpToolExport {
12
+ tools: McpToolDefinition[];
13
+ callTool: (name: string, args: Record<string, unknown>) => Promise<unknown>;
14
+ meter?: { credits: number };
15
+ cost?: Record<string, unknown>;
16
+ provider?: string;
17
+ }
18
+
19
+ /**
20
+ * Catalogue of Life MCP — global taxonomic index.
21
+ *
22
+ * Auth: none. API: https://api.checklistbank.org/openapi/
23
+ * Default dataset key 3LR = "COL latest release".
24
+ */
25
+
26
+
27
+ const BASE = 'https://api.checklistbank.org';
28
+ const DEFAULT_DATASET = '3LR';
29
+ const UA = 'pipeworx-mcp-catalogueoflife/1.0 (+https://pipeworx.io)';
30
+
31
+ const tools: McpToolExport['tools'] = [
32
+ {
33
+ name: 'search',
34
+ description: 'Name-usage search.',
35
+ inputSchema: {
36
+ type: 'object',
37
+ properties: {
38
+ query: { type: 'string', description: 'Free-text search (e.g. "Panthera leo").' },
39
+ dataset: { type: 'string', description: `ChecklistBank dataset key (default "${DEFAULT_DATASET}" = COL latest release).` },
40
+ limit: { type: 'number', description: '1-1000 (default 25).' },
41
+ offset: { type: 'number' },
42
+ rank: { type: 'string', description: 'e.g. "species", "genus", "family"' },
43
+ status: { type: 'string', description: 'accepted | synonym | bare_name | missapplied | …' },
44
+ },
45
+ required: ['query'],
46
+ },
47
+ },
48
+ {
49
+ name: 'name_match',
50
+ description: 'Exact scientific-name match (0 or 1 hit + alternatives).',
51
+ inputSchema: {
52
+ type: 'object',
53
+ properties: {
54
+ scientific_name: { type: 'string' },
55
+ authorship: { type: 'string', description: 'Optional authorship to disambiguate homonyms.' },
56
+ dataset: { type: 'string' },
57
+ },
58
+ required: ['scientific_name'],
59
+ },
60
+ },
61
+ {
62
+ name: 'usage',
63
+ description: 'Single name-usage by id.',
64
+ inputSchema: {
65
+ type: 'object',
66
+ properties: { id: { type: 'string' }, dataset: { type: 'string' } },
67
+ required: ['id'],
68
+ },
69
+ },
70
+ {
71
+ name: 'taxon',
72
+ description: 'Taxon by id.',
73
+ inputSchema: {
74
+ type: 'object',
75
+ properties: { id: { type: 'string' }, dataset: { type: 'string' } },
76
+ required: ['id'],
77
+ },
78
+ },
79
+ {
80
+ name: 'classification',
81
+ description: 'Taxonomic classification chain (kingdom → species) for a taxon id.',
82
+ inputSchema: {
83
+ type: 'object',
84
+ properties: { id: { type: 'string' }, dataset: { type: 'string' } },
85
+ required: ['id'],
86
+ },
87
+ },
88
+ {
89
+ name: 'vernacular',
90
+ description: 'Vernacular (common) names for a taxon.',
91
+ inputSchema: {
92
+ type: 'object',
93
+ properties: { id: { type: 'string' }, dataset: { type: 'string' } },
94
+ required: ['id'],
95
+ },
96
+ },
97
+ {
98
+ name: 'synonyms',
99
+ description: 'Synonyms of a taxon.',
100
+ inputSchema: {
101
+ type: 'object',
102
+ properties: { id: { type: 'string' }, dataset: { type: 'string' } },
103
+ required: ['id'],
104
+ },
105
+ },
106
+ {
107
+ name: 'children',
108
+ description: 'Direct child taxa.',
109
+ inputSchema: {
110
+ type: 'object',
111
+ properties: {
112
+ id: { type: 'string' },
113
+ dataset: { type: 'string' },
114
+ limit: { type: 'number', description: '1-1000 (default 100).' },
115
+ },
116
+ required: ['id'],
117
+ },
118
+ },
119
+ ];
120
+
121
+ async function callTool(name: string, args: Record<string, unknown>): Promise<unknown> {
122
+ const ds = datasetKey(args);
123
+ switch (name) {
124
+ case 'search': {
125
+ const params = new URLSearchParams({
126
+ q: reqStr(args, 'query', '"Panthera leo"'),
127
+ limit: String(Math.min(1000, Math.max(1, (args.limit as number) ?? 25))),
128
+ offset: String(Math.max(0, (args.offset as number) ?? 0)),
129
+ });
130
+ if (args.rank) params.set('rank', String(args.rank));
131
+ if (args.status) params.set('status', String(args.status));
132
+ return colGet(`/dataset/${ds}/nameusage/search?${params}`);
133
+ }
134
+ case 'name_match': {
135
+ const params = new URLSearchParams({ q: reqStr(args, 'scientific_name', '"Panthera leo"') });
136
+ if (args.authorship) params.set('authorship', String(args.authorship));
137
+ return colGet(`/dataset/${ds}/match/nameusage?${params}`);
138
+ }
139
+ case 'usage':
140
+ return colGet(`/dataset/${ds}/nameusage/${encodeURIComponent(reqStr(args, 'id', '"<id>"'))}`);
141
+ case 'taxon':
142
+ return colGet(`/dataset/${ds}/taxon/${encodeURIComponent(reqStr(args, 'id', '"<id>"'))}`);
143
+ case 'classification':
144
+ return colGet(`/dataset/${ds}/taxon/${encodeURIComponent(reqStr(args, 'id', '"<id>"'))}/classification`);
145
+ case 'vernacular':
146
+ return colGet(`/dataset/${ds}/taxon/${encodeURIComponent(reqStr(args, 'id', '"<id>"'))}/vernacular`);
147
+ case 'synonyms':
148
+ return colGet(`/dataset/${ds}/taxon/${encodeURIComponent(reqStr(args, 'id', '"<id>"'))}/synonyms`);
149
+ case 'children': {
150
+ const limit = Math.min(1000, Math.max(1, (args.limit as number) ?? 100));
151
+ return colGet(
152
+ `/dataset/${ds}/taxon/${encodeURIComponent(reqStr(args, 'id', '"<id>"'))}/children?limit=${limit}`,
153
+ );
154
+ }
155
+ default:
156
+ throw new Error(`Unknown tool: ${name}`);
157
+ }
158
+ }
159
+
160
+ function datasetKey(args: Record<string, unknown>): string {
161
+ const v = args.dataset;
162
+ if (typeof v === 'string' && v.trim()) return v.trim();
163
+ return DEFAULT_DATASET;
164
+ }
165
+
166
+ async function colGet(path: string): Promise<unknown> {
167
+ const res = await fetch(`${BASE}${path}`, { headers: { Accept: 'application/json', 'User-Agent': UA } });
168
+ if (res.status === 404) throw new Error('Catalogue of Life: not found');
169
+ if (!res.ok) throw new Error(`Catalogue of Life: ${res.status} ${await res.text().then((t) => t.slice(0, 200))}`);
170
+ return res.json();
171
+ }
172
+
173
+ function reqStr(args: Record<string, unknown>, key: string, example: string): string {
174
+ const v = args[key];
175
+ if (typeof v !== 'string' || !v.trim()) {
176
+ throw new Error(`Required argument "${key}" is missing. Pass a string like ${example}.`);
177
+ }
178
+ return v;
179
+ }
180
+
181
+ export default { tools, callTool, meter: { credits: 1 } } satisfies McpToolExport;
package/tsconfig.json ADDED
@@ -0,0 +1,14 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2022",
4
+ "module": "ESNext",
5
+ "moduleResolution": "bundler",
6
+ "strict": true,
7
+ "esModuleInterop": true,
8
+ "skipLibCheck": true,
9
+ "outDir": "dist",
10
+ "rootDir": "src",
11
+ "declaration": true
12
+ },
13
+ "include": ["src"]
14
+ }