arbitrum-transaction-preflight

arbitrum-transaction-preflight

Paid Arbitrum transaction simulation, gas estimation, approval detection and risk scoring for wallets, bots and AI agents. Pay per check with USDC through MPP or x402.

Category
访问服务器

README

Arbitrum Transaction Preflight

Paid transaction simulation and risk reports for wallets, bots, and AI agents. Before a transaction is signed, the API checks whether it simulates successfully, estimates gas, detects token/NFT approvals, inspects the target, and returns a machine-readable risk score.

Production API: https://arbitrum-mpp-transaction-preflight-production.up.railway.app

Product and pricing

  • Network: Arbitrum One (42161)
  • Asset: native USDC (0xaf88d065e77c8cC2239327C5EDb3A432268e5831)
  • Launch price: 0.10 USDC per report (100000 raw USDC units)
  • Primary payment channel: MPP with EIP-3009
  • Optional distribution channel: x402 with Coinbase CDP/Bazaar
  • Agent interface: MCP stdio server that pays the MPP endpoint with the caller's wallet

The service never asks for a transaction-signing wallet. The example MPP/MCP clients use a separate low-value payer key only to authorize the API payment.

Discovery endpoints

The hosted service exposes free discovery metadata:

  • GET / — product, network, price, and endpoint summary
  • GET /health — health check
  • GET /openapi.json — MPP-aware OpenAPI 3.1 discovery document
  • GET /llms.txt — concise instructions for AI agents
  • GET /.well-known/agent.json — agent/service metadata

MPP clients call:

POST /v1/preflight

When x402 is enabled, x402 clients call:

POST /x402/v1/preflight

Request and report

{
  "from": "0x0000000000000000000000000000000000000001",
  "to": "0x0000000000000000000000000000000000000002",
  "data": "0x",
  "valueEth": "0"
}

from and to are required. data defaults to 0x. Use either valueEth or valueWei for native value. A successful paid response contains:

  • call simulation success/revert details;
  • gas estimate, gas price, and estimated ETH cost;
  • EOA/contract target inspection;
  • ERC-20 approve and NFT setApprovalForAll detection;
  • weighted risk score and warnings;
  • block number and check timestamp.

Automated simulation and heuristics reduce risk but are not a guarantee of safety.

Run locally

Requirements: Node.js 22+ and a dedicated server wallet. On mainnet, the server wallet needs a small Arbitrum One ETH balance for MPP settlement gas.

npm install
cp .env.example .env
npm run server

Minimum production configuration:

SERVER_PRIVATE_KEY=0x...
CHAIN_ID=42161
ARBITRUM_RPC=https://arb1.arbitrum.io/rpc
PRICE_RAW_USDC=100000
ENABLE_FREE_DEMO=false
SERVER_URL=https://arbitrum-mpp-transaction-preflight-production.up.railway.app

Never commit .env or expose SERVER_PRIVATE_KEY.

MPP client

The included client performs the complete 402 -> authorization -> retry -> receipt flow:

CLIENT_PRIVATE_KEY=0x...
TARGET_ADDRESS=0x...
SERVER_URL=https://arbitrum-mpp-transaction-preflight-production.up.railway.app
CHAIN_ID=42161
npm run client

The payer needs native USDC on Arbitrum One. It does not need ETH for the MPP payment; the merchant settles the signed EIP-3009 authorization.

MCP integration

The MCP server exposes check_arbitrum_transaction. It uses the caller's dedicated CLIENT_PRIVATE_KEY to pay the hosted MPP API, so each tool call produces API revenue instead of bypassing payment.

npm run mcp

After the npm package is published, MCP hosts can run:

{
  "mcpServers": {
    "arbitrum-preflight": {
      "command": "npx",
      "args": ["-y", "arbitrum-mpp-transaction-preflight"],
      "env": {
        "CLIENT_PRIVATE_KEY": "0x...",
        "SERVER_URL": "https://arbitrum-mpp-transaction-preflight-production.up.railway.app",
        "CHAIN_ID": "42161"
      }
    }
  }
}

Use a dedicated low-value payer wallet. Never reuse a valuable wallet key.

Enable x402 and Bazaar

Production x402 settlement on Arbitrum uses Coinbase's CDP facilitator. Create a CDP project and add these Railway variables:

ENABLE_X402=true
CDP_API_KEY_ID=...
CDP_API_KEY_SECRET=...

The server then exposes POST /x402/v1/preflight with Bazaar discovery metadata. MPP remains available at POST /v1/preflight; the two payment channels share the same analysis engine and merchant address.

Development checks

npm run typecheck
npm run build
npm pack --dry-run

Set ENABLE_FREE_DEMO=true only for local development to expose POST /demo/preflight without payment. Never enable it in production.

Publishing surfaces

The repository includes server.json and npm metadata for the official MCP Registry. Release order:

  1. deploy this version to Railway;
  2. publish arbitrum-mpp-transaction-preflight to npm;
  3. publish server.json with mcp-publisher;
  4. enable CDP x402 to become eligible for Bazaar indexing;
  5. submit the live MPP endpoint to the MPP services catalog.

Official Arbitrum MPP guide: https://docs.arbitrum.io/build-decentralized-apps/machine-payments-protocol

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选