heroui-v2-mcp
This MCP server lets you explore and retrieve HeroUI v2 resources (docs, source code, styles, theme tokens) directly from GitHub.
List all HeroUI v2 component slugs.
Get full component documentation: description, install command, imports, usage guidance, and props/API table.
Get React/TypeScript source code for a component.
Get tailwind-variants style definitions for a component.
Get general HeroUI v2 guides (installation, frameworks, theming, CLI, etc.).
Get default theme tokens: semantic colors (light/dark) and layout tokens.
Data is fetched on demand from heroui-inc/heroui@main and cached in-memory for 30 minutes; optional GITHUB_TOKEN raises GitHub API rate limits.
Covers HeroUI v2 only, not v3.
Fetches HeroUI v2 component documentation, source code, style definitions, and theme tokens from the heroui-inc/heroui repository on GitHub (main branch) using raw.githubusercontent.com and the GitHub REST API for directory listings. Supports a GITHUB_TOKEN to raise rate limits.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@heroui-v2-mcp Show me the documentation for the Button component"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
heroui-v2-mcp
MCP (Model Context Protocol) server for HeroUI v2 (https://v2.heroui.com) component documentation, source code, style definitions and theme tokens.
Unlike the official @heroui/react-mcp — which targets HeroUI v3 and needs a
deployed Cloudflare Worker + R2 bucket + PostHog project behind it — this is a standalone local server:
it fetches everything on demand directly from heroui-inc/heroui@main (the branch that tracks v2.x) and
raw.githubusercontent.com, caching results in memory for the life of the process. No cloud account,
API deployment or extraction pipeline required.
Why a separate project
HeroUI v3 (branch v3, site heroui.com) and v2 (branch main, site v2.heroui.com) are different,
incompatible component models — different package layout, no llms.txt on the v2 site, different docs
folder structure (/docs/components/* vs /docs/react/*), different styling approach (tailwind-variants
files under packages/core/theme/src/components vs whatever v3 uses). The official MCP explicitly refuses
to serve v2 docs, so this project mirrors its tool surface but points at the v2 data sources.
Related MCP server: UI Toolkit MCP Server
Tools
Tool | Purpose |
| List all v2 component slugs (matches |
| Description, install command, imports, usage guidance, props/API table |
| React/TypeScript source from |
| tailwind-variants style definition from |
| General guides: installation, frameworks, theming, CLI, HeroUIProvider, etc. |
| Default semantic colors + layout tokens |
Install & run
The package is published on npm as heroui-v2-mcp, so no
clone or build step is required to use it.
Use from Claude Code / Claude Desktop / Cursor
Add to your MCP config — npx downloads and runs it on demand:
{
"mcpServers": {
"heroui-v2": {
"command": "npx",
"args": ["-y", "heroui-v2-mcp"]
}
}
}Or install it globally and point at the binary directly:
npm install -g heroui-v2-mcp{
"mcpServers": {
"heroui-v2": {
"command": "heroui-v2-mcp"
}
}
}Local development (from source)
npm install
npm run dev # tsx --watch, runs src/server.ts directly (no build step)
npm run inspect # launches @modelcontextprotocol/inspector against src/server.ts
npm run build # emits dist/server.jsGitHub rate limits
Directory listings go through the GitHub REST API, which is capped at 60 requests/hour
unauthenticated. File contents (raw.githubusercontent.com) are not subject to that limit. If you hit
403s while browsing many components, set a token:
export GITHUB_TOKEN=ghp_xxx # no scopes needed, just raises the rate limit to 5000/hrHow data is resolved
Component list = files under
apps/docs/content/docs/components/*.mdxon themainbranch.Most doc slugs map 1:1 to a
packages/components/<slug>package. A handful of doc pages document sub-components bundled into another package (e.g.textareaships inside@heroui/input,checkbox-groupinside@heroui/checkbox) — seeCOMPONENT_PACKAGE_ALIASESinsrc/constants.ts.Props/API tables are parsed out of the
<APITable data={[...]} />JSX literal embedded in each.mdxdoc page (that array is evaluated as a JS literal — it's static data from the official repo, not arbitrary/untrusted input).Theme tokens come from
packages/core/theme/src/colors/{semantic,common}.tsanddefault-layout.ts.
Caching
Every GitHub response (file content or directory listing) is cached in-memory for 30 minutes
(CACHE_TTL_MS in src/constants.ts). Restart the process to force a refresh sooner.
Available Tools
6 toolsget_component_docsA
Get the full HeroUI v2 documentation for a single component: description, install command, import statements, usage guidance and the props/API reference table. Use list_components first to get valid slugs (e.g. "button", "date-range-picker").
Inputs: component (required).
get_component_source_codeA
Get the React/TypeScript source implementation of a HeroUI v2 component from packages/components//src on GitHub. Useful for understanding internals, hooks and ARIA wiring. Do NOT copy this directly — import the component from @heroui/react or its individual package instead. Use list_components first to get a valid slug.
Inputs: component (required).
get_component_source_stylesA
Get the default tailwind-variants style definition for a HeroUI v2 component, from packages/core/theme/src/components on GitHub. HeroUI v2 has no separate CSS files — every component's slots/variants/compoundVariants are defined as a tailwind-variants ("tv") object in TypeScript. Use this to see which classes back each variant/color/size, useful when writing custom classNames or a custom theme. Use list_components first to get a valid slug.
Inputs: component (required).
get_docsA
Get general HeroUI v2 documentation (guides, customization, frameworks, API references) — NOT component docs. Fetches MDX content from heroui-inc/heroui@main (apps/docs/content/docs). For component documentation use get_component_docs instead. Example paths: guide/introduction, guide/installation, guide/cli, guide/tailwind-v4, guide/nextui-to-heroui.
Inputs: path (required).
get_theme_variablesA
Get HeroUI v2's default theme tokens: semantic colors (light/dark) and layout tokens (radius, border widths, opacity, font sizes, box shadows). Source: heroui-inc/heroui@main, packages/core/theme. Use get_docs({ path: "customization/theme" }) or get_docs({ path: "customization/colors" }) for the narrative guide on overriding these via tailwind.config / createTheme.
Inputs: no named parameters.
list_componentsA
List all HeroUI v2 components (from v2.heroui.com / heroui-inc/heroui@main). This MCP only covers HeroUI v2 — it does NOT know about HeroUI v3 (https://heroui.com, "v3" branch). Always call this first to get the exact slug to pass to get_component_docs / get_component_source_code / get_component_source_styles. Slugs are the same as the path segment in https://v2.heroui.com/docs/components/.
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
Each tool targets a distinct purpose: component docs, source code, styles, general docs, theme tokens, and component listing. No overlap exists, and descriptions clarify boundaries (e.g., get_docs explicitly excludes component docs).
All tool names follow a consistent verb_noun pattern (get_component_docs, get_component_source_code, get_component_source_styles, get_docs, get_theme_variables, list_components). The verb 'get' or 'list' is consistently used, and nouns clearly describe the resource.
With 6 tools, the set is well-scoped for a documentation and source code MCP server. Each tool addresses a specific need (docs, source, styles, general docs, theme, component listing) without unnecessary bloat or missing essentials.
The tool surface covers core documentation retrieval (component docs, source code, styles, general docs, theme variables) and component listing. A minor gap is the lack of a tool to search or filter components, but the core lifecycle for accessing HeroUI v2 information is fairly complete.
Maintenance
Related MCP Connectors
MCP server for StyleKit styles, tokens, recipes, lint and repair over stdio or HTTP.
MCP server for innovationlab documentation, generated by doc2mcp.
Read-only MCP server over the developer docs for the portfolio's JSON API, MCP, A2A and NLWeb.
MCP server for accessing curated awesome list documentation
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA high-quality, open-source Model Context Protocol (MCP) server that bridges AI systems and HeroUI, enabling intelligent assistance for developers working with HeroUI components.17MIT
- AlicenseAqualityFmaintenanceComprehensive MCP server for end-to-end UI development, offering tools to generate components, manage design tokens, audit accessibility, autofix issues, inspect live pages, compare screenshots, and more across multiple frameworks.1334 npmMIT
- AlicenseNot gradedqualityDmaintenanceLocal, free MCP server for brand logo search and shadcn/ui component search & source lookup, requiring no API keys or login.MIT
- AlicenseNot gradedqualityCmaintenanceA local MCP server that lets MCP clients inspect and edit the Figma document currently open in the Figma desktop app using a local bridge and development plugin.MIT