Логотип TailwindCSS MCP 服务器

TailwindCSS MCP 服务器

Организация
CarbonoDev

MCP server for TailwindCSS utility classes, documentation, and project assistance

ИздательCarbonoDev
Репозиторийtailwindcss-mcp-server
ЯзыкTypeScript
Форки
4
Звёзды
39
Доступные инструменты
0
Тип транспортаstdio
Категории
ЛицензияMIT
Ссылки
  • Подключайте инструменты к рабочим процессам с ИИ

    TailwindCSS MCP 服务器 предоставляет возможности MCP, доступные совместимым ИИ-клиентам и агентам.

  • Доступные инструменты: 0

    Ниже представлены доступные для вызова действия с названиями и описаниями, если сервер их предоставляет.

  • Готовая конфигурация для копирования

    Используйте примеры конфигурации, чтобы настроить этот сервер в предпочитаемом MCP-клиенте.

  • Показатели интереса к открытому проекту

    Звёзды: 39, форки: 4 — в связанном репозитории.

TailwindCSS MCP Server

A comprehensive Model Context Protocol (MCP) server that provides TailwindCSS utilities, documentation, conversion tools, and template generation capabilities. This server enables AI assistants to help with TailwindCSS development through intelligent tooling and real-time assistance.

🚀 Features

Information Tools (4 tools)

  • get_tailwind_utilities - Retrieve TailwindCSS utility classes by category, property, or search
  • get_tailwind_colors - Access the complete TailwindCSS color palette with all shades
  • get_tailwind_config_guide - Get configuration guides for different frameworks
  • search_tailwind_docs - Search TailwindCSS documentation with intelligent filtering

Action Tools (4 tools)

  • install_tailwind - Generate installation commands and configurations for any framework
  • convert_css_to_tailwind - Convert traditional CSS to TailwindCSS utility classes
  • generate_color_palette - Create custom color palettes with multiple shades from base colors
  • generate_component_template - Generate HTML component templates with TailwindCSS classes

Supported Frameworks

  • React (Create React App, Next.js)
  • Vue (Vue 3, Nuxt.js)
  • Angular
  • Svelte/SvelteKit
  • Laravel
  • Vite
  • Vanilla JavaScript/HTML

📦 Installation

Using npm (Recommended)

bash
npm install -g tailwindcss-mcp-server

Using the package directly

bash
npx tailwindcss-mcp-server

Local Development

bash
git clone https://github.com/CarbonoDev/tailwindcss-mcp-server.git
cd tailwindcss-mcp-server
npm install
npm run build

⚙️ Configuration

Claude Desktop

Add to your Claude Desktop configuration file:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%/Claude/claude_desktop_config.json

Option 1: Using global installation

json
{
  "mcpServers": {
    "tailwindcss-server": {
      "command": "tailwindcss-server"
    }
  }
}

Option 2: Using npx

json
{
  "mcpServers": {
    "tailwindcss-server": {
      "command": "npx",
      "args": ["-y", "tailwindcss-mcp-server"]
    }
  }
}

Option 3: Using local build

json
{
  "mcpServers": {
    "tailwindcss-server": {
      "command": "/path/to/tailwindcss-mcp/build/index.js"
    }
  }
}

Claude Code

Add MCP Server using npx

bash
claude mcp add tailwindcss-mcp-server -- npx tailwindcss-mcp-server

Windsurf IDE

Add to your ./windsurf/mcp_servers.json:

json
{
  "mcpServers": {
    "tailwindcss-server": {
      "command": "npx",
      "args": ["-y", "tailwindcss-mcp-server"]
    }
  }
}

Cursor IDE

Add to your .cursor/mcp.json:

json
{
  "mcpServers": {
    "tailwindcss-server": {
      "command": "npx",
      "args": ["-y", "tailwindcss-mcp-server"]
    }
  }
}

🛠️ Tool Reference

Information Tools

get_tailwind_utilities

Retrieve TailwindCSS utility classes with flexible filtering options.

Parameters:

  • category (optional): Filter by category (e.g., 'layout', 'typography', 'colors')
  • property (optional): Filter by CSS property (e.g., 'margin', 'color', 'font-size')
  • search (optional): Search term to find specific utilities

Example Usage:

typescript
// Get all layout utilities
get_tailwind_utilities({ category: "layout" })

// Get margin-related utilities
get_tailwind_utilities({ property: "margin" })

// Search for flex utilities
get_tailwind_utilities({ search: "flex" })

get_tailwind_colors

Access TailwindCSS color palette with complete shade information.

Parameters:

  • colorName (optional): Specific color name (e.g., 'blue', 'red')
  • includeShades (optional): Include all color shades (default: true)

Example Usage:

typescript
// Get all colors with shades
get_tailwind_colors({ includeShades: true })

// Get specific color information
get_tailwind_colors({ colorName: "blue" })

get_tailwind_config_guide

Get configuration guides and best practices for different frameworks.

Parameters:

  • topic (optional): Configuration topic (e.g., 'installation', 'customization')
  • framework (optional): Target framework (e.g., 'react', 'vue', 'nextjs')

Example Usage:

typescript
// Get React-specific configuration
get_tailwind_config_guide({ framework: "react" })

// Get customization guides
get_tailwind_config_guide({ topic: "customization" })

search_tailwind_docs

Search TailwindCSS documentation with intelligent filtering.

Parameters:

  • query (required): Search query for TailwindCSS documentation
  • category (optional): Filter by documentation category
  • limit (optional): Limit number of results (default: 10)

Example Usage:

typescript
// Search for responsive design information
search_tailwind_docs({
  query: "responsive design",
  limit: 5
})

// Search in specific category
search_tailwind_docs({
  query: "dark mode",
  category: "customization"
})

Action Tools

install_tailwind

Generate complete installation commands and configuration files for any framework.

Parameters:

  • framework (required): Target framework ('react', 'nextjs', 'vue', 'vite', 'laravel', 'angular', 'svelte')
  • packageManager (optional): Package manager ('npm', 'yarn', 'pnpm', 'bun') - default: 'npm'
  • includeTypescript (optional): Include TypeScript configuration (default: false)

Example Usage:

typescript
// Install for Next.js with npm
install_tailwind({
  framework: "nextjs",
  packageManager: "npm"
})

// Install for React with TypeScript and yarn
install_tailwind({
  framework: "react",
  packageManager: "yarn",
  includeTypescript: true
})

convert_css_to_tailwind

Convert traditional CSS to TailwindCSS utility classes with intelligent suggestions.

Parameters:

  • css (required): CSS code to convert to TailwindCSS utilities
  • mode (optional): Output format ('classes', 'inline', 'component') - default: 'classes'

Example Usage:

typescript
// Convert CSS to utility classes
convert_css_to_tailwind({
  css: ".button { padding: 1rem; background-color: #3B82F6; color: white; }"
})

// Convert with inline format
convert_css_to_tailwind({
  css: ".card { margin: 16px; border-radius: 8px; }",
  mode: "inline"
})

// Convert for @apply directive
convert_css_to_tailwind({
  css: ".component { display: flex; justify-content: center; }",
  mode: "component"
})

generate_color_palette

Create custom color palettes with multiple shades from a base color.

Parameters:

  • baseColor (required): Base color in hex, rgb, or hsl format
  • name (required): Name for the color palette
  • shades (optional): Array of shade values (default: [50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950])

Example Usage:

typescript
// Generate brand color palette
generate_color_palette({
  baseColor: "#6366F1",
  name: "brand"
})

// Generate custom shades
generate_color_palette({
  baseColor: "rgb(59, 130, 246)",
  name: "primary",
  shades: [100, 300, 500, 700, 900]
})

// Generate from HSL
generate_color_palette({
  baseColor: "hsl(217, 91%, 60%)",
  name: "accent"
})

generate_component_template

Generate HTML component templates with TailwindCSS classes and customization suggestions.

Parameters:

  • componentType (required): Component type ('button', 'card', 'form', 'navbar', 'modal', 'alert', 'badge', 'breadcrumb')
  • style (optional): Visual style ('minimal', 'modern', 'playful') - default: 'modern'
  • darkMode (optional): Include dark mode support (default: false)
  • responsive (optional): Include responsive design classes (default: true)

Example Usage:

typescript
// Generate a modern button
generate_component_template({
  componentType: "button",
  style: "modern",
  responsive: true
})

// Generate a modal with dark mode
generate_component_template({
  componentType: "modal",
  style: "minimal",
  darkMode: true
})

// Generate a playful card component
generate_component_template({
  componentType: "card",
  style: "playful",
  responsive: true
})

🎯 Use Cases

1. Learning TailwindCSS

  • Explore utility classes by category or property
  • Understand the color system and naming conventions
  • Get configuration examples for your framework
  • Search documentation for specific concepts

2. Converting Existing CSS

  • Convert legacy CSS to modern TailwindCSS utilities
  • Get suggestions for unsupported properties
  • Learn TailwindCSS equivalents for common CSS patterns
  • Optimize existing stylesheets

3. Design System Creation

  • Generate custom color palettes that match your brand
  • Create consistent component templates
  • Export color variables for CSS or JavaScript
  • Maintain design consistency across projects

4. Framework Integration

  • Get framework-specific installation guides
  • Set up TailwindCSS with TypeScript support
  • Configure build tools and development workflows
  • Learn best practices for your tech stack

🔧 Development

Prerequisites

  • Node.js 18+
  • npm, yarn, or pnpm

Setup

bash
# Clone the repository
git clone https://github.com/CarbonoDev/tailwindcss-mcp-server.git
cd tailwindcss-mcp-server

# Install dependencies
npm install

# Build the project
npm run build

# Run tests
npm test

# Start development with watch mode
npm run watch

Testing

bash
# Run all tests
npm test

# Run tests with coverage
npm run test:coverage

# Run tests in watch mode
npm run test:watch

# Run tests with UI
npm run test:ui

Debugging

Use the MCP Inspector for debugging and development:

bash
npm run inspector

This will start the inspector and provide a URL for browser-based debugging.

📊 Server Capabilities

  • Real-time Documentation: Access up-to-date TailwindCSS documentation
  • Intelligent Conversion: Convert CSS to TailwindCSS with accuracy and suggestions
  • Framework Integration: Support for all major frontend frameworks
  • Color Management: Advanced color palette generation with shade variants
  • Template Generation: Ready-to-use component templates with customization options
  • Performance Optimized: Efficient caching and service architecture
  • Error Handling: Comprehensive error handling with helpful messages
  • Type Safety: Full TypeScript implementation with proper typing

🤝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes with tests
  4. Ensure all tests pass
  5. Submit a pull request

📄 License

MIT License - see LICENSE file for details.

🔗 Links

Установка

TypingMind
Требования:

Node.js 18+

{
  "mcpServers": {
    "carbonodev-tailwindcss-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "tailwindcss-mcp-server"
      ]
    }
  }
}

Используйте MCP TailwindCSS MCP 服务器 с разными ИИ-моделями

TypingMind подключает инструменты MCP на уровне рабочего пространства, поэтому после подключения TailwindCSS MCP 服务器 вы можете использовать их с разными моделями ИИ в TypingMind, не настраивая подключение отдельно для каждой модели. Эта интеграция MCP работает локально на вашем устройстве через коннектор MCP TypingMind.

Руководство по настройке локального коннектора

Выберите этот способ, если серверу MCP нужен доступ к локальным файлам, приложениям или закрытым ресурсам на вашем компьютере.

1

Откройте настройки MCP

В TypingMind откройте «Настройки», затем «Расширенные настройки», перейдите в раздел «Протокол контекста модели» и выберите «Настроить коннектор».

  1. Откройте TypingMind в браузере.
  2. Нажмите значок настроек.
  3. Перейдите в «Расширенные настройки».
  4. Откройте раздел «Протокол контекста модели».
  5. Нажмите «Настроить коннектор» и выберите «Это устройство».
Экран настройки коннектора MCP в TypingMind с выбранным вариантом «Это устройство»
2

Выполните команду коннектора

Выберите «Это устройство», скопируйте команду из TypingMind и выполните её в терминале. Не останавливайте процесс, пока используете MCP.

  1. Скопируйте команду настройки, показанную в TypingMind.
  2. Откройте «Терминал» в macOS или Windows Terminal в Windows.
  3. Вставьте и выполните команду.
  4. Подтвердите установку пакета, если терминал запросит разрешение продолжить.
  5. Не закрывайте окно терминала и не останавливайте процесс, пока используете инструменты MCP.
3

Добавьте TailwindCSS MCP 服务器 как сервер

Когда статус коннектора сменится на «Готов», нажмите «Изменить серверы» и вставьте конфигурацию сервера MCP.

  1. Дождитесь, пока статус коннектора сменится на «Готов».
  2. Нажмите «Изменить серверы».
  3. Вставьте конфигурацию сервера MCP для TailwindCSS MCP 服务器.
  4. Сохраните список серверов.
  5. Обновите статус, если хотите убедиться, что коннектор по-прежнему готов к работе.
Настройки MCP в TypingMind с активным сервером и кнопкой «Изменить серверы»
{
  "mcpServers": {
    "carbonodev-tailwindcss-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "tailwindcss-mcp-server"
      ]
    }
  }
}
4

Используйте подключение с разными моделями

Сохраните список серверов, откройте раздел «Плагины», включите инструменты MCP для TailwindCSS MCP 服务器, затем выберите любую поддерживаемую модель ИИ в TypingMind и используйте инструменты в чате или назначьте их ИИ-агенту.

  1. Откройте страницу «Плагины» в TypingMind.
  2. Включите инструменты MCP для TailwindCSS MCP 服务器.
  3. Начните чат и выберите модель ИИ, которую хотите использовать.
  4. Используйте инструменты MCP в чате или назначьте их ИИ-агенту.
  5. При необходимости переключайтесь на другую модель ИИ без повторного подключения MCP.
Чат TypingMind с включёнными инструментами MCP и выбранной ИИ-моделью
Можете помочь мне с этой задачей с помощью TailwindCSS MCP 服务器?
TailwindCSS MCP 服务器
Конечно. Я всё прочитал.
Вот что я нашёл с помощью TailwindCSS MCP 服务器.

Часто задаваемые вопросы

Для чего используется сервер MCP TailwindCSS MCP 服务器?

TailwindCSS MCP 服务器 — это сервер MCP, который позволяет совместимым ИИ-клиентам подключаться к внешним инструментам и получать контекст. В TypingMind достаточно один раз добавить этот сервер MCP, чтобы его инструменты стали доступны в вашем рабочем пространстве с ИИ.

Можно ли использовать сервер MCP TailwindCSS MCP 服务器 с несколькими ИИ-моделями в TypingMind?

Да. TypingMind подключает инструменты MCP на уровне рабочего пространства, поэтому вы можете использовать TailwindCSS MCP 服务器 с разными ИИ-моделями, например Claude, ChatGPT, Gemini или другими моделями, настроенными в TypingMind, без отдельной настройки сервера MCP для каждой модели.

Зачем использовать MCP TailwindCSS MCP 服务器 с TypingMind?

TypingMind — один из лучших интерфейсов для чата с LLM: он объединяет разные ИИ-модели, промпты, плагины, ИИ-агентов, ключи API и инструменты MCP в одном рабочем пространстве. Подключив TailwindCSS MCP 服务器, вы сможете использовать его инструменты MCP с предпочитаемыми моделями, сохраняя удобную организацию работы с чатами в TypingMind.

Как подключить сервер MCP TailwindCSS MCP 服务器 к TypingMind?

TailwindCSS MCP 服务器 работает через локальный коннектор MCP TypingMind. Этот вариант лучше всего подходит, когда серверу MCP нужен доступ к локальным файлам, настольным приложениям, инструментам командной строки или закрытым ресурсам на вашем компьютере.

Какие инструменты предоставляет сервер MCP TailwindCSS MCP 服务器 в TypingMind?

TailwindCSS MCP 服务器 предоставляет возможности MCP, которые можно включить на странице «Плагины» в TypingMind и использовать в чате или назначить ИИ-агентам.

Нужно ли передавать TypingMind свои ключи API для использования сервера MCP TailwindCSS MCP 服务器?

Нет. TypingMind ориентирован прежде всего на локальную работу и позволяет вам контролировать выбор провайдеров моделей, ключи API, промпты и конфигурацию MCP. Если TailwindCSS MCP 服务器 требует аутентификации, при создании подключения добавьте необходимые заголовки, настройки OAuth или локальную конфигурацию для этого сервера MCP.

Похожие серверы MCP

Все

Создайте свою рабочую ИИ-среду сейчас

Подпишитесь на нашу рассылку, чтобы узнавать о новых функциях и предстоящих розыгрышах 👇