Skip to content

MCP server for AI agents

TEVM ships two complementary Model Context Protocol (MCP) servers:

  1. Local EVM Execution MCP (@tevm/mcp) — a stdio MCP server exposing isolated native ZEVM chains, bundled solc compilation, state cheatcodes, and bounded opcode tracing to any AI coding agent.
  2. Public Smithers Cloud Factory MCP (https://smithers.sh/evmts/tevm/mcp) — an OAuth 2.1 + PKCE HTTP MCP server for reading TEVM repository state, creating artifacts, filing issues/TODOs, and opening Changes/PRs on Smithers Cloud.

Each MCP session owns an isolated MemoryClient / ZevmEngine backed by Voltaire state and Guillotine Mini execution — no external node process or container required.

.mcp.json
{
"mcpServers": {
"tevm": {
"command": "npx",
"args": ["-y", "@tevm/mcp"]
}
}
}
Tool Purpose
evm_create_session Create a fresh isolated local EVM (chainId: 31337, block 0). Returns a UUID handle.
evm_fork_chain Fork an HTTP JSON-RPC endpoint at an optional blockNumber and chain preset. Returns a UUID handle.
evm_close_session Release the session’s native ZEVM handle immediately.
Tool Purpose
evm_compile_solidity Compile a Solidity source file with bundled solc into ABI, creation bytecode, and deployed bytecode.
evm_deploy_contract Deploy bytecode (or compile + deploy Solidity source) into the session txpool. Returns predicted address, gasLimit, and txHash. Mine with evm_mine to commit.
evm_call_contract Read-only contract call accepting a full ABI or a single human-readable signature. Returns decoded output, raw output, and gas estimate.
evm_send_transaction Submit a state-changing function call to the txpool. Returns estimated gas and txHash.
evm_mine Mine pending transactions and optionally advance block timestamps.
Tool Purpose
evm_get_account Read balance, nonce, bytecode, and an optional storage slot.
evm_set_account Cheatcode setter for balance, nonce, bytecode, or storage without sending a transaction.
evm_get_block Fetch the latest block or a block by number/hash (optionally with full transactions).
evm_get_transaction_receipt Fetch mined receipt status, gas used, logs, and deployed contract address.
evm_get_txpool Inspect pending and queued transactions waiting for evm_mine.
evm_trace_call Run debug_traceCall and return a context-window-bounded head/tail opcode trace plus decoded revert errors — even when the call reverts.

Use createSessionManager and executeTool inside custom agent harnesses:

agent-harness.ts
import { createSessionManager, executeTool } from '@tevm/mcp'
const sessions = createSessionManager()
let handle = ''
try {
const created = (await executeTool('evm_create_session', {}, sessions)) as {
handle: string
chainId: number
}
handle = created.handle
const compiled = (await executeTool(
'evm_compile_solidity',
{
source: 'pragma solidity ^0.8.20; contract Box { uint256 public x = 7; }',
contractName: 'Box',
},
sessions,
)) as { abi: unknown[]; bytecode: string }
await executeTool('evm_deploy_contract', { session: handle, bytecode: compiled.bytecode }, sessions)
await executeTool('evm_mine', { session: handle }, sessions)
} finally {
if (handle) await sessions.close(handle)
}

Connect any OAuth 2.1 + PKCE MCP client to TEVM’s hosted coding factory at https://smithers.sh/evmts/tevm/mcp:

Terminal window
# Add in Claude Code
claude mcp add --transport http tevm-smithers https://smithers.sh/evmts/tevm/mcp
# Print setup snippets for Claude Code, Codex, Antigravity, and Cursor
node scripts/factory/sandbox-auth.mjs mcp-guide

Sandboxed agents running inside trusted Smithers sandboxes or maintainer lanes authenticate with single-use, TTL-bounded HMAC-SHA256 credentials printed via node scripts/factory/sandbox-auth.mjs mint (never pass secrets via command-line arguments). Untrusted contributor runs receive read-only shared cache hits on https://build.smithers.sh while write cache tokens and release secrets stay isolated to trusted sandboxes.