Skip to main content
Glama
CarbonoDev

TailwindCSS MCP Server

by CarbonoDev

get_tailwind_utilities

Retrieve TailwindCSS utility classes by category, CSS property, or search term to find styling solutions for web development projects.

Instructions

Get TailwindCSS utilities by category, property, or search term

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
categoryNoFilter by utility category (e.g., 'layout', 'typography', 'colors')
propertyNoFilter by CSS property (e.g., 'margin', 'color', 'font-size')
searchNoSearch term to find utilities

Implementation Reference

  • The tool handler that receives the request, validates parameters, and calls the utility service to fetch utilities.
    private async handleGetTailwindUtilities(args: any): Promise<any> {
      try {
        const params = this.validateGetUtilitiesParams(args);
        const utilities = await this.utilityMapper.getUtilities(params);
        return this.createSuccessResponse(utilities);
      } catch (error) {
        this.handleServiceError(error, "Failed to get TailwindCSS utilities");
      }
    }
  • The core implementation of the utility fetching logic within UtilityMapperService.
    async getUtilities(params: GetUtilitiesParams): Promise<TailwindUtility[]> {
      let utilities: TailwindUtility[] = [];
    
      if (params.category) {
        utilities = this.getUtilitiesByCategory(params.category);
      } else if (params.property) {
        utilities = this.getUtilitiesByProperty(params.property);
      } else if (params.search) {
        utilities = this.searchUtilities(params.search);
      } else {
        // Return all utilities if no filter specified
        utilities = Array.from(this.utilityMap.values());
      }
    
      return utilities;
    }
  • src/index.ts:96-96 (registration)
    Registration of the tool in the listTools response.
    name: "get_tailwind_utilities",

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/CarbonoDev/tailwindcss-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server