Codex logo

Codex + GoldRush

By OpenAI. Runs in Terminal, Cloud, IDE.

Codex is OpenAI's autonomous coding agent that executes tasks in a sandboxed cloud environment. It can independently write, test, and iterate on code. Combined with GoldRush, Codex can build blockchain data pipelines, create analytics dashboards, and automate onchain data workflows without manual intervention.

Step 3: Configure GoldRush MCP server

codex mcp add goldrush --env GOLDRUSH_API_KEY=YOUR_API_KEY -- npx -y @covalenthq/goldrush-mcp-server

Set up Codex with GoldRush

  1. 1Install Codex CLI

    npm install -g @openai/codex
  2. 2Install GoldRush CLI

    Query onchain data directly from your terminal, useful for testing queries before using them in your agent.

    npm install -g @covalenthq/goldrush-cli
  3. 3Configure GoldRush MCP server

    codex mcp add goldrush --env GOLDRUSH_API_KEY=YOUR_API_KEY -- npx -y @covalenthq/goldrush-mcp-server
  4. 4Start a Codex session

    codex
  5. 5Run your first onchain query

    Ask: "Fetch the portfolio value for 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045 on Ethereum"

Things to ask Codex

Once GoldRush is connected, ask in plain words. Codex picks the calls.

  • “Get the token balances for this wallet on Ethereum”
  • “Build a script that tracks new DEX pairs on Base”
  • “Create a Node.js API that returns wallet portfolio data”
  • “Analyze the top transactions for a given address this week”
  • “Write a cron job that monitors whale wallet movements”
  • “Build a React dashboard showing token prices across chains”
  • “Create a data pipeline that aggregates DEX volume by chain”
  • “Generate a CSV export of all token transfers for a wallet”

Common workflows

  • Build a data pipeline

    1. Describe the data pipeline requirements to Codex
    2. Codex scaffolds the project with GoldRush SDK integration
    3. It writes data fetching, transformation, and storage logic
    4. Codex runs tests in its sandbox and iterates on failures
  • Create an analytics API

    1. Ask Codex to create an Express API with GoldRush endpoints
    2. It builds routes for balances, transactions, and pricing
    3. Codex adds error handling and rate limiting
    4. It creates a Dockerfile for deployment
  • Automate wallet monitoring

    1. Request a wallet monitoring service
    2. Codex builds a polling system using GoldRush transaction APIs
    3. It adds notification logic for large transfers
  • Generate onchain reports

    1. Ask Codex to build a report generator
    2. It fetches portfolio, transaction, and NFT data via GoldRush
    3. Codex formats the data into markdown or PDF reports
    4. It sets up scheduled report generation

The 37 MCP tools Codex can call

Each tool is a GoldRush API call or analytics query. Codex reads the descriptions and picks the tools a request needs.

Cross-chain

  • multichain_balances

    Fetch spot and historical balances for an address on up to 10 EVM chains.

  • multichain_transactions

    Fetch paginated transactions for up to 10 addresses and 10 chains.

  • multichain_address_activity

    Locate chains an address is active on with a single API call.

Balances

  • token_balances

    Get native and ERC20 token balances with spot prices and metadata.

  • historical_token_balances

    Get token balances at a specific block height or date.

  • historical_portfolio_value

    Get daily portfolio balance broken down by token.

  • erc20_token_transfers

    Get transfer-in and transfer-out events with historical prices.

  • token_holders

    Get paginated current or historical holders of a token.

  • native_token_balance

    Get native token balance with current market value.

Transactions

  • transaction

    Fetch a single transaction with decoded log events.

  • transaction_summary

    Get earliest/latest transactions and count for a wallet.

  • transactions_for_address

    Get paginated transactions with decoded logs for an address.

  • transactions_for_block

    Get all transactions in a block with decoded events.

Bitcoin

  • bitcoin_hd_wallet_balances

    Get balances for child addresses from an HD wallet xpub key.

  • bitcoin_transactions

    Get full transaction history for a Bitcoin wallet.

  • bitcoin_non_hd_wallet_balances

    Get balance for a non-HD Bitcoin address.

NFTs

  • nft_for_address

    Get ERC721 and ERC1155 NFTs held by an address.

  • nft_check_ownership

    Verify NFT ownership within a collection.

  • nft_check_ownership_token_id

    Verify ownership of a specific NFT by token ID.

Pricing

  • historical_token_prices

    Get historical prices for ERC20 and native tokens.

  • pool_spot_prices

    Get spot prices for a Uniswap V2/V3 pool.

Security

  • token_approvals

    Get token approvals categorized by spender with risk levels.

Utility

  • gas_prices

    Get real-time gas estimates for low, medium, and high speeds.

  • block

    Fetch a single block with timestamp, tx count, and miner info.

  • block_heights

    Get block heights within a date range.

  • log_events_by_address

    Get event logs emitted from a contract address.

  • log_events_by_topic

    Get event logs by topic hash across all contracts.

  • resolve_address

    Resolve an ENS, RNS or Unstoppable Domains name to an address.

Protocol analytics

  • list_entities

    List every dataset with live analytics, with its metrics and dimensions.

  • search_catalog

    Find a dataset, metric, dimension or ticker before querying it.

  • get_metadata

    Read what a dataset's metrics measure, how they split and what they can't answer.

  • get_metric

    Get one metric of a dataset as a daily, weekly or monthly series.

  • get_metrics

    Get several metrics of one dataset in a single call.

  • get_breakdown

    Split a metric by a dimension such as chain, asset or market.

  • list_members

    List the values a dimension holds, ranked, to filter on one of them.

  • compare_entities

    Compare two to ten named datasets on one metric.

  • rank_entities

    Rank every dataset that serves a metric.

GoldRush Agent Skills

Agent Skills give your agent the context it needs for every GoldRush endpoint: parameters, response shapes and credit costs. One command installs all of them.

npx skills add covalenthq/goldrush-agent-skills
  • Foundational API

    REST endpoints for historical blockchain data. Balances, transactions, NFTs, token prices, security checks, cross-chain queries across 100+ networks.

  • x402

    Pay-per-request access without API keys. Agents pay with stablecoins using the HTTP 402 protocol. No accounts, no rate limits, no key management.

  • CLI

    Terminal-first blockchain data with native MCP support. 17 commands that work for both humans and AI agents.

Tips

  • Codex works best with clear, specific task descriptions
  • Use the cloud sandbox for tasks that require running and testing code
  • Set your GOLDRUSH_API_KEY in the environment before starting Codex
  • Review Codex-generated PRs carefully before merging

Troubleshooting

MCP Server not connecting in sandbox
Ensure the MCP configuration is passed correctly via the --mcp-config flag. The sandbox needs network access to reach the GoldRush API.
API key not available in sandbox
Pass the API key through the MCP config env field rather than relying on local environment variables, as the sandbox has its own environment.
Timeout on large data queries
For queries returning large datasets, instruct Codex to add pagination. Use the page_size parameter in GoldRush API calls to limit response size.

More agents

  • Claude Code

    Anthropic's agentic coding tool that lives in your terminal and understands your codebase end-to-end.

  • Gemini CLI

    Google's open-source terminal AI agent powered by Gemini models with built-in MCP support and a file-based skill system.

  • OpenCode

    Open-source AI coding agent with a terminal-first UI, configurable agents, and MCP-native tool access.

See every agent

Codex and GoldRush FAQ

Codex executes code in a sandboxed cloud environment. It can install packages, run tests, and build projects safely without affecting your local machine.