StyleKit

io.github.AnxForever由 GitHub 账号 AnxForever 发布v0.5.0更新于 Oct 24, 2026

MCP server for StyleKit styles, tokens, recipes, lint and repair over stdio or HTTP.

已验证Streamable HTTP可网页运行开发者工具媒体与设计

概览

AI 生成的概览

StyleKit 为助手提供 UI 设计风格目录、设计令牌、组件配方以及代码检查与修复,让生成的前端代码符合选定风格。

可以做什么
  • 搜索与读取风格:按关键词或分类查找风格,获取风格的理念、配色、该做与不该做的规则以及设计令牌
  • 渲染组件:获取按钮、卡片、输入框等可直接使用的 Tailwind className 与 JSX 配方,以及该风格的 shadcn 主题安装命令
  • 浏览素材:列出并获取公开模板、组件模式与体验包,附带许可与来源元数据
  • 检查与修复代码:按风格规则检查生成的 UI 代码,并用风格自身的令牌改写偏离的类名
  • 获取实现说明:一次返回规则、CSS、模板、配方与令牌的大体量内容,也可只取指定部分
适用场景
适合助手编写或修改前端 UI 代码、且希望遵循统一明确的设计风格而非随意发挥时使用,并可在生成后验证结果。也适合获取参考模板和 shadcn 主题安装命令。
运行要求
可通过 npx(需 Node.js)作为本地 stdio 进程运行,也可使用远程 HTTP 端点。未声明需要账号、API 密钥或环境变量。实时目录数据与远程素材需要网络访问;实时数据不可用时会使用内置快照。
安装前请注意
所有工具均为只读,不会代你写入或删除数据。检查与修复仅为静态检查,不保证视觉质量或无障碍性,运行时表达式可能被判定为无法确定。实时数据可能回退到内置快照,需要时请查看 origin 与 fallbackReason。为便于复现,建议固定具体的包版本。

安装

在 SourceWeft 中

  1. 打开 控制台中的 StyleKit,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Web executable,通过 Streamable HTTP。 远程服务在工作区中配置后即可从网页运行时运行。

交给智能体安装

把这段提示词粘贴到 Claude Code、Codex、Cursor 等智能体,或 SourceWeft 对话中。智能体会读取该服务器的安装指南,先向你展示发布者、端点和登录方式,经你同意后再把它添加到你的客户端。密钥不会写进任何命令。

阅读 https://sourceweft.com/mcp/io.github.AnxForever%2Fstylekit-mcp/install.md,并按其中说明把这个 MCP 服务器接入我的客户端。修改任何配置之前,先告诉我它的发布者、端点和登录方式,等我确认。不要把 API 密钥写进命令或我会提交的文件;问我密钥应从哪里获取。

查看智能体所依据的安装指南

其他 MCP 客户端

把它添加到你客户端的 mcpServers 配置中。

{
  "mcpServers": {
    "stylekit": {
      "type": "http",
      "url": "https://www.stylekit.top/mcp"
    }
  }
}

README

stylekit-mcp

MCP server for StyleKit — search design styles and retrieve templates, assets, tokens, recipes, and lint checks from Claude, Cursor, or Windsurf.

The server runs locally over stdio using the official MCP SDK. It bundles stylekit-core; the published process depends on @modelcontextprotocol/sdk and zod, and needs network access only for live catalogue data and remote assets. It is MIT-licensed.

Tools

All tools are read-only.

ToolWhat it does
stylekit_search_stylesSearch styles by keyword and/or category
stylekit_list_assetsBrowse public templates and design assets by kind or query, with pagination and source provenance
stylekit_get_assetRetrieve a namespaced public asset detail and any source files the license permits
stylekit_get_implementation_briefComplete AI guidance, CSS, templates, recipes, tokens, readiness, merged lint rules and provenance (0.3.0)
stylekit_get_styleFull style profile: philosophy, palette, do/don't rules, quality/capability signals
stylekit_get_style_tokensTyped design tokens: border, shadow, typography, spacing, colors
stylekit_get_component_recipeRendered component className + JSX (button/card/input)
stylekit_get_shadcn_installThe npx shadcn add command for a style's theme
stylekit_lint_codeCheck generated UI code against a style's rules, with a reason and a fix per violation

stylekit_lint_code is the one worth building into your loop: call it after the agent writes UI code, so a style's constraints are verified rather than assumed. It resolves variant prefixes (dark:, md:, hover:) before matching, and understands JSX/HTML class attributes, cn()/clsx() calls, and template literals.

Setup

Add this configuration once to your MCP client:

json
{  "mcpServers": {    "stylekit": {      "command": "npx",      "args": ["-y", "--prefer-online", "stylekit-mcp@latest"]    }  }}
  • Claude Desktop / Claude Code: claude_desktop_config.json or .mcp.json
  • Cursor: .cursor/mcp.json
  • Windsurf: the Windsurf MCP config

When the client starts the MCP process, npx checks npm for the current latest release, including when the package is already cached. A running MCP process does not replace itself; restart the server or client to load an update. For a reproducible setup, replace stylekit-mcp@latest with an exact published version such as [email protected]. The npm caching options describe how --prefer-online handles cached packages.

To run a locally built copy instead, point your client at the absolute path:

json
{  "mcpServers": {    "stylekit": { "command": "node", "args": ["/abs/path/to/packages/mcp/dist/index.js"] }  }}

Public assets

stylekit_list_assets accepts optional kind and query filters plus offset/limit. It returns a structured page with the namespace, content level, availability, license and attribution metadata, and whether the page came from the live API or bundled snapshot. An offset beyond the last result is an empty successful page.

stylekit_get_asset returns the complete asset detail as structured data and JSON text. contentLevel tells you what is actually available: source and remote assets can include source files; metadata and restricted entries do not. availability distinguishes bundled, remote, external and restricted content. External and restricted entries provide metadata or source links only; they are not represented as downloadable full source. Remote templates require the live API to return their actual file set; if that source is unavailable, the tool reports an error instead of returning a placeholder as code.

Example

In your editor's AI chat:

"Search StyleKit for a frosted glass style, then give me its button recipe and the shadcn install command."

The agent calls stylekit_search_styles → stylekit_get_component_recipe → stylekit_get_shadcn_install and hands back ready-to-use code.

Development

bash
pnpm --filter stylekit-mcp build # compile to dist/node scripts/smoke.mjs  # smoke-test all tools over stdio

License

MIT

Release contents

The published MCP package includes the public asset tools, source provenance, and discovery reliability fixes described above. It bundles stylekit-core; the runtime npm dependencies remain the MCP SDK and Zod.

Call the brief tool before generation and save its stylekit-brief-v1 payload for later validation. provenance.source identifies the data origin; contentHash detects drift.

Lint returns status: pass | fail | inconclusive. ok is true only for a conclusive static pass. Runtime expressions are reported as inconclusive unless known literals already contain a violation. Missing requirements are advisory; pass strict: true and checkRequired: ["button"] to fail them in a static component snippet. Required checks cover the entire input, not each element. These checks do not certify visual quality or accessibility.

来源:packages/mcp/README.md,提交 3d40e73

工具

10

stylekit_search_styles

Search StyleKit styles

Search StyleKit design styles by keyword and/or category, with pagination. Exact slug or name matches are ranked first. Args: - query (string, optional): matches slug, name, description, tags, keywords (case-insensitive). - category ('modern'|'retro'|'minimal'|'expressive', optional): restrict to one category. - limit (number 1-50, default 15): page size. - offset (number >=0, default 0): results to skip (for paging). Returns structured JSON with total, count, offset, hasMore, next_offset (null on the last page), has_more as a deprecated alias, source, optional fallbackReason, and results. A valid query with no matches returns an empty results array, not a tool error. Examples: - "find a glassy frosted style" -> query: "glass" - "next page of retro styles" -> category: "retro", offset: 15 - For full tokens of one style, use stylekit_get_style_tokens instead.

输入参数limitqueryoffsetcategory

stylekit_list_assets

List public StyleKit assets

Browse StyleKit's public asset catalogue by namespace and query. Use the returned kind/id pair with stylekit_get_asset. Args: - kind (optional): one public namespace such as animation, component-pattern, template, or experience-pack. - query (optional): search public names, descriptions and tags. - offset (number >=0, default 0): results to skip. - limit (number 1-100, default 20): page size. Returns the full JSON page, including count, hasMore, next_offset, availability, contentLevel, license, attribution, source provenance, and kind counts. An empty page is a successful result. Private user kits and unpublished submissions are not listed. Examples: - "show me a pricing template" -> query: "pricing", then stylekit_get_asset with the returned kind/id. - Templates that include source files can be large; list first and fetch only the asset you need.

输入参数kindlimitqueryoffset

stylekit_get_asset

Get a public StyleKit asset

Retrieve one public asset by its exact kind and id. Source is returned only where the asset's contentLevel and license permit it. Remote templates include their actual file set only when the live source is available; if it is down, the tool returns a structured unavailable error with safe metadata and does not treat a download URL as source code. External and restricted assets expose metadata, license, attribution and source links only. Args: - kind: the namespace returned by stylekit_list_assets. - id: the exact identifier within that namespace. - includeSource (boolean, default true): include permitted source files/code; false returns metadata and links only. - files (array, optional): exact source file paths to include (templates); omit for all files. Unmatched paths are reported as missingFiles. Returns complete structured JSON and JSON text, preserving the namespace and provenance. Examples: - "show me the pricing template" -> kind: "template", id from stylekit_list_assets. - "just the page and styles" -> kind: "template", files: ["app/page.tsx", "app/globals.css"]. - A full template can return tens of thousands of characters; use includeSource: false or files to keep it small.

输入参数id必填kind必填filesincludeSource

stylekit_get_style

Get StyleKit style detail

Get one style's full profile: philosophy, palette, do/don't rules, keywords, and what's available (tokens, recipes, shadcn install). Style data is read from the live catalogue with a five-minute cache; when live data is unavailable, a bundled snapshot may be returned and marked with origin and fallbackReason. Args: - slug (string): style identifier, e.g. "glassmorphism", "neo-brutalist". Returns JSON: { slug, name, nameEn, category, tags, description, philosophy, colors, doList, dontList, keywords, hasTokens, hasRecipes, recipeIds, shadcnInstall, url, quality, origin, fallbackReason? }. The content provenance is separate from origin when returned by the implementation brief. Examples: - "how should I use neo-brutalist?" -> slug: "neo-brutalist" - Returns an error with a hint if the slug is unknown.

输入参数slug必填

stylekit_get_style_tokens

Get StyleKit style design tokens

Get a style's design tokens (Tailwind class mappings): border, shadow, typography, spacing, semantic colors, and forbidden/required classes. Style data is read from the live catalogue with a five-minute cache; when live data is unavailable, a bundled snapshot may be returned and marked with origin and fallbackReason. Args: - slug (string): style identifier. Returns JSON: the full StyleTokens object plus origin (live or bundled) and optional fallbackReason. Content provenance is distinct from transport origin. Examples: - "give me the spacing and border tokens for bento-grid" -> slug: "bento-grid" - Returns an error if the style has no tokens registered.

输入参数slug必填

stylekit_get_component_recipe

Get StyleKit component recipe

Render a ready-to-use component for a style: the full Tailwind className and JSX code. Components are usually "button", "card", "input" (check recipeIds via stylekit_get_style). Recipe data is read from the live catalogue with a five-minute cache; a bundled snapshot may be returned during an outage and is marked with origin and fallbackReason. Args: - slug (string): style identifier. - component (string): recipe id, e.g. "button", "card", "input". Returns JSON: { slug, component, className, code, origin, fallbackReason? }. Examples: - "give me a glassmorphism button" -> slug: "glassmorphism", component: "button" - Returns an error listing available recipes if the component isn't found.

输入参数slug必填component必填

stylekit_get_shadcn_install

Get StyleKit shadcn install command

Get the one-line shadcn CLI command that installs a style's color theme (light + dark) into a shadcn project. Args: - slug (string): style identifier. Returns JSON: { slug, command, registryUrl, prerequisite, lookupOrigin, fallbackReason? }. The command is derived from the style slug; lookupOrigin reports how StyleKit confirmed that slug. Examples: - "how do I install the synthwave theme?" -> slug: "synthwave" - The target project must have a tsconfig.json or the shadcn CLI errors out.

输入参数slug必填

stylekit_lint_code

Lint code against a StyleKit style

Check whether code actually follows a style's rules. Use this AFTER generating or editing UI code to verify it matches the style, instead of assuming it does. Reports forbidden classes with the reason they are banned and a concrete replacement. Understands JSX/HTML class attributes, cn()/clsx() calls, and template literals; variant prefixes (dark:, md:, hover:) are resolved before matching. Args: - slug (string): style identifier, e.g. "glassmorphism". - code (string): the source to check. JSX/TSX, HTML, or a bare class string. - checkRequired (array of 'button'|'card'|'input', optional): also report required classes the code is missing. Only pass components the code is supposed to contain. Returns JSON: { slug, ok, violations: [{ className, baseClassName, line, severity, source, rule, reason, fix }], missingRequired, checkedClasses, ruleSources, origin, contentSource, fallbackReason? }. Lint rules come from the same live implementation brief used for generation; its five-minute cache and any bundled fallback are reported separately from content provenance. Examples: - "does this button match neo-brutalist?" -> slug: "neo-brutalist", code: "<button className=...>", checkRequired: ["button"] - strict (boolean, default false): fail missing required classes in a static component snippet. Required checks cover the whole input, not each element. - status is pass, fail, or inconclusive. Runtime class expressions cannot be fully verified. ok is true only for a conclusive static pass; visual quality still needs review.

输入参数code必填slug必填strictcheckRequired

stylekit_repair_code

Repair code so it follows a StyleKit style

Rewrite code that drifts from a style, using the style's own tokens as replacements. Use this instead of hand-editing class names after stylekit_lint_code reports violations. Every applied rewrite comes from the style's tokens, never from a guess: variants (dark:, md:, hover:) are preserved, multi-class replacements are deduplicated, and string literals inside cn()/clsx() expressions are rewritten while variable references and interpolation spans are left untouched. JSX/HTML class attributes, template literals, and a bare class string are all handled. Spacing, layout and structure are never changed. Args: - slug (string): style identifier. - code (string, 1-100000 chars): source to repair. Returns JSON: { slug, code, edits: [{ from, to, line }], unfixed: [{ className, line, reason }], before, report, origin, contentSource, fallbackReason? }. Apply the returned code as-is, then review any entries in unfixed yourself — the rules flagged them but no concrete replacement exists. Examples: - "make this hero match neo-brutalist" -> slug: "neo-brutalist", code: "<section className=\"rounded-2xl shadow-2xl\">" - If edits is empty and before.status is "pass", the code already matched. Do not invent further changes.

输入参数code必填slug必填

stylekit_get_implementation_brief

Get complete StyleKit implementation brief

Fetch one complete implementation contract before generating UI. Use this when you need the full rules, CSS, templates, recipes and tokens in one call; the full payload is large (often 30k-60k characters). Pass sections to return only identity/provenance plus the parts you need. Args: - slug (string): style identifier. - sections (array, optional): philosophy, aiRules, doList, dontList, colors, globalCss, components, variants, tokens, recipes, readiness, lintRules. Returns JSON: { schemaVersion: "stylekit-brief-v1", slug, name, nameEn, category, styleType, description, tags, keywords, provenance, origin, fallbackReason?, sections?, plus the selected sections }. provenance.source records the content publisher (bundled, static, or community) and is distinct from transport origin. Coverage guidance does not certify visual quality or accessibility. Examples: - "build a landing page in glassmorphism" -> slug: "glassmorphism"; keep the returned stylekit-brief-v1 payload for later validation. - "just give me the rules and tokens" -> slug: "glassmorphism", sections: ["aiRules", "tokens", "lintRules"].

输入参数slug必填sections

版本历史

4
  1. v0.5.0最新Oct 21, 2026
  2. v0.4.1Oct 2, 2026
  3. v0.4.0Oct 2, 2026
  4. v0.2.5Sep 16, 2026

评分

已满足适用检查项的 100%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通必需25 分
  • 已声明认证方式必需10 分
  • 已列出工具必需15 分
  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分