Critical Raw Minerals & Urban Mining Oracle (x402)
关键原材料矿物与城市矿产预言机(minerals-oracle-x402)
面向自主交易、供应链和 RWA(真实世界资产)代理设计的高性能确定性微型预言机服务。为关键原材料实物商品提供实时现货定价、COMEX/LME 跨交易所套利价差以及城市矿产废料基准收益率估值。
⚡ 核心特性
标准化关键商品价格数据源:
白银(
Ag):LBMA 与 COMEX 现货,单位为USD/troy_oz、USD/g、USD/kg。铂金(
Pt):LPPM 与 NYMEX 现货,单位为USD/troy_oz、USD/g。铜(
Cu):LME A 级阴极铜与 COMEX,单位为USD/mt、USD/lb、USD/kg。锂(
Li):电池级 99.5% $\text{Li}_2\text{CO}_3$ / $\text{LiOH}$,单位为USD/mt、USD/kg。稀土(
NdDy):永磁体级钕-镝($\text{PrNd}/\text{DyFe}$)复合材料,单位为USD/kg。
跨地域套利与基差价差:
COMEX 与 LME 铜套利计算,考虑跨洋运费与进口关税。
COMEX 与 LBMA 伦敦当地白银价差。
SMM 中国国内与 Fastmarkets CIF 鹿特丹锂溢价/折价。
NYMEX 与 LPPM 铂金价差。
城市矿产与循环经济估值引擎:
EV_BATTERY_BLACK_MASS:通过湿法冶金回收 $\text{Li}$、$\text{Ni}$、$\text{Co}$ 和 $\text{Mn}$,包含可支付回收率与处理费(TC/RC)。AUTO_CATALYST_CERAMIC:从陶瓷载体检测中回收废旧催化转化器中的铂族金属($\text{Pt}$、$\text{Pd}$、$\text{Rh}$)。E_WASTE_HIGH_GRADE_PCB:从破碎 PCB 原料中提取贵金属和贱金属($\text{Au}$、$\text{Ag}$、$\text{Cu}$)。WIND_EV_PERMANENT_MAGNETS:NdFeB 废料回收,用于分离稀土氧化物($\text{Nd}$、$\text{Dy}$、$\text{Pr}$)。
通过 Base 上的 x402 实现 Web3 变现:
通过 Base(链 ID
8453)上的 HTTP 402 质询-响应机制强制执行微支付(每次查询 0.005 USDC)。Base 原生 USDC 代币:
0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913。支持 EIP-712/EIP-191 加密签名与促进者验证。
原生支持多代理标准:
Google AP2(
/.well-known/ap2):Agent Protocol v2 清单。模型上下文协议(MCP):工具模式定义(
mcp_tool_spec.json)与/mcp/invoke调度器。OpenAPI / Swagger(
/docs):标准的机器可读与交互式 API 文档。
Related MCP server: hyperd-mcp
📁 仓库结构
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🚀 快速开始
1. 本地部署
# 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 --reload交互式文档将在 http://localhost:8000/docs 提供。
2. 通过 Docker 运行
# Build lightweight container
docker build -t minerals-oracle-x402 .
# Run container
docker run -p 8000:8000 minerals-oracle-x402💳 x402 支付流程规范
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 Hashes支付授权请求头格式
Authorization: x402 eyJub25jZSI6ICIxYTIz...IiwgInNpZ25hdHVyZSI6ICIweDk5...In0=其中解码后的 JSON 载荷包含:
{
"nonce": "7f8b92c4a90184b2ef019a823b102938",
"signature": "0x...",
"signer": "0xYourAgentWalletAddress"
}🤖 MCP(模型上下文协议)集成
要与 Claude Desktop、Cursor、Gemini 或 Antigravity 代理一起使用,请加载 mcp_tool_spec.json。
可用工具:
get_mineral_prices:获取所有当前现货价格与单位换算。get_arbitrage_spreads:获取 COMEX/LME/SMM 基差价差与利润率。calculate_urban_mining_value:计算电动汽车黑粉、汽车催化剂、电子废弃物或永磁体的批量回收率。
Python 代理 MCP 工具调用示例:
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())🧪 运行测试
执行自动化测试套件,验证 402 质询流程、EIP-712 加密验证、废料计算和 AP2 端点:
pytest -v tests/test_client.py📜 许可证
MIT 许可证。专为自主代理商务与关键矿物韧性而构建。
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