Mlola UI

io.github.mlolahq由 GitHub 账号 mlolahq 发布v1.15.2更新于 Nov 11, 2026

Mlola UI components, tokens and design rules for coding agents, with a markup checker

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

概览

AI 生成的概览

Mlola UI 让编码助手获取该组件库的规则、组件与设计令牌,检查已写好的标记,并可在对话中渲染小型界面。

可以做什么
  • 在编写界面前读取设计规则、项目配置与布局基础组件
  • 按用途搜索组件、区块、页面与模板,并获取单个条目的属性、类名、data 属性、依赖与安装命令
  • 按用途或名称查询 --ml-* 设计令牌
  • 检查 HTML 或 JSX 中不存在的类名、令牌、变体、属性以及未命名的控件,并给出最接近的可用写法
  • 读取运行时渲染目录,校验 A2UI 消息,并在对话中显示表单、状态卡等界面
  • 获取在项目中配置 Mlola 所需的命令与样式表链接
适用场景
适用于构建或审查使用 Mlola UI 的前端,让助手只使用该库真实存在的类名、属性与令牌。也适合让助手在对话中直接展示小型表单、卡片或表格,而不是为其编写代码。
运行要求
可使用远程端点,或在本地通过 stdio 运行 npm 包 mlola-ui,后者需要 Node.js。读取与检查类工具未声明需要账号、密钥或请求头。Mlola Pro 条目需要许可证令牌,可通过 CLI 登录命令保存,或在 CI 中设置 MLOLA_PRO_TOKEN 环境变量。
安装前请注意
该服务器本身不能写文件,只返回安装命令,这些命令会把组件复制进项目并安装依赖包,执行前请先确认。Pro 条目需要付费许可证令牌,令牌会保存在本机的凭据文件中。渲染工具会在对话中显示界面,用户按下按钮的结果会作为其下一条消息返回。

安装

在 SourceWeft 中

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

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

交给智能体安装

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

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

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

其他 MCP 客户端

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

{
  "mcpServers": {
    "mlola-ui": {
      "type": "http",
      "url": "https://ui.mlola.com/mcp"
    }
  }
}

README

mlola-ui

The Mlola UI source-copy CLI. It writes components, blocks, pages, and templates into your project, rewrites their imports to fit it, and installs the Mlola packages they import with your package manager. Framework-free: the copied markup works in any language that can emit HTML, and React sources use only React.

The library's contract is generated from its own stylesheet, so a model reading it cannot invent a class or attribute that does not exist.

Install

bash
npx mlola-ui initnpx mlola-ui add button sheet hero-split landingnpx mlola-ui doctor

init writes mlola.config.json, the engine stylesheet, and the instructions your coding agents read (see below), and installs @mlola-ui/engine. It fits the project it finds: files go where the @/ alias in tsconfig.json points, or into src/ when there is one. Without an alias, as in a new Vite app, it sets "imports": "relative" and the copied files import each other by relative path, so nothing needs setting up first. In a Next.js project it prints the root layout that imports the stylesheet, sets the theme on <html> and loads every theme's fonts.

add resolves the dependency graph (a page pulls its blocks, a block pulls its components), copies only what you asked for, and installs the packages the copied code imports that package.json does not declare yet. Pass --no-install to only print the command. doctor checks the project against the registry: packages the installed items import, the engine import, the theme attribute on <html>, the themes' fonts the project never loads, and files changed since they were added.

Tailwind can stay in the project. The engine places Mlola's layers above Tailwind's preflight in either import order.

Commands

CommandWhat it does
init [--no-agents] [--no-hooks] [--ci] [--no-install]create mlola.config.json, the stylesheet entry and the agent instructions, and install the engine
agents [--no-hooks] [--ci]write or refresh the agent instructions in an existing project; --ci adds a workflow that runs the check on pull requests
mcprun the Mlola MCP server over stdio, for coding agents
add <items…> [--no-install]copy items and their dependencies into the project, and install the packages they import
list [--json]print every installable item
doctorreport project and registry problems
check [path…] [--fix] [--json] [--strict] [--all]check every file's markup and CSS against the contract, and count what was typed by hand; --fix puts spacing that is exactly a step of the scale back on it
audit <url | file.html> [--themes all|<ids>] [--modes light,dark] [--interact] [--shots <dir>] [--json]open a page on a desktop and a phone, light and dark, and report what only shows once it is drawn; exits 1 on a problem
migrate [path…] [--write] [--json]move a shadcn/ui project's props, toasts and icons to Mlola, and list what needs a person
render check <file | -> [--json]check A2UI messages an agent composed against the Mlola Render catalog; exits 1 on an error
render catalog [--schema]print the Mlola Render catalog as the guide an agent reads, or as the A2UI catalog
render prompt [--tool] [--page-theme]print the system prompt for a model you call yourself: every answer a surface, or (--tool) a tool the model calls when one helps; --page-theme leaves themes to the page
login <token>save a Mlola Pro token (from /account) for this user
logoutforget the saved token

Looking at a page

check reads source. audit opens the page: a desktop and a phone, light and dark, in the project's own Playwright (npm install -D playwright; the CLI ships no browser). It reports text cut off or running out of its card, a control over another element's text, fields in a row that do not line up, sideways scroll, images that did not load, a menu or dialog past the window's edge, text below the contrast floor and errors the page threw:

bash
npx mlola-ui audit localhost:3000/settingsnpx mlola-ui audit page.html --themes all        # a file, in every themenpx mlola-ui audit localhost:3000 --shots .audit # and a screenshot per view

--interact also presses what opens (menus, dialogs, tabs) and checks each state; it presses the page's real buttons, so it is off unless asked for. These are the audits Mlola runs over its own components.

Checking a project

check runs the same check as the MCP server's check_markup over every HTML, JSX, TSX, Vue, Svelte, Astro and CSS file in the project (or the paths you name), and reports each issue with its line and fix:

bash
npx mlola-ui check            # the whole projectnpx mlola-ui check src --json # one folder, every issue as data

It ends with the drift: how many different colors and spacing values were typed by hand instead of read from the tokens, and which ones most. It works in any project, so it can measure one before it uses Mlola. In a Mlola project it leaves out what the CLI installed (--all takes the copied markup in; Mlola's own stylesheets, the built theme among them, are held by the library's gates and never checked); where Tailwind, UnoCSS or Windi is installed it leaves utility classes alone and counts only the values typed into them (bg-[#fafafa], p-[13px]).

It exits 1 when it finds an error (with --strict, a warning too), and on GitHub Actions each issue is also an annotation on the pull request:

yaml
# .github/workflows/ui.ymlname: UIon: pull_requestjobs:  mlola:    runs-on: ubuntu-latest    steps:      - uses: actions/checkout@v4      - run: npx -y mlola-ui@latest check src

Moving from shadcn/ui

migrate makes the changes a machine can make without guessing, and lists the rest with the line and what to do. Mlola installs a component at the same file shadcn/ui did (components/ui/button.tsx), so imports stay as they are. It reads by default; --write makes the changes.

bash
npx mlola-ui migrate            # what would change, and what needs a personnpx mlola-ui migrate --write    # make the changesnpx mlola-ui add button badge toast --overwrite   # the command it prints

It rewrites props written out as literals (variant="destructive" becomes variant="danger", a Badge's variant becomes its tone), moves sonner and the older use-toast to Mlola's toast (toast.error becomes toast.danger), switch to toggle, and the lucide-react glyphs Mlola has to @mlola-ui/icons, in the file's own import style. It leaves a value computed at runtime, a cva() helper and a component whose API differs (Dialog, Select, Dropdown Menu…) to you, naming the attributes or the component that replace each one.

Coding agents

init (or agents, in an existing project) tells the project's coding agents that its UI is Mlola:

  • mlola.agents.md: the design guide, with the project setup (the theme on <html>, every theme's fonts), what each layout primitive does, every class, data-* value and token, and the rules for new UI;
  • AGENTS.md: a short section between markers pointing at the guide (merged, never overwritten), and CLAUDE.md importing it for Claude Code;
  • .mcp.json (and .cursor/ or .vscode/ when the project uses them): the Mlola MCP server;
  • .claude/settings.json: a hook that runs mlola-ui check --hook on each file Claude Code edits and hands what it finds back to the agent (--no-hooks leaves it out);
  • .github/workflows/mlola-check.yml, with --ci only: the check on every pull request.

npx mlola-ui mcp is that server. It answers from the registry bundled with this CLI, offline: get_design_rules, search_components, get_component, get_tokens, check_markup (classes and tokens that do not exist, with the closest that do; wrong data-* values and React props; a control's class on an element that cannot be operated; buttons, links, fields and images with no name; utility classes; and in style attributes, <style> blocks and utility classes, the colors, spacing, type sizes, radii, shadows, durations and layers typed by hand, and faded text, each with its line and fix), get_render_catalog, check_render and render_ui (Mlola Render, below), audit_page, add_components and init_project. For Claude Code without init:

sh
claude mcp add mlola --scope project -- npx -y mlola-ui mcp

It is started by your agent and talks over stdio, so run by hand it prints one line and waits. The same tools, minus the two that write, answer at https://ui.mlola.com/mcp for agents that cannot run a command (with get_install_command, which also gives the CDN link and script for a page with no build step), and the server is listed in the MCP Registry as io.github.mlolahq/mlola-ui. See https://ui.mlola.com/docs/agents for Cursor, VS Code, Codex and chat apps.

Mlola Render

When an agent should show interface instead of writing code for it (a form in a chat, a status card in an agent's app), it composes A2UI v0.9 messages from the Mlola Render catalog: free components and named values, never a color or a class. The check holds them to the catalog and to what makes a surface usable (a name on every field, one root, no loops, headings in order, values in range) and answers in A2UI's VALIDATION_FAILED shape, so the agent fixes its own messages:

sh
npx mlola-ui render catalog          # what an agent may composenpx mlola-ui render check ui.json    # an array, one message, or JSON Lines
js
import { validateRender } from "mlola-ui/render";import rules from "mlola-ui/render/rules" with { type: "json" };
const { valid, errors } = validateRender(messages, rules);

The MCP tools are get_render_catalog, check_render and render_ui. In a chat that shows MCP Apps, render_ui draws the surface in the conversation (its view is the resource ui://mlola/render), and what the person presses comes back to the agent as their next message, with A2UI's action. The A2UI catalog is mlola-ui/render/catalog and https://ui.mlola.com/a2ui/catalog/v1.

With a model you call yourself, mlola-ui/render/ai is what goes around the call: the system prompt, a reader for what the model answers (as it streams, and however it wrapped the JSON), and the loop that hands a refused reply back with its errors. Mlola never calls a model and holds no key:

js
import { composeRender } from "mlola-ui/render/ai";
const { valid, messages, turns } = await composeRender({  rules,  request: "A form to book a table for tonight",  generate: ({ system, messages }) => callYourModel(system, messages), // answers with the model's text});

renderSystemPrompt, renderTool, createRenderReader, readRenderReply, checkRenderReply and renderRepairPrompt are the parts, for a stream, a tool call or a loop of your own. npx mlola-ui render prompt prints the prompt for a server in another language.

To draw surfaces yourself: npx mlola-ui add render-surface in React, or @mlola-ui/behavior/render on a page without a framework. See https://ui.mlola.com/docs/render.

Mlola Pro

Pro components, blocks, pages and templates are not in this package. With a license, create a token at https://ui.mlola.com/account, then:

sh
npx mlola-ui login mlp_…npx mlola-ui add conversation bot

add fetches Pro items and their Pro dependencies from the service, checks every file against its integrity hash, and writes them like any other item. Free dependencies still come from this package. Pro stylesheets land in styles/mlola-pro/, gathered by styles/mlola-pro.css: import it once, after the engine stylesheet. mlola-pro.agents.md at the project root lists every Pro class and attribute for coding agents; point your AGENTS.md at it. In CI, set MLOLA_PRO_TOKEN instead of logging in. The token is stored in ~/.config/mlola-ui/credentials.json, readable by you only.

Configuration

Aliases and targets live in mlola.config.json:

json
{  "aliases": {    "components": "@/components/ui",    "blocks": "@/components/blocks",    "pages": "@/app/pages",    "templates": "@/app/templates"  }}

The CLI works from an npm tarball with no repository checkout; the packed installation is tested in CI.

MIT licensed. Part of Mlola UI.

来源:packages/cli/README.md,提交 952f4b8

工具

9

get_design_rules

Mlola design rules

The rules for building UI with Mlola: compose first, color by role, measure with the scales, shared state words, touch and focus; the project setup (the theme on <html>, every theme's fonts); and what each layout primitive does. Read once before writing UI.

无需输入参数。

search_components

Search Mlola components

Find components, blocks, pages and templates by what they do (for example 'date range', 'chat input', 'pricing'). Returns name, tier (free or Mlola Pro) and a one-line description.

输入参数kindtierquery

get_component

How to use a Mlola component

Everything needed to use one item: import, every prop with fixed values (variant, tone, size, side…) and its default, the classes it styles and the data-* values each reacts to, dependencies and the install command. Set include_source to read a free component's source.

输入参数name必填include_source

get_tokens

Mlola design tokens

The --ml-* tokens grouped by purpose (planes and ink, color roles, spacing, type, density, shape, depth, motion, layers…). Filter with a group name or part of a token name.

输入参数group

check_markup

Check markup against the Mlola contract

Checks HTML or JSX: classes and --ml-* tokens that do not exist (with the closest that do), variant classes, data-* values and React props a component does not take, a control's class on an element that cannot be operated (ml-button on a div), buttons, links, fields and images with no name, utility classes, misuse of data-theme or data-mode, and in style attributes, <style> blocks and utility classes (bg-[#fafafa]) what is typed by hand instead of read from a token: colors, spacing, type sizes, radii, shadows, durations, layers, overridden theme tokens and text faded with opacity. Each issue names its line and the fix. Run it on markup you wrote before finishing: pass the whole page or file, <style> blocks included, not an excerpt, since it only checks what it is given.

输入参数markup必填

get_render_catalog

Mlola Render catalog

The components an agent may compose at runtime with Mlola Render, as A2UI v0.9 messages: each component's props and allowed values, how surfaces, data binding and actions work, and complete examples. Read once before composing a surface. format "schema" returns the A2UI catalog (JSON Schema) instead.

输入参数format

check_render

Check Mlola Render messages

Checks A2UI messages (createSurface, updateComponents, updateDataModel, deleteSurface) against the Mlola Render catalog before they render: components and props that do not exist, values a component does not offer, colors or styles set by hand, fields and controls without a name, a missing root, children that do not exist or form a loop, headings that skip a level, values outside a range. Each error names its JSON Pointer path and the fix. Pass every message of the surface: one object, an array, or JSON Lines.

输入参数messages必填

render_ui

Show Mlola Render UI

Shows an interface in the conversation: a form, a status card, a table of results. Pass A2UI messages composed from the Mlola Render catalog (read get_render_catalog first); they are checked, and drawn with Mlola components where the host shows MCP Apps. When the person presses a button, their next message carries the A2UI action with what they entered. Where the host shows no apps, this answers with the check's report.

输入参数messages必填

get_install_command

How to install Mlola components

How to set Mlola up: the commands to run in a project to add components, blocks, pages or templates (with the license step for Mlola Pro items), and the stylesheet link and script for a page with no build step. Leave names out for the setup alone.

输入参数names

版本历史

35
  1. v1.15.2最新Nov 11, 2026
  2. v1.14.3Oct 22, 2026
  3. v1.14.2Oct 17, 2026
  4. v1.14.1Oct 17, 2026
  5. v1.14.0Oct 16, 2026
  6. v1.13.2Oct 13, 2026
  7. v1.12.0Oct 12, 2026
  8. v1.11.0Oct 11, 2026
  9. v1.10.3Oct 9, 2026
  10. v1.10.1Oct 9, 2026
  11. v1.9.3Oct 7, 2026
  12. v1.9.1Oct 7, 2026
  13. v1.9.0Oct 6, 2026
  14. v1.8.0Oct 5, 2026
  15. v1.7.0Oct 4, 2026
  16. v1.6.1Oct 4, 2026
  17. v1.6.0Oct 3, 2026
  18. v1.5.1Oct 3, 2026
  19. v1.5.0Oct 3, 2026
  20. v1.4.3Oct 2, 2026
  21. v1.4.2Oct 2, 2026
  22. v1.4.1Oct 1, 2026
  23. v1.4.0Oct 1, 2026
  24. v1.2.1Oct 1, 2026
  25. v1.2.0Sep 30, 2026
  26. v1.1.26Sep 30, 2026
  27. v1.1.24Sep 30, 2026
  28. v1.1.23Sep 29, 2026
  29. v1.1.20Sep 29, 2026
  30. v1.1.18Sep 29, 2026
  31. v1.1.14Sep 29, 2026
  32. v1.1.10Sep 28, 2026
  33. v1.1.9Sep 28, 2026
  34. v1.1.7Sep 27, 2026
  35. v1.1.4Sep 27, 2026

评分

已满足适用检查项的 100%

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

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