Foundry MCP Server

A EVM-compatible blockchain toolkit for your AI Agents powered by Foundry

Local serverstdio

What is the Foundry MCP server?

A EVM-compatible blockchain toolkit for your AI Agents powered by Foundry. The foundry mcp server wraps that behind the Model Context Protocol, so an assistant can use it through 8 defined tools rather than through you.

What it actually does

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

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

Adding it to your client

The server ships on npm as @pranesh.asp/foundry-mcp-server, so your MCP client can launch it on demand — there is no separate build step. Add the server block to your client's configuration, restart it, and the tools register themselves.

Its toolset

Everything the assistant can do here goes through one of these:

  • Requirements — The Requirements tool exposed by this server
  • Configuration — The Configuration tool exposed by this server
  • Workspace — The server maintains a persistent Forge workspace at ~/.mcp-foundry-workspace for all Solidity files, scripts, and dependencies
  • Anvil — The Anvil tool exposed by this server
  • Cast — The Cast tool exposed by this server
  • Forge — The Forge tool exposed by this server
  • Utilities — The Utilities tool exposed by this server
  • Examples — 1. Transaction analysis: Can you analyze the transaction and explain what it does? https://etherscan.io/tx/0xcb73ad3116f19358e2e649d4dc801b7ae0590

Configuration

You will need 2 environment variables: PRIVATE_KEY, RPC_URL. The server will not start without them, which is usually why the tools fail to appear on a first run. Keep credentials in your client's env block or a secrets manager rather than in a file you might commit.

Caveats

  • It runs with your machine's permissions. That is convenient and also the reason to think about what you point it at before you approve a tool call.
  • Missing credentials fail quietly in some clients — if no tools show up, check the environment block first.
  • MCP clients confirm each tool call by default. Leave that on until you have watched what the foundry mcp server does with a few real requests.

When to reach for it

Among the developer tooling options, the useful question is rarely "what can it do" but "what does it cost you to run" — permissions, credentials, and how much of your context its toolset consumes. Foundry's toolset — Requirements, Configuration, Workspace and 5 more — is a fair guide to whether it matches your workflow. It is maintained by PraneshASP; worth a glance at recent repository activity before you build anything load-bearing on it.

This entry was verified against Foundry's own documentation before publication; SyncDev keeps the directory reviewed rather than auto-generated.

Available tools

ToolWhat it does
RequirementsThe Requirements tool exposed by this server.
ConfigurationThe Configuration tool exposed by this server.
WorkspaceThe server maintains a persistent Forge workspace at ~/.mcp-foundry-workspace for all Solidity files, scripts, and dependencies.
AnvilThe Anvil tool exposed by this server.
CastThe Cast tool exposed by this server.
ForgeThe Forge tool exposed by this server.
UtilitiesThe Utilities tool exposed by this server.
Examples1. **Transaction analysis**: Can you analyze the transaction and explain what it does? https://etherscan.io/tx/0xcb73ad3116f19358e2e649d4dc801b7ae0590a47b8bb2e57a8e98b6daa5fb14b

How to install the Foundry MCP server

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

Configuration as documented by the project. Restart the client after saving.

Configuration

VariableDescriptionRequired
PRIVATE_KEYCredential the server authenticates with.Yes
RPC_URLEndpoint or connection string the server talks to.Yes

Example prompts to try

  • Use Foundry to Requirements.
  • Use Foundry to Configuration.
  • Use Foundry to Workspace.

Frequently asked questions

It connects Foundry to MCP-compatible AI assistants such as Claude and Cursor, exposing 8 tools (Requirements, Configuration, Workspace, and more) that the assistant can call on your behalf. Instead of copying data back and forth by hand, the assistant works with Foundry directly.