MCPSERV.CLUB
PraneshASP

Foundry Mcp Server

MCP Server

MCP Server: Foundry Mcp Server

Active(75)
199stars
6views
Updated 9 days ago

About

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

Capabilities

Resources
Access data sources
Tools
Execute functions
Prompts
Pre-built templates
Sampling
AI model interactions

Foundry MCP Demo

The Foundry MCP Server bridges the gap between large‑language‑model assistants and the Ethereum development ecosystem. By exposing Foundry’s core tools—Forge, Cast, and Anvil—as an MCP service, it allows AI agents to interact with smart contracts, deploy code, and query blockchain data without leaving the conversational interface. This solves a key pain point for developers: the need to manually run command‑line tools, manage local nodes, and parse on‑chain data while building or testing contracts.

At its core, the server offers a rich set of primitives for network and contract interaction. It can spin up local Anvil instances, connect to any RPC endpoint, and retrieve chain metadata. From there, it supports read‑only calls, transaction submissions (when a private key is supplied), receipt lookups, storage reads, and trace analysis. Additionally, it can fetch ABIs and source code from block explorers, enabling the assistant to work with contracts that haven’t been locally compiled. These capabilities make it possible for an LLM to answer questions like “What does this transaction do?” or “Show me the event logs for address X” directly from the chat.

The Solidity development workflow is fully supported. A persistent Forge workspace lets the assistant create, edit, and compile Solidity files on demand. It can install dependencies via Foundry’s package manager, run tests or scripts, and deploy contracts to the connected network. Utility functions such as gas estimation, bytecode size checks, unit conversions, and wallet generation provide the toolkit needed for a complete development cycle. All of these operations are exposed as MCP tools, so developers can invoke them with natural language prompts.

Smart contract analysis is a standout feature powered by Heimdall‑rs. The server can disassemble raw bytecode into opcodes, decode calldata without an ABI, decompile EVM code back to Solidity, and generate visual control‑flow graphs. These advanced inspection tools allow an assistant to walk through a transaction trace, explain why a particular function behaved unexpectedly, or identify potential vulnerabilities in third‑party contracts—all within the same conversational context.

In practice, Foundry MCP Server is ideal for rapid prototyping, automated testing, and educational scenarios. A developer can ask an LLM to “deploy a new ERC‑20 contract with 1 million tokens,” and the assistant will handle all compilation, deployment, and confirmation steps. For security audits, the server’s trace analysis can be queried to verify that a contract behaves as intended under edge conditions. By integrating seamlessly with MCP‑compatible clients like Claude Desktop, Cursor, or Windsurf, it becomes a first‑class tool in any developer’s AI‑augmented workflow.