
web3agent
io.github.Apegurus由 GitHub 帳號 Apegurus 發布v0.6.2更新於 Oct 24, 2026
Web3 MCP proxy for AI agents: DeFi swaps, bridges, market data, wallets, and gated writes.
概覽
讓 AI 助理取得 EVM 與 DeFi 工具:兌換、跨鏈橋、訂單、交易所交易、行情資料、研究與錢包管理。
- 可以做什麼
- 這是一個本機 stdio MCP 伺服器,提供 190 多個工具,涵蓋 EVM 鏈與 DeFi。功能包括鏈上讀寫、代幣兌換、跨鏈橋、限價與觸發訂單、CCXT 交易所交易、區塊瀏覽器查詢、行情與研究資料、代幣解析以及錢包生命週期管理。預設情況下寫入操作需經確認佇列,錢包密鑰工具預設關閉,除非明確啟用。
- 適用情境
- 當助理需要報價、準備或執行兌換、跨鏈橋、訂單等 DeFi 操作,或讀取多條 EVM 鏈上的餘額、交易與行情資料時適用。適合希望直接使用協定整合而不自行重建的代理開發者與 DeFi 團隊。
- 執行需求
- 以 npx 執行的本機程序;需要 Node.js 22+。可選密鑰:COINGECKO_API_KEY、ETHERSCAN_API_KEY、ZEROX_API_KEY、OWS_PASSPHRASE。可選 CCXT_CONFIG_PATH 用於交易所憑證,CHAIN_ID 用於覆寫預設的 Base 主網(8453)。需要存取 RPC 與資料供應方的網路。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 web3agent,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
[npm version] [npm downloads] [License: MIT] [GitHub stars] [smithery badge]
See it in production: The Arena — 11 AI agents trade real capital through Web3Agent.
web3agent
MCP package:
web3agent| npm: https://www.npmjs.com/package/web3agent | GitHub: https://github.com/Apegurus/web3agent | Contact: [email protected]
Links: Website · GitHub · npm · Smithery · The Arena · X / @Web3AgentFi
Give your AI agent EVM execution and DeFi tooling: swaps, bridges, limit and trigger orders, exchange trading, market data, research, wallet management. 190+ MCP tools. One install.
Works out of the box with Claude Code, Cursor, Windsurf, OpenCode, and Codex. Self-custodial. By default, write operations go through a confirmation queue: nothing executes without your approval unless you explicitly disable confirmations.
EVM execution is a solved problem. Stop rebuilding it. Plug in and ship.
What you can do
Once installed, your AI agent can execute real DeFi operations in plain language:
- "Swap 0.1 ETH for USDC on Base" — quoted, routed, confirmation-gated, executed
- "Bridge 500 USDC from Arbitrum to Optimism" — cross-chain via LI.FI, 20+ chains
- "Set a limit or trigger order to buy ETH at $2,800" — decentralized Spot orders via Orbs
- "Cancel my open orders on Binance" — CCXT exchange access with per-method risk classification
- "What's my USDC balance on Base?" — read-only EVM and ERC-20 balance checks
- "Show me yield opportunities above 5% APY" — research tools, protocol analysis, due diligence
Common flows avoid ABI handling and transaction building. Generic contract reads and writes are available when you provide or register an ABI, or when explorer ABI lookup is available. The agent handles routing, transaction preparation, and the confirmation queue. You approve, it executes.
Quickstart for agent power users
This detects Claude Code, Cursor, Windsurf, OpenCode, or Codex and configures the MCP server automatically. Restart your host, then ask:
For any other MCP-capable host, configure a stdio server that runs:
The generic MCP config shape is:
Writes are confirmation-gated by default, and wallet secrets are not exposed through MCP unless explicitly enabled.
For a step-by-step guide covering both human and agent setups, see docs/guides/universal-access.md.
Smithery local bundle
Smithery URL publishing requires a hosted Streamable HTTP MCP endpoint. Web3Agent is distributed as a local stdio/npm server, so Smithery distribution uses an MCPB bundle instead:
The generated MCPB is a thin local bundle that launches the published npm package with npm exec --package [email protected].
Why Web3Agent
- One-line install.
npx web3agent initauto-configures Claude Code, Cursor, Windsurf, OpenCode, or Codex. No manual config edits for supported hosts. - Self-custodial. Keys stay in your environment, wallet secrets are kept out of agent-visible MCP flows by default, and every write goes through the confirmation queue unless you intentionally disable it.
- Battle-tested infrastructure. Built on GOAT SDK, LI.FI, Orbs, Blockscout, Etherscan, DexScreener, and other production Web3 rails.
- Live in production. Powers Orbzy and The Arena, where AI agents trade real capital through Web3Agent.
- One MCP surface. Swaps, bridges, orders, market data, research, token resolution, wallet lifecycle, and agent-payment protocols are available through one server.
Who it is for
- AI agent builders who need Web3 execution without rebuilding protocol integrations
- DeFi teams adding MCP support to internal tools, research agents, or trading agents
- Developers prototyping wallet-aware agents, swaps, bridges, and market workflows
- MCP host users who want read-only chain data plus explicit-confirmation write flows
Copy-paste prompts
Use these after installation to get to value quickly:
Supported hosts
Supported chains
Basic EVM operations use viem's chain registry and can target any viem-supported EVM chain when RPC access is available.
Enhanced swap and order integrations currently cover Ethereum, Base, Arbitrum, Optimism, Polygon, Linea, BSC, Avalanche, Sonic, Mode, Blast, Celo, and Gnosis. Token resolution, explorer, LI.FI, and market/research tools have provider-specific coverage; LI.FI bridge quotes and execution support 20+ chains through LI.FI's own chain list.
Default: Base (8453). Override with the CHAIN_ID env var or pass chainId per call.
What's included
Starter templates
Scaffolds a ready-to-run project from one of three bundled templates:
- Vercel AI SDK — chat agent with tool calling
- Mastra — agent framework with web3agent tools
- MCP-host — lightweight MCP client
Each starter uses the same web3agent lifecycle surfaces as MCP and CLI.
Examples
Root examples are included in the npm package:
The examples default to small USDC-denominated flows and only prepare wallet actions when you pass --prepare.
Quickstart examples
Agent that prepares a swap on Base
Agent that prepares a bridge from Ethereum to Arbitrum
Agent that monitors a wallet
For crypto teams
Use web3agent when you want AI agents to discover or interact with your protocol without every team rebuilding wallet, chain, token, quote, explorer, and confirmation plumbing.
Integration surfaces:
- MCP tools for Claude Code, Cursor, Windsurf, OpenCode, Codex, and other MCP hosts
- Programmatic SDK from
web3agentfor app-owned agents and browser-wallet flows - Prepared operations for protocols that need users or apps to sign externally
- Confirmation-gated writes so execution never bypasses an explicit approval path by default
Good first integration targets:
- token, market, and position reads
- quote and simulation tools
- prepared wallet actions for browser/app signing
- protocol-specific research or risk tools
For protocol support or integration questions, open an issue at https://github.com/Apegurus/web3agent/issues or contact [email protected].
Usage
Wallet secret MCP tools are disabled by default so private keys and mnemonics do not enter an AI agent's inference context. Use the local web3agent wallet ... commands above for safe generation/import. If you explicitly accept the risk of agent-visible secrets, set WEB3AGENT_ALLOW_AGENT_VISIBLE_SECRETS=1 to re-enable the legacy MCP behavior.
wallet_deactivate only deactivates the current runtime session and returns to read-only ephemeral mode. Use confirmation-gated wallet_delete when you intentionally want to permanently remove persisted wallet material.
Wallet security defaults
By default, web3agent keeps wallet secrets out of MCP tool responses and agent-visible inputs. The local web3agent wallet ... commands are the recommended way to generate or import private keys and mnemonics because they require an interactive TTY and refuse JSON secret output. Set WEB3AGENT_ALLOW_AGENT_VISIBLE_SECRETS=1 only if you explicitly accept that private keys or mnemonics can be sent through the MCP host and visible to the agent/inference provider.
For persisted server-side wallets, setting OWS_PASSPHRASE is not mandatory, but strongly recommended. When it is set on macOS/Linux and OWS is available, web3agent uses the Open Wallet Standard encrypted vault instead of the legacy filesystem-protected wallet store. The OWS spec minimum is 12 characters; web3agent warns on weak runtime passphrases and local wallet generation/import rejects shorter values. Use a 16+ character mixed passphrase in production. Configure it in the process that runs web3agent, whether that is npx web3agent as an MCP server or an app/service using createRuntime({ env: { OWS_PASSPHRASE: "..." } }).
If OWS_PASSPHRASE is missing, empty, OWS is unavailable, the platform is Windows, or OWS_FORCE_LEGACY=1 is set, web3agent falls back to legacy wallet storage protected by file permissions only. Migrating a legacy wallet.json leaves a plaintext wallet.json.migrated rollback backup; delete it after verifying OWS access. For multi-agent services, run separate wallet-using runtimes in separate processes until per-runtime wallet isolation is supported.
Programmatic usage
Root API
Use the package root for stable, typed EVM capabilities from another app or agent layer.
Use resolveCanonicalToken() for well-known registry tokens and native-token aliases. Use resolveToken() when you also want DexScreener discovery fallback for long-tail assets.
Browser wallet flows
Use the root API when your app owns the signer (e.g. a browser wallet via wagmi or AppKit).
prepareOperation(...)returns the next wallet actions plusresumeState- Your app executes those actions with the browser wallet
resumeOperation(...)continues until the operation completes
Transaction actions are only considered complete once you return a confirmed result:
resumeOperation() independently verifies the receipt before advancing.
Architecture notes: docs/architecture/browser-wallet-operations.md
Runtime API
Use web3agent/runtime when you need tool discovery, generic invocation, or upstream passthrough tools.
Environment variables
See WEB3_CONTEXT.md for the full environment variable reference.
For authenticated exchange access via CCXT tools, set CCXT_CONFIG_PATH to a JSON file containing named accounts and exchange credentials.
Known limitations
- Blockscout explorer tools work on 8 chains only (Ethereum, Polygon, Arbitrum, Optimism, Base, Gnosis, Scroll, zkSync Era)
- Yield tooling is read-only research; protocol-specific execution beyond first-class tools uses ABI-backed EVM calls
- 0x and CoinGecko plugins require their respective API keys
- MCP hosts cannot open a browser wallet prompt directly — MCP can prepare, simulate, and submit signed payloads, but signing requires your app to handle the wallet interaction
Requirements
- Node.js 22+
- pnpm (for development)
License
MIT
來源:README.md,提交 122f159
工具
0版本歷史
1- v0.6.2最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分