{
  "markdown": "# Arbitrum Transaction Preflight\n\nPaid transaction simulation and risk reports for wallets, bots, and AI agents.\nBefore a transaction is signed, the API checks whether it simulates successfully,\nestimates gas, detects token/NFT approvals, inspects the target, and returns a\nmachine-readable risk score.\n\nProduction API: https://arbitrum-mpp-transaction-preflight-production.up.railway.app\n\n## Product and pricing\n\n- Network: Arbitrum One (`42161`)\n- Asset: native USDC (`0xaf88d065e77c8cC2239327C5EDb3A432268e5831`)\n- Launch price: `0.10 USDC` per report (`100000` raw USDC units)\n- Primary payment channel: MPP with EIP-3009\n- Optional distribution channel: x402 with Coinbase CDP/Bazaar\n- Agent interface: MCP stdio server that pays the MPP endpoint with the caller's wallet\n\nThe service never asks for a transaction-signing wallet. The example MPP/MCP\nclients use a separate low-value payer key only to authorize the API payment.\n\n## Discovery endpoints\n\nThe hosted service exposes free discovery metadata:\n\n- `GET /` — product, network, price, and endpoint summary\n- `GET /health` — health check\n- `GET /openapi.json` — MPP-aware OpenAPI 3.1 discovery document\n- `GET /llms.txt` — concise instructions for AI agents\n- `GET /.well-known/agent.json` — agent/service metadata\n\nMPP clients call:\n\n```text\nPOST /v1/preflight\n```\n\nWhen x402 is enabled, x402 clients call:\n\n```text\nPOST /x402/v1/preflight\n```\n\n## Request and report\n\n```json\n{\n  \"from\": \"0x0000000000000000000000000000000000000001\",\n  \"to\": \"0x0000000000000000000000000000000000000002\",\n  \"data\": \"0x\",\n  \"valueEth\": \"0\"\n}\n```\n\n`from` and `to` are required. `data` defaults to `0x`. Use either `valueEth`\nor `valueWei` for native value. A successful paid response contains:\n\n- call simulation success/revert details;\n- gas estimate, gas price, and estimated ETH cost;\n- EOA/contract target inspection;\n- ERC-20 `approve` and NFT `setApprovalForAll` detection;\n- weighted risk score and warnings;\n- block number and check timestamp.\n\nAutomated simulation and heuristics reduce risk but are not a guarantee of safety.\n\n## Run locally\n\nRequirements: Node.js 22+ and a dedicated server wallet. On mainnet, the server\nwallet needs a small Arbitrum One ETH balance for MPP settlement gas.\n\n```bash\nnpm install\ncp .env.example .env\nnpm run server\n```\n\nMinimum production configuration:\n\n```dotenv\nSERVER_PRIVATE_KEY=0x...\nCHAIN_ID=42161\nARBITRUM_RPC=https://arb1.arbitrum.io/rpc\nPRICE_RAW_USDC=100000\nENABLE_FREE_DEMO=false\nSERVER_URL=https://arbitrum-mpp-transaction-preflight-production.up.railway.app\n```\n\nNever commit `.env` or expose `SERVER_PRIVATE_KEY`.\n\n## MPP client\n\nThe included client performs the complete `402 -> authorization -> retry ->\nreceipt` flow:\n\n```dotenv\nCLIENT_PRIVATE_KEY=0x...\nTARGET_ADDRESS=0x...\nSERVER_URL=https://arbitrum-mpp-transaction-preflight-production.up.railway.app\nCHAIN_ID=42161\n```\n\n```bash\nnpm run client\n```\n\nThe payer needs native USDC on Arbitrum One. It does not need ETH for the MPP\npayment; the merchant settles the signed EIP-3009 authorization.\n\n## MCP integration\n\nThe MCP server exposes `check_arbitrum_transaction`. It uses the caller's\ndedicated `CLIENT_PRIVATE_KEY` to pay the hosted MPP API, so each tool call\nproduces API revenue instead of bypassing payment.\n\n```bash\nnpm run mcp\n```\n\nAfter the npm package is published, MCP hosts can run:\n\n```json\n{\n  \"mcpServers\": {\n    \"arbitrum-preflight\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"arbitrum-mpp-transaction-preflight\"],\n      \"env\": {\n        \"CLIENT_PRIVATE_KEY\": \"0x...\",\n        \"SERVER_URL\": \"https://arbitrum-mpp-transaction-preflight-production.up.railway.app\",\n        \"CHAIN_ID\": \"42161\"\n      }\n    }\n  }\n}\n```\n\nUse a dedicated low-value payer wallet. Never reuse a valuable wallet key.\n\n## Enable x402 and Bazaar\n\nProduction x402 settlement on Arbitrum uses Coinbase's CDP facilitator. Create\na CDP project and add these Railway variables:\n\n```dotenv\nENABLE_X402=true\nCDP_API_KEY_ID=...\nCDP_API_KEY_SECRET=...\n```\n\nThe server then exposes `POST /x402/v1/preflight` with Bazaar discovery metadata.\nMPP remains available at `POST /v1/preflight`; the two payment channels share the\nsame analysis engine and merchant address.\n\n## Development checks\n\n```bash\nnpm run typecheck\nnpm run build\nnpm pack --dry-run\n```\n\nSet `ENABLE_FREE_DEMO=true` only for local development to expose\n`POST /demo/preflight` without payment. Never enable it in production.\n\n## Publishing surfaces\n\nThe repository includes `server.json` and npm metadata for the official MCP\nRegistry. Release order:\n\n1. deploy this version to Railway;\n2. publish `arbitrum-mpp-transaction-preflight` to npm;\n3. publish `server.json` with `mcp-publisher`;\n4. enable CDP x402 to become eligible for Bazaar indexing;\n5. submit the live MPP endpoint to the MPP services catalog.\n\nOfficial Arbitrum MPP guide:\nhttps://docs.arbitrum.io/build-decentralized-apps/machine-payments-protocol\n",
  "bytes": 4924,
  "sha": "f0455a99c824e5ef54910b3dff5bc45c87bcdf17e6065512cf2ba3f62c81112c",
  "repo_slug": "naur9n/arbitrum-mpp-transaction-preflight",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_naur9n_arbitrum_transaction_pr_98f324e1/readme"
}