# cssgraph MCP server

> Provides AI coding agents with a local knowledge graph of CSS selectors, properties, and component references for precise style context.

- Repository: https://github.com/mack-peng/cssgraph
- Page: https://hostedmcp.org/servers/mack-peng/cssgraph
- Transport: stdio
- Stars: 2
- License: MIT
- Latest version: 0.6.3

## Install

### Claude Code

```sh
claude mcp add cssgraph -- npx -y cssgraph
```

### Cursor (`~/.cursor/mcp.json`)

```json
{
  "mcpServers": {
    "cssgraph": {
      "command": "npx",
      "args": [
        "-y",
        "cssgraph"
      ]
    }
  }
}
```

### VS Code (`.vscode/mcp.json`)

```json
{
  "servers": {
    "cssgraph": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "cssgraph"
      ]
    }
  }
}
```

### Claude Desktop (`claude_desktop_config.json`)

```json
{
  "mcpServers": {
    "cssgraph": {
      "command": "npx",
      "args": [
        "-y",
        "cssgraph"
      ]
    }
  }
}
```

### Codex (`~/.codex/config.toml`)

```toml
[mcp_servers.cssgraph]
command = "npx"
args = ["-y", "cssgraph"]
```

### Gemini CLI (`~/.gemini/settings.json`)

```json
{
  "mcpServers": {
    "cssgraph": {
      "command": "npx",
      "args": [
        "-y",
        "cssgraph"
      ]
    }
  }
}
```

## Tools (13)

- `cssgraph_explore`
- `cssgraph_search`
- `cssgraph_callers`
- `cssgraph_impact`
- `cssgraph_rule`
- `cssgraph_impact_selector`
- `cssgraph_details`
- `cssgraph_unused`
- `cssgraph_cascade`
- `cssgraph_diagnose`
- `cssgraph_property`
- `cssgraph_files`
- `cssgraph_status`

## FAQ

### What files does cssgraph index?

It indexes CSS, SCSS, Less, Sass, JSX/TSX, JavaScript, TypeScript, ERB, Haml, and HTML files.

### Does cssgraph require a browser to work?

No, cssgraph is a static analysis tool that reads source code. For runtime questions involving live browser rendering, you should use cssprobe-cli.

### How does the server handle file changes?

Auto-sync is enabled by default, meaning the MCP server watches your project and updates the graph incrementally on every file change.

### What are the system requirements?

It requires Node.js version 22.5.0 or higher to support node:sqlite.
