nuthatch — Claude Code MCP server: SQL over EVM contract history
A local MCP server that turns an EVM contract's history into a SQL database. Handy when you want to query contract events without a subgraph or Postgres.
claude mcp add nuthatch -- docker run -i --rm ghcr.io/nightswatchhq/nuthatch:4.0.0What nuthatch does
nuthatch ships as a single Rust binary. It resolves a contract's ABI through Sourcify or Etherscan, builds the schema and decoders, and each event type becomes a table you can hit with ordinary analytical SQL. Everything stays on your machine: up to 2 GB of RAM per chain, no telemetry, no required API token.
Install with curl -fsSL https://nuthatch-indexer.com/install.sh | sh; the script drops the binary into ~/.local/bin. Then nuthatch init 0x… --alias weth creates a nest — a directory holding the ABI, config and indexed data — and nuthatch dev --backfill 300 starts 300 blocks behind the tip. Leave out --backfill and indexing begins at the contract's deployment block.
The Linux build needs glibc 2.35 or newer. Debian 12 and Ubuntu 22.04 are fine; on RHEL 9 and Amazon Linux 2023, which carry glibc 2.34, you build from source with Rust 1.95.0. There is no Intel Mac binary either, so that platform also goes through the source build. The bundled public RPCs are meant for a quick trial, not for keeping a nest running — point --rpc at your own endpoint for a long backfill.
What it helps with
- query contract events in SQL without writing a subgraph
- run a local contract index without Postgres or Docker
- give an agent MCP access to on-chain contract data
- check recent contract activity near the chain tip
- get queryable tables straight from an ABI
Example prompts for the agent
- Connect the nuthatch MCP server and count WETH transfers in the last 300 blocks
- Using nuthatch, count rows in the
weth__transfertable - Start nuthatch and show the latest rows from the contract index
How to install nuthatch
Platform CLI
claude mcp add nuthatch -- docker run -i --rm ghcr.io/nightswatchhq/nuthatch:4.0.0Platform CLI
codex mcp add nuthatch -- docker run -i --rm ghcr.io/nightswatchhq/nuthatch:4.0.0Config file
{
"mcpServers": {
"nuthatch": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"ghcr.io/nightswatchhq/nuthatch:4.0.0"
]
}
}
}Config file
{
"servers": {
"nuthatch": {
"type": "stdio",
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"ghcr.io/nightswatchhq/nuthatch:4.0.0"
]
}
}
}Platform CLI
gemini mcp add nuthatch docker run -i --rm ghcr.io/nightswatchhq/nuthatch:4.0.0Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about nuthatch
How do I install nuthatch in Claude Code?
Run claude mcp add nuthatch -- docker run -i --rm ghcr.io/nightswatchhq/nuthatch:4.0.0.
What does nuthatch do?
It indexes an EVM contract's history into a local SQL database and exposes it through a built-in MCP server. Tables are generated from the ABI, so no handler code is needed.
What does nuthatch require?
An RPC endpoint for the chain, and glibc 2.35 or newer for the Linux binary. On Intel Macs and older distributions you build from source with Rust 1.95.0.