Skip to main content

Overview

Scaffold UI (@scaffold-hbar-ui/*) is a collection of React packages designed for Hedera and EVM-compatible dApps:

Components

Pre-built UI for addresses, balances, and inputs

Hooks

Hedera account resolution and address utilities

MCP Server

AI agent integration for accurate code generation

GitHub

Source code and examples

Installation

Install the packages you need:

Peer Dependencies

Ensure you have these peer dependencies:

Styles

Import the component styles in your app’s root layout:

Components

Address

Displays an EVM address with a blockie avatar, copy button, and block explorer link. Automatically uses HashScan for Hedera chains.

Balance

Shows native token balance with automatic USD conversion. Uses HBAR pricing for Hedera chains.

HbarInput

Number input optimized for HBAR amounts with tinybar conversion.

HederaAddressInput

Input field that accepts both Hedera native addresses (0.0.12345) and EVM addresses (0x...), with validation and resolution.

Hooks

useAddress

Formats EVM addresses with checksumming, short form display, and block explorer URLs.

useHederaAccountId

Resolves a Hedera account ID (0.0.12345) from an EVM address by querying the Mirror Node.

useHederaEvmAddress

Resolves an EVM address from a Hedera native account ID.

useHederaAddressInput

Validates and resolves Hedera address input (either format). Powers the HederaAddressInput component.

Mirror Node Resolution

All Hedera account resolution uses the Mirror Node API directly:

Debug Contracts

The @scaffold-hbar-ui/debug-contracts package provides a contract interaction UI for development.

Contract Component

Renders a form for interacting with deployed contracts—call read functions, execute writes, and view events.

IntegerInput

Integer input with decimal multiplier buttons for converting human-readable amounts to chain units:
  • ×1e8 — Multiplies by 10^8 (tinybars → HBAR)
  • ×1e18 — Multiplies by 10^18 (wei → ETH)

MCP Server for AI Agents

The @scaffold-hbar-ui/mcp-server package exposes Scaffold UI documentation to AI coding assistants via the Model Context Protocol (MCP).

Why Use It?

When building Hedera dApps with AI assistance (Cursor, Claude Desktop, etc.), the MCP server provides:
  • Accurate imports — AI knows the exact package exports
  • Correct props — TypeScript signatures for all components and hooks
  • Working examples — Real code snippets from the example app
  • Hedera-specific guidance — Mirror Node URLs, chain IDs, HBAR formatting

Quick Setup

Add to ~/.cursor/mcp.json (global) or .cursor/mcp.json (project):
Restart Cursor, then verify the server appears in Settings → MCP Servers.

Available Tools

The MCP server exposes these tools to AI agents:

Example Prompts

After configuring the MCP server, try these prompts:
  • “Show me how to use the HederaAddressInput component with validation”
  • “What hooks are available for Hedera account resolution?”
  • “Get the props for the Address component”

HTTP Mode (Remote Agents)

For remote AI agents or server-side integrations:
Connect with:

Testing with MCP Inspector

Debug the server visually with the MCP Inspector:
Open http://localhost:6274 to browse tools, resources, and prompts interactively.

Resources