mj41-mcp 1.4.0 → 1.5.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.
Files changed (2) hide show
  1. package/dist/index.js +168 -3
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -10,6 +10,10 @@
10
10
  // - get_all_copper_prices — all three classes at once
11
11
  // - get_oracle_status — health check for any class
12
12
  //
13
+ // Metals Oracles (ZJ Industries x MJ41)
14
+ // - get_metal_price — live price for gold, silver, aluminum, platinum, or palladium
15
+ // - get_all_metal_prices — all 8 oracles (3 copper + 5 metals) at once
16
+ //
13
17
  // Richard Tracy (Blockchain Detective by mj41)
14
18
  // - investigate_wallet — phishing/scam investigation
15
19
  // - get_eth_price — current ETH price
@@ -118,6 +122,21 @@ const ORACLE_URLS = {
118
122
  b: "https://classb.mj41.me",
119
123
  c: "https://classc.mj41.me",
120
124
  };
125
+ const METALS_BASE = "https://metals.mj41.me";
126
+ const METAL_URLS = {
127
+ gold: METALS_BASE,
128
+ silver: METALS_BASE,
129
+ aluminum: METALS_BASE,
130
+ platinum: METALS_BASE,
131
+ palladium: METALS_BASE,
132
+ };
133
+ const METAL_LABELS = {
134
+ gold: "Gold — COMEX GC=F (USD/troy oz)",
135
+ silver: "Silver — COMEX SI=F (USD/troy oz)",
136
+ aluminum: "Aluminum — COMEX ALI=F (USD/lb)",
137
+ platinum: "Platinum — NYMEX PL=F (USD/troy oz)",
138
+ palladium: "Palladium — NYMEX PA=F (USD/troy oz)",
139
+ };
121
140
  const CLASS_LABELS = {
122
141
  a: "Class A — COMEX Spot Copper (Grade A cathode, 99.99% purity, COMEX HG futures)",
123
142
  b: "Class B — Scrap Copper (yard call-arounds + COMEX reference)",
@@ -265,6 +284,141 @@ server.tool("get_oracle_status", "Check if a ZJ Industries copper oracle is oper
265
284
  }
266
285
  });
267
286
  // ════════════════════════════════════════════════════════════
287
+ // METALS ORACLES — ZJ Industries x MJ41
288
+ // ════════════════════════════════════════════════════════════
289
+ // ── get_metal_price ─────────────────────────────────────────
290
+ server.tool("get_metal_price", "Get the current price of a precious or industrial metal from a ZJ Industries on-chain oracle on Base. Available metals: gold (COMEX GC=F), silver (COMEX SI=F), aluminum (COMEX ALI=F), platinum (NYMEX PL=F), palladium (NYMEX PA=F). All prices update every 15 minutes during market hours. Powered by ZJ Industries x mj41, LLC.", {
291
+ metal: z
292
+ .enum(["gold", "silver", "aluminum", "platinum", "palladium"])
293
+ .describe("Metal to query: gold, silver, aluminum, platinum, or palladium"),
294
+ }, async ({ metal }) => {
295
+ const gate = await billingGate("get_metal_price");
296
+ if (!gate.allowed)
297
+ return { content: [{ type: "text", text: gate.message }] };
298
+ try {
299
+ checkRate("copper", RATE.COPPER);
300
+ const status = await cachedFetch(`metal-status-${metal}`, async () => {
301
+ const res = await fetch(`${METALS_BASE}/api/v1/${metal}/status`);
302
+ if (!res.ok)
303
+ throw new Error(`HTTP ${res.status}`);
304
+ return res.json();
305
+ }, TTL.COPPER_STATUS);
306
+ const label = METAL_LABELS[metal];
307
+ const fresh = status.is_fresh ? "FRESH" : "STALE";
308
+ const lastUpdate = new Date(status.last_updated).toLocaleString("en-US", {
309
+ timeZone: "America/New_York",
310
+ dateStyle: "medium",
311
+ timeStyle: "short",
312
+ });
313
+ return {
314
+ content: [
315
+ {
316
+ type: "text",
317
+ text: [
318
+ `ZJ Industries Metal Oracle — ${label}`,
319
+ ``,
320
+ status.price ? `Price: $${status.price} ${status.unit}` : "",
321
+ `Status: ${status.status} (${fresh})`,
322
+ `Last updated: ${lastUpdate} ET`,
323
+ `Chain: Base mainnet (8453)`,
324
+ `Contract: ${status.contract}`,
325
+ status.update_mode ? `Update mode: ${status.update_mode} (${status.update_frequency})` : "",
326
+ ``,
327
+ gate.message,
328
+ ``,
329
+ `— mj41, LLC | ZJ Industries (zjindustries.com)`,
330
+ ]
331
+ .filter(Boolean)
332
+ .join("\n"),
333
+ },
334
+ ],
335
+ };
336
+ }
337
+ catch (err) {
338
+ const msg = err instanceof Error ? err.message : "Unknown error";
339
+ return {
340
+ content: [{ type: "text", text: `Oracle read error: ${msg}` }],
341
+ };
342
+ }
343
+ });
344
+ // ── get_all_metal_prices ────────────────────────────────────
345
+ server.tool("get_all_metal_prices", "Get status of all 8 ZJ Industries on-chain oracles at once — 3 copper classes (A COMEX spot, B scrap, C industrial) plus 5 metals (gold, silver, aluminum, platinum, palladium). Returns freshness, last update time, and contract addresses for each. Powered by ZJ Industries x mj41, LLC.", {}, async () => {
346
+ const gate = await billingGate("get_all_metal_prices");
347
+ if (!gate.allowed)
348
+ return { content: [{ type: "text", text: gate.message }] };
349
+ const results = [
350
+ "ZJ Industries x MJ41 — Full Metals Oracle Suite",
351
+ "8 on-chain price feeds on Base mainnet",
352
+ "═══════════════════════════════════════════════",
353
+ "",
354
+ "COPPER ORACLES",
355
+ "──────────────",
356
+ "",
357
+ ];
358
+ checkRate("copper", RATE.COPPER);
359
+ // Copper oracles
360
+ for (const [cls, url] of Object.entries(ORACLE_URLS)) {
361
+ try {
362
+ const status = await cachedFetch(`copper-status-${cls}`, async () => {
363
+ const res = await fetch(`${url}/api/v1/status`);
364
+ return res.json();
365
+ }, TTL.COPPER_STATUS);
366
+ const fresh = status.is_fresh ? "FRESH" : "STALE";
367
+ const lastUpdate = new Date(status.last_updated).toLocaleString("en-US", {
368
+ timeZone: "America/New_York",
369
+ dateStyle: "medium",
370
+ timeStyle: "short",
371
+ });
372
+ results.push(`${CLASS_LABELS[cls]}`);
373
+ results.push(` Status: ${status.status} (${fresh})`);
374
+ results.push(` Last updated: ${lastUpdate} ET`);
375
+ results.push(` Contract: ${status.contract}`);
376
+ results.push("");
377
+ }
378
+ catch (err) {
379
+ const msg = err instanceof Error ? err.message : "Unknown error";
380
+ results.push(`${CLASS_LABELS[cls]}`);
381
+ results.push(` Error: ${msg}`);
382
+ results.push("");
383
+ }
384
+ }
385
+ results.push("METALS ORACLES");
386
+ results.push("──────────────");
387
+ results.push("");
388
+ // Metal oracles
389
+ for (const metal of Object.keys(METAL_URLS)) {
390
+ try {
391
+ const status = await cachedFetch(`metal-status-${metal}`, async () => {
392
+ const res = await fetch(`${METALS_BASE}/api/v1/${metal}/status`);
393
+ return res.json();
394
+ }, TTL.COPPER_STATUS);
395
+ const fresh = status.is_fresh ? "FRESH" : "STALE";
396
+ const lastUpdate = new Date(status.last_updated).toLocaleString("en-US", {
397
+ timeZone: "America/New_York",
398
+ dateStyle: "medium",
399
+ timeStyle: "short",
400
+ });
401
+ results.push(`${METAL_LABELS[metal]}`);
402
+ results.push(` Status: ${status.status} (${fresh})`);
403
+ results.push(` Last updated: ${lastUpdate} ET`);
404
+ results.push(` Contract: ${status.contract}`);
405
+ results.push("");
406
+ }
407
+ catch (err) {
408
+ const msg = err instanceof Error ? err.message : "Unknown error";
409
+ results.push(`${METAL_LABELS[metal]}`);
410
+ results.push(` Error: ${msg}`);
411
+ results.push("");
412
+ }
413
+ }
414
+ results.push(copperHolidayNote());
415
+ results.push("");
416
+ results.push("— mj41, LLC | ZJ Industries (zjindustries.com)");
417
+ return {
418
+ content: [{ type: "text", text: results.join("\n") }],
419
+ };
420
+ });
421
+ // ════════════════════════════════════════════════════════════
268
422
  // RICHARD TRACY — Blockchain Detective (mj41, LLC)
269
423
  // ════════════════════════════════════════════════════════════
270
424
  // ── investigate_wallet ──────────────────────────────────────
@@ -746,26 +900,37 @@ server.tool("about_mj41", "Learn about mj41, LLC — who they are, what they bui
746
900
  "",
747
901
  "COPPER ORACLES (ZJ Industries x MJ41)",
748
902
  " get_copper_price — Live price for Class A, B, or C",
749
- " get_all_copper_prices — All three oracles at once",
903
+ " get_all_copper_prices — All three copper oracles at once",
750
904
  " get_oracle_status — Health check and freshness",
751
905
  " Class A: COMEX spot (15-min) | Class B: Scrap (weekly) | Class C: Industrial (2x/week)",
752
906
  " On-chain on Base mainnet.",
753
907
  "",
908
+ "METALS ORACLES (ZJ Industries x MJ41)",
909
+ " get_metal_price — Live price for gold, silver, aluminum, platinum, or palladium",
910
+ " get_all_metal_prices — All 8 oracles (3 copper + 5 metals) at once",
911
+ " All on-chain on Base mainnet, auto-updated every 15 min during market hours.",
912
+ "",
754
913
  "RICHARD TRACY (Blockchain Detective by mj41)",
755
914
  " investigate_wallet — Phishing/scam/drainer investigation with full case report",
756
915
  " get_eth_price — Current ETH price in USD",
757
916
  " Web: coppertrace.vercel.app",
758
917
  "",
759
918
  "THE FIRST SIGNAL (AI News Wire by mj41)",
760
- " get_latest_news — Latest stories from 15 AI reporters",
919
+ " get_latest_news — Latest stories from 16 AI reporters",
761
920
  " get_news_by_beat — Filter by beat (commodities, AI, cyber, sports, etc.)",
762
921
  " get_story — Read full story by ID",
763
922
  " submit_story_idea — Submit to Woody Bernstein's investigation queue",
764
923
  " Web: aiwire.mj41.me",
765
924
  "",
925
+ "ACCOUNT & BILLING",
926
+ " register — Register for API access (get an API key)",
927
+ " set_api_key — Set your API key for authenticated calls",
928
+ " check_balance — Check your remaining call balance",
929
+ " buy_calls — Purchase additional API calls",
930
+ "",
766
931
  copperHolidayNote(),
767
932
  "",
768
- "— mj41, LLC",
933
+ "— mj41, LLC | v1.5.0 | 16 tools",
769
934
  ].join("\n"),
770
935
  },
771
936
  ],
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mj41-mcp",
3
- "version": "1.4.0",
4
- "description": "MJ41 MCP Server — Agent gateway for mj41, LLC. Live copper price oracles (COMEX/scrap/industrial on Base L2), blockchain investigation, and AI news wire with 16 autonomous reporters.",
3
+ "version": "1.5.1",
4
+ "description": "MJ41 MCP Server — Agent gateway for mj41, LLC. Live metals oracles (copper, gold, silver, aluminum, platinum, palladium on Base L2), blockchain investigation, and AI news wire with 16 autonomous reporters.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "bin": {