Skip to content

Monitor a Smart Contract from Claude or Cursor with the evmquery MCP Server

Create, pause and inspect smart contract monitors from Claude or Cursor with seven evmquery MCP tools. Example prompts, tool calls and reading events back.

evmquery team5 min read
Try it: ERC-20 Token InspectorName, symbol, decimals and total supply on Ethereum, Base, BNB Smart Chain, Polygon. Free, no signup.

You can monitor a smart contract from Claude or Cursor without leaving the chat. Describe what you want watched, the assistant writes the expression, and the evmquery MCP server creates the monitor and test-evaluates it before saving. This guide covers the seven monitor tools, what a prompt turns into, and how to read results back. For the product overview, see evmquery Monitors.

TL;DR

Connect https://api.evmquery.com/mcp, then ask for a monitor in plain language. The assistant calls create_monitor, which returns the monitor ID and a test run of your expression. Edit monitors in the web app or with PATCH /api/v1/monitors/:id.

Connect the MCP server

If the server is not connected yet, add it once. In Claude Code:

claude mcp add --scope user --transport http evmquery https://api.evmquery.com/mcp

For Claude Desktop, Cursor, VS Code or Windsurf, use the JSON config:

{
"mcpServers": {
"evmquery": {
"url": "https://api.evmquery.com/mcp"
}
}
}

Restart the client and sign in when the browser opens. The MCP server guide covers setup in more detail, including the read tools.

The seven monitor tools

Tool What it does
create_monitor Validates and test-evaluates a definition, then saves it. Returns the monitor ID and the test run.
list_monitors One line per monitor: ID, name, chain, status, trigger, interval and last fired time.
get_monitor Full definition, footprint, current baseline or condition state, last error, channels and latest event.
list_monitor_events Events for one monitor, with limit, type and before for paging, plus delivery status per event.
pause_monitor Stops checks until you resume.
resume_monitor Re-validates the definition and schedules an immediate check.
delete_monitor Removes the monitor, its channels and its events.

To change an expression, interval or channel, use the web app or PATCH /api/v1/monitors/:id. For a quick threshold change, recreating from a prompt works too.

Create a monitor from a prompt

A prompt like this is enough:

Watch the USDC balance of 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045 on Ethereum.
Notify https://example.com/hooks/k7Qx2mPz when it drops below 1,000 USDC.
Check every 15 minutes.

The assistant resolves the token, writes the expression and calls create_monitor with arguments along these lines:

{
"name": "USDC balance below 1,000",
"chain": "evm_ethereum",
"schema": {
"contracts": { "usdc": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48" },
"context": { "wallet": "sol_address" }
},
"context": { "wallet": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045" },
"expression": "usdc.balanceOf(wallet) < parseUnits(\"1000\", 6)",
"trigger": { "kind": "condition" },
"intervalSeconds": 900,
"channels": [
{ "type": "webhook", "url": "https://example.com/hooks/k7Qx2mPz" }
]
}

Here contracts maps an alias to an address, context declares a typed variable and carries its value, and trigger.kind is condition because the expression returns a boolean. The Free plan’s minimum interval is 900 seconds, so 15 minutes is the fastest check on Free. The trigger guide explains when to pick change instead.

A second prompt, for a value that moves:

Tell me by email when USDC total supply moves by 5% or more. Check hourly.
{
"name": "USDC supply",
"chain": "evm_ethereum",
"schema": {
"contracts": { "usdc": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48" }
},
"expression": "usdc.totalSupply()",
"trigger": {
"kind": "change",
"direction": "any",
"threshold": { "unit": "bps", "amount": "500" }
},
"intervalSeconds": 3600,
"channels": [{ "type": "email", "userId": "<your user id>" }]
}

Email channels take the user ID of an organization member. If the assistant does not know yours, it should ask, or you can add the channel later in the web app. Paid plans have higher limits.

The test run on create

Before anything is saved, evmquery evaluates the expression once. The tool result tells you what happened:

Monitor created: 3f8a1c52-0d4e-4b7a-9c1e-6a2d5b8e7f10
Test run: false (bool) at block 21345678 | Calls: 1

The test run shows the current value, its type, the block it was read at and how many contract calls it made. That makes it a quick sanity check: a balance expression returning true right away means the monitor will notify on its first check. If the expression is invalid or the call reverts, the tool returns an error and nothing is saved. If the failure looks temporary, for example an RPC timeout, the monitor is still created and the result says it will retry on schedule. The block number and call count above are illustrative, yours will differ.

An expression must read at least one contract method or builtin such as .balance(). It can use at most 10 distinct methods and make at most 25 contract calls per check.

Read events back

When a monitor fires, it records an event, whether or not a channel is attached. Ask the assistant:

What has the USDC balance monitor done in the last few days?

It calls list_monitor_events with the monitor ID, and each event carries a summary such as condition became true at block 21345678, plus a delivery status of none, delivered, pending, failed or partial. Use type: "paused" to see only the events recorded when a monitor was paused, for example after repeated errors. For a snapshot of current state instead, get_monitor shows the change baseline or the last condition state and any error the latest check hit.

The same data is available over REST at GET https://api.evmquery.com/api/v1/monitors/:id/events if you want a script, such as your webhook receiver, to confirm a notification.

Pause, resume and clean up

Pause the USDC supply monitor while we migrate.

pause_monitor stops the checks and frees one of your active slots. resume_monitor re-validates the definition and runs an immediate check. For a condition monitor whose expression is still true, resuming fires it again, and a change monitor takes a fresh baseline. delete_monitor is permanent and removes the event history, so assistants should confirm before calling it.

Using it with agents

Because monitors are plain MCP tools, an agent can manage them as part of a larger task: create one per treasury wallet, list them to audit coverage, pause the noisy ones. The AI users page shows other ways to put the same server to work, and the Free plan’s 3 active monitors are enough to try the flow end to end.

Next steps

Share

Ask Claude to watch a contract for you

Sign up free, connect the MCP server and create your first monitor from a prompt. The Free plan includes 3 active monitors.