@rangerwild/mcp-server 0.0.0-stage → 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/README.md CHANGED
@@ -1,3 +1,146 @@
1
- # Temporary Holding Version
1
+ # @rangerwild/mcp-server
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ > Give Claude Desktop (or Cursor, or any MCP client) direct access to your Ranger Wild centre.
4
+
5
+ An industry-first for zoo + wildlife software: install one package, paste your API key, and type *"log weight 1.2 kg for Buzz"* in Claude Desktop — Ranger Station records it with full Rule 10 audit, under your operator identity.
6
+
7
+ 20 tools exposed over the [Model Context Protocol](https://modelcontextprotocol.io), spanning read (list animals, species, dashboard summary, search by nickname, etc.) and write (log weight, log feed, raise incident, mark check done, etc.). 7 are live in Week 2; the rest widen progressively through Week 4 of the API-first pivot.
8
+
9
+ ---
10
+
11
+ ## Install (Claude Desktop)
12
+
13
+ 1. **Create an API key** at [station.rangerwild.com/settings/api-keys](https://station.rangerwild.com/settings/api-keys). Copy it — you won't see it again.
14
+ 2. **Open Claude Desktop → Settings → Developer → Edit Config** (this opens `claude_desktop_config.json`).
15
+ 3. **Add this to `mcpServers`:**
16
+
17
+ ```json
18
+ {
19
+ "mcpServers": {
20
+ "ranger": {
21
+ "command": "npx",
22
+ "args": ["-y", "@rangerwild/mcp-server"],
23
+ "env": {
24
+ "RANGER_API_KEY": "rwk_live_..."
25
+ }
26
+ }
27
+ }
28
+ }
29
+ ```
30
+
31
+ 4. **Restart Claude Desktop.** Look for the 🔌 icon at the bottom of the chat input — "ranger" should be in the list with 20 tools.
32
+ 5. Try: *"How many animals at my centre? Then log a weight of 1.2 kg for Buzz, keeper phil."*
33
+
34
+ ---
35
+
36
+ ## Install (Cursor)
37
+
38
+ Cursor's MCP config is per-workspace under `.cursor/mcp.json`:
39
+
40
+ ```json
41
+ {
42
+ "mcpServers": {
43
+ "ranger": {
44
+ "command": "npx",
45
+ "args": ["-y", "@rangerwild/mcp-server"],
46
+ "env": { "RANGER_API_KEY": "rwk_live_..." }
47
+ }
48
+ }
49
+ }
50
+ ```
51
+
52
+ ---
53
+
54
+ ## Install (ChatGPT custom tool via MCP bridge)
55
+
56
+ ChatGPT supports MCP via a bridge. The exact snippet depends on the bridge you use; the env + command are the same as above. See the ChatGPT docs for the current MCP-tool install path.
57
+
58
+ ---
59
+
60
+ ## Available tools (20)
61
+
62
+ ### Read (12)
63
+
64
+ | Tool | What it does | Status |
65
+ |------|--------------|--------|
66
+ | `list_animals` | List up to 500 animals at your centre | **live** |
67
+ | `get_animal` | Fetch one animal by uuid | **live** |
68
+ | `list_species` | List species held at your centre | **live** |
69
+ | `get_species` | Fetch one species-at-this-centre record | **live** |
70
+ | `list_enclosures` | List enclosures | pending (Week 4) |
71
+ | `get_enclosure` | One enclosure + contents | pending (Week 4) |
72
+ | `list_overdue_checks` | All checks past their next-due date | pending (Week 4) |
73
+ | `list_recent_incidents` | Incidents in the last N days | pending (Week 4) |
74
+ | `get_dashboard_summary` | Headline counts for your centre | **live** |
75
+ | `list_upcoming_events` | Events in the next N days | pending (Week 4) |
76
+ | `list_api_activity_today` | What has Claude Desktop done today | pending (Week 4) |
77
+ | `search_animals_by_nickname` | Find animals by nickname fragment | **live** |
78
+
79
+ ### Write (8)
80
+
81
+ | Tool | What it does | Status |
82
+ |------|--------------|--------|
83
+ | `log_weight` | Record a weight for an animal | **live** |
84
+ | `log_feed` | Record a feeding for an animal or enclosure | **live** |
85
+ | `log_enrichment` | Record an enrichment session | pending (Week 4) |
86
+ | `log_vet_note` | Record a vet note | pending (Week 4) |
87
+ | `mark_check_done` | Mark a scheduled check completed | pending (Week 4) |
88
+ | `raise_incident` | Raise an incident | pending (Week 4) |
89
+ | `add_note_to_animal` | Attach a free-text note to an animal | pending (Week 4) |
90
+ | `move_animal_to_enclosure` | Move an animal between enclosures | pending (Week 4) |
91
+
92
+ Every write tool returns `{ success, audit_id, logged_at, human_summary }` so Claude Desktop can confirm the action with its audit id.
93
+
94
+ ---
95
+
96
+ ## Why MCP
97
+
98
+ Ranger Wild is positioned as the first AI-native platform for zoo and wildlife centre operations. That doesn't mean "there's a chat window on the dashboard" — it means every capability is an API, so operators can drive Ranger from whatever tool they already live in. MCP is the protocol that makes that real: one install, every AI client gets Ranger as a tool.
99
+
100
+ See [developers.rangerwild.com](https://developers.rangerwild.com) (launches Week 4) for the full spec, a Scalar-rendered browser, and change log.
101
+
102
+ ---
103
+
104
+ ## Local dev + publish
105
+
106
+ ```bash
107
+ cd apps/ranger-mcp
108
+ npm install
109
+ npm run build # compile src/ → dist/
110
+ node dist/index.js --list-tools # quick catalogue check (no API key needed)
111
+ RANGER_API_KEY=rwk_live_... node scripts/smoke-mcp.mjs # end-to-end smoke
112
+ ```
113
+
114
+ Publish (Phil-triggered):
115
+
116
+ ```bash
117
+ cd apps/ranger-mcp
118
+ npm publish # publishConfig.access = public is set
119
+ ```
120
+
121
+ ---
122
+
123
+ ## Env vars
124
+
125
+ | Name | Required | Default |
126
+ |------|----------|---------|
127
+ | `RANGER_API_KEY` | yes | — |
128
+ | `RANGER_API_URL` | no | `https://station.rangerwild.com/api/v1` |
129
+
130
+ Set `RANGER_API_URL` to a Vercel preview URL (e.g. `https://ranger-station-web-git-....vercel.app/api/v1`) to point this server at a non-prod gateway for testing.
131
+
132
+ ---
133
+
134
+ ## Protocol + SDK
135
+
136
+ - Transport: stdio (JSON-RPC 2.0)
137
+ - SDK: [`@modelcontextprotocol/sdk`](https://www.npmjs.com/package/@modelcontextprotocol/sdk)
138
+ - Spec: [modelcontextprotocol.io](https://modelcontextprotocol.io)
139
+
140
+ Hosted MCP (SSE transport) is a separate entry point not shipped in this version.
141
+
142
+ ---
143
+
144
+ ## Licence + support
145
+
146
+ Unlicensed source; usage is covered by the Ranger Wild Terms you accept when creating an API key at station.rangerwild.com. Issues → [github.com/philgillett-git/wildlife-app/issues](https://github.com/philgillett-git/wildlife-app/issues).
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Thin fetch wrapper for the Ranger public API.
3
+ *
4
+ * WHY shared:
5
+ * Every tool hits the same gateway with the same auth header. Centralising
6
+ * the error-envelope parsing + 429 surfacing keeps each tool handler
7
+ * focused on its own argument validation + response shaping.
8
+ */
9
+ import type { RangerConfig } from './config';
10
+ export interface ApiError extends Error {
11
+ code: string;
12
+ status: number;
13
+ details?: Record<string, unknown>;
14
+ }
15
+ export declare class RangerApiClient {
16
+ private readonly cfg;
17
+ constructor(cfg: RangerConfig);
18
+ request<T = unknown>(method: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE', path: string, opts?: {
19
+ query?: Record<string, string | number | boolean | undefined>;
20
+ body?: unknown;
21
+ }): Promise<T>;
22
+ get<T = unknown>(path: string, query?: Record<string, string | number | boolean | undefined>): Promise<T>;
23
+ post<T = unknown>(path: string, body: unknown): Promise<T>;
24
+ }
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RangerApiClient = void 0;
4
+ function makeError(code, message, status, details) {
5
+ const err = new Error(message);
6
+ err.code = code;
7
+ err.status = status;
8
+ if (details)
9
+ err.details = details;
10
+ return err;
11
+ }
12
+ class RangerApiClient {
13
+ cfg;
14
+ constructor(cfg) {
15
+ this.cfg = cfg;
16
+ }
17
+ async request(method, path, opts = {}) {
18
+ const url = new URL(this.cfg.apiUrl + (path.startsWith('/') ? path : `/${path}`));
19
+ for (const [k, v] of Object.entries(opts.query ?? {})) {
20
+ if (v === undefined || v === null)
21
+ continue;
22
+ url.searchParams.set(k, String(v));
23
+ }
24
+ const res = await fetch(url.toString(), {
25
+ method,
26
+ headers: {
27
+ Authorization: `Bearer ${this.cfg.apiKey}`,
28
+ 'Content-Type': 'application/json',
29
+ Accept: 'application/json',
30
+ },
31
+ body: opts.body ? JSON.stringify(opts.body) : undefined,
32
+ });
33
+ const text = await res.text();
34
+ let parsed = null;
35
+ if (text.length > 0) {
36
+ try {
37
+ parsed = JSON.parse(text);
38
+ }
39
+ catch {
40
+ if (!res.ok)
41
+ throw makeError('invalid_response', `Non-JSON ${res.status} response: ${text.slice(0, 200)}`, res.status);
42
+ }
43
+ }
44
+ if (!res.ok) {
45
+ const envelope = (parsed ?? {});
46
+ const code = envelope.error?.code ?? `http_${res.status}`;
47
+ const message = envelope.error?.message ?? `HTTP ${res.status}`;
48
+ const extra = {};
49
+ if (envelope.error?.last_minute !== undefined)
50
+ extra.last_minute = envelope.error.last_minute;
51
+ if (envelope.error?.last_day !== undefined)
52
+ extra.last_day = envelope.error.last_day;
53
+ throw makeError(code, message, res.status, Object.keys(extra).length ? extra : undefined);
54
+ }
55
+ return (parsed ?? {});
56
+ }
57
+ get(path, query) {
58
+ return this.request('GET', path, { query });
59
+ }
60
+ post(path, body) {
61
+ return this.request('POST', path, { body });
62
+ }
63
+ }
64
+ exports.RangerApiClient = RangerApiClient;
65
+ //# sourceMappingURL=api-client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-client.js","sourceRoot":"","sources":["../src/api-client.ts"],"names":[],"mappings":";;;AAgBA,SAAS,SAAS,CAAC,IAAY,EAAE,OAAe,EAAE,MAAc,EAAE,OAAiC;IACjG,MAAM,GAAG,GAAG,IAAI,KAAK,CAAC,OAAO,CAAa,CAAA;IAC1C,GAAG,CAAC,IAAI,GAAG,IAAI,CAAA;IACf,GAAG,CAAC,MAAM,GAAG,MAAM,CAAA;IACnB,IAAI,OAAO;QAAE,GAAG,CAAC,OAAO,GAAG,OAAO,CAAA;IAClC,OAAO,GAAG,CAAA;AACZ,CAAC;AAED,MAAa,eAAe;IACG;IAA7B,YAA6B,GAAiB;QAAjB,QAAG,GAAH,GAAG,CAAc;IAAG,CAAC;IAElD,KAAK,CAAC,OAAO,CACX,MAAmD,EACnD,IAAY,EACZ,OAA0F,EAAE;QAE5F,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,GA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— reads RANGER_API_KEY (required) + RANGER_API_URL (optional)
3
+ * from env. Throws with a helpful message if the key is missing.
4
+ *
5
+ * WHY throw on missing key (not silently proceed with reads only):
6
+ * MCP clients spawn this process over stdio; they surface stderr to the
7
+ * user. A clear "set RANGER_API_KEY" tells the operator exactly what to
8
+ * do; a silent failure makes every tool call 401 and they don't know why.
9
+ */
10
+ export interface RangerConfig {
11
+ apiKey: string;
12
+ apiUrl: string;
13
+ }
14
+ export declare function loadConfig(): RangerConfig;
package/dist/config.js ADDED
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ /**
3
+ * Config loader — reads RANGER_API_KEY (required) + RANGER_API_URL (optional)
4
+ * from env. Throws with a helpful message if the key is missing.
5
+ *
6
+ * WHY throw on missing key (not silently proceed with reads only):
7
+ * MCP clients spawn this process over stdio; they surface stderr to the
8
+ * user. A clear "set RANGER_API_KEY" tells the operator exactly what to
9
+ * do; a silent failure makes every tool call 401 and they don't know why.
10
+ */
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.loadConfig = loadConfig;
13
+ function loadConfig() {
14
+ const apiKey = process.env.RANGER_API_KEY ?? '';
15
+ const apiUrl = (process.env.RANGER_API_URL ?? 'https://station.rangerwild.com/api/v1').replace(/\/$/, '');
16
+ if (!apiKey) {
17
+ throw new Error([
18
+ 'RANGER_API_KEY is required.',
19
+ '',
20
+ 'Create a key at https://station.rangerwild.com/settings/api-keys, then add it to your',
21
+ 'MCP client config. Example for Claude Desktop:',
22
+ '',
23
+ ' {',
24
+ ' "mcpServers": {',
25
+ ' "ranger": {',
26
+ ' "command": "npx",',
27
+ ' "args": ["-y", "@rangerwild/mcp-server"],',
28
+ ' "env": { "RANGER_API_KEY": "rwk_live_..." }',
29
+ ' }',
30
+ ' }',
31
+ ' }',
32
+ ].join('\n'));
33
+ }
34
+ if (!apiKey.startsWith('rwk_live_') && !apiKey.startsWith('rwk_test_')) {
35
+ throw new Error('RANGER_API_KEY must start with rwk_live_ or rwk_test_');
36
+ }
37
+ return { apiKey, apiUrl };
38
+ }
39
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;AAOH,gCA8BC;AA9BD,SAAgB,UAAU;IACxB,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,cAAc,IAAI,EAAE,CAAA;IAC/C,MAAM,MAAM,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,IAAI,uCAAuC,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAA;IAEzG,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CACb;YACE,6BAA6B;YAC7B,EAAE;YACF,uFAAuF;YACvF,gDAAgD;YAChD,EAAE;YACF,KAAK;YACL,qBAAqB;YACrB,mBAAmB;YACnB,2BAA2B;YAC3B,mDAAmD;YACnD,qDAAqD;YACrD,SAAS;YACT,OAAO;YACP,KAAK;SACN,CAAC,IAAI,CAAC,IAAI,CAAC,CACb,CAAA;IACH,CAAC;IAED,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,WAAW,CAAC,EAAE,CAAC;QACvE,MAAM,IAAI,KAAK,CAAC,uDAAuD,CAAC,CAAA;IAC1E,CAAC;IAED,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,CAAA;AAC3B,CAAC"}
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
package/dist/index.js ADDED
@@ -0,0 +1,124 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ /**
5
+ * @rangerwild/mcp-server — Model Context Protocol server for Ranger Wild.
6
+ *
7
+ * Users install this in Claude Desktop (or Cursor, or ChatGPT custom
8
+ * tools) with one JSON config entry. The MCP client spawns this process
9
+ * over stdio; `initialize` / `tools/list` / `tools/call` messages flow
10
+ * in; this server translates each `tools/call` into an HTTP request
11
+ * against the Ranger public API gateway using the operator's API key.
12
+ *
13
+ * WHY stdio transport (not SSE):
14
+ * Claude Desktop installs a local binary via npx. Stdio is the standard
15
+ * local-MCP transport and needs no public URL. For hosted MCP (future),
16
+ * SSE would be bolted on in a separate entry point under src/.
17
+ *
18
+ * WHY no tool registration via the SDK's `registerTool` helper:
19
+ * The server-side SDK's recommended pattern is to pass each tool to
20
+ * `server.setRequestHandler(CallToolRequestSchema, ...)` + a parallel
21
+ * `ListToolsRequestSchema` handler. We do exactly that below, driven
22
+ * by the catalogue in `./tools.ts`.
23
+ */
24
+ const index_js_1 = require("@modelcontextprotocol/sdk/server/index.js");
25
+ const stdio_js_1 = require("@modelcontextprotocol/sdk/server/stdio.js");
26
+ const types_js_1 = require("@modelcontextprotocol/sdk/types.js");
27
+ const config_1 = require("./config");
28
+ const api_client_1 = require("./api-client");
29
+ const tools_1 = require("./tools");
30
+ const PKG_NAME = '@rangerwild/mcp-server';
31
+ const PKG_VERSION = '0.1.0';
32
+ function toolsByName(tools) {
33
+ const map = new Map();
34
+ for (const t of tools)
35
+ map.set(t.name, t);
36
+ return map;
37
+ }
38
+ async function main() {
39
+ // CLI dry-run paths (help / version) — these let `node dist/index.js --help`
40
+ // succeed without RANGER_API_KEY so the workspace-level build check in
41
+ // preflight doesn't need live credentials.
42
+ const arg = process.argv[2];
43
+ if (arg === '--help' || arg === '-h') {
44
+ process.stdout.write([
45
+ `${PKG_NAME} v${PKG_VERSION}`,
46
+ '',
47
+ 'Model Context Protocol server for Ranger Wild. Usage: install in Claude',
48
+ 'Desktop (or any MCP client) with your RANGER_API_KEY env var. See the',
49
+ 'README for the full install snippet.',
50
+ '',
51
+ 'This binary speaks stdio MCP — spawn it from your MCP client, not from',
52
+ 'a terminal. Running it interactively will block waiting for JSON-RPC.',
53
+ '',
54
+ 'Env:',
55
+ ' RANGER_API_KEY required — your rwk_live_* key from station.rangerwild.com/settings/api-keys',
56
+ ' RANGER_API_URL optional — default https://station.rangerwild.com/api/v1',
57
+ '',
58
+ ].join('\n'));
59
+ return;
60
+ }
61
+ if (arg === '--version' || arg === '-v') {
62
+ process.stdout.write(`${PKG_VERSION}\n`);
63
+ return;
64
+ }
65
+ if (arg === '--list-tools') {
66
+ // Useful for the smoke test's quick-list check without spinning up a
67
+ // full MCP transport.
68
+ const tools = (0, tools_1.buildTools)();
69
+ process.stdout.write(JSON.stringify({ tools: tools.map((t) => ({ name: t.name, status: t.status, description: t.description })) }, null, 2) + '\n');
70
+ return;
71
+ }
72
+ const cfg = (0, config_1.loadConfig)();
73
+ const client = new api_client_1.RangerApiClient(cfg);
74
+ const tools = (0, tools_1.buildTools)();
75
+ const byName = toolsByName(tools);
76
+ const server = new index_js_1.Server({ name: PKG_NAME, version: PKG_VERSION }, { capabilities: { tools: {} } });
77
+ server.setRequestHandler(types_js_1.ListToolsRequestSchema, async () => ({
78
+ tools: tools.map((t) => ({
79
+ name: t.name,
80
+ description: t.description + (t.status === 'pending' ? ' (Pending — not yet live.)' : ''),
81
+ inputSchema: t.inputSchema,
82
+ })),
83
+ }));
84
+ server.setRequestHandler(types_js_1.CallToolRequestSchema, async (req) => {
85
+ const name = req.params.name;
86
+ const args = (req.params.arguments ?? {});
87
+ const tool = byName.get(name);
88
+ if (!tool) {
89
+ return {
90
+ content: [{ type: 'text', text: `Unknown tool: ${name}` }],
91
+ isError: true,
92
+ };
93
+ }
94
+ try {
95
+ const result = await tool.handler(client, args);
96
+ return {
97
+ content: [{ type: 'text', text: JSON.stringify(result, null, 2) }],
98
+ };
99
+ }
100
+ catch (err) {
101
+ const e = err;
102
+ const envelope = {
103
+ error: {
104
+ code: e.code ?? 'unknown_error',
105
+ message: e.message,
106
+ status: e.status,
107
+ details: e.details,
108
+ },
109
+ };
110
+ return {
111
+ content: [{ type: 'text', text: JSON.stringify(envelope, null, 2) }],
112
+ isError: true,
113
+ };
114
+ }
115
+ });
116
+ const transport = new stdio_js_1.StdioServerTransport();
117
+ await server.connect(transport);
118
+ // The transport keeps the process alive via stdin. Nothing more to do here.
119
+ }
120
+ main().catch((err) => {
121
+ process.stderr.write(`[${PKG_NAME}] fatal: ${err instanceof Error ? err.message : String(err)}\n`);
122
+ process.exit(1);
123
+ });
124
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AACA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wEAAkE;AAClE,wEAAgF;AAChF,iEAG2C;AAC3C,qCAAqC;AACrC,6CAA6D;AAC7D,mCAAkD;AAElD,MAAM,QAAQ,GAAG,wBAAwB,CAAA;AACzC,MAAM,WAAW,GAAG,OAAO,CAAA;AAE3B,SAAS,WAAW,CAAC,KAAgB;IACnC,MAAM,GAAG,GAAG,IAAI,GAAG,EAAmB,CAAA;IACtC,KAAK,MAAM,CAAC,IAAI,KAAK;QAAE,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAA;IACzC,OAAO,GAAG,CAAA;AACZ,CAAC;AAED,KAAK,UAAU,IAAI;IACjB,6EAA6E;IAC7E,uEAAuE;IACvE,2CAA2C;IAC3C,MAAM,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IAC3B,IAAI,GAAG,KAAK,QAAQ,IAAI,GAAG,KAAK,IAAI,EAAE,CAAC;QACrC,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB;YACE,GAAG,QAAQ,KAAK,WAAW,EAAE;YAC7B,EAAE;YACF,yEAAyE;YACzE,uEAAuE;YACvE,sCAAsC;YACtC,EAAE;YACF,wEAAwE;YACxE,uEAAuE;YACvE,EAAE;YACF,MAAM;YACN,iGAAiG;YACjG,6EAA6E;YAC7E,EAAE;SACH,CAAC,IAAI,CAAC,IAAI,CAAC,CACb,CAAA;QACD,OAAM;IACR,CAAC;I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aACF,CAAA;YACD,OAAO;gBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;gBAC7E,OAAO,EAAE,IAAI;aACd,CAAA;QACH,CAAC;IACH,CAAC,CAAC,CAAA;IAEF,MAAM,SAAS,GAAG,IAAI,+BAAoB,EAAE,CAAA;IAC5C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAA;IAC/B,4EAA4E;AAC9E,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IACnB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,QAAQ,YAAY,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;IAClG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;AACjB,CAAC,CAAC,CAAA"}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Ranger MCP tool catalogue — 20 tools exposed to Claude Desktop / Cursor /
3
+ * ChatGPT via the Model Context Protocol.
4
+ *
5
+ * 7 tools are LIVE (backed by endpoints already shipped in PR #859 Week 2):
6
+ * list_animals, get_animal, list_species, get_species,
7
+ * log_weight, log_feed, get_dashboard_summary,
8
+ * search_animals_by_nickname (served by list_animals + client-side filter).
9
+ *
10
+ * 12 tools are visible but PENDING — they return a friendly "coming in a
11
+ * later week" message rather than hit a 404. This keeps the catalogue the
12
+ * operator sees stable while Weeks 4+ widen the live set.
13
+ *
14
+ * WHY expose pending tools at all:
15
+ * Phil's Knowsley wedge is the catalogue breadth — "no zoo software has
16
+ * 20 AI-callable operations." A tool that says "coming in January" still
17
+ * demonstrates the direction; a missing tool reads as a gap. Each pending
18
+ * tool documents what it WILL do, so the operator's expectation matches
19
+ * what lands when Week 4+ ship it.
20
+ */
21
+ import type { RangerApiClient } from './api-client';
22
+ export interface ToolDef {
23
+ name: string;
24
+ description: string;
25
+ inputSchema: {
26
+ type: 'object';
27
+ properties: Record<string, unknown>;
28
+ required?: string[];
29
+ };
30
+ status: 'live' | 'pending';
31
+ handler: (client: RangerApiClient, args: Record<string, unknown>) => Promise<unknown>;
32
+ }
33
+ export declare function buildTools(): ToolDef[];
package/dist/tools.js ADDED
@@ -0,0 +1,348 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.buildTools = buildTools;
4
+ /** Formatted "not live yet" stub so Claude Desktop can confirm/explain to the operator. */
5
+ function pending(toolName, weekLiveTarget, backingEndpoint) {
6
+ return async () => ({
7
+ status: 'pending',
8
+ tool: toolName,
9
+ message: `This tool will go live ${weekLiveTarget}. Backing endpoint ${backingEndpoint} is documented in the OpenAPI spec at developers.rangerwild.com but not yet reachable through the public gateway.`,
10
+ });
11
+ }
12
+ /** Resolve an animal nickname → id via the live list endpoint. Returns null if ambiguous. */
13
+ async function resolveAnimalId(client, nickname) {
14
+ const resp = await client.get('/animals');
15
+ const needle = nickname.trim().toLowerCase();
16
+ const matches = (resp.animals ?? []).filter((a) => a.nickname && a.nickname.toLowerCase() === needle);
17
+ if (matches.length === 1)
18
+ return { id: matches[0].id, nickname: matches[0].nickname };
19
+ return null;
20
+ }
21
+ function buildTools() {
22
+ return [
23
+ // ─────────────── READ (12) ───────────────
24
+ {
25
+ name: 'list_animals',
26
+ description: 'List animals at the operator\'s centre. Returns id, nickname, and basic metadata for up to 500 animals.',
27
+ inputSchema: {
28
+ type: 'object',
29
+ properties: {
30
+ species: { type: 'string', description: 'Optional: filter by species display name (client-side filter in Week 3; server-side in Week 4).' },
31
+ enclosure: { type: 'string', description: 'Optional: filter by enclosure name (same).' },
32
+ status: { type: 'string', enum: ['active', 'deceased'], description: 'Optional: active (default) or deceased.' },
33
+ limit: { type: 'integer', default: 100, maximum: 500 },
34
+ },
35
+ },
36
+ status: 'live',
37
+ handler: async (client, args) => {
38
+ const resp = await client.get('/animals');
39
+ const limit = Math.min(Number(args.limit ?? 100), 500);
40
+ return { animals: (resp.animals ?? []).slice(0, limit), count: Math.min(resp.animals?.length ?? 0, limit) };
41
+ },
42
+ },
43
+ {
44
+ name: 'get_animal',
45
+ description: 'Fetch the full detail for one animal by id (uuid).',
46
+ inputSchema: {
47
+ type: 'object',
48
+ properties: { id: { type: 'string', description: 'Animal uuid.' } },
49
+ required: ['id'],
50
+ },
51
+ status: 'live',
52
+ handler: async (client, args) => client.get(`/animals/${encodeURIComponent(String(args.id))}`),
53
+ },
54
+ {
55
+ name: 'list_species',
56
+ description: 'List the species held at the operator\'s centre.',
57
+ inputSchema: {
58
+ type: 'object',
59
+ properties: {
60
+ limit: { type: 'integer', default: 100, maximum: 500 },
61
+ },
62
+ },
63
+ status: 'live',
64
+ handler: async (client, args) => {
65
+ const resp = await client.get('/species');
66
+ const limit = Math.min(Number(args.limit ?? 100), 500);
67
+ return { species: (resp.species ?? []).slice(0, limit), count: Math.min(resp.species?.length ?? 0, limit) };
68
+ },
69
+ },
70
+ {
71
+ name: 'get_species',
72
+ description: 'Fetch one species-at-this-centre record by species_id (uuid).',
73
+ inputSchema: {
74
+ type: 'object',
75
+ properties: { id: { type: 'string', description: 'Species uuid.' } },
76
+ required: ['id'],
77
+ },
78
+ status: 'live',
79
+ handler: async (client, args) => client.get(`/species/${encodeURIComponent(String(args.id))}`),
80
+ },
81
+ {
82
+ name: 'list_enclosures',
83
+ description: 'List enclosures at the operator\'s centre. (Pending — ships in Week 4 gateway widen.)',
84
+ inputSchema: { type: 'object', properties: { limit: { type: 'integer', default: 100 } } },
85
+ status: 'pending',
86
+ handler: pending('list_enclosures', 'in Week 4', 'GET /v1/enclosures'),
87
+ },
88
+ {
89
+ name: 'get_enclosure',
90
+ description: 'Fetch one enclosure by id with its contents. (Pending — ships in Week 4 gateway widen.)',
91
+ inputSchema: {
92
+ type: 'object',
93
+ properties: { id: { type: 'string', description: 'Enclosure uuid.' } },
94
+ required: ['id'],
95
+ },
96
+ status: 'pending',
97
+ handler: pending('get_enclosure', 'in Week 4', 'GET /v1/enclosures/{id}'),
98
+ },
99
+ {
100
+ name: 'list_overdue_checks',
101
+ description: 'List all check-template instances whose next-due timestamp is in the past. (Pending — ships in Week 4 checks gateway.)',
102
+ inputSchema: { type: 'object', properties: {} },
103
+ status: 'pending',
104
+ handler: pending('list_overdue_checks', 'in Week 4', 'GET /v1/checks/overdue'),
105
+ },
106
+ {
107
+ name: 'list_recent_incidents',
108
+ description: 'List incidents raised in the last N days. (Pending — ships in Week 4 incidents gateway.)',
109
+ inputSchema: {
110
+ type: 'object',
111
+ properties: { days: { type: 'integer', default: 7, minimum: 1, maximum: 90 } },
112
+ },
113
+ status: 'pending',
114
+ handler: pending('list_recent_incidents', 'in Week 4', 'GET /v1/incidents'),
115
+ },
116
+ {
117
+ name: 'get_dashboard_summary',
118
+ description: 'High-level counts for the operator\'s centre (animals, species, enclosures) plus park name and kind. Good first call for context.',
119
+ inputSchema: { type: 'object', properties: {} },
120
+ status: 'live',
121
+ handler: async (client) => client.get('/dashboard/summary'),
122
+ },
123
+ {
124
+ name: 'list_upcoming_events',
125
+ description: 'List events on the schedule for the next N days. (Pending — ships in Week 4 events gateway.)',
126
+ inputSchema: {
127
+ type: 'object',
128
+ properties: { days: { type: 'integer', default: 7, minimum: 1, maximum: 30 } },
129
+ },
130
+ status: 'pending',
131
+ handler: pending('list_upcoming_events', 'in Week 4', 'GET /v1/events?upcoming=true'),
132
+ },
133
+ {
134
+ name: 'list_api_activity_today',
135
+ description: 'List the audit log entries written by API-key callers today. Useful for "what has Claude Desktop done for me this morning". (Pending — ships in Week 4 audit gateway.)',
136
+ inputSchema: { type: 'object', properties: {} },
137
+ status: 'pending',
138
+ handler: pending('list_api_activity_today', 'in Week 4', 'GET /v1/audit?day=today&caller=api'),
139
+ },
140
+ {
141
+ name: 'search_animals_by_nickname',
142
+ description: 'Find animals whose nickname matches a query. Case-insensitive substring match.',
143
+ inputSchema: {
144
+ type: 'object',
145
+ properties: { query: { type: 'string', description: 'Nickname fragment to search for.' } },
146
+ required: ['query'],
147
+ },
148
+ status: 'live',
149
+ handler: async (client, args) => {
150
+ const q = String(args.query ?? '').trim().toLowerCase();
151
+ if (!q)
152
+ return { matches: [], count: 0 };
153
+ const resp = await client.get('/animals');
154
+ const matches = (resp.animals ?? []).filter((a) => a.nickname && a.nickname.toLowerCase().includes(q));
155
+ return { matches, count: matches.length };
156
+ },
157
+ },
158
+ // ─────────────── WRITE (8) ───────────────
159
+ {
160
+ name: 'log_weight',
161
+ description: 'Log a weight for an animal. Give the nickname (resolver) or the id. Returns the audit id so the operator can confirm "logged at hh:mm".',
162
+ inputSchema: {
163
+ type: 'object',
164
+ properties: {
165
+ animal_nickname: { type: 'string', description: 'The animal\'s nickname (e.g. "Buzz"). Resolver looks it up server-side.' },
166
+ animal_id: { type: 'string', description: 'The animal uuid (used when nickname is ambiguous).' },
167
+ kg: { type: 'number', description: 'Weight in kilograms (decimal).' },
168
+ keeper: { type: 'string', description: 'Keeper display name — recorded in the action payload notes.' },
169
+ notes: { type: 'string', description: 'Optional free-text note.' },
170
+ },
171
+ required: ['kg'],
172
+ },
173
+ status: 'live',
174
+ handler: async (client, args) => {
175
+ let animalId = args.animal_id;
176
+ let resolvedFromNickname;
177
+ if (!animalId && args.animal_nickname) {
178
+ const resolved = await resolveAnimalId(client, String(args.animal_nickname));
179
+ if (!resolved) {
180
+ return {
181
+ success: false,
182
+ error: 'ambiguous_or_missing_animal',
183
+ message: `Couldn\'t find exactly one animal with nickname "${args.animal_nickname}". Try search_animals_by_nickname first and pass animal_id.`,
184
+ };
185
+ }
186
+ animalId = resolved.id;
187
+ resolvedFromNickname = resolved.nickname;
188
+ }
189
+ if (!animalId) {
190
+ return { success: false, error: 'missing_target', message: 'Provide animal_nickname or animal_id.' };
191
+ }
192
+ if (typeof args.kg !== 'number') {
193
+ return { success: false, error: 'invalid_input', message: 'kg must be a number (e.g. 1.2).' };
194
+ }
195
+ const notesParts = [args.keeper && `keeper: ${args.keeper}`, args.notes].filter(Boolean);
196
+ const notes = notesParts.length ? notesParts.join(' · ') : undefined;
197
+ const resp = await client.post('/actions/weight', {
198
+ animal_id: animalId,
199
+ kg: args.kg,
200
+ ...(notes ? { notes } : {}),
201
+ });
202
+ return {
203
+ success: true,
204
+ audit_id: resp.action_id,
205
+ logged_at: resp.logged_at,
206
+ human_summary: `Logged ${args.kg} kg on ${resolvedFromNickname ?? 'animal'} at ${new Date(resp.logged_at).toLocaleTimeString('en-GB', { hour: '2-digit', minute: '2-digit' })}.`,
207
+ };
208
+ },
209
+ },
210
+ {
211
+ name: 'log_feed',
212
+ description: 'Log a feeding. Target can be an animal or an enclosure. Returns audit id + human summary.',
213
+ inputSchema: {
214
+ type: 'object',
215
+ properties: {
216
+ target_table: { type: 'string', enum: ['animals', 'enclosures'], description: 'Which entity was fed.' },
217
+ target_id: { type: 'string', description: 'Uuid of the animal or enclosure.' },
218
+ animal_nickname: { type: 'string', description: 'Alternative to target_id — resolver maps nickname to animal_id.' },
219
+ food: { type: 'string', description: 'What was fed (e.g. "day-old chicks").' },
220
+ amount: { type: 'string', description: 'How much (free text, e.g. "2").' },
221
+ keeper: { type: 'string', description: 'Keeper display name.' },
222
+ notes: { type: 'string', description: 'Optional free-text note.' },
223
+ },
224
+ },
225
+ status: 'live',
226
+ handler: async (client, args) => {
227
+ let targetTable = args.target_table;
228
+ let targetId = args.target_id;
229
+ if (!targetId && args.animal_nickname) {
230
+ const resolved = await resolveAnimalId(client, String(args.animal_nickname));
231
+ if (!resolved) {
232
+ return {
233
+ success: false,
234
+ error: 'ambiguous_or_missing_animal',
235
+ message: `Couldn\'t find exactly one animal with nickname "${args.animal_nickname}".`,
236
+ };
237
+ }
238
+ targetTable = 'animals';
239
+ targetId = resolved.id;
240
+ }
241
+ if (!targetTable || !targetId) {
242
+ return { success: false, error: 'missing_target', message: 'Provide (target_table + target_id) OR animal_nickname.' };
243
+ }
244
+ const resp = await client.post('/actions/feed', {
245
+ target_table: targetTable,
246
+ target_id: targetId,
247
+ food: args.food,
248
+ amount: args.amount,
249
+ notes: [args.keeper && `keeper: ${args.keeper}`, args.notes].filter(Boolean).join(' · ') || undefined,
250
+ });
251
+ return {
252
+ success: true,
253
+ audit_id: resp.action_id,
254
+ logged_at: resp.logged_at,
255
+ human_summary: `Logged feed on ${targetTable}/${String(targetId).slice(0, 8)} at ${new Date(resp.logged_at).toLocaleTimeString('en-GB', { hour: '2-digit', minute: '2-digit' })}.`,
256
+ };
257
+ },
258
+ },
259
+ {
260
+ name: 'log_enrichment',
261
+ description: 'Log an enrichment session for an animal. (Pending — ships in Week 4 actions widen.)',
262
+ inputSchema: {
263
+ type: 'object',
264
+ properties: {
265
+ animal_nickname: { type: 'string' },
266
+ animal_id: { type: 'string' },
267
+ session_type: { type: 'string', description: 'E.g. "scent", "puzzle-feeder", "flight-training".' },
268
+ duration_min: { type: 'integer' },
269
+ notes: { type: 'string' },
270
+ },
271
+ },
272
+ status: 'pending',
273
+ handler: pending('log_enrichment', 'in Week 4', 'POST /v1/actions/enrichment'),
274
+ },
275
+ {
276
+ name: 'log_vet_note',
277
+ description: 'Log a vet note for an animal. (Pending — ships in Week 4 actions widen.)',
278
+ inputSchema: {
279
+ type: 'object',
280
+ properties: {
281
+ animal_nickname: { type: 'string' },
282
+ animal_id: { type: 'string' },
283
+ vet_name: { type: 'string' },
284
+ body: { type: 'string' },
285
+ },
286
+ },
287
+ status: 'pending',
288
+ handler: pending('log_vet_note', 'in Week 4', 'POST /v1/actions/vet-note'),
289
+ },
290
+ {
291
+ name: 'mark_check_done',
292
+ description: 'Mark a scheduled check as completed. (Pending — ships in Week 4 checks gateway.)',
293
+ inputSchema: {
294
+ type: 'object',
295
+ properties: {
296
+ check_id: { type: 'string' },
297
+ result_summary: { type: 'string' },
298
+ keeper: { type: 'string' },
299
+ },
300
+ },
301
+ status: 'pending',
302
+ handler: pending('mark_check_done', 'in Week 4', 'POST /v1/actions/check-done'),
303
+ },
304
+ {
305
+ name: 'raise_incident',
306
+ description: 'Raise an incident against an animal, enclosure, or the site. (Pending — ships in Week 4 incidents gateway.)',
307
+ inputSchema: {
308
+ type: 'object',
309
+ properties: {
310
+ target_kind: { type: 'string', enum: ['animal', 'enclosure', 'site'] },
311
+ target_name_or_id: { type: 'string' },
312
+ severity: { type: 'string', enum: ['low', 'medium', 'high', 'critical'] },
313
+ summary: { type: 'string' },
314
+ },
315
+ },
316
+ status: 'pending',
317
+ handler: pending('raise_incident', 'in Week 4', 'POST /v1/incidents'),
318
+ },
319
+ {
320
+ name: 'add_note_to_animal',
321
+ description: 'Add a free-text note attached to an animal\'s record. (Pending — ships in Week 4 notes gateway.)',
322
+ inputSchema: {
323
+ type: 'object',
324
+ properties: {
325
+ animal_nickname: { type: 'string' },
326
+ animal_id: { type: 'string' },
327
+ body: { type: 'string' },
328
+ },
329
+ },
330
+ status: 'pending',
331
+ handler: pending('add_note_to_animal', 'in Week 4', 'POST /v1/animals/{id}/notes'),
332
+ },
333
+ {
334
+ name: 'move_animal_to_enclosure',
335
+ description: 'Move an animal to a different enclosure. (Pending — ships in Week 4 animals gateway widen.)',
336
+ inputSchema: {
337
+ type: 'object',
338
+ properties: {
339
+ animal_nickname_or_id: { type: 'string' },
340
+ enclosure_name_or_id: { type: 'string' },
341
+ },
342
+ },
343
+ status: 'pending',
344
+ handler: pending('move_animal_to_enclosure', 'in Week 4', 'PATCH /v1/animals/{id}'),
345
+ },
346
+ ];
347
+ }
348
+ //# sourceMappingURL=tools.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tools.js","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":";;AAgDA,gCAsUC;AAxVD,2FAA2F;AAC3F,SAAS,OAAO,CAAC,QAAgB,EAAE,cAAsB,EAAE,eAAuB;IAChF,OAAO,KAAK,IAAI,EAAE,CAAC,CAAC;QAClB,MAAM,EAA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,qBAAqB,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;oBACzC,oBAAoB,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;iBACzC;aACF;YACD,MAAM,EAAE,SAAS;YACjB,OAAO,EAAE,OAAO,CAAC,0BAA0B,EAAE,WAAW,EAAE,wBAAwB,CAAC;SACpF;KACF,CAAA;AACH,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,53 @@
1
1
  {
2
2
  "name": "@rangerwild/mcp-server",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.0",
4
+ "description": "Model Context Protocol server for Ranger Wild — AI-native zoo + wildlife centre management. Install in Claude Desktop, ChatGPT, Cursor, or any MCP client to drive your centre from the chat window.",
5
+ "bin": {
6
+ "ranger-mcp": "dist/index.js"
7
+ },
8
+ "main": "./dist/index.js",
9
+ "type": "commonjs",
10
+ "files": [
11
+ "dist",
12
+ "README.md"
13
+ ],
14
+ "scripts": {
15
+ "build": "tsc",
16
+ "typecheck": "tsc --noEmit",
17
+ "smoke": "node scripts/smoke-mcp.mjs",
18
+ "preflight": "npm run build",
19
+ "prepublishOnly": "npm run build && echo 'skipping live smoke — run manually with RANGER_API_KEY set'"
20
+ },
21
+ "dependencies": {
22
+ "@modelcontextprotocol/sdk": "1.18.0"
23
+ },
24
+ "devDependencies": {
25
+ "@types/node": "20.14.9",
26
+ "typescript": "5.5.3"
27
+ },
28
+ "engines": {
29
+ "node": ">=20"
30
+ },
31
+ "publishConfig": {
32
+ "access": "public"
33
+ },
34
+ "keywords": [
35
+ "mcp",
36
+ "model-context-protocol",
37
+ "claude-desktop",
38
+ "ranger-wild",
39
+ "zoo",
40
+ "wildlife",
41
+ "ai-native"
42
+ ],
43
+ "repository": {
44
+ "type": "git",
45
+ "url": "git+https://github.com/philgillett-git/wildlife-app.git",
46
+ "directory": "apps/ranger-mcp"
47
+ },
48
+ "license": "UNLICENSED",
49
+ "homepage": "https://developers.rangerwild.com",
50
+ "bugs": {
51
+ "url": "https://github.com/philgillett-git/wildlife-app/issues"
52
+ }
53
+ }