@fonkychen/nature-vision-mcp 0.1.2 → 0.1.3

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.
Files changed (2) hide show
  1. package/dist/index.js +7 -5
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -5,13 +5,9 @@ import { z } from 'zod';
5
5
  import fetch from "node-fetch";
6
6
  const API_ENDPOINT = "https://api.nature-vision.top/api/v1/mcp/vision";
7
7
  const API_KEY = process.env.NATURE_VISION_API_KEY;
8
- if (!API_KEY) {
9
- console.error("NATURE_VISION_API_KEY environment variable is not set");
10
- process.exit(1);
11
- }
12
8
  const server = new McpServer({
13
9
  name: "nature-vision-mcp",
14
- version: "0.1.0",
10
+ version: "0.1.3",
15
11
  });
16
12
  server.registerTool("identify_species", {
17
13
  description: "Identify species from an image and return Latin names with confidence",
@@ -42,6 +38,12 @@ server.registerTool("identify_species", {
42
38
  if (image_url && image_data) {
43
39
  throw new Error("Either image_url or image_data is required");
44
40
  }
41
+ if (!API_KEY) {
42
+ return {
43
+ content: [{ type: "text", text: "Error: NATURE_VISION_API_KEY is not configured on the server." }],
44
+ isError: true
45
+ };
46
+ }
45
47
  const resp = await fetch(API_ENDPOINT, {
46
48
  method: "POST",
47
49
  headers: {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fonkychen/nature-vision-mcp",
3
3
  "mcpName": "io.github.fonkychen/nature-vision-mcp",
4
- "version": "0.1.2",
4
+ "version": "0.1.3",
5
5
  "description": "An MCP (Model Context Protocol) server that identifies biological species from images, returning Latin names with confidence scores.",
6
6
  "type": "module",
7
7
  "main": "dist/index.js",