Overview
Scaffold UI (@scaffold-hbar-ui/*) is a collection of React packages designed for Hedera and EVM-compatible dApps:
| Package | Description |
|---|---|
@scaffold-hbar-ui/components | Address display, balance, HBAR input components |
@scaffold-hbar-ui/hooks | Hedera account resolution, address formatting hooks |
@scaffold-hbar-ui/debug-contracts | Contract debugging UI with multiplier inputs |
@scaffold-hbar-ui/mcp-server | MCP server for AI-assisted development |
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.| Prop | Type | Description |
|---|---|---|
address | string | The EVM address to display |
chain | Chain | Viem chain for explorer links (uses HashScan for Hedera) |
format | "short" | "long" | Address display format |
size | "xs" | "sm" | "base" | "lg" | "xl" | "2xl" | "3xl" | Component size |
disableAddressLink | boolean | Disable the explorer link |
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 theHederaAddressInput component.
Mirror Node Resolution
All Hedera account resolution uses the Mirror Node API directly:| Chain | Mirror Node URL |
|---|---|
| Mainnet (295) | https://mainnet.mirrornode.hedera.com |
| Testnet (296) | https://testnet.mirrornode.hedera.com |
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
- Cursor
- Claude Desktop
- Local Development
Add to Restart Cursor, then verify the server appears in Settings → MCP Servers.
~/.cursor/mcp.json (global) or .cursor/mcp.json (project):Available Tools
The MCP server exposes these tools to AI agents:| Tool | Description |
|---|---|
search_components | Find components by keyword |
search_hooks | Find hooks by keyword |
get_component_props | Get TypeScript props for a component |
get_hook_signature | Get hook signature and return type |
get_component_example | Get usage example for a component |
get_hook_example | Get usage example for a hook |
get_installation_guide | Get installation instructions |
get_theming_guide | Get theming and styling info |
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:Testing with MCP Inspector
Debug the server visually with the MCP Inspector:http://localhost:6274 to browse tools, resources, and prompts interactively.
Resources
- GitHub: scaffold-hbar-ui — Source code
- Example App — Live demos of all components
- MCP Documentation — Learn more about Model Context Protocol
- npm: @scaffold-hbar-ui/components
- npm: @scaffold-hbar-ui/hooks