npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

defi-node-health

v0.1.0

Published

DeFi RPC node health, sync, uptime and comparison monitoring with CLI and MCP server

Readme

defi-node-health

DeFi RPC node health, block synchronization, uptime and comparison monitoring with a CLI and Model Context Protocol (MCP) server.

No API key required for your own RPC endpoints. Works with Claude Desktop, Cursor, Windsurf and any MCP client.

Features

  • Health checks with latency and current block height
  • eth_syncing progress and reference-node block lag detection
  • Client version, chain ID, network ID and peer count
  • Bounded watch sessions with availability and status-change reporting
  • Side-by-side comparison of up to 20 RPC endpoints
  • Zero runtime dependencies, TypeScript declarations and offline tests

Frequently asked questions

How do I check an Ethereum RPC node in Claude Desktop?

Add this MCP server to claude_desktop_config.json:

{
  "mcpServers": {
    "defi-node-health": {
      "command": "npx",
      "args": ["-y", "defi-node-health"]
    }
  }
}

Then ask: "Check the health of https://ethereum-rpc.publicnode.com".

How do I check whether my node is synchronized?

ALLOW_PRIVATE_RPC=1 defi-node-health sync --rpc http://127.0.0.1:8545

For a real block-lag measurement, provide a trusted reference:

ALLOW_PRIVATE_RPC=1 defi-node-health sync \
  --rpc http://127.0.0.1:8545 \
  --reference-rpc https://ethereum-rpc.publicnode.com

Without a reference, in_sync only reflects the node's own eth_syncing response; it does not independently prove the node has reached the network tip.

Does defi-node-health need an API key?

No. It uses the RPC endpoint you provide. Public endpoints may enforce their own rate limits. If your provider requires a URL key, keep that URL in your secret manager and never paste it into shared logs or tickets; tool output redacts userinfo, query strings, fragments and token-like path segments.

Can I compare several RPC providers?

ALLOW_PRIVATE_RPC=1 defi-node-health compare \
  --nodes primary=https://ethereum-rpc.publicnode.com,fallback=http://127.0.0.1:8545

The summary includes healthy, degraded and unhealthy counts plus the fastest reachable endpoint.

Can I monitor node uptime?

ALLOW_PRIVATE_RPC=1 defi-node-health uptime --rpc http://127.0.0.1:8545 --checks 10 --interval 5000

Watch sessions are bounded (maxChecks up to 100) so CLI and MCP calls cannot run forever.

Which chains are supported?

Any EVM-compatible JSON-RPC endpoint. Optional public presets are included for Ethereum, BNB Smart Chain, Polygon, Arbitrum, Optimism, Base and Avalanche.

Install and verify

npm install -g defi-node-health
defi-node-health --version

Or run without a global install:

npx defi-node-health --version

CLI quick start

defi-node-health health --rpc https://ethereum-rpc.publicnode.com
defi-node-health info --rpc https://ethereum-rpc.publicnode.com
defi-node-health watch --rpc https://ethereum-rpc.publicnode.com --checks 3 --interval 10000 --stream

Output is JSON. Watch --stream emits one JSON object per check.

MCP tools

| Tool | Purpose | |---|---| | check_node_health | Availability, latency and current block | | check_block_sync | Sync progress and reference block lag | | get_node_info | Client, chain, network and peer information | | watch_node | Bounded status monitoring and change counts | | compare_nodes | Health and latency comparison | | get_node_uptime | Availability estimate over bounded checks |

Common options include timeoutMs (default 10000) and retries (default 3). Transient HTTP 429/5xx, network failures and malformed transient responses use exponential backoff. Retry-After is honored up to 60 seconds.

Endpoint security

  • Loopback, private, link-local and metadata endpoints are blocked by default, including hostnames that resolve to those addresses.
  • For a trusted local or private RPC, opt in explicitly with ALLOW_PRIVATE_RPC=1 or allowPrivateRpc: true in code.
  • Redirects are disabled by default. If enabled with allowRedirects: true, every redirect target is revalidated and limited to 3 hops.
  • Responses are capped at 1 MiB and JSON nesting is capped at 64 levels; oversized responses fail closed.
  • Result and error URLs are redacted. Keep provider credentials in your secret manager rather than sharing credential-bearing URLs.

Status semantics

  • healthy: RPC responds within maxResponseMs.
  • degraded: RPC responds but exceeds the latency threshold.
  • unhealthy: RPC request fails or returns an invalid response.
  • behind: local block is more than maxBlockLag behind reference.
  • ahead: local block is more than maxBlockLag ahead of reference.

Development

npm test

Tests use local mock RPC servers and make no external network requests.

License

MIT