# tailwind-context-resolver-mcp [Health: Active]

**Category:** 💻 Developer Tools  
**Repository:** https://github.com/vola-trebla/tailwind-context-resolver-mcp  
**GitHub Stars:** 0  
**npm Downloads (last month):** 217  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/tailwind-context-resolver-mcp

## Description
Resolves Tailwind CSS design tokens and validates utility classes against the local project config.

## Tools
Capabilities this server exposes over MCP:

- **resolve_theme_tokens** — Queries the resolved Tailwind CSS theme for a specific namespace and returns all design tokens. Use before generating components to discover what colors, spacing, or font values actually exist in this project. Example namespaces: 'colors', 'colors.brand', 'spacing', 'fontFamily', 'fontSize', 'screens'.
- **validate_class_string** — Validates a Tailwind CSS className string against the project's actual config. Returns valid_classes, invalid_classes (hallucinated tokens), possibly_valid_classes (plugin-generated — cannot verify without PostCSS), and conflict warnings. Handles variants (hover:, dark:, lg:), important (!), opacity modifiers (/50), negative values (-mt-4), and arbitrary values ([32rem]). Use to catch hallucinated design tokens before writing code.
- **detect_css_conflicts** — Detects conflicting Tailwind utility classes in a className string — e.g. applying both 'flex' and 'grid', or multiple position utilities. Use to prevent silent CSS bugs before generating or reviewing component code.
- **get_config_summary** — Returns a compact overview of the project's Tailwind configuration: version, prefix, which theme sections have been customized, and what plugins are active. Use first to understand the project's design system before querying specific tokens.
- **resolve_v4_theme_variables** — Parses the project's root CSS file (Tailwind CSS v4) and extracts all design tokens defined in @theme blocks. Returns a flat map of CSS custom properties (e.g., --color-primary-500 -> oklch(...)).
- **audit_theme_usage** — Identifies dead design tokens by scanning the project files. Checks each CSS custom property defined in @theme blocks to see if it is referenced anywhere in the source code.
- **simulate_jit_compilation** — Validates Tailwind utility classes against the JIT engine by programmatically compiling them. Supports complex arbitrary values, JIT modifiers, and custom plugin classes. Returns the generated CSS rules.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "tailwind-context-resolver-mcp": {
    "command": "npx",
    "args": ["-y","tailwind-context-resolver-mcp"]
  }
}
```

## Documentation

## What tailwind-context-resolver-mcp does

The tailwind-context-resolver-mcp MCP server gives AI agents access to the resolved design system in a local Tailwind CSS v3 project. It reads `tailwind.config.js` or `tailwind.config.ts`, including custom colors, spacing, font families, prefixes, theme extensions, and configured plugins.

Agents can query token namespaces such as `colors.brand`, `spacing`, or `fontFamily`, then use those results when generating components. They can also submit a complete Tailwind class string for validation. The validation result separates recognized and unrecognized classes, reports a configured prefix, and can identify conflicts such as using both `flex` and `grid` on one element.

## How it works

At startup, the server loads the project configuration with `jiti`, so TypeScript configuration files do not require `ts-node`. It then uses Tailwind CSS's `resolveConfig` to combine project settings with Tailwind defaults and produce the resolved theme.

The tailwind-context-resolver-mcp MCP server performs token-based checks rather than executing the complete PostCSS or JIT processing pipeline. For example, it can determine whether a color or spacing token exists and whether a utility maps to that token. This makes the workflow suitable for inspecting configuration and checking generated class names before code is committed.

A practical sequence is to call `get_config_summary` first, query relevant namespaces with `resolve_theme_tokens`, validate the proposed class string with `validate_class_string`, and finish with `detect_css_conflicts`.

## Setup and configuration

Run the package through `npx` from an MCP client configuration:

```json
{
  "tailwind-context-resolver": {
    "command": "npx",
    "args": ["-y", "tailwind-context-resolver-mcp"]
  }
}
```

The README provides this format for Claude Desktop, Cursor, VS Code, and other MCP clients. The project must contain a `tailwind.config.js` or `tailwind.config.ts`, and Node.js 18 or newer is required. No environment variables are documented.

Tailwind CSS v3 is required. Tailwind CSS v4's CSS-based configuration format is not supported; the server reports this limitation when encountered.

## Tools and capabilities

- `resolve_theme_tokens` returns the values in a requested resolved-theme namespace as flat key-value pairs.
- `validate_class_string` checks a className string and returns valid classes, invalid classes, conflict warnings, and the configured prefix.
- `detect_css_conflicts` reports conflicting utilities, including multiple layout models or incompatible positioning utilities.
- `get_config_summary` reports the Tailwind version, prefix, customized theme sections, active plugins, and counts such as colors and spacing values.

Together, these tools let an agent inspect the project's actual tokens before generating code and check its proposed utilities afterward. The tailwind-context-resolver-mcp MCP server is therefore most relevant to projects with custom Tailwind themes, non-default scales, or prefixes.

_Full upstream README: https://allmcps.com/mcp/tailwind-context-resolver-mcp/readme_

