MCP server for AI agents
TEVM ships two complementary Model Context Protocol (MCP) servers:
- Local EVM Execution MCP (
@tevm/mcp) — a stdio MCP server exposing isolated native ZEVM chains, bundledsolccompilation, state cheatcodes, and bounded opcode tracing to any AI coding agent. - 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.
Configure local EVM execution (@tevm/mcp)
Section titled “Configure local EVM execution (@tevm/mcp)”Each MCP session owns an isolated MemoryClient / ZevmEngine backed by Voltaire state and Guillotine Mini execution — no external node process or container required.
{ "mcpServers": { "tevm": { "command": "npx", "args": ["-y", "@tevm/mcp"] } }}[mcp_servers.tevm]command = "npx"args = ["-y", "@tevm/mcp"]{ "name": "tevm", "transport": "stdio", "command": "npx", "args": ["-y", "@tevm/mcp"]}Available @tevm/mcp tools (14)
Section titled “Available @tevm/mcp tools (14)”Session lifecycle
Section titled “Session lifecycle”| 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. |
Compilation & execution
Section titled “Compilation & execution”| 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. |
Inspection & debugging
Section titled “Inspection & debugging”| 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. |
Embed @tevm/mcp programmatically
Section titled “Embed @tevm/mcp programmatically”Use createSessionManager and executeTool inside custom agent harnesses:
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)}Public Smithers Cloud Coding Factory MCP
Section titled “Public Smithers Cloud Coding Factory MCP”Connect any OAuth 2.1 + PKCE MCP client to TEVM’s hosted coding factory at https://smithers.sh/evmts/tevm/mcp:
# Add in Claude Codeclaude mcp add --transport http tevm-smithers https://smithers.sh/evmts/tevm/mcp
# Print setup snippets for Claude Code, Codex, Antigravity, and Cursornode scripts/factory/sandbox-auth.mjs mcp-guideSandboxed 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.
Next steps
Section titled “Next steps”- Tracing, console.log & events — understand the underlying
debug_traceCalltracer. - HTTP, WebSocket & IPC server — expose a shared TEVM node over the network.

