Skip to content

ryo-manba/stylelint-mcp

Repository files navigation

stylelint-mcp

A Model Context Protocol (MCP) server for Stylelint that enables AI models to interact with Stylelint directly.

Installation

npm -D install stylelint-mcp

Note: You must have stylelint installed either globally or locally in your project.

Usage

The server is started automatically by your editor’s MCP client, but you can run it manually for testing:

npx stylelint-mcp

Editor setup examples

VS Code

Add .vscode/mcp.json:

{
  "servers": {
    "Stylelint": {
      "type": "stdio",
      "command": "npx",
      "args": ["stylelint-mcp@latest"]
    }
  }
}

Cursor

Add .cursor/mcp.json:

{
  "mcpServers": {
    "stylelint": {
      "command": "npx",
      "args": ["stylelint-mcp@latest"],
      "env": {}
    }
  }
}

Example prompts

Run Stylelint on the current file and explain the warnings

Lint #file:index.css and fix

License

MIT