Skip to main content

Claude Code vs Cursor vs Codex for Onchain Development

Claude Code vs Cursor vs Codex for onchain development: how each connects to MCP servers, approves tool calls, and writes and tests transactions safely.

Written by Eco
Claude Code vs Cursor vs Codex for Onchain Development

Claude Code, Cursor, and Codex are AI coding agents that can all write and test onchain transactions when connected to the right tools through the Model Context Protocol (MCP), an open standard that lets an agent call external tool servers. For onchain work, the deciding factors are less about raw coding skill and more about how each agent connects to a simulator, how it asks permission before a tool runs, and how it reaches a signer.
​

This comparison scores the three on four onchain-specific criteria: MCP setup, tool approval defaults, where project skills live, and the path from a written program to a signed transaction. It does not rank general coding quality, because no public benchmark isolates onchain development across all three. Claude Code is Anthropic's terminal and IDE agent, Cursor is an AI code editor, and Codex is OpenAI's coding agent across a CLI, IDE extension, and the ChatGPT desktop app.
​

Key facts at a glance:

  • Anthropic open-sourced MCP on November 25 2024, describing it as an open standard for connecting AI assistants to the systems where data lives (Anthropic).

  • Cursor supports 3 MCP transports: stdio, SSE, and Streamable HTTP (Cursor docs).

  • Codex shares 1 MCP configuration across its CLI, IDE extension, and the ChatGPT desktop app (OpenAI docs).

  • Eco launched the Sauce SDK, including an MCP server for coding agents, on October 28 2026 (Eco blog).

  • Wallet batching on EVM chains is standardized in EIP-5792, and delegated batching code on ordinary accounts in EIP-7702 (EIP-5792, EIP-7702).

Is Cursor or Claude Code Better for Smart Contract and Onchain Development?

Neither is better across the board. Claude Code suits terminal-first workflows with fine-grained permission rules. Cursor suits editor-first workflows and asks before every MCP tool by default. Codex suits teams already in the OpenAI stack, sharing one MCP config across its CLI, IDE extension, and desktop app. All three reach the same onchain MCP servers.
​

Onchain development changes what "better" means. A wrong line in a web app produces a bug report; a wrong line in a transaction can send funds that never come back. The useful questions are whether the agent can test against real chain state before anything is signed, and whether a human sees the transaction before it leaves the machine. Those depend on configuration, not on the agent brand.
​

For background on the protocol itself, see Eco's guide to MCP and Payments.
​

Claude Code vs Cursor vs Codex: Comparison Table

The three agents differ mainly in configuration surface and default approval behavior. Claude Code adds servers with a CLI command and prompts on first use of each tool. Cursor reads an mcp.json file and asks before using MCP tools. Codex stores servers in config.toml shared across its clients. All three support local stdio servers.
​

Criterion

Claude Code

Cursor

Codex

Add a local MCP server

claude mcp add --transport stdio name -- command (docs)

mcp.json entry with command and args, project-level in .cursor/mcp.json (docs)

codex mcp add name -- command, stored in ~/.codex/config.toml (docs)

Transports

stdio and HTTP (docs)

stdio, SSE, Streamable HTTP (docs)

stdio and URL-based servers (docs)

Default tool approval

Default mode prompts on first use of each tool (docs)

Asks for approval before using MCP tools by default (docs)

Configurable; see Codex docs for current approval settings (docs)

Config shared across surfaces

Settings files per user and project (docs)

Global and per-project mcp.json (docs)

CLI, IDE extension, and ChatGPT desktop app share config (docs)

Where Sauce skills install

.claude/skills/ (Sauce docs)

.agents/skills/ (Sauce docs)

.agents/skills/ (Sauce docs)

The approval row matters most for onchain work. An agent that runs a signing tool without a prompt can move funds on the first bad suggestion. Claude Code's permission docs also describe a bypassPermissions mode that skips prompts and should only be used in isolated environments such as containers or VMs; it has no place on a machine that holds a funded key.
​

How Do I Use Claude Code or Cursor to Write and Test Onchain Transactions?

Connect an MCP server that can compile and simulate transactions, ask the agent to write the program, simulate it against current chain state with an assumed balance, review the result, then build an unsigned transaction and sign it in a wallet you control. Keep signing outside the agent unless a spending policy limits it.
​

A concrete workflow using one such server, Eco's Sauce MCP server, runs the same way in all three agents. The Sauce agent docs describe five steps:

  1. Look up names. The agent calls sauce_globals for the chain to get token symbols and protocol namespaces such as USDC and UniswapV3.Factory.

  2. Compile. sauce_compile returns errors with line and column, which the agent fixes.

  3. Simulate. sauce_simulate runs the program against the chain's current state. The assumeBalance option gives the account a balance for that simulation only, so no funded wallet is needed.

  4. Check the account. sauce_pot reports the owner's Pot address, deployment status, fee, and holdings.

  5. Build the transaction. sauce_tx returns the unsigned transaction for review before any signing.

Setup in Claude Code is one line once the CLI is installed: the Sauce product page lists claude mcp add sauce -- sauce mcp. Cursor and Codex take the same command, sauce mcp, in their own config formats. The prerequisite in the docs is Node.js 24 or newer.
​

The same flow works with other simulators. A team on Foundry can point an agent at Anvil, Foundry's local Ethereum node, which can fork mainnet or any chain at a specific block. The simulation tools comparison covers the options.
​

How Each Agent Reaches a Signer

None of the three agents signs transactions by itself. Signing happens through whatever tools are connected: a wallet's own MCP server, a local server with wallet tools, or a human signing an unsigned transaction in an existing wallet. The safest default is an agent that can build transactions but cannot sign them.
​

The Sauce agent docs lay out three signing paths that apply regardless of which agent is in use:

  • Your own wallet. The agent returns unsigned transactions; a person signs them in the wallet they already use.

  • A wallet's own MCP server. The agent passes unsigned transactions to a wallet MCP server, which keeps the key away from the agent.

  • The server's own wallets, over stdio only. A locally started Sauce server exposes wallet tools by default. Starting it with sauce mcp --no-wallets disables them. The HTTP server never signs.

One detail applies to every agent: an agent running as the user can read what the user can read. The Sauce security notes state that a coding agent's shell commands and any stdio MCP server it starts run under the user's account, so wallet files and password sources on that machine are reachable by the agent. Approval prompts reduce that risk; they do not remove it. Account-level limits help here: the EIP-7702 specification describes sub-keys with weaker permissions, such as a key allowed to spend up to 1% of the total balance per day, or to interact only with a specific application. For agents that will hold funds in production, see the security checklist before giving an agent funds.
​

Choose Claude Code, Cursor, or Codex If...

Pick Claude Code for terminal-first work and rule-based permissions per tool. Pick Cursor for editor-first work with MCP approval prompts on by default. Pick Codex if the team already uses ChatGPT and wants one MCP configuration shared across CLI, IDE, and desktop. For onchain safety, configuration choices matter more than the agent chosen.

  • Choose Claude Code if the workflow lives in a terminal, the team wants allow and deny rules per tool, and project skills should live in .claude/skills/.

  • Choose Cursor if developers work in an editor all day and want every MCP tool call confirmed in the UI by default.

  • Choose Codex if the team wants one config.toml that the CLI, IDE extension, and ChatGPT desktop app all read, per OpenAI's Codex docs.

Whatever the pick, three settings carry over: connect a simulator, keep signing tools off by default, and review every unsigned transaction before it is signed.
​

Setting Up an Onchain MCP Server in Each Agent

Setup follows one pattern in all three agents: install the server's command, register it in the agent's MCP config, confirm its tools are listed, then decide which tools may run without a prompt. For servers that can sign, the safest first step is starting them with signing tools turned off.
​

Using the Sauce server as the worked example, the Sauce product page pins the package with npm install --save-exact @eco-incorp/sauce@1.0.0, and the agent docs require Node.js 24 or newer. To check the connection, ask the agent to list its sauce_ tools.

  • Claude Code: claude mcp add sauce -- sauce mcp. Skills installed by sauce skills install land in .claude/skills/.

  • Cursor: an mcp.json entry with "command": "sauce" and "args": ["mcp"], globally or in the project's .cursor/mcp.json.

  • Codex: codex mcp add sauce -- sauce mcp, which writes to ~/.codex/config.toml.

The tool count is a quick sanity check on what the agent can do. Per the Sauce agent docs, a server started with --no-wallets --no-stores lists 18 tools, and the default stdio server lists 27, because the default adds wallet and Pot tools. An agent that should only compile and simulate should see the smaller set. The docs also state that no tool takes a private key or a password.
​

Eco also runs a separate read-only docs MCP server at https://docs.eco.com/mcp, which searches documentation and, per the build-with-agents guide, does not submit transfers or provide wallet credentials. Pairing a read-only docs server with a build-only transaction server gives an agent context and tools without a signing path.
​

What Goes Wrong When Coding Agents Write Onchain Code

Common failures are wrong units, missing checks, and stale assumptions. Agents confuse token decimals, omit a minimum-output floor, approve more than a call spends, or trust a simulation that ran at an earlier block. Each of these compiles and can even simulate cleanly, so review must check intent, not just errors.
​

The Sauce security notes give specific examples that apply to any agent-written transaction code:

  • Units. USDC has 6 decimals, so 1,000,000 base units is 1 USDC and 1 unit is one millionth. An agent that writes 1 for "one dollar" sends a millionth of one.

  • No floor. Passing 0 as minOut sets no floor on a swap.

  • Leftover approvals. An approval made in a successful transaction outlives it; the spender can use what remains later.

  • Stale state. A simulation runs at one block, and prices move before the transaction lands.

Agents that read web pages, issues, or token metadata add a further risk: instructions hidden in that content. OWASP lists prompt injection first in its 2025 risk list for LLM applications, as LLM01:2025. The Sauce docs work their examples on a local fork of Base at block 53,122,981, which is the habit to copy: pin the block, then reproduce. Eco's article on AI smart contract security and EVMbench covers contract-level failure modes in more depth.
​

Where This Comparison Falls Short

This comparison covers configuration and safety surfaces, not coding accuracy, because no public benchmark isolates onchain tasks across all three agents. Agent features also change quickly; MCP setup and approval defaults should be checked against each vendor's current documentation before a team standardizes on one tool.

  • Documentation for all three agents was checked in November 2026, and each vendor updates its docs often.

  • Approval behavior is configurable in all three tools, so defaults describe a starting point, not a guarantee.

  • The Sauce workflow above sends on Ethereum, Base, Arc, and Solana only; on preview chains, compile works but sauce_tx returns a refusal naming the supported chains, per the Sauce agent docs.

  • Simulation reduces risk but does not match the block a transaction lands in.

FAQ

These are short answers to the questions developers and operators ask most often about using Claude Code, Cursor, and Codex for onchain development. Each answer stands on its own and points to the primary documentation used in this article, retrieved in November 2026, for readers who need the full detail.
​

Can Claude Code write Solidity smart contracts?

Yes. Claude Code, Cursor, and Codex can all write Solidity. Testing still needs a compiler and a simulator, such as Foundry's forge and Anvil, connected to the agent.
​

Which MCP servers let Claude execute onchain transactions?

Several exist, with different signing models. See the MCP section of MCP and Payments for a comparison of servers, chains, and approval gates.
​

Do I need a funded wallet to test onchain code with an AI agent?

Not to simulate. Forked-chain simulators and the Sauce MCP server's assumeBalance option run transactions without real funds, per the Sauce agent docs.
​

Should a coding agent hold a private key?

Prefer not. Build unsigned transactions in the agent and sign elsewhere. If an agent must sign, use a small hot wallet with a spending policy, as Eco's AI Agent Spend Controls article describes.
​

Does Cursor ask before running an MCP tool?

Yes, by default, per Cursor's MCP documentation.
​

Sources and Methodology

Retrieved November 9 2026: Claude Code MCP docs, Claude Code permissions, Cursor MCP docs, Codex MCP docs, Foundry Anvil, and Eco's Sauce agent docs, security considerations, and product page. No agent was benchmarked for this article.
​

Did this answer your question?