@classic-homes/theme-mcp

中文文档
0.5.8发布于 2026/11/07MITTypeScriptES Module近 30 天下载 2523

MCP server for Classic Theme design system - enables AI assistants to understand and correctly use components, tokens, and patterns

原始使用文档
文档目录23 节
  1. Why Use This?
  2. Quick Start
  3. With npx (no installation)
  4. Install globally
  5. Install in a project
  6. Configure Claude Code
  7. What's Included
  8. Resources (Read-Only Data)
  9. Tools (Queryable Functions)
  10. Prompts (Templates)
  11. Example Interactions
  12. Ask Claude to create a dashboard
  13. Ask about component variants
  14. Generate a form
  15. Component Categories
  16. For Package Maintainers
  17. Regenerate Catalog
  18. Build
  19. Test Locally
  20. Requirements
  21. Related Packages
  22. Documentation
  23. License

@classic-homes/theme-mcp

MCP (Model Context Protocol) server for the Classic Theme design system. This package enables AI assistants like Claude to understand and correctly use Classic Theme components, design tokens, layout patterns, and validation schemas.

Why Use This?

When AI assistants have access to the MCP server, they can:

  • Generate correct component code with proper props and variants
  • Follow design system patterns for layouts and forms
  • Use the right design tokens for colors, spacing, and typography
  • Validate usage to catch errors before runtime
  • Speed up development by eliminating guesswork

Quick Start

With npx (no installation)

npx @classic-homes/theme-mcp

Install globally

npm install -g @classic-homes/theme-mcp
classic-theme-mcp

Install in a project

npm install --save-dev @classic-homes/theme-mcp

Configure Claude Code

Add to your ~/.claude/settings.json:

{
  "mcpServers": {
    "classic-theme": {
      "command": "npx",
      "args": ["@classic-homes/theme-mcp"]
    }
  }
}

Or for a local installation:

{
  "mcpServers": {
    "classic-theme": {
      "command": "node",
      "args": ["./node_modules/@classic-homes/theme-mcp/dist/cli.js"]
    }
  }
}

Restart Claude Code after updating the configuration.

What's Included

Resources (Read-Only Data)

Core component and design system resources:

  • components://catalog
  • components://list
  • components://{name}
  • components://category/{category}
  • tokens://all
  • tokens://colors
  • tokens://spacing
  • tokens://typography
  • styles://all
  • styles://integration
  • styles://base
  • styles://accessibility
  • styles://utilities
  • patterns://all
  • patterns://layouts
  • patterns://forms
  • patterns://auth
  • patterns://notifications
  • patterns://{id}
  • schemas://all
  • schemas://auth
  • schemas://common

Package-specific resources:

  • auth://all
  • auth://core
  • auth://svelte
  • auth://testing
  • auth://types
  • auth://api
  • auth://core/{module}
  • auth://svelte/{module}
  • auth://quick-reference
  • notifications://all
  • notifications://core
  • notifications://svelte
  • notifications://types
  • notifications://api
  • notifications://utils
  • notifications://core/{module}
  • notifications://quick-reference
  • docs://all
  • docs://components
  • docs://utilities
  • docs://types
  • docs://extensions
  • docs://styles
  • docs://quick-reference
  • charts://all
  • charts://theme
  • charts://types
  • charts://utils
  • charts://quick-reference
  • charts://props
  • charts://data
  • charts://events
  • charts://reporting
  • gantt://all
  • gantt://types
  • gantt://scheduling
  • maps://all
  • maps://theme
  • maps://types
  • maps://utils
  • maps://route
  • maps://geocoding
  • maps://components
  • maps://quick-reference
  • maps://props
  • maps://data
  • maps://events
  • maps://hooks
  • maps://best-practices
  • maps://theme-types
  • maps://overlay-layers
  • maps://migration
  • maps://positioning
  • native://all
  • native://react
  • native://svelte
  • native://core
  • native://features
  • native://types
  • native://quick-reference
  • viewers://all
  • viewers://formats
  • viewers://setup

Tools (Queryable Functions)

ToolDescription
search_componentsFind components by name/category/functionality
get_component_propsGet detailed props for a component
suggest_patternGet recommended pattern for a use case
validate_component_usageCheck if usage follows guidelines

Prompts (Templates)

PromptDescription
build_formGenerate form with validation
layout_pageGenerate page layout
component_usageGenerate component usage example

Example Interactions

Ask Claude to create a dashboard

"Create a dashboard page with sidebar navigation and a data table"

Claude will use the MCP to look up DashboardLayout props, DataTable configuration, and generate correct TypeScript code.

Ask about component variants

"What variants does the Alert component have?"

Claude queries get_component_props and returns: default, destructive, success, warning, info.

Generate a form

"Create a contact form with name, email, and message fields"

Claude uses the build_form prompt to generate a form with FormField components, Zod validation, and proper error handling.

Component Categories

  • core: Button, Input, Card, Badge, Label, etc.
  • form: FormField, Select, Checkbox, RadioGroup, Slider, etc.
  • layout: DashboardLayout, PublicLayout, AuthLayout, ErrorLayout, ActionHeader, Toolbar, SegmentedControl, ViewToggle
  • feedback: Toast, Spinner, Skeleton, Alert
  • data: DataTable, Tabs
  • overlay: Dialog, AlertDialog, Tooltip, DropdownMenu
  • navigation: Sidebar, Header, Footer, QuickLinks
  • branding: LogoMain, LoadingLogo

For Package Maintainers

Regenerate Catalog

When Classic Theme components are updated:

npm run generate
npm run build

Build

npm run build      # Generate catalog + build
npm run build:fast # Build only (skip generation)

Test Locally

# Run the server
npm run start

# Test with MCP Inspector
npx @modelcontextprotocol/inspector node dist/cli.js

Requirements

  • Node.js 18 or later
  • Classic Theme packages installed in your project (for full functionality)
  • @classic-homes/theme-svelte - Svelte component library
  • @classic-homes/theme-react - React component library
  • @classic-homes/theme-tokens - Design tokens
  • @classic-homes/theme-tailwind-preset - Tailwind configuration

Documentation

License

MIT

版本与发布记录

@classic-homes/theme-mcp 共发布 63 个版本,首次发布于 2026/01/15;过去 12 个月发布了 63 个版本。

版本发布日期距今
0.5.8latest2026/11/073 天前
0.5.72026/11/064 天前
0.5.62026/11/055 天前
0.5.52026/11/055 天前
0.5.42026/11/055 天前
0.5.32026/11/046 天前

关于 @classic-homes/theme-mcp 的常见问题

@classic-homes/theme-mcp 是什么?

MCP server for Classic Theme design system - enables AI assistants to understand and correctly use components, tokens, and patterns

如何安装 @classic-homes/theme-mcp?

在项目目录运行 npm install @classic-homes/theme-mcp,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 classic-theme-mcp,可以用 npx classic-theme-mcp 直接运行。

@classic-homes/theme-mcp 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@classic-homes/theme-mcp 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@classic-homes/theme-mcp 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=18.0.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@classic-homes/theme-mcp 可以商用吗?

@classic-homes/theme-mcp 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@classic-homes/theme-mcp 的下载量有多少?

根据 npm 官方下载统计,@classic-homes/theme-mcp 在 2026/10/10 – 2026/11/08 这 30 天内被下载 2,523 次,日均约 84 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@classic-homes/theme-mcp 还在维护吗?

最新版本 0.5.8 发布于 2026/11/07(3 天前);至今共发布 63 个版本,其中过去 12 个月发布了 63 个;首次发布于 2026/01/15。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。