stylesafe
An MCP server that detects CSS cascade conflicts and Tailwind utility clashes, returning structured reports with risk scores for AI coding agents and CI pipelines.
README
StyleSafe - MCP and CLI
An MCP server and CLI that catches CSS cascade conflicts and Tailwind utility clashes before they ship — built for AI coding agents and CI workflows.
What it does
- Detects duplicate CSS declarations and dead rules from specificity conflicts
- Flags silent style overrides that may be accidental
- Finds conflicting Tailwind utilities (padding, margin, background, shadow, opacity, border, ring, etc.)
- Understands
cn(),clsx(), andtwMerge()call expressions, not just plainclassNamestrings - Returns structured agent-friendly reports with
confidence,riskScore, andnextStep
Quick start
As a CLI tool
npm install -g stylesafe
stylesafe src/components/Button.jsx
stylesafe --changed --fail-on-issues
stylesafe --projectRoot src
stylesafe --watch src
As an MCP server
{
"mcpServers": {
"stylesafe": {
"command": "node",
"args": ["/absolute/path/to/server.js"]
}
}
}
Example output
stylesafe examples/tailwind-conflict.jsx
Returns a structured report:
{
"totalIssues": 5,
"riskScore": 275,
"averageRiskScore": 55,
"riskLevel": "medium",
"passed": true,
"clean": false,
"files": [
{
"filename": "examples/tailwind-conflict.jsx",
"issues": [
{
"type": "tailwind-conflict",
"category": "padding",
"classes": ["p-4", "px-8"],
"confidence": "medium",
"riskScore": 55,
"nextStep": "Choose one utility from the conflicting set or split the classes by scope.",
"requiresUserConfirmation": true
}
]
}
]
}
passed: true means no hard errors. clean: true means zero issues of any kind.
Use cases
- AI code generation: Catch style bugs before the agent commits changes
- PR gate: Block merged changes that introduce cascade conflicts or utility clashes
- Agent workflows: Integrate as a confirmation step in multi-turn coding tasks
- Style audits: Run across a project to find existing issues
CLI options
stylesafe <file>— analyze a single filestylesafe <dir>— analyze a directory recursivelystylesafe --projectRoot <dir>— same as abovestylesafe --changed— analyze git-changed files (for PR/CI)stylesafe --changed --fail-on-issues— exit with code 1 if any issues foundstylesafe --watch src— re-run on every file changenpm test— run regression tests
Config
Place a .styleintegrityrc file in your project root:
{
"ignore": ["dist", "*.min.css"],
"failOn": ["error", "warning"]
}
GitHub Actions
Add to .github/workflows/style-check.yml:
name: stylesafe
on:
pull_request:
push:
branches: [main]
jobs:
stylesafe:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npm install
- run: node server.js --changed --fail-on-issues
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.