Machine Utility Foundry (Safe x402 Wallet & Trust Oracles)
Auto-paying x402 MCP wallet bridge, honeypot & wash-trade oracle, route failover & ICP guardrails.
Installation
Ajoutez ceci à la configuration MCP de votre client (Claude Desktop : claude_desktop_config.json ; Cursor : .cursor/mcp.json ; VS Code et les autres utilisent la même forme « mcpServers »).
claude mcp add --transport http machine-utility-foundry-safe-x402-wallet 'https://machine-utility-foundry.meritoriousmatrix00.workers.dev/mcp'
{
"mcpServers": {
"machine-utility-foundry-safe-x402-wallet": {
"type": "http",
"url": "https://machine-utility-foundry.meritoriousmatrix00.workers.dev/mcp"
}
}
}
foundry-x402claude mcp add machine-utility-foundry-safe-x402-wallet -e 'EVM_PRIVATE_KEY=<your evm_private_key>' -e 'MAX_PAYMENT_USD=0.05' -e 'SESSION_BUDGET_USD=1.00' -e 'FOUNDRY_WAL_PATH=<FOUNDRY_WAL_PATH>' -e 'FOUNDRY_BASE_URL=https://machine-utility-foundry.meritoriousmatrix00.workers.dev' -- npx -y foundry-x402@0.4.5 mcp
{
"mcpServers": {
"machine-utility-foundry-safe-x402-wallet": {
"command": "npx",
"args": [
"-y",
"foundry-x402@0.4.5",
"mcp"
],
"env": {
"EVM_PRIVATE_KEY": "<your evm_private_key>",
"MAX_PAYMENT_USD": "0.05",
"SESSION_BUDGET_USD": "1.00",
"FOUNDRY_WAL_PATH": "<FOUNDRY_WAL_PATH>",
"FOUNDRY_BASE_URL": "https://machine-utility-foundry.meritoriousmatrix00.workers.dev"
}
}
}
}
Variables d'environnement
EVM_PRIVATE_KEYsecret Optional isolated Base Mainnet USDC micro-wallet private key (0x...) from `npx -y foundry-x402 new-wallet` for automatic EIP-3009 payment.MAX_PAYMENT_USDMaximum USD allowed on any single paid x402 call.SESSION_BUDGET_USDMaximum cumulative USD spend allowed per MCP session.FOUNDRY_WAL_PATHOptional path for the pre-send fsync JSONL payment WAL (default resolves via LOCALAPPDATA, XDG_STATE_HOME, or ~/.foundry-x402/wal.jsonl; set to 'off' or 'none' to disable).FOUNDRY_BASE_URLOptional Machine Utility Foundry origin URL override.
Documentation
Tirée du README du projet sur GitHub, actualisée chaque semaine. Les liens ouvrent GitHub.
Sommaire
- Machine Utility Foundry (foundry-x402)
- 1. Quick Start: Claude Desktop / Cursor / Windsurf (Zero-ETH Gasless Auto-Pay)
- 2. Quick Start: TypeScript / Node / Cloudflare Workers SDK (v0.4.4)
- 3. For x402 API Providers: Copy-Paste Docs Snippets
- 4. Core x402 Trust & Routing Oracles (Primary Wedge)
- 5. Operations & Verification
Machine Utility Foundry (foundry-x402)
Safe Auto-Paying x402 Wallet & Counterparty Trust Oracle for Claude Desktop, Cursor, and Autonomous AI Agents (Worker v1.2.2 / foundry-x402@0.4.4).
Autonomous agents and desktop AI clients face three blockers when consuming x402 paid APIs on Base Mainnet (eip155:8453 USDC):
- Desktop MCP clients cannot sign EIP-3009 payments natively.
- External x402 catalogs contain wash-traded bots, price bait-and-switch endpoints, and post-payment
402honeypots. - Network drops or client crashes after signing can cause accidental double-payments on retries or fallback routes.
foundry-x402@0.4.4 solves all three: a local spend-capped Base USDC wallet bridge with pre-send fsync WAL & Base L2 reconciliation + pre-settlement Ed25519 trust screening + automatic on-chain slashing backed by Internet Computer (ICP) and Cloudflare Edge KV.
1. Quick Start: Claude Desktop / Cursor / Windsurf (Zero-ETH Gasless Auto-Pay)
Generate an isolated Base Mainnet USDC micro-wallet in memory (never written to disk), fund it with $1–$3 Base USDC (0 ETH gas required — EIP-3009 settlement is gas-sponsored), and paste the printed mcpServers JSON into your client config:
npx -y foundry-x402 new-wallet
Gives your AI assistant:
safe_x402_request— Safely call & pay any externalhttps://x402 API with pre-settlement honeypot screening, split-horizon bait-and-switch defense, per-call/session USD caps, automatic pre-sendfsyncWAL (FOUNDRY_WAL_PATH), and post-payment slashing.foundry_wallet_status— Live Base USDC balance, remaining session budget, and unresolved WAL count ($0free local check).- All Foundry Discovery & Failover Oracles — Automatic
$0zero-charge empty checks and seamless micro-USDC settlement when verified routes exist.
2. Quick Start: TypeScript / Node / Cloudflare Workers SDK (v0.4.4)
npm install foundry-x402
import {
FileWriteAheadPaymentStore,
X402OutcomeUnknownError,
createBaseUsdcPaymentAdapter,
createSafeX402Fetch,
fetchWithSafeFailover,
reconcileBaseUsdcAuthorization,
} from "foundry-x402";
const safeFetch = createSafeX402Fetch({
paymentAdapter: createBaseUsdcPaymentAdapter(process.env.EVM_PRIVATE_KEY!),
maxAcceptableUsd: 0.05,
maxDynamicPriceMultiplierByEndpoint: { "api.example.com": 2 },
attemptStore: new FileWriteAheadPaymentStore("./.foundry-x402/wal.jsonl"),
});
try {
// 1-call parallel-quarantined failover across live-verified x402 providers:
const { response, selectedUrl } = await fetchWithSafeFailover({
safeFetch,
need: "weather forecast",
maxPriceUsd: 0.01,
});
console.log(selectedUrl, response.status);
} catch (err) {
if (err instanceof X402OutcomeUnknownError) {
const { authorizer, nonce, validBefore } = err.attempt;
if (authorizer && nonce && validBefore) {
// Gasless Base L2 block-pinned USDC.authorizationState check before any retry
const recon = await reconcileBaseUsdcAuthorization({ authorizer, nonce, validBefore });
console.log(recon.status, recon.safeToRetry);
}
}
throw err;
}
v0.4.4 Crash-Safe & L2 Guarantees
OUTCOME_UNKNOWNFail-Closed Failover & In-Process Dedup:fetchWithSafeFailoverthrowsX402OutcomeUnknownErrorand halts before calling fallback providers whenever a post-sign request drops or returns HTTP non-2xx (even ifPAYMENT-RESPONSEis present).createSafeX402FetchenablesInMemoryPaymentAttemptStoreby default so accidental duplicate retries in the same process are blocked automatically.- Base L2 Block-Pinned Reconciliation:
reconcileBaseUsdcAuthorizationpinseth_getBlockByNumber("latest")andUSDC.authorizationStateto the same RPC block (with a 6s sequencer buffer) before returningCONFIRMED_NOT_SETTLED(safeToRetry: true). - Pre-Send
fsyncWAL:FileWriteAheadPaymentStore(enabled automatically innpx -y foundry-x402 mcpviaFOUNDRY_WAL_PATHresolvingLOCALAPPDATA/XDG_STATE_HOME/~/.foundry-x402/wal.jsonl;'off'or'none'disables) persistsSIGNED_IN_FLIGHTacross process crashes/restarts before outbound socket I/O. - Per-Endpoint Dynamic Price Tolerance:
maxDynamicPriceMultiplierByEndpointoverridesmaxDynamicPriceMultiplier(default5) per exact normalized URL or lowercase hostname, always capped bymaxAcceptableUsd.
See packages/x402-safe-fetch/README.md for @x402/core zero-extra-roundtrip adapter options and InMemoryPaymentAttemptStore usage.
3. For x402 API Providers: Copy-Paste Docs Snippets
Give Claude/Cursor users and autonomous TypeScript agents a spend-capped, honeypot-screened client for your x402 API (requires a funded Base Mainnet eip155:8453 USDC micro-wallet; 0 ETH gas needed via EIP-3009):
Claude Desktop / Cursor Wallet Setup (fund $1–$3 Base USDC & paste printed JSON into MCP config):
npx -y foundry-x402 new-wallet
TypeScript / Node Safe Client:
import {
FileWriteAheadPaymentStore,
createBaseUsdcPaymentAdapter,
createSafeX402Fetch,
} from "foundry-x402";
const safeFetch = createSafeX402Fetch({
paymentAdapter: createBaseUsdcPaymentAdapter(process.env.EVM_PRIVATE_KEY!),
maxAcceptableUsd: 0.10, // Set >= your endpoint's max USD price (e.g. 1.00 for $1 endpoints)
paidProbeThresholdUsd: 0.01, // Optional: skip the $0.005 Foundry Oracle fee on sub-cent ($0.001) micro-calls
attemptStore: new FileWriteAheadPaymentStore("./.foundry-x402/wal.jsonl"), // Optional: persist duplicate-pay guard across restarts
});
4. Core x402 Trust & Routing Oracles (Primary Wedge)
All oracle verdicts include offline-verifiable Ed25519 signatures (/.well-known/jwks.json) and IC Mainnet ledger proofs:
POST /v1/x402/route-plan($0.015—$0.00if 0 matches) — Parallel-quarantined x402 failover planner: live-probes top wash-filtered candidates in parallel and returns signedprimary+fallbackexecution tickets with lockedpaymentTerms.GET|POST /v1/x402/recommend($0.005—$0.00if 0 matches) — Neutral (ZERO_SELF_PREFERENCE), wash-filtered x402 API recommender with organic 30-day payer counts.POST /v1/oracle/x402-counterparty($0.005) — Live 402 header, official Base USDC asset, SSRF/DNS-rebinding-safe liveness, bait-and-switch, and historical reputation score (0–100).
Free Public Discovery & On-Chain Slashing Endpoints ($0.00)
GET /v1/x402/recommend-preview?need={task}— Free match count, masked host hint, and price range preview before paying.GET /v1/oracle/reputation-stats— Live 2-hour autonomous Bazaar crawl stats, wash-trade counts, & IC Mainnet anchor receipt.POST /v1/oracle/delivery-feedback— Free EIP-191 payer-signed & Base Mainneteth_getTransactionReceipt-verified post-payment slashing endpoint.llms.txt·GET /llms.txt— LLM-readable endpoint, SDKv0.4.4, and provider snippet index.GET /v1/verify/:receiptId·GET /.well-known/jwks.json·GET /.well-known/x402·GET /.well-known/mcp.json·GET /openapi.json·POST /mcp
Secondary Deterministic Guardrails & Attestation Utilities
POST /v1/state/budget-guard($0.005) — Payer-isolated ICP shared multi-agent budget cap & atomic nonce replay guard.POST /v1/guard/evm-preflight($0.01) — Fail-closed Base Mainneteth_callsimulator & unlimited approve / Permit2 / counterfeit USDC guard.POST /v1/attest/artifact($0.005) &POST /v1/attest/bundle($0.015) — Deterministic JSON Schema / Policy / BigInt Ledger audit anchored on IC Mainnet.POST /v1/diff/breaking-openapi($0.01) — Deterministic$ref&allOfOpenAPI 3.x breaking-change auditor (up to 2 MB).
5. Operations & Verification
npm.cmd run typecheck # Sync Apify modules & typecheck Worker + SDK
npm.cmd test # Run full unit & Red-Team regression suite
npm.cmd run deploy # Build SDK & deploy Cloudflare Worker + Cron + KV
npm.cmd run pulse # Live OpenAPI, full 8-tool MCP, 402 & external Base USDC audit
npm.cmd run bazaar:bootstrap # $0.07 E2E settlement check across all 8 routes
npm.cmd run canary:run # Execute isolated micro-USDC mystery-shopper sweep
Questions fréquentes
Qu'est-ce que Machine Utility Foundry (Safe x402 Wallet & Trust Oracles) ?
Auto-paying x402 MCP wallet bridge, honeypot & wash-trade oracle, route failover & ICP guardrails.
Comment installer Machine Utility Foundry (Safe x402 Wallet & Trust Oracles) ?
Il fonctionne comme serveur distant. Dans Claude Code : claude mcp add --transport http machine-utility-foundry-safe-x402-wallet 'https://machine-utility-foundry.meritoriousmatrix00.workers.dev/mcp'. Pour les autres clients, collez la configuration JSON de cette page dans leurs réglages MCP.
Faut-il une clé API pour Machine Utility Foundry (Safe x402 Wallet & Trust Oracles) ?
Oui. Il attend EVM_PRIVATE_KEY, à renseigner dans sa configuration.
Machine Utility Foundry (Safe x402 Wallet & Trust Oracles) est-il open source ?
Son code est public sur GitHub, mais le dépôt ne déclare pas de licence standard.
Qui maintient Machine Utility Foundry (Safe x402 Wallet & Trust Oracles) ?
Il est publié par sapphire-japan. AI.tn le référence sans le maintenir ni le recommander.
Issu du registre MCP officiel. Être listé n'est pas une recommandation : vérifiez le code et les permissions d'un serveur avant de lui donner accès à vos données.