Skip to main content
Glama
donaldrichard19-LVD

ui-component-judgment-mcp

ui-component-judgment-mcp

MCP-сервер, предоставляющий один инструмент, recommend_component, который определяет, должна ли потребность в UI-компоненте быть удовлетворена существующим компонентом shadcn/ui или 21st.dev, или требует кастомной сборки, руководствуясь ссылкой на реальное приложение из Mobbin. Возвращает структурированный вердикт, а не список результатов поиска — создан для потребления агентом в процессе сборки, а не для просмотра человеком.

Это реализует слой оценки, подтверждённый в продуктовом брифe: покрытие полей/требований оценивается на основе реальных доказательств компонентов, порогово разделяется на use_existing / custom_build, при этом категория no_candidates_found остаётся отдельной от низкого покрытия, есть статический список пропуска для тривиальных примитивов и временная метка computed_at, поскольку покрытие — это снимок, а не постоянный факт.

Как это работает

Сервер не скрейпит shadcn/21st.dev/Mobbin самостоятельно. Каждый вызов инструмента делает один запрос к Anthropic Messages API (claude-sonnet-4-6) с включённым серверным инструментом web_search и системным промптом, который кодирует весь процесс: проверка списка пропуска, извлечение требований, поиск кандидатов, оценка покрытия на основе реальных доказательств, порог и — при custom_build — поиск ссылки на Mobbin. Модель возвращает структурированный JSON, который сервер передаёт вызывающему агенту без изменений.

Тривиальные примитивы (button, input, checkbox, label, badge, spinner, tooltip, avatar, icon) перехватываются локально до любого вызова API, поэтому не тратят запрос.

Related MCP server: ui-registry-mcp

Настройка

npm install
npm run build

Требуется переменная ANTHROPIC_API_KEY, установленная в окружении, в котором работает сервер.

Запуск

ANTHROPIC_API_KEY=sk-ant-... npm start

Это запускает MCP-сервер через stdio. Укажите ваш MCP-клиент (Claude Code, Cursor, Claude Desktop и т. д.) на него — точная конфигурация зависит от клиента, но в общем виде выглядит так:

{
  "mcpServers": {
    "ui-component-judgment": {
      "command": "node",
      "args": ["/path/to/ui-component-mcp/dist/index.js"],
      "env": { "ANTHROPIC_API_KEY": "sk-ant-..." }
    }
  }
}

Инструмент: recommend_component

Входные данные:

{
  "component_need": "price breakdown with fees and taxes",
  "domain": "Airbnb-style rental marketplace",
  "framework": "React + Tailwind",
  "existing_stack": "already using shadcn/ui"
}

component_need должен быть конкретным, а не категорией — «разбивка цены с комиссиями и налогами», а не «ценообразование». Расплывчатые названия категорий — это то, что приводило к ложноположительным совпадениям при валидации (общий компонент тарифного плана SaaS оценивался как совпадение для оформления бронирования).

Выходные данные: JSON, соответствующий:

{
  "verdict": "use_existing | custom_build",
  "confidence": "high | medium | low",
  "reason": "scored | no_candidates_found | skip_list",
  "computed_at": "2026-08-23",
  "requirements_checked": [ { "requirement": "...", "met": true, "evidence": "..." } ],
  "coverage": "5/7 (71%)",
  "recommendation": {
    "source": "21st.dev | shadcn | null",
    "install_command": "string | null",
    "reference": { "source": "Mobbin", "url": "...", "flow_name": "..." }
  }
}

Стоимость

Каждый нетривиальный вызов выполняет короткий многоходовой цикл инструментов (поиск → оценка → ответ), что стоит примерно $0.06–$0.10 с Sonnet 5 по текущим ценам ($2/млн входных токенов, $10/млн выходных, $0.01 за вызов web_search) — примитивы из списка пропуска стоят $0, поскольку никогда не достигают API. Три вещи снижают эту стоимость без ущерба для качества:

  • Кэширование промптов в системном блоке (cache_control: ephemeral) — инструкции идентичны при каждом вызове, поэтому повторные ходы и повторные вызовы читаются из кэша вместо повторной оплаты полной цены.

  • Бюджет в 2 поиска для обнаружения кандидатов (ещё 1, если custom_build запускает поиск в Mobbin), при этом shadcn и 21st.dev ищутся в одном ходе, а не последовательно, поэтому растущий диалог пересылается реже за вызов.

  • Переменная окружения UI_JUDGMENT_MODEL (по умолчанию claude-sonnet-5) — позволяет заменить модель на более дешёвую (например, Haiku 4.5) без изменения кода. Прежде чем доверять более дешёвой модели в продакшене, повторно прогоните 5 проверенных тестовых случаев из продуктового брифа (разбивка цены, политика отмены, панель доходов, галерея, обмен сообщениями) и сравните вердикты с вердиктами Sonnet — это не тестировалось, только обдумывалось.

Известные ограничения (перенесены из валидации)

  • Нет кэширования, намеренно. Каждый вызов заново ищет и оценивает с нуля. Вердикт custom_build может устареть, поскольку библиотеки выпускают новые компоненты (проверено: чат-примитивы shadcn от июня 2026 превратили вероятный кастомный компонент обмена сообщениями в почти идеальное совпадение). Если вы добавляете кэширование на уровне вызывающего агента, ограничьте его только сессией — никогда не сохраняйте вердикт между сессиями или сборками.

  • Список пропуска — это отправная точка, ещё не проверенная на реальном использовании. Логируйте каждый вызов и то, попал ли он в список пропуска; следите за агентами, которые всё равно вызывают инструмент для элементов из списка (список слишком узкий) или отправляют общий UI для того, что должно было быть пропущено (в списке отсутствует запись).

  • Невозможно протестировать end-to-end в полностью песочной среде. Этому серверу нужен исходящий сетевой доступ к api.anthropic.com плюс всё, чего достигает инструмент web_search модели — он не будет работать там, где заблокирован общий доступ в интернет.

  • Извлечение требований и оценка покрытия — это оценочные суждения, принимаемые моделью за один проход, а не детерминированные поиски. Проверяйте ранние выходные данные на реальных компонентах, прежде чем доверять конвейеру без присмотра, как и при ручной валидации.

Available Tools

1 tool
recommend_componentA

Judges whether a UI component need should be met with an existing shadcn/ui or 21st.dev component, or requires a custom build guided by a real-app reference from Mobbin. Returns a structured verdict (use_existing | custom_build), not a list of search results. Call this whenever you are about to scaffold a new, non-trivial UI component from scratch, when you're unsure your own default output will look production-quality, or when the user references a specific app's pattern to match.

NameRequiredDescriptionDefault
domainYesThe product type/domain, e.g. 'Airbnb-style rental marketplace'. Shapes what requirements get extracted for the component need.
frameworkYese.g. 'React + Tailwind', 'Vue 3'.
component_needYesSpecific description of the UI component needed -- not a category. e.g. 'price breakdown with fees and taxes', not 'pricing'. Vague category names produce false-positive matches.
existing_stackNoOptional. e.g. 'already using shadcn/ui'. Used only as a tiebreaker between similarly-scored candidates, never as a hard filter.

TDQS

A4.5/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It clearly states the output format ('structured verdict, not a list') and mentions reliance on Mobbin references for custom builds. It does not detail failure modes or edge cases, but for a non-destructive decision tool, this is sufficient and adds meaningful context beyond the raw schema.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is three sentences, each earning its place: the first states the core purpose, the second clarifies the output type, and the third lists usage triggers. It is front-loaded with the primary action and avoids any fluff or redundant details.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with no output schema, the description adequately explains the return value (a verdict with two possibilities) and the context in which it should be used. It also notes it is not a search tool, which is critical for correct invocation. Combined with full schema coverage for parameters, nothing essential is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the baseline is 3. The description itself adds no additional parameter-specific semantics; the schema already explains each parameter clearly (e.g., 'component_need' should be specific, not a category). The description does not repeat or enhance this, so it stays at the baseline.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb ('judges') and resource ('UI component need'), clearly states the decision outcome (use_existing | custom_build), and explicitly distinguishes itself from search tools by saying 'not a list of search results'. This makes the tool's purpose unambiguous even without siblings.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It provides explicit trigger conditions: 'whenever you are about to scaffold a new, non-trivial UI component from scratch', 'when you're unsure your own default output will look production-quality', or 'when the user references a specific app's pattern'. This is direct, actionable guidance on when to invoke the tool.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 1 tool updatev0.1.0
    • First observedrecommend_component

TDQS

A4.5/5.0

Scored across 1 tool

Disambiguation5/5

With only a single tool, there is no possibility of confusion between tools. The tool's purpose is clearly defined and unambiguous.

Naming Consistency5/5

The tool name 'recommend_component' follows a clear verb_noun pattern, which is consistent with common naming conventions. No other tools exist to introduce inconsistency.

Tool Count3/5

A single tool is on the thin side for most servers, but it serves a specific, well-defined purpose. It is not trivial and may be sufficient for the intended scope, though additional related tools could add value.

Completeness5/5

The tool fully covers its stated purpose: making a judgment between using existing components or building custom. It provides a structured verdict without missing essential aspects like referencing Mobbin or shadcn/ui. No obvious gaps within the defined domain.

Maintenance

ActivityActive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    B
    quality
    D
    maintenance
    Provides AI assistants with tools to grade, generate, and validate UI components against the components.build specification. Supports searching documentation, checking compliance, and generating framework-agnostic accessible components.
    11
    8 npm
    Apache 2.0
  • A
    license
    A
    quality
    D
    maintenance
    Provides coding agents live access to shadcn-style component registries, enabling them to search, compare, and fetch real component source code for UI composition.
    5
    33 npm
    5
    MIT
  • A
    license
    Not graded
    quality
    A
    maintenance
    STOP UI SLOP. Gives coding agents searchable evidence from 800,000+ real web and iOS screens, design contracts, and a hard UI finish gate.
    1
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    Design review for UI code, inside your coding agent. Reviews React, Vue, Svelte, CSS and SwiftUI against 313 rules and returns scored findings with file:line fixes your agent can apply and verify.
    MIT