evmcp
evmcp
EVM + MCP — 为你的 AI 助手赋予区块链超能力。
MCP 服务器,实时访问 Base、Optimism、Avalanche、Celo 和 Arbitrum 上的链上数据,并配有部署在链上的配套智能合约,用于批量查询和跨链数据。
工作原理
EVMCP 实现了 Model Context Protocol(MCP),这是一种允许 AI 助手调用外部工具的标准。连接后,你的 AI 助手将获得 28 个只读区块链工具,可用于查询余额、解码交易、比较 gas 价格等,覆盖五条 EVM 链。
EVMCP 的独特之处在于其 配套智能合约 — 部署在 Avalanche 和 Celo 上的四个 Solidity 合约,支持通过 Multicall3 进行批量查询、链上工具注册表、事件聚合和跨链余额缓存。MCP 服务器从这些合约读取数据;所有写入操作均由管理 CLI 单独执行。
Related MCP server: Bink MCP Server
快速开始
使用 Claude Desktop
添加到你的 Claude Desktop 配置(~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"evmcp": {
"command": "npx",
"args": ["-y", "evmcp"],
"env": { "ALCHEMY_API_KEY": "your_key_here" }
}
}
}使用 Claude Code
claude mcp add evmcp -- npx -y evmcp支持的链
Chain | Chain ID | Native Token | Companion Contracts |
Base | 8453 | ETH | 尚未部署 |
Optimism | 10 | ETH | 尚未部署 |
Avalanche C-Chain | 43114 | AVAX | 已部署 |
Celo | 42220 | CELO | 已部署 |
Arbitrum One | 42161 | ETH | 尚未部署 |
以太坊主网(链 ID 1)也受支持,但仅用于 ENS 解析。
工具(共 29 个)
余额(3)
Tool | Description |
| 获取指定链上地址的原生代币余额(ETH/AVAX/CELO) |
| 获取指定链上地址的 ERC20 代币余额 |
| 并行获取地址在所有 5 条受支持链上的原生代币余额 |
区块(3)
Tool | Description |
| 按哈希获取指定链上的区块 |
| 按编号获取指定链上的区块,或传入 "latest" 获取最新区块 |
| 获取指定链的最新区块编号、时间戳和基础费用 |
交易(3)
Tool | Description |
| 按哈希获取指定链上的交易 |
| 获取交易回执,包括状态、gasUsed 和日志 |
| 使用提供的 ABI 解码交易的函数调用 |
合约(3)
Tool | Description |
| 使用提供的 ABI 调用智能合约上的只读函数 |
| 检查地址是否部署了合约代码,并返回字节码长度和哈希 |
| 读取指定地址的存储槽原始值 |
代币(2)
Tool | Description |
| 获取 ERC20 代币元数据,包括名称、符号、小数位和总供应量 |
| 获取所有者授予支出者的 ERC20 代币授权额度 |
Gas(3)
Tool | Description |
| 获取指定链的当前 gas 价格和 EIP-1559 费用数据 |
| 估算指定链上交易的 gas |
| 比较所有 5 条受支持链的当前 gas 价格 |
ENS(2)
Tool | Description |
| 通过 Ethereum L1 将 ENS 名称(如 vitalik.eth)解析为以太坊地址 |
| 通过 Ethereum L1 反向查找地址对应的 ENS 名称 |
事件(2)
Tool | Description |
| 获取指定链上合约发出的事件日志 |
| 使用提供的 ABI 解码原始事件日志 |
链与健康状态(3)
Tool | Description |
| 获取链名称、链 ID、当前区块编号、出块时间和原生代币符号 |
| 检查地址在所有 5 条受支持链上是否部署了合约代码 |
| 测试所有 6 个 RPC 端点(Ethereum、Base、Optimism、Avalanche、Celo、Arbitrum)的连通性 |
批处理(1)
Tool | Description |
| 使用 Multicall3 在单个 RPC 请求中执行多次读取调用 |
跨链(2)
Tool | Description |
| 比较地址在所有 5 条链上的原生代币余额 |
| 检查地址在所有 5 条链上的交易数量 |
注册表(1)
Tool | Description |
| 从链上 MCPRegistry 配套合约读取已注册的工具元数据 |
优化器(1)
Tool | Description |
| 推荐交易最便宜的链,同时考虑 Base/Optimism/Arbitrum 上的 L1 数据费用 |
资源(4)
URI Pattern | Description | Cache TTL |
| 链的当前区块高度和 gas 价格 | 12s |
| 以 gwei 为单位的基础费用、gas 价格和优先费用 | 12s |
| 热门代币地址和小数位(v1 中硬编码) | 1 hour |
| 所有受支持链及其 ID、符号和配套合约地址 | 静态 |
模板化资源支持的链 ID:8453(Base)、10(Optimism)、43114(Avalanche)、42220(Celo)、42161(Arbitrum)。
提示词(4)
Prompt | Arguments | Description |
|
| 钱包的多链余额和活动分析 |
|
| 智能合约的基本检查和审计工作流 |
| (无) | 比较所有链的 gas 成本、速度和特性 |
|
| 详细解码、分析和追踪交易 |
配套合约
四个 Solidity 合约已部署在 Avalanche 和 Celo 上。MCP 服务器从这些合约读取数据,以提供批量查询、链上工具元数据和跨链数据。Base 和 Optimism 的部署已在规划中。
Avalanche C-Chain(43114)
Contract | Address |
MCPRegistry |
|
BatchQuery |
|
EventAggregator |
|
CrossChainCache |
|
Celo(42220)
Contract | Address |
MCPRegistry |
|
BatchQuery |
|
EventAggregator |
|
CrossChainCache |
|
合约说明
MCPRegistry -- 所有 EVMCP 工具的链上元数据(名称、描述、版本)。仅所有者可写。
BatchQuery -- 通过 Multicall3 优化批量读取。包含多余额、多合约检查和多代币余额辅助函数。
EventAggregator -- 缓存每个合约的事件计数摘要。由管理 CLI 更新。
CrossChainCache -- 存储用于跨链查询的余额快照。由管理 CLI 更新。
环境变量
Variable | Required | Description |
| Yes* | Alchemy API 密钥(覆盖所有链) |
| No* | 覆盖 Base 的 RPC URL |
| No* | 覆盖 Optimism 的 RPC URL |
| No* | 覆盖 Avalanche 的 RPC URL |
| No* | 覆盖 Celo 的 RPC URL |
| No* | 覆盖 Arbitrum 的 RPC URL |
| No | 覆盖用于 ENS 解析的 RPC URL |
| No | 缓存 TTL(秒)(默认:15) |
| No | 最大缓存条目数(默认:1000) |
| No | debug、info、warn 或 error(默认:info) |
| No | 使用测试网链(默认:false) |
| TRANSPORT | 否 | stdio(默认)或 http,用于 Streamable HTTP 传输 |
| HTTP_PORT | 否 | HTTP 传输的端口(默认值:3402) |
| X402_ENABLED | 否 | 在 HTTP 传输上启用 x402 支付门控 |
| X402_PAYEE_ADDRESS | 否** | Base 上的 USDC 收款地址 |
| X402_FACILITATOR_URL | 否 | x402 协调器 URL(有默认值) |
*提供 ALCHEMY_API_KEY 或全部五个单独的链 RPC URL。
**当 X402_ENABLED=true 时为必需。
开发
pnpm install
pnpm build
pnpm inspect # MCP Inspector UI at localhost:6274
pnpm test # Unit tests
pnpm typecheck # Type check
pnpm lint # ESLint许可证
MIT
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceProvides tools for querying onchain data across 12+ blockchain networks, including token balances, transaction analysis, and smart contract security auditing. It enables users to interact with multiple EVM-compatible chains and perform deep contract evaluations through natural language interfaces.1

Bink MCP Serverofficial
FlicenseNot gradedqualityDmaintenanceEnables AI agents to perform blockchain operations like wallet management, token info, DeFi swaps, cross-chain bridging, and price checking across Ethereum, BNB Chain, and Solana.
Noves MCP Serverofficial
AlicenseBqualityDmaintenanceEnables AI assistants to access and explain blockchain data across 100+ networks using natural language, without requiring authentication.923MIT- AlicenseAqualityCmaintenanceEnables AI agents to fetch live multi-chain portfolio, token info, gas prices, and token prices across Ethereum, Base, Polygon, Arbitrum, and Optimism with a single call. No API key required.4MIT
Related MCP Connectors
Read-only on-chain intelligence for AI agents on Base: balances, tokens, gas, tx status.
Read-only on-chain intel for AI agents on Base: balances, tokens, gas, tx status. No API keys.
Provide AI agents and automation tools with contextual access to blockchain data including balance…
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/siriuslattice/evmcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server