Stylelint MCP服务

一个用于Stylelint的模型上下文协议(MCP)服务器,使AI模型能够直接与Stylelint交互。

  • by ryo-manba
  • TypeScript
  • 本地部署
  • 1 星标
  • 更新于
在 GitHub 查看 ryo-manba/stylelint-mcp

使用说明

styleline mcp

A. 模型上下文协议 Stylelint的(MCP)服务器,使AI模型能够直接与Stylelint交互。

安装

npm -D install stylelint-mcp

注意:您必须在项目中全局或本地安装styleline。

用法

服务器由编辑器的MCP客户端自动启动,但您可以手动运行它进行测试:

npx stylelint-mcp

编辑器设置示例

VS代码

添加 .vscode/mcp.json:

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

光标

添加 .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

许可证

麻省理工学院