Back to Devoured - April 27, 2026
DEVOURED
How to Automate MEV Blockchain Analysis Using OpenClaw and MCP

How to Automate MEV Blockchain Analysis Using OpenClaw and MCP

Crypto pawelurbanek.com
A tutorial demonstrates automating MEV blockchain analysis by connecting the mevlog-rs tool to AI agents like Claude Code or OpenClaw for natural language transaction queries.
What: The mevlog-rs MCP server integrates with Claude Code or OpenClaw agents to enable natural language queries of Ethereum blockchain data, allowing developers to search for high-value token transfers, gas usage patterns, and MEV opportunities without writing manual queries.
Why it matters: Searching for MEV opportunities typically requires tedious manual blockchain monitoring and custom scripting; this approach lets developers ask questions in plain English and automate recurring analysis tasks like scheduled Telegram reports.
Takeaway: Install mevlog-rs with `cargo install mevlog --features mcp`, run the MCP server locally, and configure Claude Code to query blockchain data using conversational commands like "find transactions that transferred over 100k USDC in the last 200 blocks".
Deep dive
  • The tutorial covers two integration approaches: manual MCP setup with Claude Code for local queries, and OpenClaw agent for automated scheduled monitoring with Telegram notifications
  • Local setup requires installing mevlog-rs with MCP features enabled, running the server on localhost:6671, and adding it to Claude Code's MCP configuration
  • Performance bottleneck is blockchain data download; the tool uses extensive caching to speed up repetitive queries over same block ranges
  • Remote deployment recommended for production, using a full Geth node on a VPS with NGINX-secured HTTPS gateway and OAuth token authentication
  • The NGINX configuration proxies requests to the local MCP server while handling SSL termination and proper headers for long-running requests
  • OpenClaw integration uses a SKILL.md file instead of MCP endpoints, works well for scheduled cron tasks reporting directly to Telegram
  • Example automated queries include hourly monitoring for million-dollar USDC transfers and daily reports on highest gas-spending transactions
  • Free RPC endpoints from ChainList work for testing but are throttled, lack historical data, and disable EVM tracing features
  • Premium RPC endpoints from services like Alchemy or self-hosted Geth nodes provide significantly better performance for scanning large block ranges
  • The author mentions a major upcoming release that will further improve querying performance across large block ranges
Decoder
  • MEV (Maximal Extractable Value): Profit opportunities extracted from reordering, inserting, or censoring blockchain transactions, typically by bots or miners
  • MCP (Model Context Protocol): A protocol that allows LLM agents to access external tools and data sources through standardized interfaces
  • OpenClaw: An autonomous AI agent framework that can perform tasks, run on schedules, and integrate with communication platforms like Telegram
  • RPC (Remote Procedure Call): An endpoint that allows querying blockchain node data; can be local (self-hosted) or remote (third-party service)
  • Geth: Go Ethereum, the official Golang implementation of an Ethereum full node that stores complete blockchain history
  • EVM tracing: Advanced blockchain query features that show detailed execution steps of smart contract transactions, often disabled on free endpoints
Original article
OpenClaw LLM agent is represented by this crab Photo by Sandra Iglesias on Unsplash

Searching for MEV profit opportunities often requires tedious blockchain monitoring and analysis. In this tutorial, I'll describe how to automate this process using the mevlog-rs MCP interface and the OpenClaw agent. We'll use a secure HTTPS connection and Telegram chat for communication. We'll also discuss the pros and cons of using OpenClaw vs. a manual MCP integration.

Initial setup and RPC requirements

I don't think the world needs another article on a basic OpenClaw setup. Any tutorial on running OpenClaw with a Ubuntu VPS should work. I will assume you already have an OpenClaw integration with a communication interface, such as Telegram, configured.

For an MCP integration, you'll need an LLM agent configured and running locally. For the rest of this article, we will use the Claude Code CLI.

An optional but useful prerequisite for this tutorial is running a Geth full node on the same machine as OpenClaw. Local node offers significantly better performance for scanning larger block ranges. You can also use a premium RPC endpoint, e.g., from Alchemy. But if you want a quick and easy way to test this setup, you can also use the built-in ChainList integration, which automatically selects the fastest free RPC endpoint. But, please remember that free RPC endpoints are often throttled, don't provide access to older data, and disable EVM tracing features.

Configuring an MCP server with mevlog-rs

Let's start with a less "magical" setup. We will first configure a local MCP server and later a remote one to enable querying blockchain data by simply talking to your LLM agent. Full reference is in the mevlog-rs MCP docs.

First, install an mevlog-rs CLI with the MCP feature enabled:

cargo install mevlog --features mcp

Start by verifying if basic querying works:

mevlog search -b latest --rpc-url=$ETH_RPC_URL

You should see JSON output with txs from the recent block.

Now run a mevlog MCP server locally:

mevlog mcp --rpc-url=$ETH_RPC_URL

Next, configure it with your Claude Code instance:

claude mcp add --transport http mevlog http://localhost:6671

That's it! You can query blockchain through an LLM interface by just asking questions like:

  • query the last 50 blocks for transactions that transferred PEPE (0x6982508145454ce325ddbe47a25d4ec3d2311933) token
  • find transactions that transferred over 100k USDC (0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48) in the last 200 blocks
  • which tx transferred the most DAI (0x6b175474e89094c44da98b954eedeac495271d0f) in the last 6 hours
Claude Code using mevlog using an MCP interface

Configuring a remote MCP endpoint for better RPC performance

The above setup assumes that the mevlog CLI executes on your local machine. For production-like deployments, this is usually not optimal. The largest bottleneck of querying blockchains is downloading the data. mevlog uses caching extensively, so repetitive queries against the same block ranges will be significantly faster, but initial data must be downloaded over the wire.

For the best download performance, I recommend a proprietary full node. But you're likely not run it in a local network but on an external VPS. To configure mevlog with an external node, you'll need an authenticated HTTPS gateway using NGINX. So let's do it now.

I won't elaborate on configuring SSH access or running a full node on a proprietary VPS. Check my other tutorial for detailed info on how to do it.

To expose your MCP endpoint externally, you'll need a similar nginx config:

server {
    listen 80;
    listen [::]:80;
    server_name mcphost.com;
    return 301 https://$host$request_uri;
}

server {
    listen 443 ssl;
    listen [::]:443 ssl;
    server_name mcphost.com;

    ssl_certificate /etc/nginx/ssl/mcphost.crt;
    ssl_certificate_key /etc/nginx/ssl/mcphost.key;
    ssl_protocols TLSv1.2 TLSv1.3;
    ssl_session_cache shared:SSL:10m;
    ssl_session_timeout 1d;

    location = /mcp {
        proxy_pass http://127.0.0.1:6671/mcp;
        proxy_http_version 1.1;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto https;
        proxy_set_header Connection "";
        proxy_buffering off;
        proxy_request_buffering off;
        chunked_transfer_encoding on;
        proxy_read_timeout 3600s;
        proxy_send_timeout 3600s;
    }

    location = /.well-known/oauth-authorization-server {
        proxy_pass http://127.0.0.1:6671/.well-known/oauth-authorization-server;
        proxy_http_version 1.1;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-Proto https;
    }

    location = /.well-known/oauth-protected-resource {
        proxy_pass http://127.0.0.1:6671/.well-known/oauth-protected-resource;
        proxy_http_version 1.1;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-Proto https;
    }
}

I usually use a Cloudflare proxy and origin certificates to configure a secure SSL connection. Alternatively, you can use Certbot. BTW, if you already have an OpenClaw running on your VPS, you can ask him to configure it; he'll know what to do.

Now start the authenticated MCP process on a VPS:

MEVLOG_MCP_AUTH_TOKEN=mcp_password mevlog mcp --rpc-url=$ETH_RPC_URL --host=127.0.0.1

and configure your Claude Code to use this external endpoint:

claude mcp add --transport http mevlog-remote https://mcphost.com --header "Authorization: Bearer mcp_password"

and use it as you did before. It's a simple way to use a high-performance, externally hosted node to query the blockchain from a local LLM agent.

How to query EVM blockchains with the OpenClaw LLM agent

The MCP server required some manual configuration. If you're more into "agentic workflows", the OpenClaw setup might work better for you. Once you already have an OpenClaw configured, getting started with mevlog-rs is straightforward. There's a dedicated SKILL.md file that explains how to use the CLI directly without the MCP endpoint. A recommended setup is to run OpenClaw on the same VPS as your RPC node to ensure the best performance.

Just ask your OpenClaw to import the skill into memory, and provide an RPC (local or remote) endpoint, and you're good to go.

OpenClaw agent using mevlog using a dedicated skill

I find OpenClaw setup useful for running scheduled queries and reporting directly to a Telegram channel. You can configure cron tasks like:

  • every 1h check and notify me if any transaction transferred more than 1 million USDC
  • each day at 8AM send me a report on which 10 txs paid the most for gas in the last 24 hours
  • how many txs did jaredfromsubway.eth send in the last 24h, and how much was his total gas spending

Summary

I wish I had access to similar tooling when I was full-time focused on building MEV bots some time ago. It would have saved me dozens of hours of manually querying blockchains for relevant txs. I hope you'll find some of these techniques useful. Please send any feature requests or bug reports.

Also, stay tuned: I'm currently working on a major release of the mevlog CLI that will massively speed up and improve querying across large block ranges.

Explore all 66 articles in today's digest

Fresh dev news, AI-digested daily. Never miss a trend at devoured.fyi