Skip to main content
Glama
lesleslie
by lesleslie

CSS MCP Server

Code style: crackerjack Runtime: oneiric Framework: FastMCP uv Python: 3.13+

Universal CSS Analysis and Documentation MCP Server. Analyze any CSS with ~150 derived metrics (built on ~78 CSSMetrics fields plus selector/property counters) for complexity, specificity, and quality.

Features

  • CSS Analysis: ~150 derived metrics (78 CSSMetrics fields plus selector/property counters) 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

Related MCP server: CSS MCP Server

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

Inherited Oneiric debug flag; sets the field on CSSMCPSettings but has no local behavioral effect (no code path in css_mcp/ reads settings.debug yet). Wire-up is tracked as a follow-up.

Available Tools

Tool

Description

analyze_css

Full CSS analysis with ~150 derived 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 derived metrics (built from 78 CSSMetrics fields plus selector and property counters), 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

  • !important usage

  • 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

A
license - permissive license
-
quality - not tested
B
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    A
    quality
    F
    maintenance
    This server integrates with Mozilla Developer Network (MDN) documentation to suggest CSS properties, check browser support, and provide implementation guidance with user consent mechanisms.
    4
    1
    4
    MIT
  • A
    license
    -
    quality
    D
    maintenance
    Provides up-to-date CSS documentation and browser compatibility data from MDN through natural language queries. Features intelligent caching and supports all CSS properties, selectors, functions, and concepts with automatic normalization.
    113
    334
    ISC
  • A
    license
    -
    quality
    D
    maintenance
    Enables checking web feature compatibility with Baseline standards, analyzing HTML, CSS, and JavaScript code to provide detailed reports on Baseline status, browser support, and recommendations.
    MIT
  • A
    license
    -
    quality
    A
    maintenance
    Enables CSS layout verification and debugging by extracting deterministic, diffable rendered layout from a browser, allowing agents to inspect, explain, and diff CSS changes.
    10
    MIT

View all related MCP servers

Related MCP Connectors

  • On-demand drift checks: declared CSS color, radius, spacing & type vs your own tokens or a pack

  • Turn any live website into brand colors, fonts, design tokens, SVGs, Lottie and paste-ready code.

  • What CSS you can actually ship today, from live Baseline data and MDN browser-compat-data.

View all MCP Connectors

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/lesleslie/css-mcp'

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