CSS MCP Server
Enables CSS analysis with 150+ metrics, MDN documentation retrieval, and browser compatibility checks for CSS properties.
README
CSS MCP Server
Universal CSS Analysis and Documentation MCP Server. Analyze any CSS with 150+ metrics for complexity, specificity, and quality.
Features
- CSS Analysis: 150+ metrics for CSS complexity, specificity, and quality
- MDN Documentation: Fetch CSS property docs from MDN Web Docs
- Browser Compatibility: Check cross-browser support for CSS properties
- Project Analysis: Analyze all CSS files in a project
Installation
# Using uv
uv pip install css-mcp
# Using pip
pip install css-mcp
Usage
Start Server
# Via CLI
css-mcp
# Via Python module
python -m css_mcp.server
Environment Variables
| Variable | Default | Description |
|---|---|---|
CSS_MCP_HTTP_PORT |
3050 | Server port |
CSS_MCP_HTTP_HOST |
localhost | Server host |
CSS_MCP_DEBUG |
false | Enable debug mode |
Available Tools
| Tool | Description |
|---|---|
analyze_css |
Full CSS analysis with 150+ metrics |
analyze_css_summary |
Quick CSS summary (faster) |
get_docs |
MDN documentation for CSS properties |
get_browser_compatibility |
Check browser support for properties |
search_properties |
Search for CSS properties |
get_properties_by_category |
Get properties by category |
analyze_project_css |
Analyze all CSS in a project |
list_capabilities |
List available capabilities |
health_check |
Check server health |
Programmatic Usage
Use the analyzer directly in Python for any CSS:
Example: Analyze Any CSS
from css_mcp.analyzer import CSSAnalyzer
# Analyze any CSS content
analyzer = CSSAnalyzer()
metrics = analyzer.analyze(css_content)
# Get complexity score
print(f"Complexity: {metrics.complexity_score}/100")
# Get optimization suggestions
suggestions = analyzer.get_suggestions()
Metrics
The analyzer provides 150+ metrics including:
Basic Metrics
- Total rules, selectors, properties
- File size (bytes, gzipped)
- Lines of code
Selector Metrics
- ID, class, element, universal selectors
- Pseudo-classes and pseudo-elements
- Combinators (descendant, child, sibling)
- Selector depth
Specificity Metrics
- Average, min, max specificity
- High specificity rules
- Specificity distribution
Property Metrics
- Unique properties
- Category distribution (layout, typography, etc.)
- Vendor prefixes
!importantusage- CSS custom properties
Quality Metrics
- Duplicate selectors
- Duplicate properties
- Empty rules
- Complexity score
- Efficiency scores
Browser Compatibility
Built-in compatibility data for common CSS properties across:
- Chrome
- Firefox
- Safari
- Edge
Development
# Install dev dependencies
uv sync --group dev
# Run tests
pytest
# Type check
mypy css_mcp
# Lint
ruff check css_mcp
License
BSD-3-Clause
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
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.
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.