Open Components

Guidelines for UI components with a perfect UX, DX and AX, whether humans or AI agents write them.

我该使用它吗

质量与安全性

A
描述质量
100%
模式完整度
96%
命名质量
70%
投毒风险
80%
权限匹配度
100%
协议合规性
100%

发现(8)

  • HIGHTool poisoning patterns detected
  • MEDIUMTool description contains URL to non-standard domain在 get-contract 中
  • LOWTool 'get-contract' doesn't follow camelCase/snake_case在 get-contract 中
  • LOWTool 'get-page' doesn't follow camelCase/snake_case在 get-page 中
  • LOWTool 'get-reference-implementation' doesn't follow camelCase/snake_case在 get-reference-implementation 中
  • LOWTool 'list-components' doesn't follow camelCase/snake_case在 list-components 中
  • LOWTool 'list-rules' doesn't follow camelCase/snake_case在 list-rules 中
  • LOWTool 'search-docs' doesn't follow camelCase/snake_case在 search-docs 中

基于对工具定义和协议合规性的自动分析。

上下文开销

~3,113token 数(工具定义)
~3.8 KB典型响应大小
对注意力有显著影响(占 128k 上下文窗口的 2.43%)

这是每次将服务器的工具加载到模型上下文窗口时所消耗的大致 token 数。数值越高,可用于其他任务的注意力就越少。

安装

一键安装

将以下内容添加到你的 `claude_desktop_config.json` 文件中:

{
  "mcpServers": {
    "open-components": {
      "url": "https://mcp.opencomponents.dev/mcp"
    }
  }
}

远程端点

https://mcp.opencomponents.dev/mcpstreamable-http

它能做什么

工具清单

工具(6)

🟢 只读🟡 写入🔴 删除⚪ 未知
🟢get-contract(component)

Returns the contract of a component or a foundation, as YAML: its API (props, slots and events), its DOM contract (element, role, states, keyboard and parts), its tokens, and every rule in its checklist, each with a stable ID (like button/keep-focus), a level (must or should), a scope (component, usage or both) and how to check it. It holds every requirement in a fraction of the page's length, and it's the same file as https://opencomponents.dev/raw/docs/<path>.yaml. WHEN TO USE: first, before you build, review or explain a component or its tokens. WHEN NOT TO USE: for some of the rules only (by scope, layer, level or check), use list-rules. For the reasoning or the examples behind a rule, use get-page with its sections.

输入模式

{
  "type": "object",
  "properties": {
    "component": {
      "type": "string",
      "enum": [
        "design-tokens",
        "button",
        "spinner",
        "input"
      ],
      "description": "The component or foundation, like button or design-tokens."
    }
  },
  "required": [
    "component"
  ],
  "$schema": "http://json-schema.org/draft-07/schema#"
}
🟢get-page(path, sections, framework)

Reads a docs page as markdown, whole or just the sections you name. Component pages explain why each rule exists, with examples in React, Vue, Svelte, Angular, Solid, Astro and Vanilla: pass a framework to keep only its examples. WHEN TO USE: for the reasoning, an example or the details behind a rule (like the sections ["Loading"] of the button's page), or for a page without a contract, like the introduction or the roadmap. WHEN NOT TO USE: for the requirements alone, use get-contract or list-rules, which are much shorter. To find which page or section covers a topic, use search-docs. A page longer than about 8,000 tokens, like the button's, returns its outline instead: every heading with its anchor and length, so you can ask for the sections you need. So do sections that are too long to return together.

输入模式

{
  "type": "object",
  "properties": {
    "path": {
      "type": "string",
      "maxLength": 300,
      "description": "The page: its name (introduction, roadmap, mcp-server, agent-plugin, design-tokens, button, spinner, input), or its path, like /docs/components/button. A URL's #anchor, like the ones search-docs returns, reads that section."
    },
    "sections": {
      "description": "The sections to read, by heading or anchor, like [\"Loading\"] or [\"#ux-rules\"]. Each comes with its sub-sections. Name a parent to tell apart headings that repeat, as in \"Every state > Loading\".",
      "maxItems": 20,
      "type": "array",
      "items": {
        "type": "string",
        "maxLength": 200
      }
    },
    "framework": {
      "description": "Your framework, to keep only its examples.",
      "type": "string",
      "enum": [
        "react",
        "vue",
        "svelte",
        "angular",
        "solid",
        "astro",
        "vanilla"
      ]
    }
  },
  "required": [
    "path"
  ],
  "$schema": "http://json-schema.org/draft-07/schema#"
}
🟢get-reference-implementation(component, files)

Returns a shipped component's reference implementation: a Vue 3 component that meets every rule in its checklist, the tests that prove it, the helpers it shares with other components and its theme tokens. The live examples on the site run on this code. WHEN TO USE: to build a component that meets the standard, in Vue or by porting it and its tests to another framework, or to see how a rule is met in code. WHEN NOT TO USE: for the requirements, use get-contract. For how the component is used in another framework, use get-page with that framework.

输入模式

{
  "type": "object",
  "properties": {
    "component": {
      "type": "string",
      "enum": [
        "button",
        "input",
        "spinner"
      ],
      "description": "A component with a reference implementation, like button."
    },
    "files": {
      "description": "Only these files, like [\"Button.vue\"] or [\"Button.test.ts\"]. Leave it out for every file.",
      "maxItems": 20,
      "type": "array",
      "items": {
        "type": "string",
        "maxLength": 100
      }
    }
  },
  "required": [
    "component"
  ],
  "$schema": "http://json-schema.org/draft-07/schema#"
}
🟢list-components(status)

Lists what the Open Components standard covers: the components that have shipped (like Button), the foundations every component follows (like Design Tokens), and the components planned on the Roadmap. WHEN TO USE: to check whether a component has a standard yet, to get the name the other tools take for it, or to see what's planned. WHEN NOT TO USE: if you already know the component, call get-contract directly. To find a topic in the docs, use search-docs. Shipped entries come with their page, their contract and how many rules they have. Planned ones have no page, contract or rules yet: hold them to the three layers and Design Tokens, following the Button's structure, as the build-component prompt does.

输入模式

{
  "type": "object",
  "properties": {
    "status": {
      "default": "all",
      "description": "Which components to list.",
      "type": "string",
      "enum": [
        "shipped",
        "planned",
        "all"
      ]
    }
  },
  "$schema": "http://json-schema.org/draft-07/schema#"
}

输出模式

{
  "type": "object",
  "properties": {
    "total": {
      "type": "number"
    },
    "components": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "description": "The name the other tools take, like button."
          },
          "title": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "enum": [
              "component",
              "foundation"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "shipped",
              "planned"
            ]
          },
          "group": {
            "description": "Its group on the Roadmap.",
            "type": "string"
          },
          "summary": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "contractUrl": {
            "type": "string"
          },
          "rules": {
            "type": "object",
            "properties": {
              "total": {
                "type": "number"
              },
              "must": {
                "type": "number"
              },
              "should": {
                "type": "number"
              }
            },
            "required": [
              "total",
              "must",
              "should"
            ],
            "additionalProperties": false
          },
          "reference": {
            "description": "The files of its reference implementation.",
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "key",
          "title",
          "kind",
          "status",
          "summary"
        ],
        "additionalProperties": false
      }
    }
  },
  "required": [
    "total",
    "components"
  ],
  "$schema": "http://json-schema.org/draft-07/schema#",
  "additionalProperties": false
}
🟢list-rules(component, ids, scope, layer, level, ...)

Lists checklist rules as records, filtered by component, ID, scope, layer, level or check. Each rule has a stable ID to cite in reviews and commits, its level (must or should), its scope, its requirement, how to check it (like a unit test, a review or axe's button-name rule) and a link to it. WHEN TO USE: to review code rule by rule, to get only the rules that apply to a task, to look rules up by ID, or to find the ones a tool can check. Pass scope ["component", "both"] to build or review a component, and ["usage", "both"] to review a screen that uses it. WHEN NOT TO USE: for a component's API, DOM contract and tokens, use get-contract, which has every rule too. It returns up to 50 rules at a time, and total counts every rule that matches. When there are more, pass nextOffset as offset, with the same filters, to get the next page. A component meets the standard when it meets every must rule. Each should rule is expected unless there's a good reason not to follow it.

输入模式

{
  "type": "object",
  "properties": {
    "component": {
      "description": "The component or foundation, like button or design-tokens.",
      "type": "string",
      "enum": [
        "design-tokens",
        "button",
        "spinner",
        "input"
      ]
    },
    "ids": {
      "description": "The IDs of the rules to look up, like [\"button/keep-focus\"].",
      "maxItems": 100,
      "type": "array",
      "items": {
        "type": "string",
        "maxLength": 100
      }
    },
    "scope": {
      "description": "Who meets the rule: component (the component itself), usage (the code that uses it) or both. Rules without a scope, like the Design Tokens', match any scope.",
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "component",
          "usage",
          "both"
        ]
      }
    },
    "layer": {
      "description": "ui (how it looks), ux (user experience), dx (developer experience) or ax (agentic experience).",
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "ui",
          "ux",
          "dx",
          "ax"
        ]
      }
    },
    "level": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "must",
          "should"
        ]
      }
    },
    "check": {
      "description": "How the rule is checked.",
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "axe",
          "unit-test",
          "type-check",
          "lint",
          "visual-regression",
          "keyboard",
          "aria-snapshot",
          "screen-reader",
          "emulation",
          "zoom",
          "contrast-checker",
          "review"
        ]
      }
    },
    "automated": {
      "description": "true for the rules tools check all of (unit tests, axe, a type check, a linter or a visual regression test), false for the ones a person checks, at least in part.",
      "type": "boolean"
    },
    "offset": {
      "default": 0,
      "description": "Where the page starts: 0, or the nextOffset of the page before.",
      "type": "integer",
      "minimum": 0,
      "maximum": 9007199254740991
    },
    "limit": {
      "default": 50,
      "description": "How many rules to return, at most.",
      "type": "integer",
      "minimum": 1,
      "maximum": 50
    }
  },
  "$schema": "http://json-schema.org/draft-07/schema#"
}

输出模式

{
  "type": "object",
  "properties": {
    "total": {
      "type": "number",
      "description": "How many rules match, on every page."
    },
    "rules": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "component": {
            "type": "string"
          },
          "layer": {
            "type": "string",
            "enum": [
              "ui",
              "ux",
              "dx",
              "ax"
            ]
          },
          "level": {
            "type": "string",
            "enum": [
              "must",
              "should"
            ]
          },
          "scope": {
            "type": "string",
            "enum": [
              "component",
              "usage",
              "both"
            ]
          },
          "requirement": {
            "type": "string"
          },
          "check": {
            "type": "string"
          },
          "checks": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "axe",
                "unit-test",
                "type-check",
                "lint",
                "visual-regression",
                "keyboard",
                "aria-snapshot",
                "screen-reader",
                "emulation",
                "zoom",
                "contrast-checker",
                "review"
              ]
            }
          },
          "axe": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The axe rules that check it."
          },
          "automated": {
            "type": "boolean",
            "description": "Whether tools check all of it."
          },
          "url": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "component",
          "level",
          "requirement",
          "check",
          "checks",
          "axe",
          "automated",
          "url"
        ],
        "additionalProperties": false
      }
    },
    "unknown": {
      "description": "The IDs asked for that no rule has, with the ones that might have been meant.",
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "suggestions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "id",
          "suggestions"
        ],
        "additionalProperties": false
      }
    },
    "nextOffset": {
      "description": "The offset of the next page, when there is one.",
      "type": "number"
    }
  },
  "required": [
    "total",
    "rules"
  ],
  "$schema": "http://json-schema.org/draft-07/schema#",
  "additionalProperties": false
}
🟢search-docs(query, component, type, limit)

Searches the whole standard, every section of every page and every checklist rule, and returns the best matches: where each one is, a short excerpt, and for rules, their ID, level and scope. WHEN TO USE: to find where a topic is covered when you don't know the page or the section, like "focus after delete", "spinner", "aria-pressed" or "dark mode". Then read a section with get-page, or rules with list-rules. WHEN NOT TO USE: to list a component's rules, use list-rules. To see which components there are, use list-components. Search for a few specific words rather than a whole question.

输入模式

{
  "type": "object",
  "properties": {
    "query": {
      "type": "string",
      "minLength": 2,
      "maxLength": 200,
      "description": "A few words, like \"focus after delete\" or \"aria-pressed\"."
    },
    "component": {
      "description": "Only search this page and its rules, like button or design-tokens.",
      "type": "string",
      "enum": [
        "introduction",
        "roadmap",
        "mcp-server",
        "agent-plugin",
        "design-tokens",
        "button",
        "spinner",
        "input"
      ]
    },
    "type": {
      "description": "Only search sections, or only rules.",
      "type": "string",
      "enum": [
        "section",
        "rule"
      ]
    },
    "limit": {
      "default": 8,
      "description": "How many results to return, at most.",
      "type": "integer",
      "minimum": 1,
      "maximum": 20
    }
  },
  "required": [
    "query"
  ],
  "$schema": "http://json-schema.org/draft-07/schema#"
}

输出模式

{
  "type": "object",
  "properties": {
    "query": {
      "type": "string"
    },
    "total": {
      "type": "number",
      "description": "How many sections and rules match, of which the best come first."
    },
    "results": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "section",
              "rule"
            ]
          },
          "title": {
            "type": "string",
            "description": "The section's heading, or the rule's ID."
          },
          "trail": {
            "type": "string",
            "description": "Where it is, page first."
          },
          "path": {
            "type": "string",
            "description": "The page, for get-page."
          },
          "anchor": {
            "description": "The section, for get-page's sections. A rule's is its checklist table: the sections that explain it are results of their own.",
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "excerpt": {
            "type": "string"
          },
          "rule": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "level": {
                "type": "string"
              },
              "scope": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "level"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "type",
          "title",
          "trail",
          "path",
          "url",
          "excerpt"
        ],
        "additionalProperties": false
      }
    }
  },
  "required": [
    "query",
    "total",
    "results"
  ],
  "$schema": "http://json-schema.org/draft-07/schema#",
  "additionalProperties": false
}

社区

评价此服务器

证据

最近观测

已验证未记录版本6 个工具