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 分