Skip to main content
Glama

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

getBalance

获取指定链上地址的原生代币余额(ETH/AVAX/CELO)

getTokenBalance

获取指定链上地址的 ERC20 代币余额

getMultiChainBalance

并行获取地址在所有 5 条受支持链上的原生代币余额

区块(3)

Tool

Description

getBlock

按哈希获取指定链上的区块

getBlockByNumber

按编号获取指定链上的区块,或传入 "latest" 获取最新区块

getLatestBlock

获取指定链的最新区块编号、时间戳和基础费用

交易(3)

Tool

Description

getTransaction

按哈希获取指定链上的交易

getTransactionReceipt

获取交易回执,包括状态、gasUsed 和日志

decodeTransaction

使用提供的 ABI 解码交易的函数调用

合约(3)

Tool

Description

readContract

使用提供的 ABI 调用智能合约上的只读函数

getContractCode

检查地址是否部署了合约代码,并返回字节码长度和哈希

getStorageAt

读取指定地址的存储槽原始值

代币(2)

Tool

Description

getERC20Info

获取 ERC20 代币元数据,包括名称、符号、小数位和总供应量

getTokenAllowance

获取所有者授予支出者的 ERC20 代币授权额度

Gas(3)

Tool

Description

getGasPrice

获取指定链的当前 gas 价格和 EIP-1559 费用数据

estimateGas

估算指定链上交易的 gas

compareGasAcrossChains

比较所有 5 条受支持链的当前 gas 价格

ENS(2)

Tool

Description

resolveENS

通过 Ethereum L1 将 ENS 名称(如 vitalik.eth)解析为以太坊地址

lookupAddress

通过 Ethereum L1 反向查找地址对应的 ENS 名称

事件(2)

Tool

Description

getContractEvents

获取指定链上合约发出的事件日志

decodeEventLog

使用提供的 ABI 解码原始事件日志

链与健康状态(3)

Tool

Description

getChainInfo

获取链名称、链 ID、当前区块编号、出块时间和原生代币符号

isContractDeployed

检查地址在所有 5 条受支持链上是否部署了合约代码

healthCheck

测试所有 6 个 RPC 端点(Ethereum、Base、Optimism、Avalanche、Celo、Arbitrum)的连通性

批处理(1)

Tool

Description

batchQuery

使用 Multicall3 在单个 RPC 请求中执行多次读取调用

跨链(2)

Tool

Description

compareBalances

比较地址在所有 5 条链上的原生代币余额

crossChainActivity

检查地址在所有 5 条链上的交易数量

注册表(1)

Tool

Description

queryRegistry

从链上 MCPRegistry 配套合约读取已注册的工具元数据

优化器(1)

Tool

Description

gasOptimizer

推荐交易最便宜的链,同时考虑 Base/Optimism/Arbitrum 上的 L1 数据费用

资源(4)

URI Pattern

Description

Cache TTL

chain://{chainId}/status

链的当前区块高度和 gas 价格

12s

chain://{chainId}/gas

以 gwei 为单位的基础费用、gas 价格和优先费用

12s

chain://{chainId}/tokens/popular

热门代币地址和小数位(v1 中硬编码)

1 hour

evmcp://chains

所有受支持链及其 ID、符号和配套合约地址

静态

模板化资源支持的链 ID:8453(Base)、10(Optimism)、43114(Avalanche)、42220(Celo)、42161(Arbitrum)。

提示词(4)

Prompt

Arguments

Description

analyze-wallet

address

钱包的多链余额和活动分析

audit-contract

contractAddress, chain

智能合约的基本检查和审计工作流

compare-chains

(无)

比较所有链的 gas 成本、速度和特性

investigate-tx

txHash, chain

详细解码、分析和追踪交易

配套合约

四个 Solidity 合约已部署在 Avalanche 和 Celo 上。MCP 服务器从这些合约读取数据,以提供批量查询、链上工具元数据和跨链数据。Base 和 Optimism 的部署已在规划中。

Avalanche C-Chain(43114)

Contract

Address

MCPRegistry

0x62402b65bfb4Fd022285A6FC2F26d8caEEc3D055

BatchQuery

0xfDc19e0617AdF1811A68Aa1575409F3769f39491

EventAggregator

0xECE24a53A28F088351EC2Da258f78479e81A8007

CrossChainCache

0x0899a6Ef23c6B39A4D9B877B219645B89209A670

Celo(42220)

Contract

Address

MCPRegistry

0x62402b65bfb4Fd022285A6FC2F26d8caEEc3D055

BatchQuery

0xfDc19e0617AdF1811A68Aa1575409F3769f39491

EventAggregator

0xECE24a53A28F088351EC2Da258f78479e81A8007

CrossChainCache

0x0899a6Ef23c6B39A4D9B877B219645B89209A670

合约说明

  • MCPRegistry -- 所有 EVMCP 工具的链上元数据(名称、描述、版本)。仅所有者可写。

  • BatchQuery -- 通过 Multicall3 优化批量读取。包含多余额、多合约检查和多代币余额辅助函数。

  • EventAggregator -- 缓存每个合约的事件计数摘要。由管理 CLI 更新。

  • CrossChainCache -- 存储用于跨链查询的余额快照。由管理 CLI 更新。

环境变量

Variable

Required

Description

ALCHEMY_API_KEY

Yes*

Alchemy API 密钥(覆盖所有链)

BASE_RPC_URL

No*

覆盖 Base 的 RPC URL

OPTIMISM_RPC_URL

No*

覆盖 Optimism 的 RPC URL

AVALANCHE_RPC_URL

No*

覆盖 Avalanche 的 RPC URL

CELO_RPC_URL

No*

覆盖 Celo 的 RPC URL

ARBITRUM_RPC_URL

No*

覆盖 Arbitrum 的 RPC URL

ETHEREUM_RPC_URL

No

覆盖用于 ENS 解析的 RPC URL

CACHE_TTL_SECONDS

No

缓存 TTL(秒)(默认:15)

CACHE_MAX_ENTRIES

No

最大缓存条目数(默认:1000)

LOG_LEVEL

No

debug、info、warn 或 error(默认:info)

USE_TESTNETS

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

A
license - permissive license
Not graded
quality - not tested
D
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

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

  • F
    license
    Not graded
    quality
    D
    maintenance
    Provides 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
  • F
    license
    Not graded
    quality
    D
    maintenance
    Enables 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.
  • A
    license
    A
    quality
    C
    maintenance
    Enables 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.
    4
    MIT

View all related MCP servers

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…

View all MCP Connectors

Latest Blog Posts

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