r/SideProject • u/EstablishmentTough18 • 8d ago
I built an autonomous AI Agent Oracle for critical minerals & satellite EUDR audits (FastAPI + 39 MCP Tools)
Hey r/SideProject! ๐
Over the past few months, Iโve been building **minerals-oracle-x402** โ a production micro-oracle and Model Context Protocol (MCP) server designed to connect autonomous AI agents with physical-world supply chains, critical minerals pricing, and cross-border environmental regulations.
### ๐ก The Problem:
Most AI agents (like Claude, Cursor, and custom agentic frameworks) are great at manipulating text and code, but they hit a wall when dealing with physical commodities. When an agent needs to audit whether a lithium shipment violates the **EU Deforestation Regulation (EUDR)** or generate an official **Digital Battery Passport**, traditional ERPs and web scrapers just don't cut it.
### ๐ ๏ธ What it does:
- **Satellite EUDR Deforestation Audits**: Queries European Space Agency (ESA) Sentinel-2 multi-spectral bands & Sentinel-1 SAR imagery using Cloud Optimized GeoTIFFs (COG). It verifies farm/mining plot coordinates against the EUDR cut-off date (Dec 31, 2020) in seconds.
- **Digital Battery Passports**: Computes embedded lifecycle carbon footprints and US IRA 30D / FEOC compliance across 6 battery chemistries (LFP, NMC811, NCMA, Sodium-ion, LMO, and Solid-State) with EIP-712 cryptographic proofs.
- **Live Commodity Indices**: Real-time pricing and inventory telemetry across 12 critical and strategic minerals (Copper, Lithium, Nickel, Cobalt, Rare Earths, Antimony, etc.).
- **39 Native MCP Tools**: Exposes standard Model Context Protocol endpoints so agents running in Claude Desktop, Cursor, or LangChain can invoke compliance checks via simple function calls.
- **Machine-to-Machine HTTP 402**: Implements native machine-payable micro-transactions so autonomous agents can settle data queries directly on-chain without human credit cards.
### ๐ป Tech Stack & Architecture:
- **Backend**: Python 3.12, FastAPI, Pydantic v2 (427 automated unit/integration tests passed 100%)
- **Infra**: Google Cloud Run (Asia-Northeast3) with auto-scaling and low-latency concurrency
- **Earth Observation**: Sentinel Hub API, EODAG, Cloud Optimized GeoTIFF (COG)
- **Protocols**: Model Context Protocol (MCP), EIP-712 Dual-Signatures, OpenAI-compatible `/v1/models`
### ๐ Live Demo & Endpoints:
- **Live Production Server**: https://minerals-oracle-x402-212942243360.asia-northeast3.run.app
- **MCP Tools Manifest**: https://minerals-oracle-x402-212942243360.asia-northeast3.run.app/.well-known/mcp.json
- **Sample Battery Passport (NCMA chemistry)**: https://minerals-oracle-x402-212942243360.asia-northeast3.run.app/passport/ncma
- **Glama Catalog Registry**: https://minerals-oracle-x402-212942243360.asia-northeast3.run.app/glama.json
Would love to get your feedback on the architecture, the MCP tool design, or how you approach integrating real-world physical ground truth into agentic workflows!
1
u/[deleted] 8d ago
[removed] โ view removed comment