Web3 Systemic Agent

io.github.RafaCoelho33由 GitHub 账号 RafaCoelho33 发布v1.0.1更新于 Nov 12, 2026

Web3 security & DAO auditor: free bytecode/honeypot/Snapshot tools + x402 Gemini LLM deep audit.

发布方自己的服务:Web3TV MCP Server

已验证Streamable HTTP可网页运行金融安全与监控

概览

AI 生成的概览

远程 Web3 安全审计服务,让助手筛查 EVM 合约、代币与 DAO 提案,并可选用付费的 LLM 深度审计。

可以做什么
  • 检查 EVM 合约字节码中的函数选择器与高危后门,如转移所有权、升级、增发和自毁
  • 扫描代币字节码中的蜜罐特征:黑名单、卖出税与费率设置、交易暂停及自毁陷阱
  • 抓取 Snapshot DAO 近期提案,提取执行目标与 calldata,识别治理劫持载荷
  • 执行付费混合审计,用 LLM 将提案描述与字节码和 calldata 对照,返回批准、人工复核或拒绝
适用场景
适合在助手与 Base、Base Sepolia 或 Arbitrum 上的合约、代币或 DAO 提案交互前做零成本快速尽调,也适合在值得小额付费时对治理载荷做更深入的 LLM 复核。
运行要求
远程 streamable-HTTP 端点,未声明账号或 API 密钥。免费工具会针对指定链查询实时 RPC。付费审计需在 Base 上支付 0.05 USDC,通过 x402 支付头或已配置的买方私钥提供。
安装前请注意
深度审计每次调用收费 0.05 USDC 且非幂等,重试可能重复扣费。付款需要已充值的钱包,若配置买方私钥则等于授予支出权限。结果为启发式静态分析与 LLM 判断,不保证安全。提交的地址与 calldata 会发送至远程服务及其 LLM 提供方。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Web3 Systemic Agent,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Web executable,通过 Streamable HTTP。 远程服务在工作区中配置后即可从网页运行时运行。

交给智能体安装

把这段提示词粘贴到 Claude Code、Codex、Cursor 等智能体,或 SourceWeft 对话中。智能体会读取该服务器的安装指南,先向你展示发布者、端点和登录方式,经你同意后再把它添加到你的客户端。密钥不会写进任何命令。

阅读 https://sourceweft.com/mcp/io.github.RafaCoelho33%2Fweb3-systemic-agent/install.md,并按其中说明把这个 MCP 服务器接入我的客户端。修改任何配置之前,先告诉我它的发布者、端点和登录方式,等我确认。不要把 API 密钥写进命令或我会提交的文件;问我密钥应从哪里获取。

查看智能体所依据的安装指南

其他 MCP 客户端

把它添加到你客户端的 mcpServers 配置中。

{
  "mcpServers": {
    "web3-systemic-agent": {
      "type": "http",
      "url": "https://web3-systemic-agent.onrender.com/mcp"
    }
  }
}

README

Web3 Condition-Action Trigger Agent

Autonomous Web3 Security & Governance Auditor with Two-Stage Hybrid LLM Pipeline & x402 Bazaar Micropayments

[Python 3.11+] [Base] [x402 Protocol] [MCP Server] [Glama MCP] [mcptry] [M8ven Score] [Gemini 2.5/3.5] [License: Apache 2.0]

An autonomous Web3 agent engineered for real-time smart contract monitoring, DEX honeypot detection, and DAO governance security. Features a two-stage hybrid architecture that combines zero-cost deterministic on-chain gatekeeping with structured Gemini LLM evaluations, monetized Agent-to-Agent (A2A) via x402 gasless USDC micropayments on Base.

Operates natively as both a high-throughput FastAPI REST Service and a Model Context Protocol (MCP) Server compatible with Claude Desktop, Cursor, Smithery, Glama, and Coinbase AgentKit.


🌐 Live Production Service

The service is continuously deployed and operational in production on Render:

Canonical API Endpoints

MethodRouteDescriptionx402 Micropayment
GET/Service discovery, payment parameters, and endpoint directoryFree
GET/healthUptime probe, multi-chain RPC connectivity, LLM statusFree
GET/mcpMCP server discovery, transport metadata, tools manifestFree
POST/mcpMCP JSON-RPC 2.0 execution endpoint (streamable-http)Free / 402 for Deep Audit
POST/rules/validateStatic deterministic rule pre-validation and syntax checkFree
POST/evaluateTwo-stage hybrid evaluation (Deterministic + Gemini LLM)0.05 USDC
POST/rules/evaluate-batchSynchronous batch evaluation for up to 50 rulesFree / Sub-rules gated
POST/rules/enqueueAsynchronous evaluation queue returning unique job_idFree
GET/jobs/{job_id}Asynchronous job status inspection and results retrievalFree

🔌 Model Context Protocol (MCP) Server

The agent provides a first-class Model Context Protocol (MCP) server (src/mcp_server.py) implementing protocol specification 2024-11-05. It serves 3 free Stage 1 on-chain analysis tools to discover and qualify threats, and 1 paid Stage 2 tool for deep semantic auditing:

                                  ┌───────────────────────────────────────────────┐                                  │           MCP Server Tools Registry           │                                  └───────────────────────────────────────────────┘                                                          │                    ┌─────────────────────────────────────┴─────────────────────────────────────┐                    ▼                                                                           ▼      ┌───────────────────────────┐                                               ┌───────────────────────────┐      │     STAGE 1: FREE TOOLS   │                                               │    STAGE 2: PAID AUDIT    │      │   (Deterministic / $0.00) │                                               │     ($0.05 USDC via x402) │      └───────────────────────────┘                                               └───────────────────────────┘                    │                                                                           │       ├── scan_contract_selectors ───> Discovers EVM selectors & high-risk backdoors           │       ├── check_token_honeypot    ───> Static bytecode analysis for tax & blacklist traps      │       └── scan_dao_proposals      ───> Ingests Snapshot DAO proposals & calldata payloads     │                                                                                                │                               └─── (Upsell Recommendation Triggered) ──────────────────────────┘                                                                ▼                                                      deep_semantic_audit                                        (Two-Stage Gatekeeping + Gemini LLM Reasoning)

1. Free Stage 1 Tools

scan_contract_selectors
  • Purpose: Free deterministic bytecode inspection on Base or any EVM network. Discovers 4-byte function selectors and flags high-privilege administrative backdoors (transferOwnership, upgradeTo, mint, selfdestruct).
  • Parameters:
    • target_address (string, required): Hex EVM smart contract address.
    • chain_id (integer, default 8453): EVM Chain ID (8453 for Base Mainnet, 84532 for Base Sepolia).
    • bytecode_override (string, optional): Raw contract runtime bytecode hex string for offline analysis.
  • Returns: Contract status, bytecode size, extracted selectors, flagged high-risk capabilities, risk level (HIGH, LOW, EOA), and upsell recommendation.
check_token_honeypot
  • Purpose: Free static bytecode analysis for DEX honeypots, rugpull traps, and malicious token contracts:
    • Blacklist manipulation (isBlacklisted, setBlacklist, addToBlacklist)
    • Arbitrary transfer taxes & 100% sell fee traps (setTax, setFee, setSellFee)
    • Trading freeze and pause backdoors (pause, setTrading, enableTrading)
    • EVM SELFDESTRUCT (opcode 0xff) drainage traps
  • Parameters:
    • token_address (string, required): Hex EVM address of token contract.
    • chain_id (integer, default 8453): EVM Chain ID.
    • bytecode_override (string, optional): Raw token runtime bytecode for offline analysis.
  • Returns: is_honeypot_suspect boolean, numeric risk_score (0.0 to 10.0), active threat categories, detailed risk flags, and audit upsell guidance.
scan_dao_proposals
  • Purpose: Free scanner for recent Snapshot DAO governance proposals (Arbitrum, Aave, ENS, etc.). Extracts proposed execution targets, native Wei value transfers, and 4-byte calldata to detect governance hijack attempts.
  • Parameters:
    • space_id (string, default "arbitrumfoundation.eth"): Snapshot DAO space ENS domain.
    • limit (integer, default 3): Maximum proposals to fetch.
    • use_curated_offline (boolean, default false): If true, returns verified realistic curated proposals without outbound network calls.
  • Returns: Proposal IDs, natural language titles, execution targets, calldata payloads, and audit recommendations.

2. Paid Stage 2 Tool

deep_semantic_audit
  • Purpose: Two-stage autonomous security and governance audit. Executes deterministic on-chain gatekeeping followed by structured Google Gemini LLM reasoning crossing natural language claims with actual bytecode and calldata reality.
  • Parameters:
    • target_address (string, required): Hex EVM smart contract address.
    • proposal_description (string, required): Natural language claim or governance proposal explanation.
    • policy_prompt (string, optional): Security policy or criteria to audit against.
    • calldata (string, default "0x"): Transaction hex calldata being executed.
    • chain_id (integer, default 8453): EVM Chain ID.
    • risk_threshold (number, default 7.0): Threshold (0.0 to 10.0) above which intervention is warranted.
    • x402_payment_header (string, optional): Base64-encoded EIP-3009 transfer authorization satisfying $0.05 USDC payment.
  • Pricing & Micropayment Flow:
    • If invoked without payment credentials, returns a structured HTTP 402 payment challenge with the exact recipient address, amount ($0.05 USDC), and instructions.
    • If x402_payment_header is supplied (or X402_BUYER_PRIVATE_KEY is configured in the environment), the audit executes immediately and returns a deterministic policy result (APPROVE, MANUAL_REVIEW, or REJECT) with risk scores and flagged issues.

🛠️ MCP Client Configuration & Installation

Claude Desktop

Add the server to your claude_desktop_config.json:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
json
{  "mcpServers": {    "web3-systemic-agent": {      "command": "python",      "args": ["-m", "src.mcp_server"],      "cwd": "/path/to/web3-condition-action-trigger-agent",      "env": {        "WEB3_AGENT_URL": "https://web3-systemic-agent.onrender.com",        "X402_BUYER_PRIVATE_KEY": ""      }    }  }}

Cursor IDE

Create or edit .cursor/mcp.json in your project root or user config:

json
{  "mcpServers": {    "web3-systemic-agent": {      "command": "python",      "args": ["-m", "src.mcp_server"],      "env": {        "WEB3_AGENT_URL": "https://web3-systemic-agent.onrender.com"      }    }  }}

Smithery (smithery.yaml)

Install directly via Smithery.ai:

bash
smithery run web3-systemic-agent

Or reference the local manifest:

yaml
startCommand:  type: stdio  configSchema:    type: object    properties:      web3AgentUrl:        type: string        default: "https://web3-systemic-agent.onrender.com"      x402BuyerPrivateKey:        type: string  commandFunction:    python: "python -m src.mcp_server"

Glama (glama.json)

Verified for the Glama MCP Directory:

json
{  "$schema": "https://glama.ai/mcp/schemas/server.json",  "name": "web3-systemic-agent",  "maintainers": ["RafaCoelho33"],  "homepage": "https://web3-systemic-agent.onrender.com",  "repository": "https://github.com/RafaCoelho33/web3-systemic-agent"}

Coinbase AgentKit / Streamable-HTTP

Connect via HTTP streaming to the remote MCP endpoint without local installation:

python
import httpx
# Ingest tools manifest via Streamable-HTTPasync with httpx.AsyncClient() as client:    resp = await client.get("https://web3-systemic-agent.onrender.com/mcp")    tools = resp.json()["tools"]

🏗️ Two-Stage Architecture & x402 Micropayments

mermaid
flowchart TD    Client["Client / Agent / MCP Tool"] -->|POST /evaluate or deep_semantic_audit| Gate["x402 Payment Gatekeeper\n(EIP-3009 Gasless USDC)"]    Gate -->|No / Invalid Payment Header| R402["HTTP 402 Payment Required\n(0.05 USDC -> PAY_TO_ADDRESS)"]    Gate -->|Valid EIP-3009 Authorization| S1["Stage 1: ChainInspector (AsyncWeb3)\nBytecode Cache + Native Balance + Selectors"]    S1 -->|Condition Fails| ShortCircuit["Deterministic Short-Circuit\n(llm_invoked=False, LLM Cost = $0.00)"]    S1 -->|RPC Connectivity Error| Err503["HTTP 503 Unavailable\n(Payment NOT Settled / No Charge)"]    S1 -->|Condition Passes| S2["Stage 2: GeminiSemanticEvaluator\nStructured JSON Schema + Failover Models"]    S2 --> Policy["enforce_decision_policy\nDeterministic Escalation: REJECT / MANUAL / APPROVE"]    ShortCircuit --> Settle["Settle Payment via x402 Facilitator\nLog to SQLite Ledger (data/agent.db)"]    Policy --> Settle    Settle --> Resp["HTTP 200 OK: FinalAgentResponse + PaymentReceipt"]

Proven Live On-Chain Settlements (Base Sepolia)

The x402 A2A settlement cycle using EIP-3009 (transferWithAuthorization) has been verified and settled on Base Sepolia (Chain ID: 84532) with zero gas ETH consumed by the buyer or agent:

MetricTransaction 1 (Direct Settlement)Transaction 2 (Live Mempool Capture)Transaction 3 (Production Render)
Transaction Hash0xa02872819cef...0x6aa7c671469d...0x63ea962e6f0d...
Settlement MethodDirect EIP-3009 callLive mempool/block scanPOST https://web3-systemic-agent.onrender.com/evaluate
On-Chain StatusSuccess (Block 54583500)Success (Block 54644484)Success
Agent Wallet (PAY_TO_ADDRESS)0x2b7F1fd931...0x2b7F1fd931...0x2b7F1fd931...
Buyer Wallet (A2A Agent)0x4EbC7529d8...0x4EbC7529d8...0x4EbC7529d8...
x402 Facilitator (Gas Sponsor)0xd407e409E3... (https://x402.org/facilitator)0xd407e409E3... (https://x402.org/facilitator)0xd407e409E3... (https://x402.org/facilitator)
USDC Token Contract0x036CbD5384...0x036CbD5384...0x036CbD5384...
Settled Amount0.01 USDC0.01 USDC0.05 USDC
Gas Cost (Buyer / Server)0.00 ETH (Gasless EIP-3009)0.00 ETH (Gasless EIP-3009)0.00 ETH (Gasless EIP-3009)

📁 Repository Structure

├── src/│   ├── api.py                    # FastAPI service, x402 middleware, REST & MCP endpoints│   ├── mcp_server.py             # MCP server implementation (stdio & HTTP, 4 tools)│   ├── engine.py                 # ConditionAgentEngine two-stage orchestrator│   ├── chain_inspector.py        # Stage 1 deterministic on-chain gatekeeper with FIFO cache│   ├── semantic_evaluator.py     # Stage 2 Gemini/OpenAI LLM evaluator with cooldown failovers│   ├── schemas.py                # Pydantic v2 strict schemas and contracts│   ├── x402_payment.py           # x402 protocol, EIP-3009 signatures, replay defense│   ├── governance_connector.py   # Snapshot GraphQL connector & Discord/Slack dispatcher│   ├── storage.py                # Asynchronous SQLite ledger with automatic secret redaction│   ├── task_worker.py            # In-memory background task worker pool│   └── report.py                 # Telemetry CLI reporting token costs, revenue, net profit├── scripts/│   ├── block_contract_scanner.py # Autonomous Base Mainnet block deployment scanner│   ├── dex_pool_monitor.py       # Uniswap v3 & Aerodrome pool event monitor & honeypot engine│   ├── governance_listener.py    # Snapshot DAO sentinel bot│   ├── client_agent_x402.py      # Standalone A2A client with real on-chain settlement│   └── setup_buyer_wallet.py     # Wallet generation and USDC balance inspection utility├── tests/                        # 460+ automated unit, security, and integration tests├── smithery.yaml                 # Smithery MCP registry manifest├── glama.json                    # Glama MCP directory configuration├── Dockerfile                    # Production Docker container definition├── docker-compose.yml            # Local containerized orchestration└── .env.example                  # Environment configuration template

⚡ Quickstart & Setup

1. Installation

bash
git clone https://github.com/RafaCoelho33/web3-condition-action-trigger-agent.gitcd web3-condition-action-trigger-agent
# Install core and development dependenciespip install -r requirements-dev.txt

2. Configuration (.env)

Copy the template and provide your API keys:

bash
cp .env.example .env

Key environment variables:

env
# ServerPORT=8000PUBLIC_EVALUATE_ONLY=true
# Google Gemini APIGEMINI_API_KEY=your_gemini_api_key_hereGEMINI_MODEL=gemini-3.5-flash-liteGEMINI_FAILOVER_MODELS=gemini-3.5-flash-lite,gemini-3.1-flash-lite,gemini-2.5-flash-lite,gemini-2.0-flash
# x402 Micropayment ProtocolPAY_TO_ADDRESS=0x2b7F1fd931f7f28f89e0f688Dd5Bb7a620c24b63X402_ENABLED=trueX402_NETWORK=eip155:8453X402_PRICE_EVALUATE=0.05X402_USE_LIVE_FACILITATOR=true

3. Verify MCP Server Offline

bash
python src/mcp_server.py --dry-run

Expected output:

=== Web3 Systemic Agent MCP Server Self-Test ===[1/5] Registered 4 MCP tools: scan_contract_selectors, check_token_honeypot, scan_dao_proposals, deep_semantic_audit[2/5] Tool 'scan_contract_selectors' OK: risk_level=LOW, selectors=1, cost=$0.00[3/5] Tool 'check_token_honeypot' OK: is_honeypot=True, score=7.5, cost=$0.00[4/5] Tool 'scan_dao_proposals' OK: count=1, cost=$0.00[5/5] Tool 'deep_semantic_audit' OK: status=payment_required, status_code=402, price_usdc=0.05=== All MCP self-tests PASSED successfully ===

4. Run the Full Test Suite

bash
pytest

📜 License

This project is licensed under the Apache License 2.0 (SPDX-License-Identifier: Apache-2.0).

  • Copyright: Copyright (c) 2026 RafaCoelho33. All rights reserved under Apache-2.0 terms (including trademark protection under Section 6 and mandatory attribution under Section 4).

来源:README.md,提交 18ff7c0

工具

4

scan_contract_selectors

Scan Smart Contract Bytecode & Selectors

Stage 1 Free ($0.00) deterministic EVM bytecode inspector that extracts 4-byte function selectors and flags privileged backdoors (transferOwnership, upgradeTo, mint, selfdestruct). Queries live RPC for chain_id (8453 Base, 84532 Base Sepolia, 42161 Arbitrum) unless bytecode_override (0x hex) is supplied for offline analysis; falls back to empty bytecode on RPC error. Returns JSON with is_contract, bytecode_size_bytes, selectors_found, high_risk_selectors, risk_level (HIGH, LOW, EOA), and recommendation.

输入参数chain_idtarget_address必填bytecode_override

check_token_honeypot

Check Token Honeypot & Tax Traps

Stage 1 Free ($0.00) static DEX token bytecode scanner that detects blacklist traps (isBlacklisted, setBlacklist), 100% sell-tax modifiers (setTax, setFee), trading freezes (pause), and SELFDESTRUCT opcodes. Fetches live token_address bytecode on chain_id unless bytecode_override (0x hex) is provided for offline execution; returns safe EOA status if bytecode is empty. Returns JSON with is_contract, is_honeypot_suspect (bool), risk_score (0.0-10.0), threat_categories, risk_flags, and recommendation.

输入参数chain_idtoken_address必填bytecode_override

scan_dao_proposals

Scan Snapshot DAO Governance Proposals

Stage 1 Free ($0.00) governance scanner that fetches up to limit (1-20) recent Snapshot DAO proposals for space_id (e.g. arbitrumfoundation.eth, aavedao.eth, ens.eth) and extracts on-chain target addresses and calldata to spot hostile takeover payloads. Queries Snapshot GraphQL API by default, or falls back to deterministic offline fixtures when use_curated_offline=true or network fails. Returns JSON with space_id, proposals_count, proposals (id, title, target_address, calldata, value_wei, state), and recommendation.

输入参数limitspace_iduse_curated_offline

deep_semantic_audit

Deep Semantic LLM Governance & Contract Audit (x402)

Stage 2 Paid ($0.05 USDC via x402 on Base Mainnet) hybrid audit combining Stage 1 on-chain gatekeeping with Stage 2 Gemini LLM evaluation to verify proposal_description claims against target_address bytecode and calldata under policy_prompt. Non-idempotent due to LLM evaluation and single-use EIP-3009 x402_payment_header nonce; omitting x402_payment_header safely returns an HTTP 402 payment challenge without charging. Breaching risk_threshold (0.0-10.0) escalates decision to REJECT. Returns JSON with status, decision (APPROVE, MANUAL_REVIEW, REJECT), risk_score, reasoning, and flagged_issues.

输入参数calldatachain_idpolicy_promptrisk_thresholdtarget_address必填x402_payment_headerproposal_description必填

版本历史

2
  1. v1.0.1最新Nov 12, 2026
  2. v1.0.0Nov 11, 2026

评分

已满足适用检查项的 100%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通必需25 分
  • 已声明认证方式必需10 分
  • 已列出工具必需15 分
  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分

其他 Web3 集成