@depthark/css-first

@depthark/css-first

This server integrates with Mozilla Developer Network (MDN) documentation to suggest CSS properties, check browser support, and provide implementation guidance with user consent mechanisms.

Category
访问服务器

Tools

suggest_css_solution

Suggests CSS-first solutions for UI implementation tasks by searching MDN documentation. Provides detailed CSS property information, browser support, and asks for user consent before recommending usage.

check_css_browser_support

Checks browser support for specific CSS properties using MDN data and provides detailed compatibility information.

get_css_property_details

Retrieves comprehensive information about a CSS property from MDN documentation including syntax, examples, and use cases.

confirm_css_property_usage

Confirms user consent for using a specific CSS property and provides implementation guidance.

README

MCP CSS First

An MCP (Model Context Protocol) server that provides CSS-first solutions for UI implementation tasks. This server integrates with Mozilla Developer Network (MDN) documentation to suggest CSS properties, check browser support, and provide implementation guidance with user consent mechanisms.

Features

  • CSS Property Suggestions: Analyzes UI task descriptions and suggests relevant CSS properties from MDN documentation
  • Browser Support Checking: Provides detailed browser compatibility information for CSS properties
  • User Consent Mechanism: Asks for user approval before recommending CSS properties with browser support information
  • Implementation Guidance: Provides code examples, best practices, and fallback strategies
  • MDN Integration: Fetches information from Mozilla Developer Network for accurate CSS documentation

Installation

pnpm install
pnpm run build

Usage

Add to your MCP settings:

{
  "mcpServers": {
    "mcp-css-first": {
      "command": "node",
      "args": ["dist/cli.js"]
    }
  }
}

Available Tools

1. suggest_css_solution

Suggests CSS-first solutions for UI implementation tasks by searching MDN documentation.

Parameters:

  • task_description (string): Description of the UI task or problem to solve
  • preferred_approach (optional): 'modern', 'compatible', or 'progressive'
  • target_browsers (optional): Array of target browsers/versions

Example:

{
  "task_description": "I need to center a div horizontally and vertically",
  "preferred_approach": "modern"
}

2. check_css_browser_support

Checks browser support for specific CSS properties using MDN data.

Parameters:

  • css_property (string): CSS property name to check
  • include_experimental (optional boolean): Include experimental features

Example:

{
  "css_property": "flexbox",
  "include_experimental": false
}

3. get_css_property_details

Retrieves comprehensive information about a CSS property from MDN documentation.

Parameters:

  • css_property (string): CSS property name to get details for
  • include_examples (optional boolean): Include code examples

Example:

{
  "css_property": "grid",
  "include_examples": true
}

4. confirm_css_property_usage

Confirms user consent for using a specific CSS property and provides implementation guidance.

Parameters:

  • css_property (string): CSS property name user wants to use
  • user_consent (boolean): User consent to use this CSS property
  • fallback_needed (optional boolean): Whether fallback solutions are needed

Example:

{
  "css_property": "container-queries",
  "user_consent": true,
  "fallback_needed": true
}

How It Works

  1. Task Analysis: When you describe a UI task, the server extracts relevant CSS keywords
  2. MDN Integration: Searches MDN documentation for appropriate CSS properties
  3. Browser Support: Provides detailed browser compatibility information
  4. User Consent: Asks for approval before recommending properties with support details
  5. Implementation: Provides code examples, best practices, and fallback strategies

Development

# Install dependencies
pnpm install

# Build for development
pnpm run build:tsc

# Watch for changes
pnpm run dev

# Build for production
pnpm run build

# Run tests
pnpm test

# Lint code
pnpm run lint

Project Structure

src/
├── index.ts              # Main MCP server implementation
├── services/
│   └── mdnApi.ts         # MDN API integration and CSS property logic
└── utils/
    └── tryCatch.ts       # Error handling utilities

CSS Property Coverage

The server currently supports suggestions for:

  • Layout: Flexbox, Grid, positioning
  • Responsive Design: Container queries, media queries
  • Animations: CSS animations, transitions
  • Visual Effects: Shadows, gradients, borders
  • Typography: Font properties, text alignment
  • Colors: Color properties, backgrounds

Browser Support Levels

  • Excellent (95%+): Safe for production use
  • Good (85%+): Consider fallbacks for legacy browsers
  • Moderate (70%+): Use with caution and provide fallbacks
  • Limited (<70%): Consider alternative approaches

License

MIT

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选