SafeDrop MCP服务器
用于空投搜寻和智能合约安全分析的付费API服务,由x402支付协议提供支持。
特性
- 空投发现:获取具有风险评分的最新空投机会
- 合同扫描:智能合约的安全分析
- 钱包资格:检查您钱包的空投资格
- 自动支付:通过x402协议使用USDC支付
定价
| 端点 | 价格 |
|---|---|
| GET/api/空投/最新 | 0.001美元 |
| POST/api/合约/扫描 | 0.01美元 |
| GET/api/钱包/:地址/资格 | 0.005美元 |
| GET/api/钱包/:地址/活动 | 0.003美元 |
| POST/api/钱包/批量检查 | 0.02美元 |
快速开始
先决条件
- Node.js 18+
- 用于接收付款的EVM钱包
- 基础Sepolia(用于测试)或基础主网的USDC
安装
# Clone and install
cd x402-mcp-server
npm install
# Configure
cp .env.example .env
# Edit .env with your wallet address
# Build and run
npm run build
npm start配置
编辑 .env:
WALLET_ADDRESS=0xYourWalletAddress
NETWORK=testnet # or mainnet
PORT=3000API使用
自由端点
# Health check
curl http://localhost:3000/health
# API documentation
curl http://localhost:3000/付费端点
使用付费端点时,服务器将返回 402 Payment Required 以付款指示进行响应。您的客户需要处理x402付款流程。
x402兼容客户端示例:
import { x402Fetch } from '@x402/fetch';
const response = await x402Fetch('http://localhost:3000/api/airdrops/latest', {
wallet: yourWallet
});x402付款流程
- 客户端请求付费端点
- 服务器返回
402 Payment Required和PAYMENT-REQUIRED头球 - 客户使用钱包签署付款
- 客户端重试请求
PAYMENT-SIGNATURE头球 - 服务器验证付款并返回数据
发展
# Run in development mode
npm run dev
# Build
npm run build
# Start production
npm start项目结构
src/
├── index.ts # Entry point
├── middleware/
│ └── payment.ts # x402 payment middleware
├── routes/
│ ├── airdrops.ts # Airdrop endpoints
│ ├── contracts.ts # Contract scanning endpoints
│ └── wallets.ts # Wallet eligibility endpoints
└── services/
├── airdrop.service.ts
├── contract.service.ts
└── wallet.service.ts路线图
- \[\]整合真实空投数据源(airdrops.io、DropsTab)
- \[\]实施实际合同扫描(Slither集成)
- \[\]添加更多链(Solana、Arbitrum、Optimism)
- \[\]部署到Cloudflare Workers
- \[\]在Bazaar发现层注册
许可证
麻省理工学院
______________________________________________________________________
采用x402协议构建|基于Base的USDC支付
