eth-mcp

eth-mcp

MCP server that enables AI agents to build and deploy Ethereum applications using Scaffold-ETH.

Category
访问服务器

README

eth-mcp

MCP server that enables AI agents to build and deploy Ethereum applications using Scaffold-ETH.

The AI is the planner. The MCP server is the executor.


Quick Start

Add to your Cursor MCP config (~/.cursor/mcp.json):

{
  "mcpServers": {
    "eth-mcp": {
      "command": "npx",
      "args": ["-y", "eth-mcp@latest"]
    }
  }
}

Restart Cursor. Done! Now ask your AI:

"Build me a swapping app with a 1% tax token on Base"


What This Does

eth-mcp is a Model Context Protocol (MCP) server that:

  1. Clones and configures Scaffold-ETH projects - Foundry + Next.js stack
  2. Manages long-running processes - Anvil fork, contract deployment, frontend
  3. Provides file access - Read/write project files
  4. Exposes logs and status - Resources for agent polling
  5. Includes Web3 knowledge - Guides for incentive design and Solidity patterns
  6. DeFi address registry - Token and protocol addresses across 5 chains
  7. DeFi yield tools - Query live APY/TVL data from DefiLlama

This enables AI agents to go from natural language to running dApp without manual intervention.


Recommended MCP Stack

eth-mcp is designed to work alongside companion MCP servers for a complete Ethereum development experience. We strongly recommend installing all three:

MCP Server Purpose Essential For
eth-mcp Build, deploy, run local dev Core functionality
mcp-server-ens ENS name resolution Resolving .eth names (vitalik.eth → 0x...)
@blockscout/mcp-server Blockchain exploration Tx analysis, contract ABIs, on-chain data

Full Configuration (Recommended)

Add all three to your ~/.cursor/mcp.json:

{
  "mcpServers": {
    "eth-mcp": {
      "command": "npx",
      "args": ["-y", "eth-mcp@latest"]
    },
    "ens": {
      "command": "npx",
      "args": ["-y", "mcp-server-ens"]
    },
    "blockscout": {
      "command": "npx",
      "args": ["-y", "@blockscout/mcp-server"]
    }
  }
}

Division of Responsibilities

Task eth-mcp ENS MCP Blockscout
Scaffold project
Deploy contracts
Run local fork
Start frontend
Resolve vitalik.eth
Get ENS records (avatar, socials)
Check mainnet balances
Analyze transactions
Get contract ABIs
Look up token addresses ✅ (registry) ✅ (live)
Query live yield data

Example Workflow

1. Use ENS MCP to resolve "vitalik.eth" to get the address
2. Use Blockscout to check their USDC balance and recent transactions
3. Use eth-mcp to scaffold a project that interacts with their address
4. Use eth-mcp to write and deploy contracts locally
5. Use Blockscout to verify mainnet state your fork is based on
6. Use eth-mcp to start frontend and test

Why All Three?

  • eth-mcp handles the local development loop: scaffolding, forking, deploying, hot-reloading
  • ENS MCP handles name resolution: converting human-readable .eth names to addresses
  • Blockscout handles blockchain exploration: reading mainnet state, analyzing transactions, fetching ABIs

The AI agent orchestrates all three, choosing the right tool for each task.


Alternative Installation (from source)

# Clone the repo
git clone https://github.com/austintgriffith/eth-mcp
cd eth-mcp

# Install dependencies
npm install

# Build
npm run build

Configure MCP Client (local)

Add to your MCP settings:

{
  "mcpServers": {
    "eth-mcp": {
      "command": "node",
      "args": ["/path/to/eth-mcp/dist/index.js"]
    }
  }
}

MCP Tools

Stack Management

Tool Description
stack_init Clone Scaffold-ETH, configure for chain
stack_install Install dependencies (yarn install)
stack_start Start components: fork, deploy, frontend
stack_stop Stop running components
stack_status Get health report and URLs

Process Management

Tool Description
process_list List all managed processes
process_logs Get stdout/stderr for a process
process_stop Stop a specific process

Project Files

Tool Description
project_readFile Read a project file
project_writeFile Write content to a file
project_listFiles List directory contents

MCP Resources

Resources for polling status and logs:

Resource URI Description
resource://stack/status Current stack health
resource://stack/config Stack configuration
resource://process/fork/stdout Anvil fork output
resource://process/fork/stderr Anvil fork errors
resource://process/frontend/stdout Next.js output
resource://process/frontend/stderr Next.js errors
resource://contracts/deployed Deployed contract addresses

Example Agent Workflow

Here's how an AI agent would build a tax token swap app:

Agent: "Build a swapping app with a 1% tax token on Base"

1. stack_init({ template: "scaffold-eth", chain: "base", workspacePath: "/tmp/tax-swap" })
   → Clones scaffold-eth-2, configures for Base

2. stack_install()
   → Runs yarn install

3. project_writeFile({ path: "packages/foundry/contracts/TaxToken.sol", content: "..." })
   → Creates the tax token contract

4. project_writeFile({ path: "packages/foundry/script/Deploy.s.sol", content: "..." })
   → Updates deploy script

5. stack_start({ components: ["fork", "deploy", "frontend"] })
   → Starts Anvil fork of Base
   → Deploys contracts
   → Starts Next.js

6. stack_status()
   → Returns: { urls: { rpc: "http://localhost:8545", frontend: "http://localhost:3000" } }

7. project_writeFile({ path: "packages/nextjs/app/page.tsx", content: "..." })
   → Creates swap UI on home page

Result: Running app at http://localhost:3000

Supported Chains

Chain ID Fork RPC
mainnet 1 Public RPC
base 8453 Public RPC
optimism 10 Public RPC
arbitrum 42161 Public RPC
polygon 137 Public RPC
sepolia 11155111 Public RPC

Documentation for AI Agents

The docs/ folder contains guides that help AI agents understand Web3 development:

  • WEB3_DEVELOPMENT_GUIDE.md - Mental model shift, incentive thinking, security patterns
  • SOLIDITY_PATTERNS.md - Common contract patterns and templates
  • DEFI_BUILDING_BLOCKS.md - DeFi primitives and composability

AI agents should read these before building complex applications.


Protocol Packs

Example protocol integrations in protocol-packs/:

uniswap-v4-tax-swap

Placeholder implementation of:

  • TaxToken.sol - ERC-20 with 1% transfer tax
  • TaxSwapHook.sol - Uniswap V4 hook for tax handling
  • SwapUI.tsx - React swap interface

This shows structure, not full implementation. V4 is still in development.


Safety

The server enforces several safety constraints:

Command Allowlist:

  • Only git, yarn, npm, pnpm, npx, forge, anvil, cast, node

Private Key Protection:

  • Sanitizes output to remove private keys
  • Blocks access to .env files
  • Filters sensitive environment variables

No Mainnet Writes:

  • Local development only
  • Fork-based testing

Architecture

┌─────────────────────────────────────────────────────────────┐
│                      AI Agent                               │
│  ┌─────────────────────────────────────────────────────┐   │
│  │  "Build me a swapping app with a 1% tax token"      │   │
│  └─────────────────────────────────────────────────────┘   │
└─────────────────────────┬───────────────────────────────────┘
                          │ MCP Protocol
┌─────────────────────────▼───────────────────────────────────┐
│                       eth-mcp                               │
│  ┌──────────┐  ┌──────────┐  ┌──────────┐  ┌──────────┐   │
│  │  Stack   │  │ Process  │  │ Project  │  │Resources │   │
│  │  Tools   │  │ Manager  │  │  Tools   │  │          │   │
│  └────┬─────┘  └────┬─────┘  └────┬─────┘  └────┬─────┘   │
└───────┼─────────────┼─────────────┼─────────────┼──────────┘
        │             │             │             │
┌───────▼─────────────▼─────────────▼─────────────▼──────────┐
│                     Workspace                               │
│  ┌─────────────────────────────────────────────────────┐   │
│  │               scaffold-eth-2                         │   │
│  │  ┌───────────────┐  ┌───────────────────────────┐   │   │
│  │  │   Foundry     │  │        Next.js            │   │   │
│  │  │  (Contracts)  │  │       (Frontend)          │   │   │
│  │  └───────────────┘  └───────────────────────────┘   │   │
│  └─────────────────────────────────────────────────────┘   │
│                                                             │
│  ┌─────────────────┐  ┌─────────────────────────────────┐  │
│  │  Anvil Fork     │  │     http://localhost:3000       │  │
│  │  (Base chain)   │  │         (Running app)           │  │
│  └─────────────────┘  └─────────────────────────────────┘  │
└─────────────────────────────────────────────────────────────┘

Development

# Watch mode
npm run dev

# Type check
npm run typecheck

# Run server directly
npm start

Limitations (v1)

  • Local development only (no mainnet deployment)
  • Single workspace at a time
  • Basic error recovery
  • Placeholder protocol pack implementations

License

MIT

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选