mcp-gauge-x402 1.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/LICENSE +21 -0
- package/README.md +116 -0
- package/dist/index.js +256 -0
- package/package.json +56 -0
- package/server.json +17 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 CHANGCHINFU
|
|
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,116 @@
|
|
|
1
|
+
# mcp-gauge โ MCP server for GAUGE (verifiable signals, pay-per-call in USDC via x402)
|
|
2
|
+
|
|
3
|
+
[](https://glama.ai/mcp/servers/CHANGCHINFU/mcp-gauge)
|
|
4
|
+
[](./LICENSE)
|
|
5
|
+
[](https://modelcontextprotocol.io)
|
|
6
|
+
|
|
7
|
+
Give any **MCP host** (Claude Desktop, Cursor, MCP-compatible agents) access to **GAUGE**'s verifiable, screening-level signals across many domains (weather, drought, agriculture, power grid, shipping, regulatory filings, and more) โ and let the agent **pay per call in USDC on Base via [x402](https://x402.org)** (EIP-3009 gasless, **no API key, no signup**).
|
|
8
|
+
|
|
9
|
+
**Pure description** โ official-source facts (USGS / NOAA / EPA / CAMS / ERA5 / FRED / Open-Meteo Marine / SEC EDGAR) + back-testable statistics + `record_hash`, with daily Merkle roots stamped via OpenTimestamps to Bitcoin โ the stamp proves the record set existed **no later than** its `stamped_at`; it is **not** evidence about the data day itself. The agent decides. Payment settles **directly to the provider wallet**.
|
|
10
|
+
|
|
11
|
+
Backed by the GAUGE service at **https://api.truthbear.co**.
|
|
12
|
+
(The service also still answers on its previous host `https://aeml-x402.zeabur.app`; `api.truthbear.co` is the canonical URL and is what every 402 challenge advertises as the resource.)
|
|
13
|
+
|
|
14
|
+
> **Part of Truth Bear ๐ป** โ GAUGE is the data engine behind [Truth Bear](https://gauge-frontdesk.zeabur.app), the natural-language front desk for AI agents and SMBs. Ask in plain language, get the official fact + its source + a verifiable `record_hash` โ no prediction, no advice, the rest is your call. *An analyst, not a commander.* Front desk: **https://gauge-frontdesk.zeabur.app** ยท discovery: `/.well-known/x402`, `/llms.txt`.
|
|
15
|
+
|
|
16
|
+
## Why MCP + x402
|
|
17
|
+
|
|
18
|
+
- **Discovery** is free and open (MCP): any MCP host lists these tools with zero setup.
|
|
19
|
+
- **Payment** is crypto (x402): the agent pays USDC only when it calls a *paid* tool.
|
|
20
|
+
- Free tools (`gauge_catalog`, `gauge_preview`, `gauge_sample`, `gauge_river_free`) need **no wallet** โ try before you buy.
|
|
21
|
+
|
|
22
|
+
## Tools
|
|
23
|
+
|
|
24
|
+
| Tool | Price | What |
|
|
25
|
+
|---|---|---|
|
|
26
|
+
| `gauge_catalog` | free | All signals + queryable entities |
|
|
27
|
+
| `gauge_preview` | free | Coverage, pricing menu, bundle lists |
|
|
28
|
+
| `gauge_sample` | free | A full sample record (what paid looks like) |
|
|
29
|
+
| `gauge_river_free` | free | Raw US river reading (USGS site id) |
|
|
30
|
+
| `verify_signal` | **$0.01** | **Start here.** Verify one official fact before your agent acts - reading vs the official threshold ladder + 5yr percentile + source URL + offline-recomputable record_hash. 180+ signals. |
|
|
31
|
+
| `gauge_flood_risk` | **$0.01** | Hydrology/air/precip alias of `verify_signal` - same endpoint, same price |
|
|
32
|
+
| `gauge_region` | **$0.25** | City bundle: air + precipitation + river + cross-check |
|
|
33
|
+
| `gauge_crop_drought` | **$0.25** | Agriculture triangle: drought (USDM) + heat/GDD + crop VHI |
|
|
34
|
+
| `gauge_grid_stress` | **$0.25** | Power grid triangle: demand + renewables + energy inflation |
|
|
35
|
+
| `gauge_route_disruption` | **$0.25** | Shipping triangle: route disruption + sea state + AIS throughput |
|
|
36
|
+
| `gauge_filing_check` | **$0.25** | Regulatory-filing triangle: 8-K + late filing + Form 4 insider |
|
|
37
|
+
| `gauge_stablecoin_lifecycle` | **$0.25** | see the tool description (regenerated from the live 402 quote) |
|
|
38
|
+
| `gauge_rwa_lifecycle` | **$0.25** | see the tool description (regenerated from the live 402 quote) |
|
|
39
|
+
| `gauge_lrt_lifecycle` | **$0.25** | see the tool description (regenerated from the live 402 quote) |
|
|
40
|
+
| `gauge_defi_lending` | **$0.25** | see the tool description (regenerated from the live 402 quote) |
|
|
41
|
+
| `gauge_depin_network` | **$0.25** | see the tool description (regenerated from the live 402 quote) |
|
|
42
|
+
| `gauge_resolution_as_of` | **$0.01** | see the tool description (regenerated from the live 402 quote) |
|
|
43
|
+
|
|
44
|
+
Every figure above is regenerated from the live 402 quote. **The 402 challenge the endpoint returns is always authoritative.** If you drive the API with your own x402 client rather than this server, set its `maxValue` to at least **$0.25** โ the common default of $0.10 makes your client reject the bundle tools locally, before the request is ever sent. `gauge_preview` returns the current menu for free.
|
|
45
|
+
|
|
46
|
+
**130+ signals (and growing)** across hydrology, air quality, precipitation, agriculture, power grid, shipping and regulatory filing โ with **global coverage** (US plus Argentina, Brazil, China, India, Ukraine, EU and more). Check the live set anytime via the free `gauge_catalog` tool.
|
|
47
|
+
|
|
48
|
+
## Install & configure
|
|
49
|
+
|
|
50
|
+
Requires Node 18+. The MCP host runs the server over **stdio**. Install straight from GitHub โ **no npm account, no signup** (the built `dist/` is committed):
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
npx -y github:CHANGCHINFU/mcp-gauge
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### Claude Desktop
|
|
57
|
+
|
|
58
|
+
Add to `claude_desktop_config.json` (macOS: `~/Library/Application Support/Claude/`, Windows: `%APPDATA%\Claude\`):
|
|
59
|
+
|
|
60
|
+
```json
|
|
61
|
+
{
|
|
62
|
+
"mcpServers": {
|
|
63
|
+
"gauge": {
|
|
64
|
+
"command": "npx",
|
|
65
|
+
"args": ["-y", "github:CHANGCHINFU/mcp-gauge"],
|
|
66
|
+
"env": {
|
|
67
|
+
"EVM_PRIVATE_KEY": "0xYOUR_BASE_WALLET_KEY_WITH_A_LITTLE_USDC"
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Omit `EVM_PRIVATE_KEY` to use **free tools only** (catalog / preview / sample / river).
|
|
75
|
+
|
|
76
|
+
### Cursor / other MCP hosts / Claude Code
|
|
77
|
+
|
|
78
|
+
- **Claude Code**: `claude mcp add gauge -- npx -y github:CHANGCHINFU/mcp-gauge` (add `--env EVM_PRIVATE_KEY=0xโฆ` for paid tools).
|
|
79
|
+
- **Cursor / others**: command `npx -y github:CHANGCHINFU/mcp-gauge`, transport stdio, optional `EVM_PRIVATE_KEY` env.
|
|
80
|
+
|
|
81
|
+
### From source
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
git clone https://github.com/CHANGCHINFU/mcp-gauge && cd mcp-gauge
|
|
85
|
+
npm install && npm run build
|
|
86
|
+
node dist/index.js # stdio
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
> Once published to npm the package name is `mcp-gauge-x402` (`npx -y mcp-gauge-x402`); until then use the GitHub form above.
|
|
90
|
+
|
|
91
|
+
## Config (env)
|
|
92
|
+
|
|
93
|
+
| Key | Required | Description |
|
|
94
|
+
|---|---|---|
|
|
95
|
+
| `EVM_PRIVATE_KEY` | for **paid** tools | 0x Base-mainnet wallet key; needs a little USDC (EIP-3009 gasless, no ETH). |
|
|
96
|
+
| `GAUGE_BASE_URL` | no | Default `https://api.truthbear.co`. |
|
|
97
|
+
| `GAUGE_MAX_USDC` | no | Atomic per-call cap. Default `120000` ($0.12). |
|
|
98
|
+
|
|
99
|
+
> Handle the private key like any hot-wallet secret; fund it with a small USDC balance only.
|
|
100
|
+
|
|
101
|
+
## Verify (zero-trust)
|
|
102
|
+
|
|
103
|
+
Every paid record carries `record_hash` (canonical sha256). Daily Merkle roots are stamped via OpenTimestamps to Bitcoin: **the stamp proves the record set existed no later than its `stamped_at` โ it is NOT evidence about the data day itself.** Re-check via `POST /verify` or `/proof/:record_hash` at the GAUGE service; see `/gauge/anchor` for the day roots and attestation bytes (verify them with the official `ots` tool).
|
|
104
|
+
|
|
105
|
+
## Distribution (maintainers)
|
|
106
|
+
|
|
107
|
+
- **GitHub install** (primary, no npm account): users run `npx -y github:CHANGCHINFU/mcp-gauge`.
|
|
108
|
+
- **awesome-mcp-servers**: submit a PR to a curated MCP server list for discoverability (no npm needed).
|
|
109
|
+
- **MCP Registry** (optional, needs npm): publish `mcp-gauge-x402` to npm, then `server.json` is ready for the [MCP publisher](https://github.com/modelcontextprotocol/registry):
|
|
110
|
+
```bash
|
|
111
|
+
npm publish
|
|
112
|
+
mcp-publisher login github
|
|
113
|
+
mcp-publisher publish
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
MIT ยท AEML-DS Vanished-Data Exchange
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// src/index.ts
|
|
4
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
5
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
6
|
+
import { z } from "zod";
|
|
7
|
+
import { createWalletClient, http } from "viem";
|
|
8
|
+
import { privateKeyToAccount } from "viem/accounts";
|
|
9
|
+
import { base } from "viem/chains";
|
|
10
|
+
import { wrapFetchWithPayment } from "x402-fetch";
|
|
11
|
+
var BASE = (process.env.GAUGE_BASE_URL || "https://api.truthbear.co").replace(/\/$/, "");
|
|
12
|
+
var MAX = BigInt(process.env.GAUGE_MAX_USDC || "350000");
|
|
13
|
+
var DAILY_MAX = BigInt(process.env.GAUGE_DAILY_MAX_USDC || "5000000");
|
|
14
|
+
var _spendDay = "";
|
|
15
|
+
var _spentToday = 0n;
|
|
16
|
+
function assertDailyCap() {
|
|
17
|
+
const today = (/* @__PURE__ */ new Date()).toISOString().slice(0, 10);
|
|
18
|
+
if (today !== _spendDay) {
|
|
19
|
+
_spendDay = today;
|
|
20
|
+
_spentToday = 0n;
|
|
21
|
+
}
|
|
22
|
+
if (_spentToday + MAX > DAILY_MAX) {
|
|
23
|
+
throw new Error(`GAUGE daily spend cap reached (${DAILY_MAX} atomic USDC/day). Blocks runaway/prompt-injection wallet drain. Raise GAUGE_DAILY_MAX_USDC or restart to reset.`);
|
|
24
|
+
}
|
|
25
|
+
_spentToday += MAX;
|
|
26
|
+
}
|
|
27
|
+
function wallet() {
|
|
28
|
+
let pk = process.env.EVM_PRIVATE_KEY || process.env.GAUGE_PRIVATE_KEY;
|
|
29
|
+
if (!pk) return null;
|
|
30
|
+
if (!pk.startsWith("0x")) pk = "0x" + pk;
|
|
31
|
+
return createWalletClient({ account: privateKeyToAccount(pk), chain: base, transport: http() });
|
|
32
|
+
}
|
|
33
|
+
async function freeGet(path) {
|
|
34
|
+
const r = await fetch(BASE + path);
|
|
35
|
+
if (!r.ok) throw new Error(`GAUGE ${r.status}: ${(await r.text()).slice(0, 200)}`);
|
|
36
|
+
return r.json();
|
|
37
|
+
}
|
|
38
|
+
async function paidGet(path) {
|
|
39
|
+
const w = wallet();
|
|
40
|
+
if (!w) throw new Error("EVM_PRIVATE_KEY not set \u2014 paid GAUGE tools need a Base-mainnet wallet with a little USDC (x402, gasless, no API key). Set EVM_PRIVATE_KEY in this MCP server's env. Free tools (gauge_catalog/sample/preview/river_free) work without a wallet.");
|
|
41
|
+
assertDailyCap();
|
|
42
|
+
const payFetch = wrapFetchWithPayment(fetch, w, MAX);
|
|
43
|
+
const r = await payFetch(BASE + path, { method: "GET" });
|
|
44
|
+
if (!r.ok) throw new Error(`GAUGE ${r.status}: ${(await r.text()).slice(0, 200)}`);
|
|
45
|
+
return r.json();
|
|
46
|
+
}
|
|
47
|
+
var q = (s) => encodeURIComponent(s);
|
|
48
|
+
var ok = (o) => ({ content: [{ type: "text", text: typeof o === "string" ? o : JSON.stringify(o, null, 2) }] });
|
|
49
|
+
var fail = (e) => ({ content: [{ type: "text", text: "Error: " + (e?.message || String(e)) }], isError: true });
|
|
50
|
+
var server = new McpServer({ name: "gauge", version: "0.1.0" });
|
|
51
|
+
server.registerTool("gauge_catalog", {
|
|
52
|
+
title: "GAUGE catalog (free)",
|
|
53
|
+
description: "List all GAUGE signals \u2014 hydrology (river level/streamflow), air quality (AQI/PM2.5), precipitation/drought, agriculture (drought/heat/crop VHI), power grid (demand/renewables/energy inflation), shipping (route disruption/sea state/AIS throughput), regulatory filing (8-K/late filing/insider) \u2014 with the entities you can query. Free, no payment.",
|
|
54
|
+
inputSchema: {}
|
|
55
|
+
}, async () => {
|
|
56
|
+
try {
|
|
57
|
+
return ok(await freeGet("/gauge/catalog"));
|
|
58
|
+
} catch (e) {
|
|
59
|
+
return fail(e);
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
server.registerTool("gauge_preview", {
|
|
63
|
+
title: "GAUGE preview & pricing menu (free)",
|
|
64
|
+
description: "GAUGE coverage counts, \xE0-la-carte pricing menu, and the lists of region/company bundles (regions, agri_regions, grid_regions, shipping_regions, filing_watchlist). Use this to discover what to buy. Free.",
|
|
65
|
+
inputSchema: {}
|
|
66
|
+
}, async () => {
|
|
67
|
+
try {
|
|
68
|
+
return ok(await freeGet("/gauge/preview"));
|
|
69
|
+
} catch (e) {
|
|
70
|
+
return fail(e);
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
server.registerTool("gauge_sample", {
|
|
74
|
+
title: "GAUGE free sample record",
|
|
75
|
+
description: "A free full sample GAUGE record \u2014 shows exactly what a paid response contains: current reading vs official thresholds (band, distance-to-action), seasonal statistical anomaly (percentile/strata), sources + record_hash provenance. Try before you buy.",
|
|
76
|
+
inputSchema: {}
|
|
77
|
+
}, async () => {
|
|
78
|
+
try {
|
|
79
|
+
return ok(await freeGet("/gauge/sample"));
|
|
80
|
+
} catch (e) {
|
|
81
|
+
return fail(e);
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
server.registerTool("gauge_river_free", {
|
|
85
|
+
title: "Free US river reading",
|
|
86
|
+
description: "Free raw US river reading (gage height / streamflow) for a USGS site id \u2014 current/previous/change/trend/sources/record_hash. No payment. Example site 07010000 = Mississippi at St. Louis.",
|
|
87
|
+
inputSchema: {
|
|
88
|
+
entity: z.string().describe("USGS site id, e.g. 07010000"),
|
|
89
|
+
signal_id: z.enum(["hydrology.river-level", "hydrology.streamflow"]).optional().describe("default hydrology.river-level")
|
|
90
|
+
}
|
|
91
|
+
}, async ({ entity, signal_id }) => {
|
|
92
|
+
try {
|
|
93
|
+
return ok(await freeGet(`/gauge/raw?signal_id=${q(signal_id || "hydrology.river-level")}&entity=${q(entity)}`));
|
|
94
|
+
} catch (e) {
|
|
95
|
+
return fail(e);
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
server.registerTool("verify_signal", {
|
|
99
|
+
title: "Verify one official fact before you act ($0.01)",
|
|
100
|
+
description: "PRE-EXECUTION CHECK. Verify one official-source fact before your agent commits to an action - a payout, an order, a route, a filing, an alert. Returns the current official reading against the OFFICIAL threshold ladder (band, distance-to-action), a 5-year same-season percentile so you can tell routine from unusual, the source URL, and a record_hash you can recompute offline to prove the answer was not altered. 180+ signals across macro, weather, hazard, shipping, filings, crypto and lifecycle lines - this is the cheapest and most general entry point; the $0.25 *_region tools are the multi-leg audit version of the same thing. Costs $0.01 USDC on Base via x402. Free coverage check first at gauge_catalog. Descriptive only, never a forecast or advice. No data -> not billed.",
|
|
101
|
+
inputSchema: {
|
|
102
|
+
signal_id: z.string().describe("what to check, in genus.species form, e.g. hydrology.river-level, macro.unemployment, crypto.spot, earthquake.current_activity - full list free via gauge_catalog"),
|
|
103
|
+
entity: z.string().describe("which object, PAIRED WITH signal_id, e.g. 07010000 for hydrology.river-level, japan for earthquake.current_activity - valid pairs free via gauge_catalog")
|
|
104
|
+
}
|
|
105
|
+
}, async ({ signal_id, entity }) => {
|
|
106
|
+
try {
|
|
107
|
+
return ok(await paidGet(`/gauge?signal_id=${q(signal_id)}&entity=${q(entity)}`));
|
|
108
|
+
} catch (e) {
|
|
109
|
+
return fail(e);
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
server.registerTool("gauge_flood_risk", {
|
|
113
|
+
title: "Flood-risk / anomaly record ($0.01)",
|
|
114
|
+
description: "Hydrology/air/precipitation alias of verify_signal - same endpoint, same $0.01 price; prefer verify_signal for anything else. Verifiable flood-risk / anomaly record for one signal+entity: current vs official USGS/NOAA/EPA/CAMS thresholds (band, distance-to-action) + 5yr seasonal anomaly (percentile/strata) + record_hash. Costs $0.01 USDC on Base via x402. Works for hydrology/air/precip signals.",
|
|
115
|
+
inputSchema: {
|
|
116
|
+
signal_id: z.string().describe("e.g. hydrology.river-level, hydrology.streamflow, airquality.aqi, airquality.pm25, precipitation.daily, precipitation.wetness30d"),
|
|
117
|
+
entity: z.string().describe("USGS site id for rivers, or city id (e.g. us-chicago) for air/precip \u2014 see gauge_catalog")
|
|
118
|
+
}
|
|
119
|
+
}, async ({ signal_id, entity }) => {
|
|
120
|
+
try {
|
|
121
|
+
return ok(await paidGet(`/gauge?signal_id=${q(signal_id)}&entity=${q(entity)}`));
|
|
122
|
+
} catch (e) {
|
|
123
|
+
return fail(e);
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
server.registerTool("gauge_region", {
|
|
127
|
+
title: "Region bundle: air + rain + river ($0.25)",
|
|
128
|
+
description: "Three-leg region bundle for a US city: air quality + precipitation + nearby river, with cross-line corroboration narrative. Costs $0.25 USDC on Base. loc e.g. us-stlouis, us-chicago (see gauge_preview regions). Set your x402 client maxValue to at least $0.25 - the common default of $0.10 rejects this locally, before the request is sent.",
|
|
129
|
+
inputSchema: { loc: z.string().describe("city id, e.g. us-stlouis") }
|
|
130
|
+
}, async ({ loc }) => {
|
|
131
|
+
try {
|
|
132
|
+
return ok(await paidGet(`/gauge/region?loc=${q(loc)}`));
|
|
133
|
+
} catch (e) {
|
|
134
|
+
return fail(e);
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
server.registerTool("gauge_crop_drought", {
|
|
138
|
+
title: "Agriculture triangle: crop drought ($0.25)",
|
|
139
|
+
description: "Agriculture triangle for a grain region: agricultural drought (soil moisture vs official USDM D0\u2013D4) + heat/GDD + crop vegetation health (NOAA satellite VHI) + cross-validation (has drought hit the crop canopy). For ag traders & crop insurers. Costs $0.25 USDC on Base. loc e.g. us-iowa, ar-pampas, ua-ukraine. Set your x402 client maxValue to at least $0.25 - the common default of $0.10 rejects this locally, before the request is sent.",
|
|
140
|
+
inputSchema: { loc: z.string().describe("grain region id, e.g. us-iowa, ar-pampas, ua-ukraine") }
|
|
141
|
+
}, async ({ loc }) => {
|
|
142
|
+
try {
|
|
143
|
+
return ok(await paidGet(`/gauge/agri-region?loc=${q(loc)}`));
|
|
144
|
+
} catch (e) {
|
|
145
|
+
return fail(e);
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
server.registerTool("gauge_grid_stress", {
|
|
149
|
+
title: "Power grid triangle: grid stress & energy inflation ($0.25)",
|
|
150
|
+
description: "Power grid triangle for a grid region: electricity demand pressure (temperature HDD/CDD load proxy) + renewable resource (solar/wind) + energy inflation (US CPI Energy YoY) / natural gas price + cross-validation (high demand \xD7 low renewables = grid squeeze \u2192 energy inflation). For power/energy & macro/inflation traders, utilities. Costs $0.25 USDC on Base. loc e.g. us-ercot, us-caiso, eu-germany. Set your x402 client maxValue to at least $0.25 - the common default of $0.10 rejects this locally, before the request is sent.",
|
|
151
|
+
inputSchema: { loc: z.string().describe("grid region id, e.g. us-ercot, us-caiso, eu-germany") }
|
|
152
|
+
}, async ({ loc }) => {
|
|
153
|
+
try {
|
|
154
|
+
return ok(await paidGet(`/gauge/grid-region?loc=${q(loc)}`));
|
|
155
|
+
} catch (e) {
|
|
156
|
+
return fail(e);
|
|
157
|
+
}
|
|
158
|
+
});
|
|
159
|
+
server.registerTool("gauge_route_disruption", {
|
|
160
|
+
title: "Shipping triangle: route disruption & throughput ($0.25)",
|
|
161
|
+
description: "Shipping/port triangle for a chokepoint: logistics-flow disruption (WMO sea state + wind vs operational thresholds) + sea-state cause (wave decomposition: local-storm vs distant-swell) + live AIS vessel throughput (waiting vs transiting + congestion) + cross-validation. For shipping lines, commodity/freight traders, ports, marine insurers. Costs $0.25 USDC on Base. loc e.g. malacca, suez-redsea, hormuz, channel. Set your x402 client maxValue to at least $0.25 - the common default of $0.10 rejects this locally, before the request is sent.",
|
|
162
|
+
inputSchema: { loc: z.string().describe("chokepoint id, e.g. malacca, suez-redsea, hormuz, channel") }
|
|
163
|
+
}, async ({ loc }) => {
|
|
164
|
+
try {
|
|
165
|
+
return ok(await paidGet(`/gauge/shipping-region?loc=${q(loc)}`));
|
|
166
|
+
} catch (e) {
|
|
167
|
+
return fail(e);
|
|
168
|
+
}
|
|
169
|
+
});
|
|
170
|
+
server.registerTool("gauge_filing_check", {
|
|
171
|
+
title: "Regulatory-filing triangle: corporate distress & insider ($0.25)",
|
|
172
|
+
description: "Regulatory-filing triangle for a company: 8-K material events (item severity \u2014 bankruptcy/default/restatement/delisting = critical) + NT late-filing delinquency (distress leading indicator) + Form 4 insider net open-market buy/sell + cross-validation (do insiders confirm the distress by selling or contradict it by buying). All official SEC EDGAR. For event-driven/activist/short funds, quant funds, credit & distressed analysts. Costs $0.25 USDC on Base. entity = ticker e.g. AMC, CVNA, GME. Set your x402 client maxValue to at least $0.25 - the common default of $0.10 rejects this locally, before the request is sent.",
|
|
173
|
+
inputSchema: { entity: z.string().describe("ticker from watchlist, e.g. AMC, CVNA, GME, BA (see gauge_preview filing_watchlist)") }
|
|
174
|
+
}, async ({ entity }) => {
|
|
175
|
+
try {
|
|
176
|
+
return ok(await paidGet(`/gauge/filing-company?entity=${q(entity.toUpperCase())}`));
|
|
177
|
+
} catch (e) {
|
|
178
|
+
return fail(e);
|
|
179
|
+
}
|
|
180
|
+
});
|
|
181
|
+
server.registerTool("gauge_stablecoin_lifecycle", {
|
|
182
|
+
title: "Stablecoin lifecycle triangle: peg-distress & redemption flight ($0.25)",
|
|
183
|
+
description: "Verifiable stablecoin lifecycle record for one issuer: peg-distress band (current price vs the $1 anchor \u2014 distance-to-action) + redemption-flight pressure (supply/reserve/outflow dynamics) + downstream exposure cascade + cross-validation, from official/on-chain sources with record_hash. Screening-grade forensics of where a stablecoin sits in its lifecycle \u2014 not investment advice, no buy/sell framing. Costs $0.25 USDC on Base via x402. entity e.g. terrausd-ust, usdc-circle, usdt. Set your x402 client maxValue to at least $0.25 - the common default of $0.10 rejects this locally, before the request is sent.",
|
|
184
|
+
inputSchema: { entity: z.string().describe("stablecoin id, e.g. terrausd-ust, usdc-circle, usdt (see gauge_catalog)") }
|
|
185
|
+
}, async ({ entity }) => {
|
|
186
|
+
try {
|
|
187
|
+
return ok(await paidGet(`/gauge/stablecoin-region?entity=${q(entity)}`));
|
|
188
|
+
} catch (e) {
|
|
189
|
+
return fail(e);
|
|
190
|
+
}
|
|
191
|
+
});
|
|
192
|
+
server.registerTool("gauge_rwa_lifecycle", {
|
|
193
|
+
title: "Tokenized RWA lifecycle triangle: redemption pressure & exposure cascade ($0.25)",
|
|
194
|
+
description: "Verifiable tokenized real-world-asset (RWA) issuer lifecycle record: issuer lifecycle band + redemption pressure (NAV vs on-chain supply, outflow) + exposure cascade to downstream holders/protocols + cross-validation, from official/on-chain sources with record_hash. Screening-grade forensics of a tokenized-asset issuer's lifecycle position \u2014 not investment advice, no buy/sell framing. Costs $0.25 USDC on Base via x402. entity e.g. blackrock-buidl, ondo-ousg. Set your x402 client maxValue to at least $0.25 - the common default of $0.10 rejects this locally, before the request is sent.",
|
|
195
|
+
inputSchema: { entity: z.string().describe("RWA issuer id, e.g. blackrock-buidl, ondo-ousg (see gauge_catalog)") }
|
|
196
|
+
}, async ({ entity }) => {
|
|
197
|
+
try {
|
|
198
|
+
return ok(await paidGet(`/gauge/rwa-region?entity=${q(entity)}`));
|
|
199
|
+
} catch (e) {
|
|
200
|
+
return fail(e);
|
|
201
|
+
}
|
|
202
|
+
});
|
|
203
|
+
server.registerTool("gauge_lrt_lifecycle", {
|
|
204
|
+
title: "Liquid-restaking (LRT) lifecycle triangle: redemption queue & collateral cascade ($0.25)",
|
|
205
|
+
description: "Verifiable liquid-restaking-token (LRT) lifecycle record: lifecycle band anchored to ETH-NAV (NOT $1) + redemption-queue pressure (withdrawal backlog, discount-to-NAV) + collateral cascade to protocols using the LRT as collateral + cross-validation, from official/on-chain sources with record_hash. Screening-grade forensics of where an LRT sits in its lifecycle \u2014 not investment advice, no buy/sell framing. Costs $0.25 USDC on Base via x402. entity e.g. etherfi-weeth, renzo-ezeth. Set your x402 client maxValue to at least $0.25 - the common default of $0.10 rejects this locally, before the request is sent.",
|
|
206
|
+
inputSchema: { entity: z.string().describe("LRT id, e.g. etherfi-weeth, renzo-ezeth (see gauge_catalog)") }
|
|
207
|
+
}, async ({ entity }) => {
|
|
208
|
+
try {
|
|
209
|
+
return ok(await paidGet(`/gauge/lrt-region?entity=${q(entity)}`));
|
|
210
|
+
} catch (e) {
|
|
211
|
+
return fail(e);
|
|
212
|
+
}
|
|
213
|
+
});
|
|
214
|
+
server.registerTool("gauge_defi_lending", {
|
|
215
|
+
title: "DeFi lending protocol lifecycle triangle: bad-debt stress & contagion ($0.25)",
|
|
216
|
+
description: "Verifiable DeFi lending-protocol lifecycle record: protocol lifecycle band + bad-debt stress (utilization, insolvency/underwater-position pressure) + contagion cascade to correlated protocols and collateral + cross-validation, from official/on-chain sources with record_hash. Screening-grade forensics of a lending protocol's lifecycle position \u2014 not investment advice, no buy/sell framing. Costs $0.25 USDC on Base via x402. entity = protocol id (see gauge_catalog). Set your x402 client maxValue to at least $0.25 - the common default of $0.10 rejects this locally, before the request is sent.",
|
|
217
|
+
inputSchema: { entity: z.string().describe("DeFi lending protocol id (see gauge_catalog)") }
|
|
218
|
+
}, async ({ entity }) => {
|
|
219
|
+
try {
|
|
220
|
+
return ok(await paidGet(`/gauge/defilending-region?entity=${q(entity)}`));
|
|
221
|
+
} catch (e) {
|
|
222
|
+
return fail(e);
|
|
223
|
+
}
|
|
224
|
+
});
|
|
225
|
+
server.registerTool("gauge_depin_network", {
|
|
226
|
+
title: "DePIN network lifecycle triangle: reward churn & downstream exposure ($0.25)",
|
|
227
|
+
description: "Verifiable DePIN (decentralized physical infrastructure) network lifecycle record: network-liveness lifecycle band (active nodes/coverage/throughput) + reward-churn pressure (emissions vs participation, node attrition) + downstream exposure cascade + cross-validation, from official/on-chain sources with record_hash. Screening-grade forensics of a DePIN network's lifecycle position \u2014 not investment advice, no buy/sell framing. Costs $0.25 USDC on Base via x402. entity e.g. helium, render, filecoin. Set your x402 client maxValue to at least $0.25 - the common default of $0.10 rejects this locally, before the request is sent.",
|
|
228
|
+
inputSchema: { entity: z.string().describe("DePIN network id, e.g. helium, render, filecoin (see gauge_catalog)") }
|
|
229
|
+
}, async ({ entity }) => {
|
|
230
|
+
try {
|
|
231
|
+
return ok(await paidGet(`/gauge/depin-region?entity=${q(entity)}`));
|
|
232
|
+
} catch (e) {
|
|
233
|
+
return fail(e);
|
|
234
|
+
}
|
|
235
|
+
});
|
|
236
|
+
server.registerTool("gauge_resolution_as_of", {
|
|
237
|
+
title: "Proposer-feed resolution: official fact + evidence + source-agreement confidence ($0.01)",
|
|
238
|
+
description: "Resolves a prediction-market question to the OFFICIAL FACT for an issuer/form. Returns the official answer (boolean) + a verifiable evidence_url + source_tier + a source-AGREEMENT confidence in [0,1] + _citation. This is the recorded official fact and how strongly official sources agree on it \u2014 it is NOT a prediction of the market outcome, and the confidence is NOT a probability that the market resolves yes. Honest-fails with no charge ({ answer:null, confidence:0, no_charge:true, note }) when the fact is not officially determinable as of the cutoff. Screening-grade, official sources only. Costs $0.01 USDC on Base via x402 (no charge on honest-fail).",
|
|
239
|
+
inputSchema: {
|
|
240
|
+
issuer: z.string().describe("the entity/issuer the question is about (e.g. a ticker or issuer id)"),
|
|
241
|
+
form: z.string().optional().describe("the official form/event type to resolve against (e.g. a filing form), if applicable"),
|
|
242
|
+
as_of: z.string().optional().describe("optional cutoff timestamp \u2014 resolve the fact as known at this instant (ISO 8601)")
|
|
243
|
+
}
|
|
244
|
+
}, async ({ issuer, form, as_of }) => {
|
|
245
|
+
try {
|
|
246
|
+
const params = [`issuer=${q(issuer)}`];
|
|
247
|
+
if (form) params.push(`form=${q(form)}`);
|
|
248
|
+
if (as_of) params.push(`as_of=${q(as_of)}`);
|
|
249
|
+
return ok(await paidGet(`/resolve/proposer?${params.join("&")}`));
|
|
250
|
+
} catch (e) {
|
|
251
|
+
return fail(e);
|
|
252
|
+
}
|
|
253
|
+
});
|
|
254
|
+
var transport = new StdioServerTransport();
|
|
255
|
+
await server.connect(transport);
|
|
256
|
+
console.error("mcp-gauge running (stdio). Base=" + BASE + " wallet=" + (wallet() ? "set" : "unset \u2014 free tools only"));
|
package/package.json
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "mcp-gauge-x402",
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"mcpName": "io.github.CHANGCHINFU/mcp-gauge",
|
|
5
|
+
"description": "MCP server for GAUGE โ verifiable environmental, agriculture, power-grid, shipping & regulatory-filing signals for AI agents. Free discovery tools; paid screening-level records pay-per-call in USDC on Base via x402 (no API key). Official sources (USGS/NOAA/EPA/ERA5/FRED/Marine/SEC-EDGAR) + record_hash provenance.",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"bin": {
|
|
8
|
+
"mcp-gauge-x402": "dist/index.js"
|
|
9
|
+
},
|
|
10
|
+
"main": "dist/index.js",
|
|
11
|
+
"files": [
|
|
12
|
+
"dist",
|
|
13
|
+
"README.md",
|
|
14
|
+
"server.json"
|
|
15
|
+
],
|
|
16
|
+
"scripts": {
|
|
17
|
+
"build": "tsup",
|
|
18
|
+
"start": "node dist/index.js",
|
|
19
|
+
"dev": "node dist/index.js"
|
|
20
|
+
},
|
|
21
|
+
"dependencies": {
|
|
22
|
+
"@modelcontextprotocol/sdk": "^1.12.0",
|
|
23
|
+
"viem": "^2.21.0",
|
|
24
|
+
"x402-fetch": "^0.4.0",
|
|
25
|
+
"zod": "^3.23.8"
|
|
26
|
+
},
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
"tsup": "^8.3.0",
|
|
29
|
+
"typescript": "^5.6.0"
|
|
30
|
+
},
|
|
31
|
+
"keywords": [
|
|
32
|
+
"mcp",
|
|
33
|
+
"model-context-protocol",
|
|
34
|
+
"mcp-server",
|
|
35
|
+
"x402",
|
|
36
|
+
"usdc",
|
|
37
|
+
"base",
|
|
38
|
+
"ai-agent",
|
|
39
|
+
"pay-per-call",
|
|
40
|
+
"verifiable-data",
|
|
41
|
+
"flood-risk",
|
|
42
|
+
"drought",
|
|
43
|
+
"air-quality",
|
|
44
|
+
"power-grid",
|
|
45
|
+
"energy-inflation",
|
|
46
|
+
"shipping",
|
|
47
|
+
"port-congestion",
|
|
48
|
+
"sec-edgar",
|
|
49
|
+
"insider-trading",
|
|
50
|
+
"corporate-distress",
|
|
51
|
+
"record-hash",
|
|
52
|
+
"opentimestamps"
|
|
53
|
+
],
|
|
54
|
+
"license": "MIT",
|
|
55
|
+
"author": "AEML-DS Vanished-Data Exchange"
|
|
56
|
+
}
|
package/server.json
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
|
|
3
|
+
"name": "io.github.CHANGCHINFU/mcp-gauge",
|
|
4
|
+
"description": "US government data (USGS/NOAA/SEC/FDA) with cryptographic proof; x402 pay-per-call, no API key",
|
|
5
|
+
"version": "1.0.1",
|
|
6
|
+
"websiteUrl": "https://truthbear.co",
|
|
7
|
+
"repository": {
|
|
8
|
+
"url": "https://github.com/CHANGCHINFU/mcp-gauge",
|
|
9
|
+
"source": "github"
|
|
10
|
+
},
|
|
11
|
+
"remotes": [
|
|
12
|
+
{
|
|
13
|
+
"type": "streamable-http",
|
|
14
|
+
"url": "https://api.truthbear.co/mcp"
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
}
|