High-performance code intelligence MCP server. Indexes codebases into a persistent knowledge graph — average repo in milliseconds. 158 languages, sub-ms queries, 99% fewer tokens. Single static binary, zero dependencies.
MCP server for Foundry Solidity tools
This server plugs Foundry into MCP clients so an assistant can work with Solidity code, local Anvil nodes, remote RPCs, and transaction data. It wraps Forge, Cast, and Heimdall into tools for contract calls, deployments, traces, ABI lookups, and bytecode analysis.
Builders who use MCP clients to develop and inspect Solidity contracts.
You can ask your agent to deploy, call, trace, and analyze contracts without leaving your chat.
What it does
Network interaction
Starts and stops local Anvil, connects to remote RPC endpoints, and reads chain information.
Contract interaction
Calls contract functions, sends transactions when `PRIVATE_KEY` is set, reads storage, gets receipts, and fetches ABIs and sources.
Solidity workspace
Keeps a persistent Forge workspace for creating files, installing dependencies, running scripts, and deploying contracts.
Utility commands
Calculates addresses, checks bytecode size, estimates gas, converts units, generates wallets, and looks up signatures.
Heimdall analysis
Disassembles bytecode, decodes calldata, decompiles contracts, draws control flow graphs, and inspects transactions.
How to get it
- 1Ensure Foundry tools (Forge, Cast, Anvil) are installed on your system
curl -L https://foundry.paradigm.xyz | bash foundryup
- 2Clone and build the server.
bun i && bun build ./src/index.ts --outdir ./dist --target node
- 3Run
npm install -g @pranesh.asp/foundry-mcp-server
- 4Run
npx @pranesh.asp/foundry-mcp-server
- 5Claude Code
claude mcp add-json foundry-mcp-server '{"type":"stdio","command":"npx","args":["@pranesh.asp/foundry-mcp-server"],"env":{"RPC_URL":"","PRIVATE_KEY":""}}' - 6Transaction analysis
Can you analyze the transaction and explain what it does? https://etherscan.io/tx/0xcb73ad3116f19358e2e649d4dc801b7ae0590a47b8bb2e57a8e98b6daa5fb14b
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_KEYis 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
- Node.js v18+
- Foundry toolchain (Forge, Cast, Anvil)
- Heimdall-rs (for smart contract analysis)
Manual Setup
-
Ensure Foundry tools (Forge, Cast, Anvil) are installed on your system:
curl -L https://foundry.paradigm.xyz | bash foundryup -
Clone and build the server.
bun i && bun build ./src/index.ts --outdir ./dist --target node -
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_KEYis 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
npx @pranesh.asp/foundry-mcp-server
MCP Client Configuration
Claude Code
claude mcp add-json foundry-mcp-server '{"type":"stdio","command":"npx","args":["@pranesh.asp/foundry-mcp-server"],"env":{"RPC_URL":"","PRIVATE_KEY":""}}'
Other MCP Clients (Cursor, Claude, Windsurf)
Add to your MCP settings:
{
"mcpServers": {
"foundry": {
"command": "npx",
"args": ["@pranesh.asp/foundry-mcp-server"],
"env": {
"RPC_URL": "http://localhost:8545",
"PRIVATE_KEY": "0x..."
}
}
}
}
Configuration
The server supports the following environment variables:
RPC_URL: Default RPC URL to use when none is specified (optional)PRIVATE_KEY: Private key to use for transactions (optional)
[!CAUTION] Do not add keys with mainnet funds. Even though the code uses it safely, LLMs can hallicunate and send malicious transactions. Use it only for testing/development purposes. DO NOT trust the LLM!!
[!TIP] Getting
Invalid configurationerrors? Check your JSON syntax—common issues include double quotes (""KEY"→"KEY"), trailing commas, or unquoted keys. Validate withecho '...' | jq .
Workspace
The server maintains a persistent Forge workspace at ~/.mcp-foundry-workspace for all Solidity files, scripts, and dependencies.
Tools
Anvil
anvil_start: Start a new Anvil instanceanvil_stop: Stop a running Anvil instanceanvil_status: Check if Anvil is running and get its status
Cast
cast_call: Call a contract function (read-only)cast_send: Send a transaction to a contract functioncast_balance: Check the ETH balance of an addresscast_receipt: Get the transaction receiptcast_storage: Read contract storage at a specific slotcast_run: Run a published transaction in a local environmentcast_logs: Get logs by signature or topiccast_sig: Get the selector for a function or event signaturecast_4byte: Lookup function or event signature from the 4byte directorycast_chain: Get information about the current chain
Forge
forge_script: Run a Forge script from the workspaceinstall_dependency: Install a dependency for the Forge workspace
File Management
create_solidity_file: Create or update a Solidity file in the workspaceread_file: Read the content of a file from the workspacelist_files: List files in the workspace
Utilities
convert_eth_units: Convert between EVM units (wei, gwei, hex)compute_address: Compute the address of a contract that would be deployedcontract_size: Get the bytecode size of a deployed contractestimate_gas: Estimate the gas cost of a transaction
Heimdall Analysis
heimdall_disassemble: Disassemble EVM bytecode into human-readable opcodesheimdall_decode: Decode raw calldata without requiring ABIheimdall_decompile: Decompile EVM bytecode to Solidity source code and ABIheimdall_cfg: Generate visual control flow graph for EVM bytecodeheimdall_inspect: Detailed inspection of Ethereum transactions
Usage in Claude Desktop App 🎯
Once the installation is complete, and the Claude desktop app is configured, you must completely close and re-open the Claude desktop app to see the tavily-mcp server. You should see a hammer icon in the bottom left of the app, indicating available MCP tools, you can click on the hammer icon to see more details on the available tools.

Now claude will have complete access to the foundry-mcp server. If you insert the below examples into the Claude desktop app, you should see the foundry-mcp server tools in action.
Examples
- Transaction analysis:
Can you analyze the transaction and explain what it does?
https://etherscan.io/tx/0xcb73ad3116f19358e2e649d4dc801b7ae0590a47b8bb2e57a8e98b6daa5fb14b
- Querying Balances:
Query the mainnet ETH and USDT balances for the wallet 0x195F46025a6926968a1b3275822096eB12D97E70.
- Sending transactions:
Transfer 0.5 USDC to 0x195F46025a6926968a1b3275822096eB12D97E70 on Mainnet.
- Deploying contracts/Running scripts:
Deploy a mock ERC20 contract to a local anvil instance and name it "Fire Coin".
Acknowledgments ✨
- Model Context Protocol for the MCP specification
- Anthropic for Claude Desktop
Disclaimer
The software is being provided as is. No guarantee, representation or warranty is being made, express or implied, as to the safety or correctness of the software. They have not been audited and as such there can be no assurance they will work as intended, and users may experience delays, failures, errors, omissions, loss of transmitted information or loss of funds. The creators are not liable for any of the foregoing. Users should proceed with caution and use at their own risk.
Files in the repo
- assets
- src
- .gitignore
- bun.lockb
- funding.json
- LICENSE
- package-lock.json
- package.json
- README.md
- tsconfig.json
Discussion (0)
Ask about usage, or say what you built with itSign in to join the discussion.
No comments yet. Be the first to say what this is good for.
More connectors

Universal provider proxy for OpenAI Codex & Claude Code — use any LLM (Claude, Gemini, Grok, DeepSeek, Ollama…) with Codex CLI, App, SDK, and Claude Code
Git-native persistent memory for AI coding agents. Implements Google OKF v0.2 with sub-300µs in-memory BM25 search, embedded MCP server, and progressive disclosure. Slashes token bloat by 80% with zero external databases or dependencies. Built in pure Go.
Local-first code intelligence graph for MCP and CLI. Builds a persistent map of your codebase so AI coding tools read only what matters, with benchmarked context reductions on reviews and large-repo workflows.
Stop your AI from making things up — it proposes, deterministic tools decide, every claim checked against ground truth with evidence. Grounded facts and context survive resets. Reverse engineering is the proving ground. MCP server + CLI.
20 MB lightweight cross-platform database client for 90+ databases, including MySQL, PostgreSQL, SQLite, Redis, MongoDB, DuckDB, SQL Server, and Dameng. Built-in AI, MCP Server, CLI, desktop and Docker. | 轻量级跨平台数据库管理工具,支持 MySQL、PostgreSQL、SQLite、Redis、MongoDB、达梦等 90+ 数据库,提供桌面端、Docker、CLI、内置 AI 助手和 MCP Server。