Critical Raw Minerals & Urban Mining Oracle (x402)
Critical Raw Minerals & Urban Mining Oracle (minerals-oracle-x402)
High-performance deterministic micro-oracle service designed for autonomous trading, supply chain, and RWA (Real World Asset) agents. Serves real-time spot pricing, COMEX/LME cross-exchange arbitrage spreads, and urban-mining scrap benchmark yield valuations for critical raw physical commodities.
โก Key Features
Normalized Critical Commodities Price Feeds:
Silver (
Ag): LBMA & COMEX spot inUSD/troy_oz,USD/g,USD/kg.Platinum (
Pt): LPPM & NYMEX spot inUSD/troy_oz,USD/g.Copper (
Cu): LME Grade A Cathode & COMEX inUSD/mt,USD/lb,USD/kg.Lithium (
Li): Battery Grade 99.5% $\text{Li}_2\text{CO}_3$ / $\text{LiOH}$ inUSD/mt,USD/kg.Rare Earths (
NdDy): Permanent magnet grade Neodymium-Dysprosium ($\text{PrNd}/\text{DyFe}$) composite inUSD/kg.
Locational Arbitrage & Basis Spreads:
COMEX vs. LME Copper arbitrage calculation factoring in trans-oceanic freight & import tariffs.
COMEX vs. LBMA Loco London Silver spread.
SMM Domestic China vs. Fastmarkets CIF Rotterdam Lithium premium/discount.
NYMEX vs. LPPM Platinum spread.
Urban Mining & Circular Economy Valuation Engine:
EV_BATTERY_BLACK_MASS: Hydrometallurgical recovery of $\text{Li}$, $\text{Ni}$, $\text{Co}$, and $\text{Mn}$ with payable recovery yields and treatment charges (TC/RC).AUTO_CATALYST_CERAMIC: Spent catalytic converter PGM recovery ($\text{Pt}$, $\text{Pd}$, $\text{Rh}$) from ceramic monolith assays.E_WASTE_HIGH_GRADE_PCB: Precious and base metal extraction ($\text{Au}$, $\text{Ag}$, $\text{Cu}$) from shredded PCB feedstock.WIND_EV_PERMANENT_MAGNETS: NdFeB scrap recycling for separated rare earth oxides ($\text{Nd}$, $\text{Dy}$, $\text{Pr}$).
Web3 Monetization via x402 on Base:
Enforces micro-payments (0.005 USDC per query) via HTTP 402 challenge-response on Base (Chain ID
8453).Native Base USDC token:
0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913.Supports EIP-712/EIP-191 cryptographic signatures and facilitator verification.
Multi-Agent Standards Native:
Google AP2 (
/.well-known/ap2): Agent Protocol v2 manifest.Model Context Protocol (MCP): Tool schema definitions (
mcp_tool_spec.json) and/mcp/invokedispatcher.OpenAPI / Swagger (
/docs): Standard machine-readable and interactive API documentation.
Related MCP server: hyperd-mcp
๐ Repository Structure
minerals-oracle-x402/
โโโ app/
โ โโโ __init__.py
โ โโโ main.py # FastAPI application, routing & MCP endpoints
โ โโโ feed_engine.py # Deterministic commodity pricing, spread & scrap engine
โ โโโ x402_verifier.py # HTTP 402 challenge & EIP-712 payment verifier
โ โโโ schemas.py # Pydantic data contracts & schemas
โโโ tests/
โ โโโ __init__.py
โ โโโ test_client.py # Autonomous agent payment test suite
โโโ .well-known/
โ โโโ ap2.json # Google Agent Protocol AP2 manifest
โโโ mcp_tool_spec.json # FastMCP tool definition for LLM agents
โโโ Dockerfile # Ultra-lightweight multi-stage container
โโโ requirements.txt # Python dependencies
โโโ README.md # Documentation & quickstart๐ Quick Start
1. Local Setup
# Clone and enter directory
cd minerals-oracle-x402
# Create virtual environment
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Run development server
uvicorn app.main:app --host 0.0.0.0 --port 8000 --reloadInteractive documentation will be available at http://localhost:8000/docs.
2. Running via Docker
# Build lightweight container
docker build -t minerals-oracle-x402 .
# Run container
docker run -p 8000:8000 minerals-oracle-x402๐ณ x402 Payment Flow Specification
sequenceDiagram
autonumber
actor Agent as Autonomous AI Agent
participant Oracle as minerals-oracle-x402
participant Base as Base Network (USDC)
Agent->>Oracle: GET /api/v1/oracle/prices
Oracle-->>Agent: HTTP 402 Payment Required<br/>(Nonce, Price: 0.005 USDC, Base Chain ID: 8453)
Note over Agent: Agent signs payment challenge<br/>using private key (EIP-712/EIP-191)
Agent->>Oracle: GET /api/v1/oracle/prices<br/>Header: Authorization: x402 <base64_payload>
Oracle->>Oracle: Verify signature / Facilitator settle
Oracle-->>Agent: HTTP 200 OK<br/>Certified Oracle Feeds & Attestation HashesPayment Authorization Header Format
Authorization: x402 eyJub25jZSI6ICIxYTIz...IiwgInNpZ25hdHVyZSI6ICIweDk5...In0=Where the decoded JSON payload contains:
{
"nonce": "7f8b92c4a90184b2ef019a823b102938",
"signature": "0x...",
"signer": "0xYourAgentWalletAddress"
}๐ค MCP (Model Context Protocol) Integration
To use with Claude Desktop, Cursor, Gemini or Antigravity agents, load mcp_tool_spec.json.
Available tools:
get_mineral_prices: Retrieve all current spot prices and unit conversions.get_arbitrage_spreads: Fetch COMEX/LME/SMM basis spreads and margins.calculate_urban_mining_value: Calculate batch recovery yields for EV Black Mass, Auto Catalysts, E-Waste, or Permanent Magnets.
Example Python Agent MCP tool call:
import httpx
resp = httpx.post(
"http://localhost:8000/mcp/invoke",
json={
"name": "calculate_urban_mining_value",
"arguments": {
"scrap_category": "EV_BATTERY_BLACK_MASS",
"quantity_metric_tons": 5.0,
"custom_assay_overrides": {"Li": 4.1, "Co": 6.5}
}
},
headers={"X-Dev-Bypass": "true"} # Or with valid x402 signature
)
print(resp.json())๐งช Running Tests
Execute the automated test suite verifying 402 challenge flow, EIP-712 cryptographic verification, scrap calculations, and AP2 endpoints:
pytest -v tests/test_client.py๐ License
MIT License. Built for Autonomous Agent Commerce and Critical Mineral Resilience.
This server cannot be installed
Maintenance
Related MCP Servers
- FlicenseAqualityNot gradedmaintenanceTrust infrastructure for AI agents on Base. DEX Spread Oracle (live Uniswap V3 prices), on-chain escrow, insurance pool, and collective knowledge base. 7 smart contracts. Pay-per-query via x402 micropayments in USDC.6

hyperd-mcpofficial
AlicenseAqualityBmaintenancePre-trade DeFi intelligence for AI agents. 20 paid x402 endpoints, USDC on Base.23561MIT- AlicenseAqualityBmaintenanceUSDA nutrition API optimized for AI agents. x402 + USDC on Base41MIT
- FlicenseNot gradedqualityDmaintenancePay-per-use AI security and research tools for autonomous agents on Base, enabling honeypot detection, risk assessment, wallet analysis, and yield optimization via the x402 protocol.
Related MCP Connectors
Pay-per-call web scraping for AI agents via x402 on Base USDC. Six tools, no signup.
Pay-per-call data tools for AI agents: crypto signal, web reader, SEO audit. x402 USDC on Base.
63 pay-per-call tools for agents: vision, text, data, web, blockchain. USDC on Base via x402.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/nohosa001-pixel/minerals-oracle-x402'
If you have feedback or need assistance with the MCP directory API, please join our Discord server