CSS Crème
Give your agent a real design system: tokens, measured WCAG contrast, and rules to follow.
我該用這個嗎
品質與安全性
發現項目(1)
- LOW在 how_to_use 中
根據工具定義與協定合規性的自動化分析。
上下文成本
這是每次將伺服器的工具載入模型上下文時所消耗的約略 token 數量。數量越高,可用於其他工作的注意力就越少。
安裝
一鍵安裝
將以下內容加入你的 `claude_desktop_config.json` 檔案:
{
"mcpServers": {
"design-systems": {
"url": "https://csscreme.com/mcp"
}
}
}遠端端點
https://csscreme.com/mcpstreamable-http它能做什麼
工具清單
工具(12)
🟢search_themes(query, kind, mode, limit)
Find a design system by describing what you are building ("dark developer tool", "calm fintech dashboard", "playful consumer app"). Returns matching themes with their DESIGN.md URL and shadcn install command. Call this first when the user has no design system defined.
輸入結構描述
{
"type": "object",
"properties": {
"query": {
"type": "string",
"description": "Free text: mood, industry, colour, or use case."
},
"kind": {
"type": "string",
"enum": [
"any",
"theme",
"template"
],
"description": "Curated palette theme, full page template, or either. Default any."
},
"mode": {
"type": "string",
"enum": [
"any",
"light",
"dark"
],
"description": "Preferred light or dark. Default any."
},
"limit": {
"type": "integer",
"minimum": 1,
"maximum": 25,
"description": "Max results, 1-25. Default 8."
}
},
"required": [
"query"
]
}🟢list_themes(kind, mode)
Browse the full catalogue of curated themes and templates. Use when the user wants to see options rather than search for one.
輸入結構描述
{
"type": "object",
"properties": {
"kind": {
"type": "string",
"enum": [
"any",
"theme",
"template"
]
},
"mode": {
"type": "string",
"enum": [
"any",
"light",
"dark"
]
}
}
}🟢get_design_md(id)
Fetch the full DESIGN.md for one theme: semantic colour roles, the complete shadcn token set in light and dark, typography, radius, spacing, MEASURED WCAG contrast ratios, and numbered rules the generated UI must follow. Read this before writing any UI. Save it at the repo root as DESIGN.md so it applies to every session.
輸入結構描述
{
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "Theme or template id, e.g. \"deep-ocean\". Get ids from search_themes or list_themes."
}
},
"required": [
"id"
]
}🟢get_theme_tokens(id, format)
Get the shadcn/ui registry item (OKLCH tokens, light and dark) plus the paste-ready CSS variables for one theme, and the one-line command that installs it for real. Use after get_design_md when you are ready to write the tokens into globals.css.
輸入結構描述
{
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "Theme or template id."
},
"format": {
"type": "string",
"enum": [
"registry",
"css",
"both"
],
"description": "Default both."
}
},
"required": [
"id"
]
}🟢how_to_use(tool)
Explains where a DESIGN.md belongs for a given coding agent (Claude Code, Cursor, v0, Codex, Lovable) so the design rules apply to every session rather than one message.
輸入結構描述
{
"type": "object",
"properties": {
"tool": {
"type": "string",
"description": "claude-code | cursor | v0 | codex | lovable"
}
}
}🟢get_install_command(id)
Return the exact `npx shadcn@latest add <url>` command that installs one theme into a shadcn/ui project, plus the registry URL it reads. Use when the user says "install it" and you already know the id.
輸入結構描述
{
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "Theme or template id."
}
},
"required": [
"id"
]
}🟢get_agent_rules(id)
Return a short standing-instructions block that makes every future session read DESIGN.md before touching UI. Paste it whole into CLAUDE.md, AGENTS.md or .cursor/rules/design.mdc. It points at the DESIGN.md rather than restating it, and carries the token fingerprint so drift is detectable.
輸入結構描述
{
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "Theme or template id."
}
},
"required": [
"id"
]
}🟢decode_url(url, maxAge, format, expect, expectSpec)
Fetch a public site's HTML and stylesheets and return what its CSS declares: named custom properties that look like design tokens, the colours it uses most, its font stacks, border radii, spacing values, and the framework it appears to be built with. Also returns a "drop" report: roughly how many words a web-to-markdown reader would carry away from this page, against the design decisions it would discard, because markdown is defined by throwing the design layer away. It reads CSS and does not render the page, so it reports a confidence ("tokens" when named properties were found, "derived" when only compiled CSS was available) and flags a JavaScript shell rather than pretending every site is equally legible. It obeys the site's robots.txt for CSSCremeBot: a disallowed path is refused with ROBOTS_DENIED, which a retry will not change. A bot challenge, a parked or for-sale domain, or a host's default page is refused with NOT_THE_SITE and the evidence, rather than measured as if it were the site. Every error starts with its code and a retry verdict (never, later, with-changes). A read is reused for up to maxAge seconds (default 600, 0 for fresh), and every result carries `work`: the requests it made of the site. Use when the user wants to match a site that is not in the catalogue, or has fetched a page as markdown and needs what that markdown lost.
輸入結構描述
{
"type": "object",
"properties": {
"url": {
"type": "string",
"description": "Absolute public http(s) URL of the page to read."
},
"maxAge": {
"type": "integer",
"minimum": 0,
"maximum": 3600,
"description": "How old a reused read may be, in seconds. Default 600; 0 reads the site now. A reused read keeps its own fetchedAt and says cache.hit: true."
},
"format": {
"type": "string",
"enum": [
"json",
"md",
"tokens",
"css",
"tailwind",
"registry",
"agents",
"aliases",
"figma"
],
"description": "Default json (the measurement). Or one artefact from the same read: md (DESIGN.md), tokens (W3C DTCG tokens.json with the site's declared names by scope), css (globals.css: shadcn variables, Tailwind v4 @theme, the declared block), tailwind (v4 and v3 shapes), registry (a shadcn registry item: npx shadcn add <url>), agents (an agents.md rules block), aliases (every resolved value mapped back to the declared names that produce it, with scope), figma (a script for Figma's use_figma tool that creates a Variables collection with Light and Dark modes, built from the same mapper the CSS Crème plugin runs)."
},
"expect": {
"type": "string",
"description": "Optional brand hex, like #635BFF. The json response then carries `expect`: the nearest value the site declares (a token when it has any, else a literal), its CIE76 distance, and whether that is within the same-colour tolerance, near, or different. A distance, not a grade."
},
"expectSpec": {
"type": "object",
"description": "Optional brand spec to check field by field, for example {\"primary\":\"#635BFF\",\"bg\":\"#FFFFFF\",\"font\":\"Inter\",\"heading\":\"Sohne\",\"radius\":\"8px\",\"base\":\"16px\",\"spacing\":\"4px\",\"darkMode\":true,\"tokens\":{\"--brand\":\"#635BFF\"}}. The json response then carries `compliance`: per field a verdict (match, near, different, not-declared), what it was compared against, and the value found. not-declared means the site gives nothing to compare; it is never filled with the nearest guess."
}
},
"required": [
"url"
]
}🟢css_feature(feature)
Answers two questions about a modern CSS feature with data instead of recall. First, its Baseline status (widely available, newly available, or limited availability), the date, and which core browsers lack it, read from the open web-features dataset at build time. Second, how many of CSS Crème's curated, decoded showcase sites ship it, which ones, how many of them guard it with @supports, and the exact @supports conditions they test. Also returns a fallback note where we have one, any name the feature has shipped under before (an agent that learned the old name will otherwise write it), and the documented limits that catch people out, each cited to the page it was read on. Call it before writing CSS that uses container queries, :has(), anchor positioning, @scope, view transitions, oklch(), color-mix(), light-dark(), subgrid, scroll-driven animations, @property, text-wrap and similar, so the CSS you write is accurate for today rather than for your training date. With no feature given it returns the Ship Gap: features that are safe and mostly ignored, and features that are early and shipped anyway.
輸入結構描述
{
"type": "object",
"properties": {
"feature": {
"type": "string",
"description": "A web-features id or a plain name: \"container-queries\", \"has\", \":has()\", \"anchor positioning\", \"oklch\", \"subgrid\", \"@scope\". Omit for the whole Ship Gap summary."
}
}
}🟢get_design_md_for_url(url, maxAge)
Read the stylesheets of a public site and return a full DESIGN.md: semantic roles with the token each came from, measured WCAG contrast pairs, the tokens the site itself declares (framework internals counted separately), font families, the type scale with the ratio between steps, colour frequency, gradients, corner radii, spacing, an elevation ladder of shadows, breakpoints, the z-index ladder, interaction-state rule counts, motion, and whether a dark theme is declared. This is the artefact to hand a coding agent before it writes UI that should match a site. It reads declared CSS and does not execute JavaScript, so it reports what the stylesheets say rather than what the page renders.
輸入結構描述
{
"type": "object",
"properties": {
"url": {
"type": "string",
"description": "Absolute public http(s) URL of the page to read."
},
"maxAge": {
"type": "integer",
"minimum": 0,
"maximum": 3600,
"description": "How old a reused read may be, in seconds. Default 600; 0 reads the site now. A reused read keeps its own fetchedAt and says cache.hit: true."
}
},
"required": [
"url"
]
}🟢decode_site(url, pages, maxAge)
Read a sample of pages from one site (from its sitemap.xml, or the homepage links when there is no sitemap) and report what is CONSISTENT across them: which declared tokens, colours, font stacks, radii and spacing values appear on every page read, and which appear on only some. One page shows what a page uses; a design system is a claim about consistency, and only a sample can test it. Returns counts and the pages actually read, never a score. Use when the user asks whether a site is really on a system, or wants the system rather than one page of it.
輸入結構描述
{
"type": "object",
"properties": {
"url": {
"type": "string",
"description": "Absolute public http(s) URL anywhere on the site."
},
"pages": {
"type": "integer",
"description": "How many pages to read, 2 to 8. Default 5.",
"minimum": 2,
"maximum": 8
},
"maxAge": {
"type": "integer",
"minimum": 0,
"maximum": 3600,
"description": "How old a reused read may be, in seconds. Default 600; 0 reads the site now. A reused read keeps its own fetchedAt and says cache.hit: true."
}
},
"required": [
"url"
]
}🟢verify_design_md(id, fingerprint)
Every DESIGN.md carries a Fingerprint line. Pass the id and that fingerprint; the server answers whether the copy matches the current token set, and if not, returns the current tokens so the agent can update the file instead of following a stale one. Call this at the start of a session when a DESIGN.md is already in the repo.
輸入結構描述
{
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "Theme or template id from the DESIGN.md Source line."
},
"fingerprint": {
"type": "string",
"description": "The value from the DESIGN.md Fingerprint line, e.g. \"fnv1a-9c2a41d7\"."
}
},
"required": [
"id",
"fingerprint"
]
}社群
證據