A Model Context Protocol (MCP) server for Stylelint that enables AI models to interact with Stylelint directly.
npm -D install stylelint-mcp
Note: You must have stylelint installed either globally or locally in your project.
The server is started automatically by your editor’s MCP client, but you can run it manually for testing:
npx stylelint-mcp
Add .vscode/mcp.json
:
{
"servers": {
"Stylelint": {
"type": "stdio",
"command": "npx",
"args": ["stylelint-mcp@latest"]
}
}
}
Add .cursor/mcp.json
:
{
"mcpServers": {
"stylelint": {
"command": "npx",
"args": ["stylelint-mcp@latest"],
"env": {}
}
}
}
Run Stylelint on the current file and explain the warnings
Lint #file:index.css and fix