npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

tailwindcss-mcp

v1.1.0

Published

MCP server for TailwindCSS: suggest and validate utility classes, theme reference

Readme

TailwindCSS MCP Server

An MCP (Model Context Protocol) server for Tailwind CSS. It gives AI assistants context and tools to suggest and validate utility classes and to read the current theme, so you don’t have to look up or paste classes manually.

Features

  • suggest_classes – Suggest Tailwind utility classes from a short description (e.g. “red button with padding and rounded corners”).
  • validate_classes – Check a list of class names and get back which are valid and which are unknown.
  • get_theme – Return the Tailwind theme (or a section like colors, spacing, screens) as JSON.
  • Resource: tailwind://theme – Read the current theme as a JSON resource for context.

Theme and class set are built from the default Tailwind v3 config, or from a project’s tailwind.config.* when a path is provided. Optional support for Tailwind v4 via a static theme reference (TAILWIND_VERSION=4).

Installation

npm install -g tailwindcss-mcp
# or
pnpm add -g tailwindcss-mcp

If you get EACCES (permission denied) when installing globally, npm is trying to write to a system directory. Use one of these approaches:

  1. User-owned global directory (recommended) – install globals without sudo:

    mkdir -p ~/.npm-global
    npm config set prefix ~/.npm-global

    Add to your ~/.zshrc (or ~/.bashrc): export PATH="$HOME/.npm-global/bin:$PATH", then run source ~/.zshrc. After that, npm install -g tailwindcss-mcp will work.

  2. No global install – clone or install the package somewhere (e.g. ~/dev/tailwindcss-mcp), run npm install && npm run build, and in Cursor point to that path:

    "command": "node",
    "args": ["/Users/you/dev/tailwindcss-mcp/dist/index.js"]

From source:

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

Configuration

Cursor

Add the server in Cursor MCP settings (e.g. Settings → MCP or .cursor/mcp.json).

If installed globally:

{
  "mcpServers": {
    "tailwindcss": {
      "command": "tailwindcss-mcp"
    }
  }
}

Or run the built file directly:

{
  "mcpServers": {
    "tailwindcss": {
      "command": "node",
      "args": ["/path/to/tailwindcss-mcp/dist/index.js"]
    }
  }
}

With optional project config path (directory or path to tailwind.config.js):

{
  "mcpServers": {
    "tailwindcss": {
      "command": "node",
      "args": ["/path/to/tailwindcss-mcp/dist/index.js", "--config=/path/to/your/project"]
    }
  }
}

Or via environment:

{
  "mcpServers": {
    "tailwindcss": {
      "command": "node",
      "args": ["/path/to/tailwindcss-mcp/dist/index.js"],
      "env": {
        "TAILWIND_CONFIG_PATH": "/path/to/your/project"
      }
    }
  }
}

Claude Desktop

In Claude Desktop config (e.g. ~/Library/Application Support/Claude/claude_desktop_config.json on macOS):

{
  "mcpServers": {
    "tailwindcss": {
      "command": "node",
      "args": ["/path/to/tailwindcss-mcp/dist/index.js"]
    }
  }
}

Optional environment variables

  • TAILWIND_CONFIG_PATH – Path to project directory or to tailwind.config.js / tailwind.config.mjs / etc. Used when no per-call configPath is passed.
  • TAILWIND_VERSION3 (default) or 4. Use 4 for Tailwind v4 static theme reference when resolveConfig is not available.

You can also pass --config=/path as a single argument when starting the server.

Config file format

Supported config files: tailwind.config.js, tailwind.config.cjs, tailwind.config.mjs, tailwind.config.ts. For tailwind.config.ts, Node must be able to run TypeScript (e.g. via ts-node or tsx). If you start the server with plain node dist/index.js, a .ts config will not load and the server will use the default theme. Prefer .js / .cjs / .mjs, or run the server with tsx or ts-node and pass the project path if you need a TypeScript config.

Tool examples

  • suggest_classes

    • description: e.g. "red button with padding and rounded corners"
    • Optional configPath for this call.
  • validate_classes

    • classes: space-separated string or array of class names.
    • Optional configPath.
  • get_theme

    • Optional section: colors, spacing, screens, borderRadius, fontFamily, fontSize, boxShadow.
    • Optional configPath.

Troubleshooting

"Connection closed" / "No server info found" in Cursor – The MCP process exits before the handshake. Common causes:

  1. Global install from npm – Older tarballs might not include the built dist/ folder. Reinstall the latest version, or run the server by path instead of the tailwindcss-mcp command:

    "tailwindcss": {
      "command": "node",
      "args": ["/absolute/path/to/tailwindcss-mcp/dist/index.js"]
    }

    (Use the path where the repo is cloned or the package is installed; run npm run build there first.)

  2. Crash on startup – Run in a terminal to see the error:

    tailwindcss-mcp

    or node /path/to/tailwindcss-mcp/dist/index.js. Any message printed to stderr will point to the cause.

License

MIT