mcpField
E
ETH Security MCP

ETH Security MCP

本地服务
github.com/sirocco-k1开发工具056 周前更新

关于 ETH Security MCP

ETH Security MCP 是面向以太坊安全分析人员、审计人员和事件响应人员的 MCP 服务集合,涵盖交易与代币活动查询、合约源码和函数签名检索,以及交易模拟。

主要功能

  1. 01查询交易和代币活动
  2. 02检索合约源码
  3. 03解析函数签名
  4. 04使用 Foundry cast 模拟交易

适用场景

  1. 01审查以太坊地址相关活动
  2. 02检查合约并识别函数签名
  3. 03模拟交易以查看执行情况和 Gas 用量

MCP 相关

它向 MCP 客户端提供 Dune、Sources 和 Cast 三种专用 MCP 服务,分别用于查询链上活动、合约数据和交易模拟结果。

配置

本地服务的配置在各客户端中通用,复制后粘贴到客户端的 MCP 配置文件即可。

暂未收录安装方式

我们还没有获取到这个服务的安装包或远程地址,请按项目 README 中的说明安装。

代码仓库

工具

还没有获取到工具列表

本地服务需要在你的电脑上运行后才能读取工具,维护者暂未提供工具列表。

详细介绍

ETH Security MCP

为安全分析师、审计人员和事件响应人员提供的一系列 MCP 服务。

设置

依赖项

eth-security-mcp 需要安装以下依赖项:

环境变量设置

eth-security-mcp 中的 MCP 服务可能会使用环境变量传递 API 密钥等信息。.env.example 列出了运行所有 MCP 服务所需的相关值。要设置 .env 文件,请运行 cp .env.example .env 并填写相关信息。

工作区

此代码库使用 npm 工作区来分隔各项操作。要与特定工作区交互,请使用 npm <action> -w src/<directory-name>。

构建和调试

此代码库使用 justfile,通过 MCP Inspector 自动执行构建和调试。例如,要构建和调试 dune MCP 服务,可以运行以下命令:

$ just -l
Available recipes:
    build workspace
    debug workspace

$ just debug dune
将 MCP 服务安装到 Claude Desktop

要将此代码库中的 MCP 服务安装到 Claude Desktop:

  1. 运行 just setup-<machine> <mcp-server>,其中 machine 可以是 linux 或 macos,mcp-server 是包含要安装的 MCP 服务的目录名称。

  2. just 命令会在 MCP 服务所在目录中生成一个名为 claude.config.tmp.json 的文件。将其内容复制并粘贴到以下文件中的 mcpServers 下:

    • macOS:~/Library/Application Support/Claude/claude_desktop_config.json
    • linux:~/.config/Claude/claude_desktop_config.json
  3. 添加配置信息后,重启 Claude Desktop 以使更改生效。

MCP 服务

此集合包含三个专用于 Ethereum 安全分析的 MCP 服务:

服务用途工具
Dune交易分析和区块链数据get_transactions_by_address、get_activity_by_address
Sources函数签名和合约源代码retrieve_function_signature、retrieve_source_code
Cast交易模拟和调试run_transaction

🔍 Dune

**用途:**访问 Dune API 端点,进行结构化交易分析并检索区块链数据。

工具
get_transactions_by_address

**说明:**使用 Dune 的 Sim API 检索特定地址的交易。

参数
参数类型必需说明
addressstring✅要查询交易的地址
block_numbernumber❌筛选从此区块编号开始的交易
chain_idsstring❌以逗号分隔的链 ID 列表
is_senderboolean❌返回该地址为发送方的交易
is_receiverboolean❌返回该地址为接收方的交易
返回值

返回一个交易对象数组,结构如下:

{
  address: string;          // Contract or account address
  block_number: number;     // Block containing the transaction
  data: string;             // Raw transaction data
  from: string;             // Transaction sender address
  to: string | null;        // Transaction recipient (null for contract creation)
  value: string;            // ETH amount transferred in wei
  logs: Array<{             // Event logs emitted during execution
    address: string;        // Contract emitting the event
    data: string;           // Raw event data
    topics: string[];       // Event topics
  }>;
}[]
get_activity_by_address

**说明:**使用 Dune 的 Sim API 检索特定地址的代币活动。

参数
参数类型必需说明
addressstring✅要查询代币活动的地址
block_numbernumber✅返回截至此区块编号的活动
chain_idsstring❌以逗号分隔的链 ID 列表
返回值

返回一个活动对象数组,结构如下:

{
  chain_id: number;         // Chain ID where activity occurred
  block_number: number;     // Block containing the activity
  block_time: string;       // Timestamp of the block
  tx_hash: string;          // Transaction hash
  type: string;             // Type of activity (transfer, swap, etc.)
  asset_type: string;       // Type of asset (erc20, native, etc.)
  token_address: string;    // Address of the token contract
  from: string;             // Sender address
  to: string;               // Receiver address
  spender: string;          // Spender address (for approvals)
  value: string;            // Amount transferred
  value_usd: number;        // USD value of the transfer
  token_metadata: {         // Token information
    symbol: string;         // Token symbol
    decimals: number;       // Token decimals
    name: string;           // Token name
    price_usd: number;      // Token price in USD
    standard: string;       // Token standard (erc20, etc.)
  };
  function: {               // Function call details
    signature: string;      // Function signature
    name: string;           // Function name
    inputs: {               // Function inputs
      name: string;         // Parameter name
      type: string;         // Parameter type
      value: string;        // Parameter value
    };
  };
  contract_metadata: {      // Contract information
    name: string;           // Contract name
  };
  from_token_address: string;    // Source token address (for swaps)
  from_token_value: string;      // Source token amount (for swaps)
  to_token_address: string;      // Destination token address (for swaps)
  to_token_value: string;        // Destination token amount (for swaps)
}[]

📚 Sources

**用途:**访问函数签名数据和合约源代码,以进行安全分析。

工具
retrieve_function_signature

**说明:**从 4byte API 检索给定函数选择器对应的函数签名。

参数
参数类型必填描述
selectorstring✅十六进制函数选择器(例如:"0x70a08231")
返回值
{
  best_match: string;      // Most likely function signature (lowest ID)
  all_matches: string[];   // All potential matching signatures
}
retrieve_source_code

描述: 从 Sourcify 获取合约地址对应的源代码。

参数
参数类型必填描述
addressstring✅要获取源代码的合约地址
chain_idnumber✅部署合约的链 ID
返回值
{
  sources: Record<string, {      // Source files
    [filePath: string]: string;  // File path → file content
  }>;
}

⚡ Cast

用途: 使用 Foundry 的 cast 命令行工具进行交易模拟和智能合约交互。

工具
run_transaction

描述: 使用 Foundry 的 cast run 命令模拟交易,以便进行调试和分析。

参数
参数类型必填描述
transactionHashstring✅要模拟的交易哈希
rpcUrlstring✅Ethereum 节点的 RPC URL
quickboolean❌使用快速模式加快模拟速度(默认值:false)
返回值

返回一个字符串,其中包含:

  • 交易执行详情
  • 状态变更
  • Gas 使用情况
  • 回滚原因(如果交易失败)

评论

支持 Markdown

第一次接触 MCP?

从协议是什么,到在客户端里装上第一个服务,这几条回答覆盖了大多数入门问题。

一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。