rdx-data-mcp 2.1.0__py3-none-any.whl

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.
@@ -0,0 +1,5 @@
1
+ """rdx-data-mcp: MCP server for the RDX Data Network (rdxdata.xyz)."""
2
+
3
+ __version__ = "2.1.0"
4
+
5
+ __all__ = ["__version__"]
@@ -0,0 +1,6 @@
1
+ """Allow ``python -m rdx_data_mcp`` as an alternative to the ``rdx-data-mcp`` script."""
2
+
3
+ from .server import main
4
+
5
+ if __name__ == "__main__":
6
+ main()
@@ -0,0 +1,401 @@
1
+ """Static catalog of the RDX Data Network tools.
2
+
3
+ Single source of truth for endpoints, per-call prices, categories and the
4
+ free ``list_rdx_catalog`` directory. ``server.py`` builds its requests from
5
+ these entries and ``payment.py`` receives the price from them.
6
+ """
7
+
8
+ from __future__ import annotations
9
+
10
+ from dataclasses import dataclass
11
+ from decimal import Decimal
12
+ from typing import Any
13
+
14
+ ROOT_DOMAIN = "rdxdata.xyz"
15
+
16
+ MARKET = "Market & Trading Alpha"
17
+ WEB3 = "Web3 Security & Infrastructure"
18
+ UTILITIES = "AI & Web Utilities"
19
+ COMMODITIES = "Commodities & Travel"
20
+
21
+ CATEGORIES = (MARKET, WEB3, UTILITIES, COMMODITIES)
22
+
23
+
24
+ @dataclass(frozen=True)
25
+ class RdxTool:
26
+ """One paid RDX endpoint exposed as an MCP tool."""
27
+
28
+ name: str
29
+ category: str
30
+ service: str # sub-domain label, e.g. "pulse" -> pulse.rdxdata.xyz
31
+ path: str
32
+ price_usdc: Decimal
33
+ summary: str
34
+ freshness: str
35
+ inputs: str
36
+ method: str = "GET"
37
+ # (key, human-readable condition, path template) alternative endpoints.
38
+ variants: tuple[tuple[str, str, str], ...] = ()
39
+ kya_free_tier: bool = False
40
+
41
+ @property
42
+ def host(self) -> str:
43
+ return f"{self.service}.{ROOT_DOMAIN}"
44
+
45
+ @property
46
+ def base_url(self) -> str:
47
+ return f"https://{self.host}"
48
+
49
+ @property
50
+ def url(self) -> str:
51
+ return self.base_url + self.path
52
+
53
+ def variant_path(self, key: str) -> str:
54
+ for variant_key, _when, path in self.variants:
55
+ if variant_key == key:
56
+ return path
57
+ raise KeyError(f"{self.name} has no endpoint variant {key!r}")
58
+
59
+ def price_label(self) -> str:
60
+ return "$" + format(self.price_usdc, "f")
61
+
62
+ def to_dict(self) -> dict[str, Any]:
63
+ entry: dict[str, Any] = {
64
+ "tool": self.name,
65
+ "category": self.category,
66
+ "service": self.host,
67
+ "method": self.method,
68
+ "endpoint": self.url,
69
+ "alternate_endpoints": [
70
+ {"when": when, "endpoint": self.base_url + path}
71
+ for _key, when, path in self.variants
72
+ ],
73
+ "price_usdc": format(self.price_usdc, "f"),
74
+ "summary": self.summary,
75
+ "data_freshness": self.freshness,
76
+ "inputs": self.inputs,
77
+ }
78
+ if self.kya_free_tier:
79
+ entry["free_with_skyfire_kya"] = True
80
+ return entry
81
+
82
+
83
+ _P = Decimal
84
+
85
+ TOOLS: tuple[RdxTool, ...] = (
86
+ # --- Market & Trading Alpha -------------------------------------------
87
+ RdxTool(
88
+ name="get_crypto_market_pulse",
89
+ category=MARKET,
90
+ service="pulse",
91
+ path="/v1/pulse/market",
92
+ price_usdc=_P("0.001"),
93
+ summary="BTC, ETH and SOL prices, the Fear & Greed Index and BTC/ETH dominance.",
94
+ freshness="Live market snapshot (near real-time); see the timestamp in the response.",
95
+ inputs="none",
96
+ kya_free_tier=True,
97
+ ),
98
+ RdxTool(
99
+ name="get_global_fx_and_macro_rates",
100
+ category=MARKET,
101
+ service="macro-fx",
102
+ path="/v1/macro/fx-rates",
103
+ price_usdc=_P("0.005"),
104
+ summary=(
105
+ "ECB and central-bank fiat exchange rates (USD base: EUR, GBP, JPY, CHF, CNY, CAD, AUD, "
106
+ "VND, SGD, KRW, INR, THB, BRL, MXN) plus World Bank CPI inflation and GDP growth "
107
+ "benchmarks for the USA, Eurozone, Japan and Vietnam."
108
+ ),
109
+ freshness=(
110
+ "Cached feed refreshed about every 30 minutes; ECB reference rates change once per "
111
+ "business day and World Bank indicators are annual. See the timestamp in the response."
112
+ ),
113
+ inputs="none",
114
+ ),
115
+ RdxTool(
116
+ name="convert_fiat_currency_pair",
117
+ category=MARKET,
118
+ service="macro-fx",
119
+ path="/v1/macro/convert",
120
+ price_usdc=_P("0.005"),
121
+ summary="Exact cross-rate conversion of an amount between two fiat currencies (for example USD to VND).",
122
+ freshness="Same cached feed as get_global_fx_and_macro_rates; ECB reference rates update once per business day.",
123
+ inputs="from_currency (ISO 4217 code, default 'USD'), to_currency (default 'VND'), amount (number > 0, default 100.0)",
124
+ ),
125
+ RdxTool(
126
+ name="get_social_sentiment_velocity",
127
+ category=MARKET,
128
+ service="sentiment",
129
+ path="/v1/sentiment/velocity",
130
+ price_usdc=_P("0.03"),
131
+ summary="Narrative velocity across Hacker News, GitHub and crypto social.",
132
+ freshness="Rolling-window snapshot refreshed periodically; see the timestamp in the response.",
133
+ inputs="category (optional): narrative category slug",
134
+ variants=(("category", "when `category` is provided", "/v1/sentiment/narratives/{category}"),),
135
+ ),
136
+ RdxTool(
137
+ name="get_web3_grants_and_airdrop_alpha",
138
+ category=MARKET,
139
+ service="alpha",
140
+ path="/v1/alpha/opportunities",
141
+ price_usdc=_P("0.03"),
142
+ summary="Tokenless high-TVL protocols (airdrop candidates) and open developer bounties.",
143
+ freshness="Periodically refreshed opportunity list; see the timestamp in the response.",
144
+ inputs="opportunity_type (optional): filter such as 'airdrop' or 'bounty'",
145
+ ),
146
+ RdxTool(
147
+ name="get_prediction_market_arbitrage",
148
+ category=MARKET,
149
+ service="predict",
150
+ path="/v1/markets/prediction-trends",
151
+ price_usdc=_P("0.05"),
152
+ summary="Matched Polymarket vs Kalshi events with price spreads.",
153
+ freshness="Cached near-real-time snapshot; pass refresh=true to force a fresh pull.",
154
+ inputs="refresh (optional bool)",
155
+ ),
156
+ RdxTool(
157
+ name="get_rwa_premium_analytics",
158
+ category=MARKET,
159
+ service="rwa",
160
+ path="/v1/rwa/analytics",
161
+ price_usdc=_P("0.05"),
162
+ summary="NAV premium/discount and liquidity for tokenized real-world assets (Ondo, PAXG).",
163
+ freshness="Near-real-time snapshot; see the timestamp in the response.",
164
+ inputs="token_id (optional): a single RWA token",
165
+ variants=(("token_id", "when `token_id` is provided", "/v1/rwa/tokens/{token_id}"),),
166
+ ),
167
+ RdxTool(
168
+ name="get_dex_stablecoin_arbitrage",
169
+ category=MARKET,
170
+ service="dex",
171
+ path="/v1/dex/arbitrage",
172
+ price_usdc=_P("0.05"),
173
+ summary="Cross-chain USDC/USDT de-peg detection and DEX routes.",
174
+ freshness="Near-real-time snapshot; see the timestamp in the response.",
175
+ inputs="chain (optional): chain slug",
176
+ variants=(("chain", "when `chain` is provided", "/v1/dex/chain/{chain}"),),
177
+ ),
178
+ RdxTool(
179
+ name="get_funding_rate_arbitrage",
180
+ category=MARKET,
181
+ service="funding",
182
+ path="/v1/funding/arbitrage",
183
+ price_usdc=_P("0.10"),
184
+ summary=(
185
+ "BTC/ETH/SOL perpetual funding-rate spreads across Binance, Hyperliquid and dYdX, "
186
+ "net of fees over a holding period."
187
+ ),
188
+ freshness="Near-real-time snapshot; see the timestamp in the response.",
189
+ inputs="fee_bps (float, default 0.0), hold_hours (int, default 8)",
190
+ ),
191
+ RdxTool(
192
+ name="get_expired_domains_alpha",
193
+ category=MARKET,
194
+ service="domains",
195
+ path="/v1/domains/alpha",
196
+ price_usdc=_P("0.02"),
197
+ summary="AI-scored high-value pending-delete (expiring) domains.",
198
+ freshness="Periodically refreshed list; see the timestamp in the response.",
199
+ inputs="none",
200
+ ),
201
+ # --- Web3 Security & Infrastructure -----------------------------------
202
+ RdxTool(
203
+ name="score_web3_wallet_intelligence",
204
+ category=WEB3,
205
+ service="wallet-intel",
206
+ path="/v1/wallet/score",
207
+ price_usdc=_P("0.01"),
208
+ summary="Base/ETH balance, transaction history, Sybil risk and persona trust score for a wallet.",
209
+ freshness="On-chain data as of request time (near real-time).",
210
+ inputs="address: EVM (0x...) or Solana wallet address",
211
+ ),
212
+ RdxTool(
213
+ name="get_cross_chain_gas_and_mev_oracle",
214
+ category=WEB3,
215
+ service="gas",
216
+ path="/v1/gas/oracle",
217
+ price_usdc=_P("0.01"),
218
+ summary="Gas prices and MEV risk for Base, Arbitrum, Optimism, Solana and Ethereum.",
219
+ freshness="Cached near-real-time snapshot; see the timestamp in the response.",
220
+ inputs="chain (optional): chain slug such as 'base', 'arbitrum', 'optimism', 'solana', 'ethereum'",
221
+ variants=(("chain", "when `chain` is provided", "/v1/gas/chain/{chain}"),),
222
+ ),
223
+ RdxTool(
224
+ name="audit_smart_contract_security",
225
+ category=WEB3,
226
+ service="security",
227
+ path="/v1/security/trending-audits",
228
+ price_usdc=_P("0.02"),
229
+ summary=(
230
+ "Honeypot and rug-pull scanner for Base and Solana tokens; "
231
+ "without an address it returns the trending audits."
232
+ ),
233
+ freshness="Results from the latest scan cycle; see the timestamp in the response.",
234
+ inputs="contract_address (optional): EVM (0x...) or Solana token address",
235
+ variants=(("contract_address", "when `contract_address` is provided", "/v1/security/token/{contract_address}"),),
236
+ ),
237
+ RdxTool(
238
+ name="get_depin_gpu_compute_prices",
239
+ category=WEB3,
240
+ service="compute",
241
+ path="/v1/compute/gpu-prices",
242
+ price_usdc=_P("0.02"),
243
+ summary="DePIN GPU compute prices (H100, A100, RTX 4090) across io.net, Akash and Render.",
244
+ freshness="Periodically refreshed marketplace snapshot; see the timestamp in the response.",
245
+ inputs="none",
246
+ ),
247
+ # --- AI & Web Utilities -----------------------------------------------
248
+ RdxTool(
249
+ name="extract_clean_web_markdown",
250
+ category=UTILITIES,
251
+ service="reader",
252
+ path="/v1/reader/extract",
253
+ price_usdc=_P("0.005"),
254
+ summary="Converts any public webpage into clean, LLM-ready Markdown.",
255
+ freshness="Fetched live at request time.",
256
+ inputs="url: http(s) page to convert",
257
+ ),
258
+ RdxTool(
259
+ name="audit_package_dependency",
260
+ category=UTILITIES,
261
+ service="deps",
262
+ path="/v1/deps/audit",
263
+ price_usdc=_P("0.005"),
264
+ summary="Checks a package for known CVEs via Google OSV.dev and reports the latest registry version.",
265
+ freshness="Live lookup against OSV.dev and the package registry at request time.",
266
+ inputs="ecosystem (default 'PyPI'), package (default 'fastapi'), version (optional)",
267
+ ),
268
+ RdxTool(
269
+ name="evaluate_math_or_quant_expression",
270
+ category=UTILITIES,
271
+ service="sandbox",
272
+ path="/v1/sandbox/eval",
273
+ price_usdc=_P("0.002"),
274
+ summary="Deterministic SymPy/NumPy math coprocessor for exact and numeric expressions.",
275
+ freshness="Computed on demand (deterministic, no staleness).",
276
+ inputs="expression, precision (default 12)",
277
+ ),
278
+ RdxTool(
279
+ name="calculate_quant_finance_model",
280
+ category=UTILITIES,
281
+ service="sandbox",
282
+ path="/v1/sandbox/quant",
283
+ price_usdc=_P("0.002"),
284
+ summary="Quant finance calculators: Kelly Criterion, AMM slippage, compound APY and Black-Scholes.",
285
+ freshness="Computed on demand (deterministic, no staleness).",
286
+ inputs="calc_type, params (object of model inputs)",
287
+ method="POST",
288
+ ),
289
+ RdxTool(
290
+ name="verify_citation_or_url",
291
+ category=UTILITIES,
292
+ service="verify",
293
+ path="/v1/verify/source",
294
+ price_usdc=_P("0.01"),
295
+ summary="Anti-hallucination grounding: URL liveness plus Crossref/Wikipedia citation checks.",
296
+ freshness="Checked live at request time.",
297
+ inputs="url, query and/or doi (at least one)",
298
+ ),
299
+ RdxTool(
300
+ name="check_product_price_and_stock",
301
+ category=UTILITIES,
302
+ service="price-watch",
303
+ path="/v1/price/check",
304
+ price_usdc=_P("0.01"),
305
+ summary="Real-time price and stock/inventory from Schema.org and OpenGraph product data.",
306
+ freshness="Fetched live at request time.",
307
+ inputs="url: product page",
308
+ ),
309
+ RdxTool(
310
+ name="get_llm_cost_routing_recommendations",
311
+ category=UTILITIES,
312
+ service="llm-router",
313
+ path="/v1/router/recommendations",
314
+ price_usdc=_P("0.01"),
315
+ summary="The cheapest high-performing LLM for each task type.",
316
+ freshness="Periodically refreshed benchmark and pricing snapshot.",
317
+ inputs="task_type (optional): e.g. 'coding', 'summarization'",
318
+ variants=(("task_type", "when `task_type` is provided", "/v1/router/task/{task_type}"),),
319
+ ),
320
+ RdxTool(
321
+ name="audit_domain_trust_and_ssl",
322
+ category=UTILITIES,
323
+ service="domain-trust",
324
+ path="/v1/domain/trust",
325
+ price_usdc=_P("0.005"),
326
+ summary="Domain trust check: RDAP domain age, TLS/SSL certificate validity, SPF/DMARC records and URLhaus anti-phishing status.",
327
+ freshness="Checked on demand (RDAP, TLS, DNS and URLhaus); see the timestamp in the response.",
328
+ inputs="domain: hostname such as 'example.com' (a full URL is reduced to its hostname)",
329
+ ),
330
+ RdxTool(
331
+ name="parse_remote_pdf_document",
332
+ category=UTILITIES,
333
+ service="doc-parse",
334
+ path="/v1/doc/parse-pdf",
335
+ price_usdc=_P("0.01"),
336
+ summary=(
337
+ "Page-by-page text and metadata (title, author, page count, word count, estimated tokens) "
338
+ "from any public PDF URL (15 MB limit)."
339
+ ),
340
+ freshness="Fetched and parsed on demand; results may be cached for up to 24 hours per URL.",
341
+ inputs="url: public PDF address, max_pages (int, default 30, range 1-200)",
342
+ ),
343
+ # --- Commodities & Travel ---------------------------------------------
344
+ RdxTool(
345
+ name="get_global_coffee_commodities",
346
+ category=COMMODITIES,
347
+ service="coffee",
348
+ path="/v1/coffee/global",
349
+ price_usdc=_P("0.01"),
350
+ summary="Arabica and Robusta prices plus Vietnam farmgate prices (VND/kg).",
351
+ freshness="Periodically refreshed commodity snapshot (not tick-by-tick).",
352
+ inputs="region: 'global' (default) or 'vietnam'",
353
+ variants=(("vietnam", "when `region` is 'vietnam'", "/v1/coffee/vietnam"),),
354
+ ),
355
+ RdxTool(
356
+ name="get_travel_flash_deals",
357
+ category=COMMODITIES,
358
+ service="travel",
359
+ path="/v1/travel/flash-deals",
360
+ price_usdc=_P("0.05"),
361
+ summary="Flight error fares and hotel flash discounts.",
362
+ freshness="Periodically refreshed; deals can expire within hours.",
363
+ inputs="region (optional): region slug",
364
+ variants=(("region", "when `region` is provided", "/v1/travel/region/{region}"),),
365
+ ),
366
+ )
367
+
368
+ BY_NAME: dict[str, RdxTool] = {tool.name: tool for tool in TOOLS}
369
+
370
+
371
+ def service_count() -> int:
372
+ return len({tool.service for tool in TOOLS})
373
+
374
+
375
+ def build_catalog() -> dict[str, Any]:
376
+ """Return the free, machine-readable directory used by ``list_rdx_catalog``."""
377
+ prices = [tool.price_usdc for tool in TOOLS]
378
+ return {
379
+ "network": "RDX Data Network",
380
+ "homepage": f"https://{ROOT_DOMAIN}",
381
+ "tool_count": len(TOOLS),
382
+ "service_count": service_count(),
383
+ "currency": "USDC",
384
+ "price_range_usdc_per_call": {
385
+ "min": format(min(prices), "f"),
386
+ "max": format(max(prices), "f"),
387
+ },
388
+ "free_tier": (
389
+ "get_crypto_market_pulse is free with a Skyfire KYA token, and some services "
390
+ "(for example macro-fx, doc-parse and gas) return a free preview to KYA tokens: "
391
+ "set RDX_SKYFIRE_TOKEN_TYPE=kya to request previews. "
392
+ "list_rdx_catalog is always free."
393
+ ),
394
+ "categories": [
395
+ {
396
+ "name": category,
397
+ "tools": [tool.to_dict() for tool in TOOLS if tool.category == category],
398
+ }
399
+ for category in CATEGORIES
400
+ ],
401
+ }