rdx-data-mcp
# rdx-data-mcp
An [MCP](https://modelcontextprotocol.io) server that gives autonomous AI agents (Claude Code, Claude Desktop, Cursor, Windsurf, OpenAI Agents) one tool gateway to the **RDX Data Network** at [rdxdata.xyz](https://rdxdata.xyz): live crypto and macro data, Web3 security, web utilities, commodities and travel.
Agents discover the tools for free, then pay per call (from **$0.001 to $0.10 USDC**) with no human in the loop. Payment is settled under the hood through either rail:
- **Skyfire**: set `SKYFIRE_API_KEY`. Supports `kya` (free preview), `pay` and `kya-pay` tokens.
- **Coinbase x402 v2 / AgentCash**: set `BUYER_PRIVATE_KEY`. Pays in USDC on Base mainnet.
> **25 paid tools across 23 `*.rdxdata.xyz` services, plus 1 free discovery tool** (`list_rdx_catalog`).
> Two services expose two tools each: `sandbox` (math + quant) and `macro-fx` (FX rates + conversion).
## What's new in 2.1.0
- **`macro-fx.rdxdata.xyz`**: `get_global_fx_and_macro_rates` and `convert_fiat_currency_pair` (the RDX Global FX & Macro Oracle).
- **`doc-parse.rdxdata.xyz`**: `parse_remote_pdf_document`.
- **`domain-trust.rdxdata.xyz`**: `audit_domain_trust_and_ssl`.
- Request timeout raised from 20 s to 25 s.
## Services and tools
### Market & Trading Alpha
| Tool | Service | Cost (USDC) | What it returns |
|---|---|---|---|
| `get_crypto_market_pulse` | `pulse` | $0.001 (free with Skyfire KYA) | BTC/ETH/SOL prices, Fear & Greed Index, dominance |
| `get_global_fx_and_macro_rates` | `macro-fx` | $0.005 | ECB and central-bank FX rates plus World Bank CPI inflation and GDP growth |
| `convert_fiat_currency_pair` | `macro-fx` | $0.005 | Exact cross-rate conversion between two fiat currencies |
| `get_expired_domains_alpha` | `domains` | $0.02 | AI-scored high-value pending-delete domains |
| `get_social_sentiment_velocity` | `sentiment` | $0.03 | Hacker News, GitHub and crypto narrative velocity |
| `get_web3_grants_and_airdrop_alpha` | `alpha` | $0.03 | Tokenless high-TVL protocols and open dev bounties |
| `get_prediction_market_arbitrage` | `predict` | $0.05 | Polymarket vs Kalshi matched-event spreads |
| `get_rwa_premium_analytics` | `rwa` | $0.05 | Ondo / PAXG NAV premium or discount and liquidity |
| `get_dex_stablecoin_arbitrage` | `dex` | $0.05 | Cross-chain USDC/USDT de-pegs and DEX routes |
| `get_funding_rate_arbitrage` | `funding` | $0.10 | BTC/ETH/SOL perp funding spreads (Binance, Hyperliquid, dYdX) |
### Web3 Security & Infrastructure
| Tool | Service | Cost (USDC) | What it returns |
|---|---|---|---|
| `score_web3_wallet_intelligence` | `wallet-intel` | $0.01 | Base/ETH balance, tx history, Sybil and persona trust score |
| `get_cross_chain_gas_and_mev_oracle` | `gas` | $0.01 | Base, Arbitrum, Optimism, Solana, ETH gas and MEV risk |
| `audit_smart_contract_security` | `security` | $0.02 | Base/Solana honeypot and rug-pull scanner |
| `get_depin_gpu_compute_prices` | `compute` | $0.02 | H100, A100, RTX 4090 prices across io.net, Akash, Render |
### AI & Web Utilities
| Tool | Service | Cost (USDC) | What it returns |
|---|---|---|---|
| `evaluate_math_or_quant_expression` | `sandbox` | $0.002 | Deterministic SymPy/NumPy math results |
| `calculate_quant_finance_model` | `sandbox` | $0.002 | Kelly Criterion, AMM slippage, compound APY, Black-Scholes |
| `extract_clean_web_markdown` | `reader` | $0.005 | Any webpage as clean, LLM-ready Markdown |
| `audit_package_dependency` | `deps` | $0.005 | CVEs via OSV.dev plus latest registry version |
| `audit_domain_trust_and_ssl` | `domain-trust` | $0.005 | RDAP domain age, TLS/SSL validity, SPF/DMARC, URLhaus phishing status |
| `parse_remote_pdf_document` | `doc-parse` | $0.01 | Page-by-page text and metadata from any public PDF URL |
| `verify_citation_or_url` | `verify` | $0.01 | URL liveness and Crossref/Wikipedia grounding |
| `check_product_price_and_stock` | `price-watch` | $0.01 | Real-time Schema.org/OpenGraph price and inventory |
| `get_llm_cost_routing_recommendations` | `llm-router` | $0.01 | Cheapest high-performing LLM per task |
### Commodities & Travel
| Tool | Service | Cost (USDC) | What it returns |
|---|---|---|---|
| `get_global_coffee_commodities` | `coffee` | $0.01 | Arabica, Robusta, Vietnam farmgate (VND/kg) |
| `get_travel_flash_deals` | `travel` | $0.05 | Flight error fares and hotel discounts |
Every service lives at `https://<service>.rdxdata.xyz`. Call `list_rdx_catalog` first (free): it returns every endpoint, price and data-freshness note, and reports whether a payment method is configured.
## Install
```bash
# no install needed with uv
uvx rdx-data-mcp
# or with pip
pip install rdx-data-mcp
rdx-data-mcp
```
Python 3.10+. Set `SKYFIRE_API_KEY`, `BUYER_PRIVATE_KEY`, or both (Skyfire is tried first). Blank values are treated as unset.
### Claude Desktop
Edit `claude_desktop_config.json` (macOS: `~/Library/Application Support/Claude/`, Windows: `%APPDATA%\Claude\`):
```json
{
"mcpServers": {
"rdx-data": {
"command": "uvx",
"args": ["rdx-data-mcp"],
"env": {
"SKYFIRE_API_KEY": "your_skyfire_buyer_agent_api_key",
"BUYER_PRIVATE_KEY": "",
"BASE_RPC_URL": "https://rpc.ankr.com/base"
}
}
}
}
```
### Claude Code
```bash
claude mcp add rdx-data -e SKYFIRE_API_KEY=your_skyfire_buyer_agent_api_key -- uvx rdx-data-mcp
```
### Cursor
Add to `~/.cursor/mcp.json` (or `.cursor/mcp.json` in a project):
```json
{
"mcpServers": {
"rdx-data": {
"command": "uvx",
"args": ["rdx-data-mcp"],
"env": {
"BUYER_PRIVATE_KEY": "0xyour_dedicated_wallet_private_key"
}
}
}
}
```
### Windsurf
Add to `~/.codeium/windsurf/mcp_config.json`:
```json
{
"mcpServers": {
"rdx-data": {
"command": "uvx",
"args": ["rdx-data-mcp"],
"env": {
"SKYFIRE_API_KEY": "your_skyfire_buyer_agent_api_key"
}
}
}
}
```
### pip install (any client)
```json
{
"mcpServers": {
"rdx-data": {
"command": "rdx-data-mcp",
"env": {
"SKYFIRE_API_KEY": "your_skyfire_buyer_agent_api_key"
}
}
}
}
```
### OpenAI Agents SDK
```python
from agents import Agent
from agents.mcp import MCPServerStdio
async with MCPServerStdio(
params={"command": "uvx", "args": ["rdx-data-mcp"], "env": {"SKYFIRE_API_KEY": "..."}}
) as rdx:
agent = Agent(name="Analyst", instructions="Use RDX tools for live data.", mcp_servers=[rdx])
```
## Pricing
Every call is priced in USDC. There is no subscription.
| Price per call | Tools |
|---|---|
| **Free** | `list_rdx_catalog` |
| $0.001 (free with Skyfire KYA) | `get_crypto_market_pulse` |
| $0.002 | `evaluate_math_or_quant_expression`, `calculate_quant_finance_model` |
| $0.005 | `extract_clean_web_markdown`, `audit_package_dependency`, `audit_domain_trust_and_ssl`, `get_global_fx_and_macro_rates`, `convert_fiat_currency_pair` |
| $0.01 | `parse_remote_pdf_document`, `verify_citation_or_url`, `check_product_price_and_stock`, `score_web3_wallet_intelligence`, `get_cross_chain_gas_and_mev_oracle`, `get_llm_cost_routing_recommendations`, `get_global_coffee_commodities` |
| $0.02 | `audit_smart_contract_security`, `get_depin_gpu_compute_prices`, `get_expired_domains_alpha` |
| $0.03 | `get_social_sentiment_velocity`, `get_web3_grants_and_airdrop_alpha` |
| $0.05 | `get_prediction_market_arbitrage`, `get_rwa_premium_analytics`, `get_dex_stablecoin_arbitrage`, `get_travel_flash_deals` |
| $0.10 | `get_funding_rate_arbitrage` |
### Free `kya` preview tier
A Skyfire `kya` (identity-only) token costs nothing. `get_crypto_market_pulse` always uses one. Several other services also return a free preview or sample to `kya` tokens (for example FX majors on `macro-fx`, a PDF preview on `doc-parse`, a two-chain sample on `gas`). By default the server requests full paid results with a `kya-pay` token; set `RDX_SKYFIRE_TOKEN_TYPE=kya` to request previews on every call instead.
## Funding a payment method
### Option A: Skyfire (recommended)
1. Create an account at [skyfire.xyz](https://skyfire.xyz) and a **Buyer agent** (docs: [docs.skyfire.xyz](https://docs.skyfire.xyz)).
2. Fund the Buyer agent's wallet with USDC.
3. Copy the Buyer agent API key into `SKYFIRE_API_KEY`.
The server asks Skyfire for a token sized to the call price and sends it to the RDX service in the `kyapay-token` header.
Skyfire tokens for services listed in the Skyfire Directory need the seller's service ID unless your Skyfire account belongs to an organization. Provide IDs with `RDX_SKYFIRE_SERVICE_IDS`, a JSON map keyed by sub-domain, for example `{"pulse": "<service-id>", "macro-fx": "<service-id>", "doc-parse": "<service-id>"}`. If Skyfire fails for any reason, the server falls back to x402 when `BUYER_PRIVATE_KEY` is set.
### Option B: Base USDC wallet (x402 / AgentCash)
1. Create a **dedicated wallet** for the agent. Never reuse a main wallet.
2. Send it USDC on **Base mainnet** (contract `0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913`) plus a few cents of ETH on Base for gas. Most exchanges that support Base withdrawals work.
3. Put the wallet's private key in `BUYER_PRIVATE_KEY`.
## How payment works
1. Skyfire first: if `SKYFIRE_API_KEY` is set, a token is created and the request is sent with `kyapay-token`.
2. If Skyfire is not configured, or the service answers 401/402, the request is sent unauthenticated.
3. On HTTP 402 the invoice (`asset`, `payTo`, `amount`) is decoded from the Base64 `Payment-Required` header, or from the JSON body.
4. No `BUYER_PRIVATE_KEY`: the tool returns a structured `payment_required` result with the decoded invoice and exact setup steps.
5. With `BUYER_PRIVATE_KEY`: an ERC-20 USDC `transfer` is sent on Base (chain id 8453), the server waits 6 seconds, then retries the identical request with `X-402-Payment-Receipt: <tx hash>`.
Every request times out after 25 seconds. Successful results include an `_rdx_payment` field showing the protocol used and, for x402, the transaction hash. If a payment is sent but the service has not accepted the receipt yet, the tool says so and an identical retry re-submits the saved receipt instead of paying again.
## Safety
An autonomous wallet needs guard rails, so these are built in:
- Only `https://*.rdxdata.xyz` is ever called or paid.
- Only **USDC on Base mainnet** is ever sent. Testnet or other-asset invoices are refused.
- Each payment is capped at **0.25 USDC** by default (`RDX_MAX_PAYMENT_USDC`). Larger invoices are refused and nothing is paid.
- On-chain sends are serialized so concurrent calls cannot collide on the wallet nonce.
- Private keys and Skyfire keys are never logged or returned in results. Logs go to stderr.
- Tool inputs are validated before any request is made.
Use a wallet that holds only what you are willing to spend.
## Configuration
| Variable | Default | Purpose |
|---|---|---|
| `SKYFIRE_API_KEY` | unset | Skyfire Buyer agent API key (payment rail 1) |
| `BUYER_PRIVATE_KEY` | unset | Hex private key of a Base wallet holding USDC (payment rail 2) |
| `BASE_RPC_URL` | `https://rpc.ankr.com/base` | Base mainnet RPC. `https://mainnet.base.org` is used as a fallback |
| `RDX_MAX_PAYMENT_USDC` | `0.25` | Per-call payment cap |
| `RDX_SKYFIRE_TOKEN_TYPE` | auto | Force `kya`, `pay` or `kya-pay` for every call |
| `RDX_SKYFIRE_SERVICE_IDS` | unset | JSON map of sub-domain to Skyfire seller service ID |
| `SKYFIRE_API_BASE` | `https://api.skyfire.xyz` | Skyfire API base URL |
| `RDX_ALLOW_CUSTOM_HOSTS` | unset | Set to `1` to allow non-rdxdata.xyz hosts (self-hosting, testing) |
| `RDX_LOG_LEVEL` | `WARNING` | Log level (stderr) |
## Development
```bash
python -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"
pytest -q
# try it interactively
npx @modelcontextprotocol/inspector rdx-data-mcp
```
Layout:
```
src/rdx_data_mcp/
catalog.py endpoints, prices, categories (single source of truth)
payment.py Skyfire + x402 payment client
server.py MCP server and the 26 tools
tests/ payment-flow and tool-mapping tests (no network needed)
```
## Publishing
```bash
python -m build && twine check dist/* && twine upload dist/*
```
Smithery reads `smithery.yaml` and the `Dockerfile` from the repository root. Glama.ai and mcp.so index the public repository.
## License
MIT
TDQS
Scored across 26 tools
Each tool targets a distinct data source or operation, so boundaries are mostly clear. Mild ambiguity exists within families like the three arbitrage tools, the FX rates vs. conversion pair, and the three audit tools, but descriptions sufficiently differentiate them.
All tool names use consistent snake_case verb_noun patterns such as get_, list_, audit_, calculate_, verify_, and extract_. The convention is predictable throughout the 26-tool surface.
26 tools is heavy for a single MCP server, spanning many unrelated domains like commodities, travel, DeFi, PDFs, package security, and LLM routing. Although each tool is distinct, the large surface is difficult to scan and select from efficiently.
The server covers a broad set of data/utility categories and includes a free catalog tool for discovery. Minor gaps remain around historical/time-series access, account or payment management beyond the catalog status, and batch operations, but agents can generally work around these.