agr-mcp-server 4.0.0 → 4.0.1

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/dist/client.d.ts CHANGED
@@ -50,12 +50,9 @@ export declare class AllianceClient {
50
50
  */
51
51
  searchAlleles(query: string, limit?: number): Promise<SearchResponse>;
52
52
  /**
53
- * Get list of supported species
53
+ * Get list of supported species from API
54
54
  */
55
- getSpeciesList(): Array<{
56
- name: Species;
57
- shortName: string;
58
- }>;
55
+ getSpeciesList(): Promise<unknown>;
59
56
  /**
60
57
  * Helper to resolve species short name
61
58
  */
package/dist/client.js CHANGED
@@ -51,9 +51,8 @@ export class AllianceClient {
51
51
  id: r.id,
52
52
  symbol: r.symbol,
53
53
  name: r.name || r.name_key || r.id,
54
- species: r.species?.name,
54
+ species: r.species,
55
55
  category: r.category,
56
- description: r.highlights?.description?.[0],
57
56
  highlights: r.highlights,
58
57
  })),
59
58
  total: response.total,
@@ -202,22 +201,29 @@ export class AllianceClient {
202
201
  return this.search(query, "allele", undefined, limit);
203
202
  }
204
203
  /**
205
- * Get list of supported species
204
+ * Get list of supported species from API
206
205
  */
207
- getSpeciesList() {
208
- // Return hardcoded list of Alliance model organisms
209
- const speciesList = [
210
- { name: "Homo sapiens", shortName: "human" },
211
- { name: "Mus musculus", shortName: "mouse" },
212
- { name: "Rattus norvegicus", shortName: "rat" },
213
- { name: "Danio rerio", shortName: "zebrafish" },
214
- { name: "Drosophila melanogaster", shortName: "fly" },
215
- { name: "Caenorhabditis elegans", shortName: "worm" },
216
- { name: "Saccharomyces cerevisiae", shortName: "yeast" },
217
- { name: "Xenopus laevis", shortName: "frog" },
218
- { name: "Xenopus tropicalis", shortName: "xenopus" },
219
- ];
220
- return speciesList;
206
+ async getSpeciesList() {
207
+ const url = `${this.agrApiUrl}/api/species`;
208
+ try {
209
+ return await this.fetch(url);
210
+ }
211
+ catch {
212
+ // Fallback to hardcoded list
213
+ return {
214
+ results: [
215
+ { name: "Homo sapiens", shortName: "Hsa", commonNames: ["human"] },
216
+ { name: "Mus musculus", shortName: "Mmu", commonNames: ["mouse"] },
217
+ { name: "Rattus norvegicus", shortName: "Rno", commonNames: ["rat"] },
218
+ { name: "Danio rerio", shortName: "Dre", commonNames: ["zebrafish"] },
219
+ { name: "Drosophila melanogaster", shortName: "Dme", commonNames: ["fly"] },
220
+ { name: "Caenorhabditis elegans", shortName: "Cel", commonNames: ["worm"] },
221
+ { name: "Saccharomyces cerevisiae", shortName: "Sce", commonNames: ["yeast"] },
222
+ { name: "Xenopus tropicalis", shortName: "Xtr", commonNames: ["xenopus"] },
223
+ ],
224
+ total: 8,
225
+ };
226
+ }
221
227
  }
222
228
  /**
223
229
  * Helper to resolve species short name
package/dist/index.js CHANGED
@@ -220,17 +220,9 @@ server.tool("search_alleles", "Search for alleles/variants in the Alliance datab
220
220
  // Tool: Get Species List
221
221
  server.tool("get_species_list", "Get list of model organisms supported by Alliance of Genome Resources.", {}, async () => {
222
222
  try {
223
- const species = client.getSpeciesList();
223
+ const data = await client.getSpeciesList();
224
224
  return {
225
- content: [
226
- {
227
- type: "text",
228
- text: JSON.stringify({
229
- description: "Model organisms in the Alliance of Genome Resources",
230
- species,
231
- }, null, 2),
232
- },
233
- ],
225
+ content: [{ type: "text", text: JSON.stringify(data, null, 2) }],
234
226
  };
235
227
  }
236
228
  catch (error) {
@@ -259,18 +251,18 @@ server.resource("entity-types", "agr://entity-types", async () => ({
259
251
  ],
260
252
  }));
261
253
  // Resource: Species
262
- server.resource("species", "agr://species", async () => ({
263
- contents: [
264
- {
265
- uri: "agr://species",
266
- mimeType: "application/json",
267
- text: JSON.stringify({
268
- description: "Model organisms in Alliance of Genome Resources",
269
- species: client.getSpeciesList(),
270
- }, null, 2),
271
- },
272
- ],
273
- }));
254
+ server.resource("species", "agr://species", async () => {
255
+ const data = await client.getSpeciesList();
256
+ return {
257
+ contents: [
258
+ {
259
+ uri: "agr://species",
260
+ mimeType: "application/json",
261
+ text: JSON.stringify(data, null, 2),
262
+ },
263
+ ],
264
+ };
265
+ });
274
266
  function getEntityDescription(type) {
275
267
  const descriptions = {
276
268
  gene: "Genes across all model organisms",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agr-mcp-server",
3
- "version": "4.0.0",
3
+ "version": "4.0.1",
4
4
  "description": "MCP server for Alliance of Genome Resources - access genomics data across model organisms",
5
5
  "main": "dist/index.js",
6
6
  "bin": {