PF

praneshasp/foundry-mcp-server

Developer tools

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る

255 stars 37 forks 品質 75 トレンド 18MIT

praneshasp/foundry-mcp-server は、https://github.com/praneshasp/foundry-mcp-server. からインポートされたMCPサーバー候補です。

概要

praneshasp/foundry-mcp-server は、https://github.com/praneshasp/foundry-mcp-server. からインポートされたMCPサーバー候補です。

概要(AI 翻訳)

Foundryツールチェーン(Forge、Cast、Anvil)を用いたSolidity開発機能を提供する、シンプルで軽量かつ高速なMCP(Model Context Protocol)サーバーです。

概要

このサーバーはLLMアシスタントをFoundryエコシステムに接続し、以下を実現します:

  • ノード(ローカルのAnvilインスタンスまたはリモートRPCエンドポイント)とのやり取り
  • スマートコントラクトおよびブロックチェーンデータの分析
  • キャストを用いて一般的なEVM操作を行う
  • Solidityコードおよびスクリプトの管理、展開、実行
  • 永続的なForgeワークスペースでの作業

特徴

ネットワークの交流

  • ローカルのAnvilインスタンスの開始と管理
  • 任意のリモートネットワークに接続(RPCを指定するのみ)
  • ネットワークやチェーン情報の取得

契約の相互作用

  • 契約関数の呼び出し(読み取り専用)
  • トランザクションを契約に送信する(PRIVATE_KEYが設定されている場合)
  • 取引の領収書を取得する
  • 契約保存を読み取る
  • トランザクショントレースの解析
  • ブロックエクスプローラーからコントラクトのABIやソースを取得する

ソリディティ・デベロップメント

  • 専用のForgeワークスペースを維持する
  • Solidityファイルの作成と編集
  • 依存関係のインストール
  • Run Forgeスクリプト
  • デプロイ契約

ユーティリティ関数

  • 契約アドレスの計算

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。

README

以下は原文 README の抜粋です。原文を見る。

Foundry MCP Server

A simple, lightweight and fast MCP (Model Context Protocol) server that provides Solidity development capabilities using the Foundry toolchain (Forge, Cast, and Anvil).

Overview

This server connects LLM assistants to the Foundry ecosystem, enabling them to:

  • Interact with nodes (local Anvil instances or remote RPC endpoints)
  • Analyze smart contracts and blockchain data
  • Perform common EVM operations using Cast
  • Manage, deploy, and execute Solidity code and scripts
  • Work with a persistent Forge workspace

Features

Network Interaction

  • Start and manage local Anvil instances
  • Connect to any remote network (just specify the RPC)
  • Get network/chain information

Contract Interaction

  • Call contract functions (read-only)
  • Send transactions to contracts (if PRIVATE_KEY is configured)
  • Get transaction receipts
  • Read contract storage
  • Analyze transaction traces
  • Retrieve contract ABIs and sources from block explorers

Solidity Development

  • Maintain a dedicated Forge workspace
  • Create and edit Solidity files
  • Install dependencies
  • Run Forge scripts
  • Deploy contracts

Utility Functions

  • Calculate contract addresses
  • Check contract bytecode size
  • Estimate gas costs
  • Convert between units (hex to decimals, etc.,)
  • Generate wallets
  • Get event logs
  • Lookup function and event signatures

Smart Contract Analysis (Heimdall)

  • Disassemble EVM bytecode into human-readable opcodes
  • Decode raw calldata without requiring ABI
  • Decompile EVM bytecode to Solidity source code and ABI
  • Generate visual control flow graphs for EVM bytecode
  • Detailed transaction inspection with calldata decoding and trace analysis

Usage

The server is designed to be used as an MCP tool provider for MCP Clients. When connected to a client, it enables the clients(claude desktop, cursor, client, etc.,) to perform Solidity and onchain operations directly.

Requirements

Manual Setup

  1. Ensure Foundry tools (Forge, Cast, Anvil) are installed on your system:

    curl -L https://foundry.paradigm.xyz | bash
    foundryup
    
  2. Clone and build the server.

    bun i && bun build ./src/index.ts --outdir ./dist --target node
    
    
  3. Update your client config (eg: Claude desktop):

 "mcpServers": {
    "foundry": {
      "command": "node",
      "args": [
        "path/to/foundry-mcp-server/dist/index.js"
      ],
      "env" :{
        "PRIVATE_KEY": "0x1234",
      }
    }
 }

[!NOTE] PRIVATE_KEY is optional

Setup using NPM Package

You can now install and run the server directly using npm:

Global Installation

npm install -g @pranesh.asp/foundry-mcp-server

Direct Usage with npx

GitHub で README 全文を見る

インストール

npx @pranesh.asp/foundry-mcp-server
MCP 初心者?mcpskill.org のガイドから始めましょう →