Skip to main content
Glama

Foundry MCP Project

by lhemerly

🧠 Foundry MCP 项目

该项目是一个模型上下文协议 (MCP) 服务器,旨在与 Foundry 工具交互。它提供了一套工具和实用程序来管理 Foundry 项目、运行测试、构建合约等。


📂 项目结构

pyproject.toml # Project configuration file README.md # Project documentation uv.lock # Dependency lock file LLM/ # Documentation and SDK usage src/eth_wh_mcp/ # Source code for the MCP server

🚀 功能

  • 创建 Foundry 项目:初始化新的 Foundry 项目。
  • 建立合约:使用各种选项编译 Solidity 合约。
  • 运行测试:使用详细配置执行测试。
  • 检查合同:检索 ABI、字节码和其他元数据。
  • 运行脚本:执行 Solidity 脚本。
  • 启动本地节点:启动 Anvil 或 Chisel 进行本地以太坊开发。
  • 高级 Cast 命令:使用cast执行与以太坊相关的命令。

🛠️ 安装

  1. 克隆存储库:
    git clone <repository-url>
  2. 确保 Foundry 工具( forgecastanvil等)已安装并在您的 PATH 中可用。

🏗️ 使用方法

运行 MCP 服务器

要启动 MCP 服务器:

python src/eth_wh_mcp/main.py

可用工具

MCP 服务器中提供以下工具:

  • create_project :初始化一个新的 Foundry 项目。
  • build_project :构建当前的 Foundry 项目。
  • test_project :在 Foundry 项目中运行测试。
  • clone_contract :从 Etherscan 克隆合约。
  • run_script :执行 Solidity 脚本。
  • run_cast_command :运行cast命令。
  • start_anvil_with_options :启动 Anvil 本地以太坊节点。
  • start_chisel_with_options :启动 Chisel Solidity REPL。
  • inspect_contract :检查合同元数据。
  • snapper_project :创建 gas 使用情况快照。
  • coverage_project :显示测试覆盖率。

📖 文档

MCP Python SDK

有关 MCP Python SDK 的详细使用方法,包括服务器构建、工具、提示和上下文处理,请参阅LLM/python-mcp-sdk.md文件。


🧪 开发

本地调试

以开发模式运行 MCP 服务器:

mcp dev src/eth_wh_mcp/main.py --with-editable .

运行时执行

执行服务器:

python src/eth_wh_mcp/main.py

📜 许可证

本项目遵循 MIT 许可证。详情请参阅 LICENSE 文件。

-
security - not tested
A
license - permissive license
-
quality - not tested

local-only server

The server can only run on the client's local machine because it depends on local resources.

模型上下文协议服务器,可通过自然语言与 Foundry 工具进行交互,允许用户创建项目、构建合约、运行测试和管理以太坊开发环境。

  1. 📂 项目结构
    1. 🚀 功能
      1. 🛠️ 安装
        1. 🏗️ 使用方法
          1. 运行 MCP 服务器
          2. 可用工具
        2. 📖 文档
          1. MCP Python SDK
        3. 🧪 开发
          1. 本地调试
          2. 运行时执行
        4. 📜 许可证

          Related MCP Servers

          • A
            security
            A
            license
            A
            quality
            A comprehensive Model Context Protocol server that provides advanced Node.js development tooling for automating project creation, component generation, package management, and documentation with AI-powered assistance.
            Last updated -
            7
            4
            JavaScript
            MIT License
          • A
            security
            A
            license
            A
            quality
            A Model Context Protocol server that gives LLMs the ability to interact with Ethereum networks, manage wallets, query blockchain data, and execute smart contract operations through a standardized interface.
            Last updated -
            31
            0
            8
            TypeScript
            MIT License
          • A
            security
            A
            license
            A
            quality
            A Model Context Protocol server that enables AI agents to interact with 30+ Ethereum-compatible blockchain networks, providing services like token transfers, contract interactions, and ENS resolution through a unified interface.
            Last updated -
            28
            988
            304
            TypeScript
            MIT License
          • A
            security
            A
            license
            A
            quality
            A flexible Model Context Protocol server that makes documentation or codebases searchable by AI assistants, allowing users to chat with code or docs by simply pointing to a git repository or folder.
            Last updated -
            1
            149
            49
            JavaScript
            MIT License

          View all related MCP servers

          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/lhemerly/foundry-mcp'

          If you have feedback or need assistance with the MCP directory API, please join our Discord server