AI 코딩 에이전트에게 CSS 선택자, 속성 및 컴포넌트 참조에 대한 로컬 지식 그래프를 제공하여 정밀한 스타일 컨텍스트를 지원합니다.
다른 이름 mack-peng/cssgraph
- 스타
- 2
- Tools
- 13
- 다운로드, 30일
- —
- 최신 버전
- 0.6.3
- 마지막 커밋
- 2026년 9월 16일
- 라이선스
- MIT
cssgraph MCP란?
cssgraph은(는) MCP server입니다. AI 코딩 에이전트에게 CSS 선택자, 속성 및 컴포넌트 참조에 대한 로컬 지식 그래프를 제공하여 정밀한 스타일 컨텍스트를 지원합니다. 13개 도구를 제공합니다. 예: cssgraph_explore, cssgraph_search, cssgraph_callers.
프로젝트 README에서 생성된 요약
cssgraph MCP server 정보
cssgraph는 AI 코딩 에이전트에게 CSS 선택자, 속성 및 컴포넌트 참조에 대한 로컬 지식 그래프를 제공합니다. 에이전트가 grep이나 glob 명령어를 사용하여 수동으로 파일을 탐색할 필요 없이 정밀한 스타일 컨텍스트를 파악할 수 있도록 설계되었습니다. 스타일시트와 컴포넌트 파일을 인덱싱함으로써, 에이전트는 단 한 번의 도구 호출로 스타일 캐스케이드, 명시도 및 스타일 변경의 영향을 이해할 수 있습니다.
이 시스템은 SQLite 데이터베이스를 사용하여 로컬에서 실행되며 Node.js 버전 22.5.0 이상이 필요합니다. CSS, SCSS, Less, Sass, CSS-in-JS를 비롯하여 JSX, TSX 및 ERB, Haml과 같은 다양한 뷰 템플릿 형식을 지원합니다. 사용자는 cssgraph init 명령으로 인덱스를 초기화할 수 있으며, mcp-install 유틸리티를 사용하여 Claude Code, Cursor 또는 Codex와 같은 에이전트에 연결할 수 있습니다.
이 서버는 파일 변경을 감시하는 자동 동기화를 통해 최신 인덱스를 유지합니다. 전체 스타일 컨텍스트를 가져오는 cssgraph_explore나 클래스 이름 변경 시 영향을 받는 범위를 확인하는 cssgraph_impact와 같은 13가지 특화된 도구를 제공합니다. 이러한 로컬 방식 덕분에 에이전트는 프로젝트 내의 가장 최신 스타일 정보에 항상 접근할 수 있습니다.
프로젝트의 README를 바탕으로 작성되었습니다. 모든 활용 사례는 해당 내용의 인용문과 대조하여 확인합니다.
cssgraph MCP 설치 방법
형식 확인: 2026년 11월 10일Claude Code에 cssgraph MCP 설치
$ claude mcp add cssgraph -- npx -y cssgraphCursor에 cssgraph MCP 설치
~/.cursor/mcp.json
{
"mcpServers": {
"cssgraph": {
"command": "npx",
"args": [
"-y",
"cssgraph"
]
}
}
}VS Code에 cssgraph MCP 설치
.vscode/mcp.json
{
"servers": {
"cssgraph": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"cssgraph"
]
}
}
}Claude Desktop에 cssgraph MCP 설치
claude_desktop_config.json
{
"mcpServers": {
"cssgraph": {
"command": "npx",
"args": [
"-y",
"cssgraph"
]
}
}
}Codex에 cssgraph MCP 설치
~/.codex/config.toml
[mcp_servers.cssgraph] command = "npx" args = ["-y", "cssgraph"]
Gemini CLI에 cssgraph MCP 설치
~/.gemini/settings.json
{
"mcpServers": {
"cssgraph": {
"command": "npx",
"args": [
"-y",
"cssgraph"
]
}
}
}cssgraph MCP 도구 13
README에서 감지됨cssgraph_explorecssgraph_searchcssgraph_callerscssgraph_impactcssgraph_rulecssgraph_impact_selectorcssgraph_detailscssgraph_unusedcssgraph_cascadecssgraph_diagnosecssgraph_propertycssgraph_files
| 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 | — |
도구 13개 모두 보기도구 수 줄이기
cssgraph_status
| cssgraph_status | — |
자동 검사
2026년 11월 14일에 실행됨전체 보고서 →자동 검사를 통과했습니다. 이는 보안 감사가 아닙니다. 코드를 직접 읽고 서버에 필요한 최소한의 권한만 부여하십시오. 검사 방식
- 소스 저장소 연결 및 접근 가능mack-peng/cssgraph is public and reachablegithub.com/mack-peng/cssgraph ↗통과
- 패키지가 이 저장소를 소스로 지정cssgraph names mack-peng/cssgraph as sourcenpmjs.com/package/cssgraph ↗통과
- 빌드 출처(Sigstore 증명)Sigstore attestation for cssgraphnpmjs.com/package/cssgraph/v/0.6.3#provenance ↗통과
- 오픈 소스 라이선스 (OSI)MITspdx.org/licenses/MIT.html ↗통과
- 최근 1년 내 커밋 또는 릴리스Last commit or release 2026-09-16github.com/mack-peng/cssgraph ↗통과
- OpenSSF Scorecard검사되지 않음
- 패키지 이름이 인기 패키지와 유사하지 않음No popular package one edit away from cssgraph통과
- 패키지와 의존성에 심각한 보안 권고 없음20 resolved dependencies checked; no critical advisoryosv.dev ↗통과
- 모델에 대한 숨겨진 지침 없음13 tool descriptions and the README read; no override phrases, credential paths or hidden characters통과
- 파괴적인 도구에 라벨 표시됨No tool named like delete, drop or exec통과
- 원격 endpoint가 MCP 핸드셰이크에 응답검사되지 않음
README
GitHub에서 보기cssgraph
CSS Intelligence for AI Coding Agents
Surgical style context · fewer tool calls · faster answers · 100% local
Why cssgraph?
When an AI agent needs to understand CSS — where is .btn-primary defined, what properties does it have, which selectors cascade over it, which JSX components reference it — it discovers style the slow way: grep, glob, and Read, one file at a time, reconstructing the cascade by hand.
cssgraph hands the agent the exact style context it needs in one call. It's a pre-built knowledge graph of every className, CSS property, variable, and at-rule in your stylesheets — so instead of crawling files, the agent asks one question and gets back the properties, overrides, specificity, callers, and file-level impact in full.
Installation
For Humans
Copy and paste this prompt to your LLM agent (Claude Code, Cursor, Codex, etc.):
Install and configure cssgraph by following the instructions here:
https://raw.githubusercontent.com/mack-peng/cssgraph/main/docs/guide/installation.md
Or read the Installation Guide, but seriously, let an agent do it. Humans fat-finger configs.
For LLM Agents
Fetch the installation guide and follow it:
curl -s https://raw.githubusercontent.com/mack-peng/cssgraph/main/docs/guide/installation.md
Quick Start
1. Initialize
npm i -g cssgraph
cd your-project
cssgraph init --workers 8
Indexes all style files (CSS, SCSS, Less, Sass), JSX/TSX className references, CSS-in-JS, CSS Modules, and view templates (ERB/Haml/HTML) — enabling every MCP tool.
Pass --workers <n> to control parallel parse threads (default: cpu cores - 1).
Requires Node.js >= 22.5.0 (for node:sqlite).
2. Wire up your agent
cssgraph mcp-install
Auto-detects and configures opencode, Claude Code, Cursor, Codex CLI, Gemini CLI,
Hermes Agent, Antigravity IDE, and Kiro. Writes MCP server config, instructions
block, and an Agent Skill (SKILL.md + references/pitfalls.md) that teaches
agents when to use each of the 13 cssgraph tools, how to chain them into
workflows, and what pitfalls to avoid.
Or add to any MCP agent manually:
{
"mcpServers": {
"cssgraph": {
"type": "stdio",
"command": "cssgraph",
"args": ["serve", "--mcp"]
}
}
}
3. No more syncing
Auto-sync is enabled by default. The MCP server watches your project and updates the graph on every file change — while your agent edits code, or you add/modify/delete CSS files. The index is never stale.
How It Works
┌───────────────────────────────────────────────────────────┐
│ AI Agent │
│ │
│ "What code files use .btn-primary?" │
│ calls cssgraph_rule — one tool call │
│ │ │
└─────────────────────────────┬─────────────────────────────┘
│
▼
┌───────────────────────────────────────────────────────────┐
│ cssgraph MCP Server │
│ │
│ rule · O(1) exact selector lookup · loose/strict impact │
│ explore · properties + overrides + specificity + callers │
│ │ │
│ ▼ │
│ SQLite knowledge graph │
│ classNames · properties · variables · at-rules │
│ edges · FTS5 full-text search │
└───────────────────────────────────────────────────────────┘
- Extraction — PostCSS parses CSS/SCSS/Less/Sass into ASTs. CSS-in-JS (
styled.div), JSX className references, and template class attributes extracted from.jsx/.tsx/.erb/.hamlfiles. - Storage — Everything goes into a local SQLite database (
.cssgraph/cssgraph.db) with FTS5 full-text search. WAL-mode + batch commits for write performance. FTS triggers and unique indexes are deferred during bulk load for speed. - Graph — Edges connect related nodes:
contains(selector→property),nests(parent→child selector),overrides(higher specificity selector overrides lower),imports(file→imported file),references(JSX/view file→className, property→CSS variable). - Git-first scanning —
git ls-filesfor instant file discovery. Falls back to filesystem walk on non-git projects. - Parallel parsing — Files dispatched in batches to worker threads via
Promise.all. Parses complete concurrently; results flushed in file order for correctness. - Auto-Sync — Native OS file events, debounced, incrementally synced.
CLI Reference
cssgraph init [path] [-w, --workers <n>] # Initialize + build graph
cssgraph index [path] [-w, --workers <n>] # Rebuild from scratch
cssgraph query <className> # Search for className selectors
cssgraph explore <query...> # Full style context for a className
cssgraph details <selector> # O(1) exact selector → file:line lookup
cssgraph rule <selector> [--strict] # Selector impact: exact + loose/strict files
cssgraph impact-selector <selector> # Code files affected by a selector
cssgraph impact <className> # Blast radius of changing a className
cssgraph unused # Find unreferenced class selectors
cssgraph cascade <className> # Visualize cascade path
cssgraph diagnose <className> [chain...] # Static anchor diagnosis (height/scroll)
cssgraph property <query...> # Search by CSS property value
cssgraph files [path] # Project style file tree
cssgraph status [path] # Index statistics
cssgraph sync [path] # Incremental update
cssgraph serve --mcp # Start MCP server
cssgraph mcp-install # Auto-wire to your AI agent (alias: install)
cssgraph skill-install # Install/update SKILL.md only (no MCP config changes)
cssgraph skill-uninstall # Remove SKILL.md only (no MCP config changes)
cssgraph mcp-uninstall # Remove from your AI agent (alias: uninstall)
cssgraph version # Print installed version
JSX and View File Scanning (default)
cssgraph always scans:
- JSX/TSX/JS/TS/ES6 —
classNamereferences, CSS-in-JS, CSS Modules - View templates —
.erb,.haml,.htmlfiles forclass="..."attributes and Haml.classnameshorthand
This enables cssgraph_impact, cssgraph_callers, and cssgraph_rule to track both component files AND template files that reference each className.
| Project | Total files | First index | Nodes | Edges |
|---|---|---|---|---|
| Small | ~50 | ~15s | ~16K | ~50K |
| Production monorepo | ~11K | ~3-5m | ~780K | ~22M |
MCP Tools
| Tool | Purpose |
|---|---|
cssgraph_explore |
PRIMARY: Full style context for a className — properties, overrides, specificity, callers |
cssgraph_search |
Search for className selectors by name |
cssgraph_callers |
Find JSX components referencing a className |
cssgraph_impact |
Blast radius of changing a className |
cssgraph_rule |
Blast radius of a full CSS selector (exact match + loose/strict file impact) |
cssgraph_impact_selector |
Find code files (JS/TS/JSX/TSX) affected by a CSS selector |
cssgraph_details |
O(1) exact selector lookup (no edges, lightweight) |
cssgraph_unused |
Find class selectors with no incoming references |
cssgraph_cascade |
Visualize the cascade path for a className |
cssgraph_diagnose |
Static anchor diagnosis for scroll/height issues — classifies height declarations as DEFINITE / INDEFINITE / UNVERIFIABLE along the ancestor chain |
cssgraph_property |
Search selectors by CSS property value |
cssgraph_files |
Indexed style file tree |
cssgraph_status |
Index health check |
Complementary Tool: cssprobe-cli
cssgraph is a static analysis tool — it reads your source code and answers where a class is defined, what cascades over it, and what a change would affect. For runtime questions — what a page actually renders in a browser (overflow, scroll chains, computed height chains, containing block hijacks) — use cssprobe-cli, which opens a real browser and reads computed styles plus DOM metrics. The two tools complement each other:
| cssgraph (static) | cssprobe-cli (runtime) | |
|---|---|---|
| Analyzes | source code (CSS/SCSS/Less + JSX/TSX + templates) | live browser (computed styles + DOM) |
| Answers | where a class is defined, cascade, impact, unused CSS | actual rendered layout, overflow, scroll, height chains |
| When | before/without a browser | after static analysis, to verify at runtime |
| Usage | cssgraph init + explore/rule/impact |
open + inspect/layout/findings |
Recommended workflow for a style problem — go static first, then verify at runtime:
# 1. Static: find the definitions, cascade, and blast radius (cssgraph)
cssgraph explore .btn-primary
cssgraph cascade .btn-primary
# 2. Runtime: confirm what actually renders (cssprobe-cli)
npm i -g cssprobe-cli
cssprobe-cli open https://example.com
cssprobe-cli inspect .btn-primary
cssprobe-cli findings .btn-primary
Install: npm install -g cssprobe-cli (requires Node.js >= 22.5.0). See npm / GitHub.
Supported Languages
| Language | Extension | Extraction |
|---|---|---|
| CSS | .css |
PostCSS standard |
| SCSS | .scss |
postcss-scss plugin |
| Less | .less |
postcss-less plugin |
| Sass (indented) | .sass |
Compile → PostCSS |
| PostCSS custom | .pcss |
PostCSS standard |
| JSX / TSX | .jsx .tsx |
className + CSS-in-JS |
| JavaScript / TypeScript | .js .ts .es6 |
className + CSS Modules |
| ERB (Rails) | .erb |
class="..." extraction |
| Haml (Rails) | .haml |
.classname + {:class =>} extraction |
| HTML | .html |
class="..." extraction |
| CSS Modules | .module.css .module.scss .module.less |
Dynamic import resolution |
| Tailwind | tailwind.config.js + CSS @theme |
v3 JS config + v4 CSS config |
Production Scale
| Project | Total files | First index | Nodes | Edges |
|---|---|---|---|---|
| Small | ~50 | ~15s | ~16K | ~50K |
| Production monorepo | ~11K | ~3-5m | ~780K | ~22M |
Project Configuration
Zero-config by default. Optional .cssgraph.json at your project root:
{
"exclude": ["static/vendor/", "**/legacy/**"],
"extensions": {
".pcss": "css"
}
}
Built-in default excludes (always applied): **/*.test.*, **/*.stories.*, **/*.spec.*, **/*.min.*, **/__tests__/**, **/__snapshots__/**, **/__mocks__/**, **/generated/**, **/spec/**, **/vendor/**.
Supported Platforms
| Platform | Architectures | Install |
|---|---|---|
| macOS | x64, arm64 | npm |
| Linux | x64, arm64 | npm |
| Windows | x64, arm64 | npm |
If cssgraph is useful
A ⭐ star helps other developers discover it — and tells us to keep shipping.
License
MIT
cssgraph MCP 질문
cssgraph MCP를 Claude Code에 추가하려면 어떻게 하나요?
터미널에서 claude mcp add cssgraph -- npx -y cssgraph를 실행합니다. 모든 프로젝트에서 사용할 수 있게 하려면 --scope user를 추가합니다.
cssgraph MCP를 Cursor에 추가하려면 어떻게 하나요?
~/.cursor/mcp.json를 열고 mcpServers 아래에 서버를 추가합니다. 위 설치 섹션에 표시된 Cursor 구성을 사용합니다.
cssgraph MCP는 어떤 도구를 제공하나요?
13개 도구를 제공합니다. 예: cssgraph_explore, cssgraph_search, cssgraph_callers, cssgraph_impact, cssgraph_rule.
cssgraph는 어떤 파일을 인덱싱하나요?
CSS, SCSS, Less, Sass, JSX/TSX, JavaScript, TypeScript, ERB, Haml 및 HTML 파일을 인덱싱합니다.
cssgraph를 사용하려면 브라우저가 필요한가요?
아니요, cssgraph는 소스 코드를 읽는 정적 분석 도구입니다. 라이브 브라우저 렌더링이 포함된 런타임 질문에는 cssprobe-cli를 사용해야 합니다.
서버는 파일 변경 사항을 어떻게 처리하나요?
자동 동기화가 기본적으로 활성화되어 있습니다. 즉, MCP server가 프로젝트를 감시하며 파일이 변경될 때마다 그래프를 점진적으로 업데이트합니다.
시스템 요구 사항은 무엇인가요?
node:sqlite를 지원하기 위해 Node.js 버전 22.5.0 이상이 필요합니다.