# web3agent MCP server

> Enables AI agents to execute DeFi operations including swaps, bridges, limit orders, and market research across multiple EVM chains.

- Repository: https://github.com/Apegurus/web3agent
- Page: https://hostedmcp.org/servers/apegurus/web3agent
- Transport: stdio
- Stars: 1
- License: MIT
- Latest version: 0.6.2

## Install

### Claude Code

```sh
claude mcp add --env 'COINGECKO_API_KEY=<YOUR_COINGECKO_API_KEY>' --env 'ETHERSCAN_API_KEY=<YOUR_ETHERSCAN_API_KEY>' --env 'OWS_PASSPHRASE=<YOUR_OWS_PASSPHRASE>' --env 'ZEROX_API_KEY=<YOUR_ZEROX_API_KEY>' web3agent -- npx -y web3agent
```

### Cursor (`~/.cursor/mcp.json`)

```json
{
  "mcpServers": {
    "web3agent": {
      "command": "npx",
      "args": [
        "-y",
        "web3agent"
      ],
      "env": {
        "COINGECKO_API_KEY": "<YOUR_COINGECKO_API_KEY>",
        "ETHERSCAN_API_KEY": "<YOUR_ETHERSCAN_API_KEY>",
        "OWS_PASSPHRASE": "<YOUR_OWS_PASSPHRASE>",
        "ZEROX_API_KEY": "<YOUR_ZEROX_API_KEY>"
      }
    }
  }
}
```

### VS Code (`.vscode/mcp.json`)

```json
{
  "servers": {
    "web3agent": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "web3agent"
      ],
      "env": {
        "COINGECKO_API_KEY": "<YOUR_COINGECKO_API_KEY>",
        "ETHERSCAN_API_KEY": "<YOUR_ETHERSCAN_API_KEY>",
        "OWS_PASSPHRASE": "<YOUR_OWS_PASSPHRASE>",
        "ZEROX_API_KEY": "<YOUR_ZEROX_API_KEY>"
      }
    }
  }
}
```

### VS Code CLI

```sh
code --add-mcp '{"name":"web3agent","type":"stdio","command":"npx","args":["-y","web3agent"],"env":{"COINGECKO_API_KEY":"<YOUR_COINGECKO_API_KEY>","ETHERSCAN_API_KEY":"<YOUR_ETHERSCAN_API_KEY>","OWS_PASSPHRASE":"<YOUR_OWS_PASSPHRASE>","ZEROX_API_KEY":"<YOUR_ZEROX_API_KEY>"}}'
```

### Claude Desktop (`claude_desktop_config.json`)

```json
{
  "mcpServers": {
    "web3agent": {
      "command": "npx",
      "args": [
        "-y",
        "web3agent"
      ],
      "env": {
        "COINGECKO_API_KEY": "<YOUR_COINGECKO_API_KEY>",
        "ETHERSCAN_API_KEY": "<YOUR_ETHERSCAN_API_KEY>",
        "OWS_PASSPHRASE": "<YOUR_OWS_PASSPHRASE>",
        "ZEROX_API_KEY": "<YOUR_ZEROX_API_KEY>"
      }
    }
  }
}
```

### Codex

```sh
codex mcp add web3agent --env 'COINGECKO_API_KEY=<YOUR_COINGECKO_API_KEY>' --env 'ETHERSCAN_API_KEY=<YOUR_ETHERSCAN_API_KEY>' --env 'OWS_PASSPHRASE=<YOUR_OWS_PASSPHRASE>' --env 'ZEROX_API_KEY=<YOUR_ZEROX_API_KEY>' -- npx -y web3agent
```

### Codex config.toml (`~/.codex/config.toml`)

```toml
[mcp_servers.web3agent]
command = "npx"
args = ["-y", "web3agent"]

[mcp_servers.web3agent.env]
COINGECKO_API_KEY = "<YOUR_COINGECKO_API_KEY>"
ETHERSCAN_API_KEY = "<YOUR_ETHERSCAN_API_KEY>"
OWS_PASSPHRASE = "<YOUR_OWS_PASSPHRASE>"
ZEROX_API_KEY = "<YOUR_ZEROX_API_KEY>"
```

### Gemini CLI

```sh
gemini mcp add -s user -e 'COINGECKO_API_KEY=<YOUR_COINGECKO_API_KEY>' -e 'ETHERSCAN_API_KEY=<YOUR_ETHERSCAN_API_KEY>' -e 'OWS_PASSPHRASE=<YOUR_OWS_PASSPHRASE>' -e 'ZEROX_API_KEY=<YOUR_ZEROX_API_KEY>' web3agent npx -- -y web3agent
```

### Gemini settings.json (`~/.gemini/settings.json`)

```json
{
  "mcpServers": {
    "web3agent": {
      "command": "npx",
      "args": [
        "-y",
        "web3agent"
      ],
      "env": {
        "COINGECKO_API_KEY": "<YOUR_COINGECKO_API_KEY>",
        "ETHERSCAN_API_KEY": "<YOUR_ETHERSCAN_API_KEY>",
        "OWS_PASSPHRASE": "<YOUR_OWS_PASSPHRASE>",
        "ZEROX_API_KEY": "<YOUR_ZEROX_API_KEY>"
      }
    }
  }
}
```

## Environment variables

| Name | Required | Secret | Description |
|---|---|---|---|
| `COINGECKO_API_KEY` | no | yes | Optional CoinGecko API key for higher-rate market data. |
| `ETHERSCAN_API_KEY` | no | yes | Optional Etherscan API key for Etherscan-backed explorer tools. |
| `OWS_PASSPHRASE` | no | yes | Optional Open Wallet Standard vault passphrase for persisted local wallets. |
| `ZEROX_API_KEY` | no | yes | Optional 0x API key for 0x swap plugin support. |
| `CCXT_CONFIG_PATH` | no | no | Optional local path to a CCXT account config JSON file. |
| `CHAIN_ID` | no | no | Default EVM chain ID. Defaults to Base mainnet (8453). |
| `CONFIRM_WRITES` | no | no | Require explicit confirmation before write operations execute. Defaults to true. |
| `WEB3AGENT_EXAMPLE_ACCOUNT` | no | no |  |

## FAQ

### Is it safe to use with AI agents?

Yes, it is self-custodial and write operations are confirmation-gated by default, meaning nothing executes without your approval unless explicitly disabled.

### Which AI agents or hosts are supported?

It works out of the box with Claude Code, Cursor, Windsurf, OpenCode, and Codex.

### What kind of DeFi operations can the agent perform?

The agent can perform swaps, bridges, limit and trigger orders, exchange trading, and market data research.

### How do I install it for my agent?

You can use the command `npx web3agent init` to automatically configure supported hosts.
