Foundry
An MCP server that allows AI assistants to interact with Foundry datasets, ontology objects, and functions through natural language queries and commands.
What is Foundry?
Foundry is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to mcp server that allows ai assistants to interact with foundry datasets, ontology objects, and functions through natural language queries and commands.
An MCP server that allows AI assistants to interact with Foundry datasets, ontology objects, and functions through natural language queries and commands.
This server falls under the Databases category on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- An MCP server that allows AI assistants to interact with Fou
Use Cases
Maintainer
Works with
Installation
Manual Installation
npx foundry-mcp-serverConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use Foundry
The Foundry MCP Server gives AI assistants direct access to the Foundry smart contract development toolchain — including Forge, Cast, and Anvil — through natural language commands, enabling developers to compile and test Solidity contracts, query blockchain state, send transactions, and analyze contract bytecode without leaving their AI client. It also integrates Heimdall-rs for advanced reverse engineering tasks like bytecode decompilation, control flow graph generation, and transaction inspection. Blockchain developers and security researchers use it to accelerate smart contract workflows by expressing complex Cast or Forge operations as plain English instructions.
Prerequisites
- Node.js v18 or higher installed
- Foundry toolchain installed: Forge, Cast, and Anvil (install via curl -L https://foundry.paradigm.xyz | bash && foundryup)
- Heimdall-rs installed for bytecode analysis features (https://github.com/Jon-Becker/heimdall-rs)
- An MCP client such as Claude Desktop or Claude Code
- Optional: RPC_URL for connecting to a live network; PRIVATE_KEY only for testnets — never use mainnet keys
Install the Foundry toolchain
Install Foundry (Forge, Cast, Anvil) using the official installer. Run foundryup after installation to download the latest binaries.
curl -L https://foundry.paradigm.xyz | bash
foundryup
# Verify
forge --version
cast --version
anvil --versionInstall the Foundry MCP Server
Install the MCP server package globally via npm or use npx for on-demand execution without a global install.
# Global install
npm install -g @pranesh.asp/foundry-mcp-server
# Or use directly with npx
npx @pranesh.asp/foundry-mcp-serverAdd to Claude Code via CLI
Register the server with Claude Code using the mcp add-json command with your RPC URL and optional private key for testnet use.
claude mcp add-json foundry-mcp-server '{
"type": "stdio",
"command": "npx",
"args": ["@pranesh.asp/foundry-mcp-server"],
"env": {
"RPC_URL": "https://rpc.ankr.com/eth_sepolia",
"PRIVATE_KEY": ""
}
}'Start a local Anvil instance for testing
Use the MCP server's Anvil tool to start a local Ethereum node for safe contract testing without spending real funds.
# Via the MCP tool (ask Claude):
# "Start a local Anvil instance"
# Or directly:
anvilInstall Heimdall-rs for bytecode analysis
Heimdall-rs enables decompilation, disassembly, and control flow graph generation. Follow the installation instructions from the Heimdall GitHub repository.
# Install via cargo
cargo install heimdall-rs
# Or use the install script from:
# https://github.com/Jon-Becker/heimdall-rsFoundry Examples
Client configuration
Claude Desktop configuration for the Foundry MCP Server. Set RPC_URL to your preferred testnet endpoint. Leave PRIVATE_KEY empty unless needed for testnet transactions.
{
"mcpServers": {
"foundry-mcp-server": {
"command": "npx",
"args": ["@pranesh.asp/foundry-mcp-server"],
"env": {
"RPC_URL": "https://rpc.ankr.com/eth_sepolia",
"PRIVATE_KEY": ""
}
}
}
}Prompts to try
Natural language prompts for Foundry operations via the MCP server
- "Start a local Anvil instance and show me the test accounts"
- "Check the ETH balance of address 0x742d35Cc6634C0532925a3b8D4C9C7b2"
- "Deploy the contract at contracts/MyToken.sol to the local Anvil instance"
- "Decompile the bytecode at 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48 using Heimdall"
- "Run the forge test suite and show me any failing tests"Troubleshooting Foundry
forge, cast, or anvil not found in PATH
After running foundryup, add ~/.foundry/bin to your PATH: export PATH="$PATH:$HOME/.foundry/bin". Add this line to ~/.bashrc or ~/.zshrc to make it permanent, then restart your terminal.
RPC connection errors or network timeouts
Verify RPC_URL is a valid endpoint for your target network. For local testing, start Anvil first (anvil command) and use http://127.0.0.1:8545 as the RPC_URL. For public testnets, use Alchemy, Infura, or Ankr RPC endpoints.
Heimdall analysis tools not available
Heimdall-rs must be installed separately from Foundry. Install it via cargo install heimdall-rs. If cargo is not available, install Rust first from https://rustup.rs, then retry.
Frequently Asked Questions about Foundry
What is Foundry?
Foundry is a Model Context Protocol (MCP) server that mcp server that allows ai assistants to interact with foundry datasets, ontology objects, and functions through natural language queries and commands. It connects AI assistants to external tools and data sources through a standardized interface.
How do I install Foundry?
Follow the installation instructions on the Foundry GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.
Which AI clients work with Foundry?
Foundry works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is Foundry free to use?
Yes, Foundry is open source and available under the MIT License license. You can use it freely in both personal and commercial projects.
Foundry Alternatives — Similar Databases Servers
Looking for alternatives to Foundry? Here are other popular databases servers you can use with Claude, Cursor, and VS Code.
Excelize
★ 20.6kGo language library for reading and writing Microsoft Excel™ (XLAM / XLSM / XLSX / XLTM / XLTX) spreadsheets
MCP Toolbox for Databases
★ 15.3kOpen source MCP server specializing in easy, fast, and secure tools for Databases.
DBHub
★ 2.8kA universal database gateway MCP server that enables AI assistants to connect to and query multiple databases (PostgreSQL, MySQL, MariaDB, SQL Server, SQLite) with support for schema exploration, SQL execution, and secure connections via SSH tunnels.
Tabularis
★ 2.1kA lightweight, cross-platform database client for developers. Supports MySQL, PostgreSQL and SQLite. Hackable with plugins. Built for speed, security, and aesthetics.
Postgres AI Guide
★ 1.7kMCP server and Claude plugin for Postgres skills and documentation. Helps AI coding tools generate better PostgreSQL code.
Anyquery
★ 1.7k🏎️ 🏠 ☁️ - Query more than 40 apps with one binary using SQL. It can also connect to your PostgreSQL, MySQL, or SQLite compatible database. Local-first and private by design.
Browse More Databases MCP Servers
Explore all databases servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.
Set Up Foundry in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
Ready to use Foundry?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.