MCP 서버 (시작하기)
HeroUI v3 문서를 AI 어시스턴트에서 바로 접근할 수 있게 도와주는 MCP 서버 소개예요.
출처: HeroUI
본문
HeroUI MCP Server는 AI 어시스턴트에게 HeroUI v3 컴포넌트 문서에 직접 접근할 수 있게 해줘요. AI 기반 개발 환경에서 HeroUI로 더 쉽게 빌드할 수 있게 도와주죠.
MCP 서버는 현재 @heroui/react v3만 지원하며 stdio transport를 사용해요. npm의 @heroui/react-mcp로 배포되어 있어요. 소스 코드는 GitHub에서 볼 수 있어요.
참고: HeroUI v3에 컴포넌트를 더 추가하면 그 컴포넌트들도 MCP 서버에서 사용할 수 있게 돼요.
빠른 설정 (Quick Setup)
Cursor
Cursor Settings → Tools → MCP Servers에 추가하거나, 다음을 ~/.cursor/mcp.json 파일에 추가하세요.
{
"mcpServers": {
"heroui-react": {
"command": "npx",
"args": ["-y", "@heroui/react-mcp@latest"]
}
}
}
자세한 내용은 Cursor 문서를 참고하세요.
Claude Code
터미널에서 다음 명령을 실행하세요.
claude mcp add heroui-react -- npx -y @heroui/react-mcp@latest
또는 프로젝트의 .mcp.json 파일에 수동으로 추가하세요.
{
"mcpServers": {
"heroui-react": {
"command": "npx",
"args": ["-y", "@heroui/react-mcp@latest"]
}
}
}
설정을 추가한 후 Claude Code를 재시작하고 /mcp를 실행하면 목록에서 HeroUI MCP 서버를 볼 수 있어요. Connected가 보이면 바로 사용할 수 있어요.
더 자세한 내용은 Claude Code MCP 문서를 참고하세요.
Windsurf
프로젝트의 .windsurf/mcp.json 설정 파일에 HeroUI 서버를 추가하세요.
{
"mcpServers": {
"heroui-react": {
"command": "npx",
"args": ["-y", "@heroui/react-mcp@latest"]
}
}
}
설정을 추가한 후 Windsurf를 재시작하면 MCP 서버가 활성화돼요.
더 자세한 내용은 Windsurf MCP 문서를 참고하세요.
Zed
settings.json 설정 파일에 HeroUI 서버를 추가하세요. Command Palette(zed: open settings)로 설정을 열거나 Cmd-,(Mac) / Ctrl-,(Linux)를 사용하세요.
{
"context_servers": {
"heroui-react": {
"command": "npx",
"args": ["-y", "@heroui/react-mcp@latest"],
"env": {}
}
}
}
설정을 추가한 후 Zed를 재시작하고 Agent Panel 설정 화면을 여세요. heroui 서버 옆의 표시 점이 녹색이고 "Server is active" 툴팁이 있는지 확인하세요.
더 자세한 내용은 Zed MCP 문서를 참고하세요.
VS Code
GitHub Copilot과 함께 VS Code에서 MCP를 설정하려면 프로젝트의 .vscode/mcp.json 설정 파일에 HeroUI 서버를 추가하세요.
{
"servers": {
"heroui-react": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@heroui/react-mcp@latest"]
}
}
}
설정을 추가한 후 .vscode/mcp.json을 열고 heroui-react 서버 옆의 Start를 클릭하세요.
더 자세한 내용은 VS Code MCP 문서를 참고하세요.
Codex
~/.codex/config.toml(또는 프로젝트 범위 .codex/config.toml)에 HeroUI 서버를 추가하세요.
[mcp_servers.heroui-react]
command = "npx"
args = ["-y", "@heroui/react-mcp@latest"]
설정을 추가한 후 Codex를 재시작하고 TUI에서 /mcp를 실행해 서버가 활성화되었는지 확인하세요.
더 자세한 내용은 Codex MCP 문서를 참고하세요.
OpenCode
프로젝트의 opencode.json 설정 파일에 HeroUI 서버를 추가하세요.
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"heroui-react": {
"type": "local",
"command": ["npx", "-y", "@heroui/react-mcp@latest"]
}
}
}
설정을 추가한 후 OpenCode를 재시작하면 MCP 서버가 활성화돼요.
더 자세한 내용은 OpenCode MCP 문서를 참고하세요.
사용법 (Usage)
설정이 끝나면 AI 어시스턴트에게 다음과 같은 질문을 해보세요.
- "Help me install HeroUI v3 in my Next.js/Vite/Astro app"
- "Show me all HeroUI components"
- "What props does the Button component have?"
- "Give me an example of using the Card component"
- "Get the source code for the Button component"
- "Show me the CSS styles for Card"
- "What are the theme variables for dark mode?"
자동 업데이트
MCP 서버는 최신 HeroUI 버전으로 업그레이드하도록 도와줄 수 있어요.
"Hey Cursor, update HeroUI to the latest version"
AI 어시스턴트가 자동으로:
- 현재 버전을 최신 릴리스와 비교
- breaking changes에 대한 changelog 검토
- 프로젝트에 필요한 코드 업데이트 적용
이 기능은 최신 안정 버전이나 사전 릴리스(pre-release) 버전으로 업데이트할 때 모두 작동해요.
사용 가능한 도구 (Available Tools)
MCP 서버는 AI 어시스턴트에게 다음 도구를 제공해요.
| 도구 | 설명 |
|---|---|
list_components |
사용 가능한 모든 HeroUI v3 컴포넌트를 나열해요 |
get_component_docs |
하나 이상의 컴포넌트에 대한 anatomy, props, 예시, 사용 패턴을 포함한 완전한 컴포넌트 문서를 가져와요 |
get_component_source_code |
컴포넌트의 React/TypeScript 소스 코드(.tsx 파일)에 접근해요 |
get_component_source_styles |
컴포넌트의 CSS 스타일(.css 파일)을 봐요 |
get_theme_variables |
라이트/다크 모드 지원과 함께 색상, 타이포그래피, 간격에 대한 테마 변수에 접근해요 |
get_docs |
가이드와 원칙을 포함한 완전한 HeroUI v3 문서를 탐색해요 (설치 지침은 /docs/react/getting-started/quick-start 경로 사용) |
문제 해결 (Troubleshooting)
요구 사항: Node.js 22 이상. npx를 사용하면 패키지가 자동으로 다운로드돼요.
도움이 필요하세요? GitHub Issues | Discord Community