Back to blockhertz-mcp

Documentation

Installation, configuration, tool reference, rate limits, and error codes for blockhertz-mcp v0.1.3.

Tool Reference

audit_contract

Audits a smart contract for security vulnerabilities. Supports Solidity, Rust, Move, and Vyper.

Parameters

NameTypeRequiredDescription
codestringYesSmart contract source code
languagestringYesOne of: solidity, rust, move, vyper (case-insensitive)

Example Response

200 OK
{
  "success": true,
  "riskScore": 74,
  "severity": "high",
  "findings": [
    {
      "title": "Reentrancy in withdraw()",
      "severity": "critical",
      "description": "...",
      "recommendation": "Apply CEI pattern"
    }
  ],
  "language": "Solidity",
  "contractName": "Lock",
  "summary": "...",
  "timestamp": "2026-12-01T12:00:00.000Z"
}

optimize_gas

Analyzes a Solidity contract for gas inefficiencies and returns an optimized version.

Parameters

NameTypeRequiredDescription
codestringYesSolidity contract source code

Example Response

200 OK
{
  "success": true,
  "findings": [ { "category": "Storage Packing", "savings": "~2100 gas", ... } ],
  "summaryStats": { "totalFindings": 5, "estimatedSavings": "~12,400 gas" },
  "optimizedCode": "// SPDX-License-Identifier: MIT ...",
  "originalCode": "...",
  "timestamp": "2026-12-01T12:00:00.000Z"
}

Configuration

Environment variables read by blockhertz-mcp at startup.

VariableRequiredDescription
BLOCKHERTZ_API_KEYYesYour Blockhertz API key. Get one free at blockhertz.com/tools/dashboard.
BLOCKHERTZ_BASE_URLNoOverride the API endpoint. Defaults to https://blockhertz.com. Useful for staging.

Rate Limits

MCP calls are rate-limited independently from web tool usage. Limits reset daily at midnight UTC.

TierDaily Limit
Anonymous (no key)1 call / day
Free (signed-in)3 calls / day
Starter / Pro (credits)Unlimited
Unlimited subscriberUnlimited

429 Response Shape

429 Too Many Requests
{
  "error": "Free limit reached",
  "message": "You have used your free MCP calls for today. Upgrade to Pro for unlimited access.",
  "upgrade_url": "https://blockhertz.com/tools/pricing",
  "reset_at": "2026-12-02T00:00:00.000Z"
}

Error Codes

CodeErrorResponse Body
401Invalid API key{ "message": "Invalid API key", "upgrade_url": "https://blockhertz.com/tools/pricing" }
402No credits remaining{ "message": "No credits remaining", "upgrade_url": "https://blockhertz.com/tools/pricing" }
429Rate limit exceeded{ "error": "Free limit reached", "message": "...", "upgrade_url": "...", "reset_at": "<ISO>" }
500Analysis failed{ "error": "audit_failed", "detail": "..." }

Changelog

v0.1.32026-11-26

Initial public release. Two tools: audit_contract, optimize_gas.

Resources

FAQ

Frequently Asked Questions

Where do I find my API key?+

Log in at blockhertz.com/tools/dashboard and go to API Keys. Free accounts get a key with 3 uses/day.

What does the 429 response look like?+

{ "error": "Free limit reached", "message": "You have used your free MCP calls for today. Upgrade to Pro for unlimited access.", "upgrade_url": "https://blockhertz.com/tools/pricing", "reset_at": "<ISO timestamp>" }

Can I self-host the blockhertz-mcp backend?+

Not currently — blockhertz-mcp connects to the Blockhertz hosted API. Self-hosting support is on the roadmap.

How do I report a bug?+

Open an issue at github.com/Blockhertz/blockhertz-mcp.