@maz-ui/mcp 5.1.1 → 5.2.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -2
- package/dist/chunks/files.mjs +70 -0
- package/dist/chunks/index.mjs +28535 -0
- package/dist/chunks/prompt.mjs +280 -0
- package/dist/chunks/theme.mjs +14789 -0
- package/dist/cli.mjs +9 -11
- package/dist/index.d.mts +90 -5
- package/dist/index.d.ts +90 -5
- package/dist/index.mjs +13 -11
- package/dist/shared/mcp.Ccxm-Aoc.mjs +3312 -0
- package/dist/shared/mcp.D3_Fk0U3.mjs +34563 -0
- package/docs/agents/agents-md.md +32 -17
- package/docs/agents/claude-rule.md +32 -17
- package/docs/components/maz-alert.md +1 -1
- package/docs/components/maz-bottom-sheet.md +1 -1
- package/docs/components/maz-btn.md +3 -3
- package/docs/components/maz-container.md +2 -2
- package/docs/components/maz-dropdown.md +1 -1
- package/docs/components/maz-dropzone.md +1 -1
- package/docs/components/maz-icon.md +2 -2
- package/docs/components/maz-input.md +2 -2
- package/docs/components/maz-link.md +2 -2
- package/docs/components/maz-select-country.md +1 -1
- package/docs/components/maz-sidebar-menu-button.md +1 -1
- package/docs/components/maz-sidebar-menu-sub.md +1 -1
- package/docs/components/maz-sidebar.md +2 -2
- package/docs/ecosystem/icons/index.md +7 -4
- package/docs/ecosystem/mcp.md +47 -2
- package/docs/ecosystem/node/setup-agents.md +76 -3
- package/docs/guide/ai-agents.md +51 -17
- package/docs/manifest.json +1 -1
- package/docs/rules.md +32 -17
- package/package.json +28 -12
- package/dist/shared/mcp.cBFLVChV.mjs +0 -3002
package/docs/agents/agents-md.md
CHANGED
|
@@ -1,41 +1,56 @@
|
|
|
1
1
|
## maz-ui
|
|
2
2
|
|
|
3
|
-
This project is built with **maz-ui** and its ecosystem
|
|
3
|
+
This project is built with **maz-ui** and its ecosystem. Reuse what it provides instead of re-implementing it: most UI elements, helpers, icons and styles you need already exist.
|
|
4
4
|
|
|
5
5
|
### Look it up before you write it
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
- **MCP server `maz-ui`** (when available): `search_docs` (describe the need: "confirm before delete"), `get_component_api`, `find_icons`, `get_theme_tokens`, `get_doc`, `review_code`.
|
|
8
|
+
- **Version-matched docs** in `node_modules/maz-ui/docs/` (start with `README.md`; in a monorepo, the `maz-ui` of the app).
|
|
8
9
|
|
|
9
|
-
|
|
10
|
-
- **Version-matched docs** in `node_modules/maz-ui/docs/` (start with `README.md`; in a monorepo, resolve `maz-ui` from the app package). Read the relevant page before using an API.
|
|
10
|
+
Never guess an API: only use documented props, events, slots and imports.
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
### Which package for what
|
|
13
|
+
|
|
14
|
+
`maz-ui` (components, composables, directives, plugins), `@maz-ui/themes` (brand colors, fonts, dark mode), `@maz-ui/icons` (icons, logos, flags), `@maz-ui/utils` (helpers), `@maz-ui/translations` (texts of the components), `@maz-ui/nuxt` (Nuxt module).
|
|
13
15
|
|
|
14
16
|
### Components
|
|
15
17
|
|
|
16
|
-
- Use `Maz*` components instead of native elements or hand-made widgets: `MazBtn` (not `<button>`), `MazInput`, `MazSelect`, `MazCheckbox`, `
|
|
18
|
+
- Use `Maz*` components instead of native elements or hand-made widgets: `MazBtn` (not `<button>`), `MazLink`, `MazInput`, `MazSelect`, `MazCheckbox`, `MazDialog`, `MazDrawer`, `MazPopover`, `MazDropdown`, `MazTabs`, `MazTable`, `MazCard`, `MazAvatar`, `MazBadge`, `MazAlert`, `MazDatePicker`, `MazInputPhoneNumber`, `MazDropzone`, `MazPagination`...
|
|
17
19
|
- Prop values are typed: colors are `primary | secondary | accent | info | success | warning | destructive | contrast | transparent` (plus `surface` on some components), sizes `mini | xs | sm | md | lg | xl`.
|
|
18
|
-
-
|
|
20
|
+
- A button with only an icon needs an `aria-label`.
|
|
21
|
+
|
|
22
|
+
### Feedback, overlays and forms
|
|
23
|
+
|
|
24
|
+
- `useToast()` for notifications, `useDialog()` or `MazDialogConfirm` for confirmations, `useWait()` for loading states, `MazSkeleton` / `MazSpinner` while data loads.
|
|
25
|
+
- These composables need their plugin. Vue: `app.use(ToastPlugin)` from `maz-ui/plugins/toast` (`DialogPlugin`, `WaitPlugin`, `AosPlugin` likewise). Nuxt: `mazUi: { plugins: { toast: true } }`, off by default like the directives (`mazUi.directives.vTooltip`, or import the directive).
|
|
19
26
|
- Forms: `useFormValidator` / `useFormField` with your Standard Schema library (Zod, Valibot, ArkType).
|
|
20
27
|
|
|
21
28
|
### Icons
|
|
22
29
|
|
|
23
|
-
Use `@maz-ui/icons
|
|
30
|
+
Use `@maz-ui/icons`, never inline SVG nor another icon library. Pick the format by usage:
|
|
31
|
+
|
|
32
|
+
- **Icon props** (`<MazBtn :start-icon>`, `<MazIcon :icon>`...): the raw SVG string, the lightest, `@maz-ui/icons/raw/MazTrash`.
|
|
33
|
+
- **Directly in a template**: the component, `@maz-ui/icons/static/MazTrash`, then `<MazTrash class="size-5 text-muted" />` (size and color from the text: `1em`, `currentColor`).
|
|
34
|
+
- **Not visible at first render** (`v-if`, menus, dialogs, tabs): the lazy component, `@maz-ui/icons/lazy/MazTrash`. Never for icons visible on load: each one is an extra request.
|
|
35
|
+
- `<img>` or CSS only for multicolor icons (flags, logos): `@maz-ui/icons/svg/<name>.svg`, the text color does not apply there.
|
|
24
36
|
|
|
25
|
-
### Helpers
|
|
37
|
+
### Helpers
|
|
26
38
|
|
|
27
|
-
Use `@maz-ui/utils
|
|
39
|
+
Use `@maz-ui/utils/helpers/<name>` and the maz-ui composables instead of lodash, VueUse or hand-written code: `debounce`, `throttle`, `sleep`, `isEqual`, `formatCurrency`, `formatDate`, `formatNumber`, `formatPhoneNumber`, `capitalize`, `normalizeString`, `getCookie` / `setCookie`, `useBreakpoints`, `useWindowSize`, `useTimer`, `useIdleTimeout`, `useSwipe`, `vClickOutside`, `vTooltip`, `vLazyImg`...
|
|
40
|
+
|
|
41
|
+
### Texts and languages
|
|
42
|
+
|
|
43
|
+
The texts built in the components come from `@maz-ui/translations`: change the language with `useTranslations().setLocale('fr')` and customize the texts in its options, not in every component.
|
|
28
44
|
|
|
29
45
|
### Styling with Tailwind
|
|
30
46
|
|
|
31
47
|
The maz-ui theme is exposed to Tailwind (`@import 'maz-ui/tailwindcss/theme.css'`) and the project usually extends it. Only use theme tokens:
|
|
32
48
|
|
|
33
|
-
- **Project tokens first**: the Tailwind entry of the project
|
|
34
|
-
|
|
35
|
-
-
|
|
36
|
-
- Never use the default Tailwind palette (`bg-blue-500`, `text-gray-600`, `bg-white`, `text-black`) nor hard-coded colors (`#fff`, `rgb()`, `bg-[#...]`). Theme colors already adapt to dark mode: do not add `dark:` color overrides.
|
|
49
|
+
- **Project tokens first**: the Tailwind entry of the project adds its own `@theme` tokens, variants and utilities, and the `definePreset` file sets the brand values. `get_theme_tokens` lists both (or read these files). When a value is missing, add a token to the project `@theme` instead of an arbitrary value.
|
|
50
|
+
- Colors: `primary`, `secondary`, `accent`, `info`, `success`, `warning`, `destructive`, `contrast` (each with `-foreground` and `-50` to `-950`), `surface`, `foreground`, `muted`, `divider`, `overlay`, `bg-container`, `bg-input`. Example: `bg-surface text-foreground border-divider`.
|
|
51
|
+
- Never the default Tailwind palette (`bg-blue-500`, `text-gray-600`, `bg-white`, `text-black`) nor hard-coded colors (`#fff`, `rgb()`, `bg-[#...]`). Theme colors already adapt to dark mode: no `dark:` color overrides.
|
|
37
52
|
- Radius `rounded-*`, shadows `shadow-sm` to `shadow-xl` and `shadow-elevation`, spacing scale (`p-4`, `gap-2`), breakpoints `mob-*`, `tab-*`, `lap-*` (plus `sm` to `2xl`), utilities `flex-center`, `padded-container`.
|
|
38
|
-
- **No `maz:` prefix** in this project: it is internal to the maz-ui library
|
|
53
|
+
- **No `maz:` prefix** in this project: it is internal to the maz-ui library.
|
|
39
54
|
- In custom CSS, use the variables: `var(--maz-primary)`, `var(--maz-rounded-md)`, `calc(var(--maz-space) * 4)`.
|
|
40
55
|
|
|
41
56
|
### Theme
|
|
@@ -44,8 +59,8 @@ Brand colors, fonts, radius and spacing come from a `@maz-ui/themes` preset (`de
|
|
|
44
59
|
|
|
45
60
|
### Imports
|
|
46
61
|
|
|
47
|
-
- Deep imports: `maz-ui/components/MazBtn`, `maz-ui/composables/useToast`, `maz-ui/directives/vTooltip`, `@maz-ui/utils/helpers/debounce`, `@maz-ui/icons/
|
|
48
|
-
- With `@maz-ui/nuxt`, components and composables are auto-imported: do not import them.
|
|
62
|
+
- Deep imports: `maz-ui/components/MazBtn`, `maz-ui/composables/useToast`, `maz-ui/directives/vTooltip`, `maz-ui/plugins/toast`, `@maz-ui/utils/helpers/debounce`, `@maz-ui/icons/raw/MazTrash`. The `maz-ui` root entry only exports types. Never import from `maz-ui/src` or `maz-ui/dist`.
|
|
63
|
+
- With `@maz-ui/nuxt`, components and composables are auto-imported: do not import them. Icons are not: import them. The theme and the translations are set in the `mazUi` options of `nuxt.config`, not with the `MazUi` Vue plugin.
|
|
49
64
|
|
|
50
65
|
### Before you finish
|
|
51
66
|
|
|
@@ -1,41 +1,56 @@
|
|
|
1
1
|
# maz-ui
|
|
2
2
|
|
|
3
|
-
This project is built with **maz-ui** and its ecosystem
|
|
3
|
+
This project is built with **maz-ui** and its ecosystem. Reuse what it provides instead of re-implementing it: most UI elements, helpers, icons and styles you need already exist.
|
|
4
4
|
|
|
5
5
|
### Look it up before you write it
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
- **MCP server `maz-ui`** (when available): `search_docs` (describe the need: "confirm before delete"), `get_component_api`, `find_icons`, `get_theme_tokens`, `get_doc`, `review_code`.
|
|
8
|
+
- **Version-matched docs** in `node_modules/maz-ui/docs/` (start with `README.md`; in a monorepo, the `maz-ui` of the app).
|
|
8
9
|
|
|
9
|
-
|
|
10
|
-
- **Version-matched docs** in `node_modules/maz-ui/docs/` (start with `README.md`; in a monorepo, resolve `maz-ui` from the app package). Read the relevant page before using an API.
|
|
10
|
+
Never guess an API: only use documented props, events, slots and imports.
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
### Which package for what
|
|
13
|
+
|
|
14
|
+
`maz-ui` (components, composables, directives, plugins), `@maz-ui/themes` (brand colors, fonts, dark mode), `@maz-ui/icons` (icons, logos, flags), `@maz-ui/utils` (helpers), `@maz-ui/translations` (texts of the components), `@maz-ui/nuxt` (Nuxt module).
|
|
13
15
|
|
|
14
16
|
### Components
|
|
15
17
|
|
|
16
|
-
- Use `Maz*` components instead of native elements or hand-made widgets: `MazBtn` (not `<button>`), `MazInput`, `MazSelect`, `MazCheckbox`, `
|
|
18
|
+
- Use `Maz*` components instead of native elements or hand-made widgets: `MazBtn` (not `<button>`), `MazLink`, `MazInput`, `MazSelect`, `MazCheckbox`, `MazDialog`, `MazDrawer`, `MazPopover`, `MazDropdown`, `MazTabs`, `MazTable`, `MazCard`, `MazAvatar`, `MazBadge`, `MazAlert`, `MazDatePicker`, `MazInputPhoneNumber`, `MazDropzone`, `MazPagination`...
|
|
17
19
|
- Prop values are typed: colors are `primary | secondary | accent | info | success | warning | destructive | contrast | transparent` (plus `surface` on some components), sizes `mini | xs | sm | md | lg | xl`.
|
|
18
|
-
-
|
|
20
|
+
- A button with only an icon needs an `aria-label`.
|
|
21
|
+
|
|
22
|
+
### Feedback, overlays and forms
|
|
23
|
+
|
|
24
|
+
- `useToast()` for notifications, `useDialog()` or `MazDialogConfirm` for confirmations, `useWait()` for loading states, `MazSkeleton` / `MazSpinner` while data loads.
|
|
25
|
+
- These composables need their plugin. Vue: `app.use(ToastPlugin)` from `maz-ui/plugins/toast` (`DialogPlugin`, `WaitPlugin`, `AosPlugin` likewise). Nuxt: `mazUi: { plugins: { toast: true } }`, off by default like the directives (`mazUi.directives.vTooltip`, or import the directive).
|
|
19
26
|
- Forms: `useFormValidator` / `useFormField` with your Standard Schema library (Zod, Valibot, ArkType).
|
|
20
27
|
|
|
21
28
|
### Icons
|
|
22
29
|
|
|
23
|
-
Use `@maz-ui/icons
|
|
30
|
+
Use `@maz-ui/icons`, never inline SVG nor another icon library. Pick the format by usage:
|
|
31
|
+
|
|
32
|
+
- **Icon props** (`<MazBtn :start-icon>`, `<MazIcon :icon>`...): the raw SVG string, the lightest, `@maz-ui/icons/raw/MazTrash`.
|
|
33
|
+
- **Directly in a template**: the component, `@maz-ui/icons/static/MazTrash`, then `<MazTrash class="size-5 text-muted" />` (size and color from the text: `1em`, `currentColor`).
|
|
34
|
+
- **Not visible at first render** (`v-if`, menus, dialogs, tabs): the lazy component, `@maz-ui/icons/lazy/MazTrash`. Never for icons visible on load: each one is an extra request.
|
|
35
|
+
- `<img>` or CSS only for multicolor icons (flags, logos): `@maz-ui/icons/svg/<name>.svg`, the text color does not apply there.
|
|
24
36
|
|
|
25
|
-
### Helpers
|
|
37
|
+
### Helpers
|
|
26
38
|
|
|
27
|
-
Use `@maz-ui/utils
|
|
39
|
+
Use `@maz-ui/utils/helpers/<name>` and the maz-ui composables instead of lodash, VueUse or hand-written code: `debounce`, `throttle`, `sleep`, `isEqual`, `formatCurrency`, `formatDate`, `formatNumber`, `formatPhoneNumber`, `capitalize`, `normalizeString`, `getCookie` / `setCookie`, `useBreakpoints`, `useWindowSize`, `useTimer`, `useIdleTimeout`, `useSwipe`, `vClickOutside`, `vTooltip`, `vLazyImg`...
|
|
40
|
+
|
|
41
|
+
### Texts and languages
|
|
42
|
+
|
|
43
|
+
The texts built in the components come from `@maz-ui/translations`: change the language with `useTranslations().setLocale('fr')` and customize the texts in its options, not in every component.
|
|
28
44
|
|
|
29
45
|
### Styling with Tailwind
|
|
30
46
|
|
|
31
47
|
The maz-ui theme is exposed to Tailwind (`@import 'maz-ui/tailwindcss/theme.css'`) and the project usually extends it. Only use theme tokens:
|
|
32
48
|
|
|
33
|
-
- **Project tokens first**: the Tailwind entry of the project
|
|
34
|
-
|
|
35
|
-
-
|
|
36
|
-
- Never use the default Tailwind palette (`bg-blue-500`, `text-gray-600`, `bg-white`, `text-black`) nor hard-coded colors (`#fff`, `rgb()`, `bg-[#...]`). Theme colors already adapt to dark mode: do not add `dark:` color overrides.
|
|
49
|
+
- **Project tokens first**: the Tailwind entry of the project adds its own `@theme` tokens, variants and utilities, and the `definePreset` file sets the brand values. `get_theme_tokens` lists both (or read these files). When a value is missing, add a token to the project `@theme` instead of an arbitrary value.
|
|
50
|
+
- Colors: `primary`, `secondary`, `accent`, `info`, `success`, `warning`, `destructive`, `contrast` (each with `-foreground` and `-50` to `-950`), `surface`, `foreground`, `muted`, `divider`, `overlay`, `bg-container`, `bg-input`. Example: `bg-surface text-foreground border-divider`.
|
|
51
|
+
- Never the default Tailwind palette (`bg-blue-500`, `text-gray-600`, `bg-white`, `text-black`) nor hard-coded colors (`#fff`, `rgb()`, `bg-[#...]`). Theme colors already adapt to dark mode: no `dark:` color overrides.
|
|
37
52
|
- Radius `rounded-*`, shadows `shadow-sm` to `shadow-xl` and `shadow-elevation`, spacing scale (`p-4`, `gap-2`), breakpoints `mob-*`, `tab-*`, `lap-*` (plus `sm` to `2xl`), utilities `flex-center`, `padded-container`.
|
|
38
|
-
- **No `maz:` prefix** in this project: it is internal to the maz-ui library
|
|
53
|
+
- **No `maz:` prefix** in this project: it is internal to the maz-ui library.
|
|
39
54
|
- In custom CSS, use the variables: `var(--maz-primary)`, `var(--maz-rounded-md)`, `calc(var(--maz-space) * 4)`.
|
|
40
55
|
|
|
41
56
|
### Theme
|
|
@@ -44,8 +59,8 @@ Brand colors, fonts, radius and spacing come from a `@maz-ui/themes` preset (`de
|
|
|
44
59
|
|
|
45
60
|
### Imports
|
|
46
61
|
|
|
47
|
-
- Deep imports: `maz-ui/components/MazBtn`, `maz-ui/composables/useToast`, `maz-ui/directives/vTooltip`, `@maz-ui/utils/helpers/debounce`, `@maz-ui/icons/
|
|
48
|
-
- With `@maz-ui/nuxt`, components and composables are auto-imported: do not import them.
|
|
62
|
+
- Deep imports: `maz-ui/components/MazBtn`, `maz-ui/composables/useToast`, `maz-ui/directives/vTooltip`, `maz-ui/plugins/toast`, `@maz-ui/utils/helpers/debounce`, `@maz-ui/icons/raw/MazTrash`. The `maz-ui` root entry only exports types. Never import from `maz-ui/src` or `maz-ui/dist`.
|
|
63
|
+
- With `@maz-ui/nuxt`, components and composables are auto-imported: do not import them. Icons are not: import them. The theme and the translations are set in the `mazUi` options of `nuxt.config`, not with the `MazUi` Vue plugin.
|
|
49
64
|
|
|
50
65
|
### Before you finish
|
|
51
66
|
|
|
@@ -227,7 +227,7 @@ You can use either title, content, or both.
|
|
|
227
227
|
|
|
228
228
|
- `title` (`string`): Title of the alert.
|
|
229
229
|
- `content` (`string`): Content of the alert.
|
|
230
|
-
- `icon` (`
|
|
230
|
+
- `icon` (`string | IconComponent`): Icon of the alert - can be a component or icon name string.
|
|
231
231
|
- `hide-icon` (`boolean`, default: `false`): Hide the icon.
|
|
232
232
|
- `color` (`MazAlertColor`, default: `"info"`): Color of the alert. Values: `'success'`, `'warning'`, `'destructive'`, `'info'`, `'primary'`, `'secondary'`, `'accent'`, `'contrast'` (non exhaustive).
|
|
233
233
|
- `icon-size` (`MazIconSize`, default: `"md"`): Size of the icon.
|
|
@@ -217,7 +217,7 @@ The bottom sheet is a modal `dialog` labelled by its `title` and described by it
|
|
|
217
217
|
|
|
218
218
|
- `model-value` (`boolean`, `v-model`): Modal's model value.
|
|
219
219
|
- `title` (`string`): Title of the bottom sheet in the header.
|
|
220
|
-
- `icon` (`
|
|
220
|
+
- `icon` (`MazIconLike`): Icon displayed on the left of the header. Accepts an icon value or a full `MazIconProps` object.
|
|
221
221
|
- `max-width` (`` `${number}rem` | `${number}px` | `${number}em` | `${number}vw` | `${number}vh` | `${number}vmin` | `${number}vmax` | `${number}%` | `${number}ch` | `${number}cm` | `${number}mm` | `${number}in` | `${number}ex` | `${number}pc` | `${number... ``, default: `"40rem"`): Bottom sheet's max-width, applied from the tablet breakpoint and up (full-width below).
|
|
222
222
|
- `hide-close-button` (`boolean`, default: `false`): Remove the close button in the header.
|
|
223
223
|
- `hide-header` (`boolean`, default: `false`): Remove the whole header.
|
|
@@ -406,9 +406,9 @@ When `to` attribute is provided, the component automatically becomes a `<RouterL
|
|
|
406
406
|
- `loading` (`boolean`, default: `false`): Enable the button loader.
|
|
407
407
|
- `disabled` (`boolean`, default: `false`): Disable the button.
|
|
408
408
|
- `fab` (`boolean`, default: `false`): If true, the button will have a fab style.
|
|
409
|
-
- `icon` (`
|
|
410
|
-
- `start-icon` (`
|
|
411
|
-
- `end-icon` (`
|
|
409
|
+
- `icon` (`MazIconLike`): The icon to display in the fab variant. Accepts a bare value (Vue component, raw SVG string, URL or `data:` URI) for the common case, or a full `MazIconProps` object for fine-grained control (size, title, svgAttributes, fallback, flipIconForRtl, …).
|
|
410
|
+
- `start-icon` (`MazIconLike`): The icon to display on the inline-start edge (left in LTR, right in RTL). Accepts a bare value or a full `MazIconProps` object.
|
|
411
|
+
- `end-icon` (`MazIconLike`): The icon to display on the inline-end edge (right in LTR, left in RTL). Accepts a bare value or a full `MazIconProps` object.
|
|
412
412
|
- `padding` (`boolean`, default: `true`): Apply the padding of the button, set it to `false` to remove it.
|
|
413
413
|
- `justify` (`"center" | "end" | "start" | "space-between" | "space-around" | "space-evenly"`, default: `"center"`): Choose how the elements are aligned in the button.
|
|
414
414
|
- `active` (`boolean`, default: `false`): If true, the button will have an active state.
|
|
@@ -226,8 +226,8 @@ Use the `header` slot to fully customize the header, or use `title`, `icon-start
|
|
|
226
226
|
- `rounded-size` (`MazRoundedSize`, default: `'md'`): Size of the rounded. Values: `'none'`, `'sm'`, `'md'`, `'lg'`, `'xl'`, `'full'` (non exhaustive).
|
|
227
227
|
- `transparent` (`boolean`, default: `false`): Remove background color.
|
|
228
228
|
- `overflow-hidden` (`boolean`, default: `true`): Hide overflow.
|
|
229
|
-
- `start-icon` (`
|
|
230
|
-
- `end-icon` (`
|
|
229
|
+
- `start-icon` (`MazIconLike`): Icon displayed on the inline-start edge of the header (left in LTR, right in RTL). Accepts a bare value (Vue component, raw SVG string, URL or `data:` URI) or a full `MazIconProps` object.
|
|
230
|
+
- `end-icon` (`MazIconLike`): Icon displayed on the inline-end edge of the header (right in LTR, left in RTL). Accepts a bare value or a full `MazIconProps` object.
|
|
231
231
|
- `icon-size` (`MazIconSize`, default: `"md"`): Size of the icon.
|
|
232
232
|
- `block` (`boolean`, default: `false`): Display the container in full width.
|
|
233
233
|
- `content-class` (`string`): Additional class to add to the content wrapper.
|
|
@@ -376,7 +376,7 @@ The trigger button exposes the menu state (`aria-haspopup="menu"`, `aria-expande
|
|
|
376
376
|
- `menu-panel-class` (`ClassValue`): Additional CSS classes to apply to the dropdown menu panel Useful for customizing the dropdown appearance (background, border, etc.).
|
|
377
377
|
- `menu-panel-style` (`StyleValue`): Inline styles to apply to the dropdown menu panel Useful for custom styling. You may use `!important` to override default styles.
|
|
378
378
|
- `block` (`boolean`, default: `false`): Makes the dropdown button expand to full width of its container.
|
|
379
|
-
- `dropdown-icon` (`
|
|
379
|
+
- `dropdown-icon` (`MazIconLike`): Icon to use instead of the default chevron for the dropdown indicator Custom icon to display in place of the default chevron. Accepts a bare value (Vue component, raw SVG string, URL or `data:` URI) or a full `MazIconProps` object.
|
|
380
380
|
- `dropdown-icon-animation` (`boolean`, default: `true`): Controls whether the dropdown icon rotates when the dropdown is opened.
|
|
381
381
|
- `size` (`"xs" | "sm" | "md" | "lg" | "xl" | "mini"`, default: `'md'`): Size of the dropdown button.
|
|
382
382
|
- `transition` (`string`, default: `"scale-pop"`): Transition to use when the dropdown is opened or closed. Values: `'scale-pop'`, `'scale-fade'`, `'string'` (non exhaustive).
|
|
@@ -355,8 +355,8 @@ Customize the upload request using `uploadUrl`, `requestOptions` and `transformB
|
|
|
355
355
|
|
|
356
356
|
### Events
|
|
357
357
|
|
|
358
|
-
- `@error` (payload: `values: { files: File[] | null; event: DragEvent | null; code: MazDropzoneErrorCode; }`): Event emitted when an error occurs
|
|
359
358
|
- `@add` (payload: `value: File`): Event emitted when a file is added to the dropzone
|
|
359
|
+
- `@error` (payload: `values: { files: File[] | null; event: DragEvent | null; code: MazDropzoneErrorCode; }`): Event emitted when an error occurs
|
|
360
360
|
- `@drop` (payload: `values: { files: File[] | null; event: DragEvent; }`): Event emitted when files are dropped in the dropzone
|
|
361
361
|
- `@update:modelValue` (payload: `value: MazDropzoneFileData[]`)
|
|
362
362
|
- `@enter` (payload: `values: { files: File[] | null; event: DragEvent; }`): Event emitted when dragged files enter the dropzone
|
|
@@ -191,8 +191,8 @@ Source: [Heroicons](https://heroicons.com/) - see also the [icon set page](../ec
|
|
|
191
191
|
|
|
192
192
|
### Props
|
|
193
193
|
|
|
194
|
-
- `icon` (`
|
|
195
|
-
- `fallback` (`
|
|
194
|
+
- `icon` (`MazIconValue`): The icon to render. Accepts: - A Vue component (e.g. `import { MazStar } from '@maz-ui/icons/static/MazStar'`) - A URL or `data:` URI to a `.svg` file (`'/icons/star.svg'`, `'data:image/svg+xml,…'`) - A raw SVG string (`'<svg viewBox="0 0 24 24">…</svg>'`) The component detects the format and renders accordingly.
|
|
195
|
+
- `fallback` (`MazIconValue`, default: `MazQuestionMarkCircle`): Fallback icon used when: - `icon` is not provided - `icon` is a URL that fails to load or returns invalid SVG Same shape as `icon`. Defaults to the imported `MazQuestionMarkCircle` if neither `icon` nor `fallback` resolves to anything renderable.
|
|
196
196
|
- `size` (`MazIconSize`): Predefined keyword (`'xs' | 'sm' | 'md' | 'lg' | 'xl'`) or any CSS length.
|
|
197
197
|
- `title` (`string`): Sets a `<title>` element inside the SVG for screen-reader accessibility.
|
|
198
198
|
- `svg-attributes` (`Record<string, string | number>`): Extra attributes to merge onto the rendered `<svg>` root.
|
|
@@ -310,8 +310,8 @@ Use the attribute `rounded-size` with a value in `'none' | 'sm' | 'md' | 'lg' |
|
|
|
310
310
|
- `debounce` (`number | boolean`, default: `false`): Enables input debouncing to limit the frequency of value updates. When true, uses 500ms delay. When a number, uses that value as delay in milliseconds.
|
|
311
311
|
- `auto-focus` (`boolean`, default: `false`): Automatically focuses the input when the component mounts.
|
|
312
312
|
- `border-active` (`boolean`, default: `false`): When true, shows the colored border immediately instead of only on focus.
|
|
313
|
-
- `start-icon` (`
|
|
314
|
-
- `end-icon` (`
|
|
313
|
+
- `start-icon` (`MazIconLike`): Icon displayed on the inline-start edge of the input (left in LTR, right in RTL). Accepts a bare value (Vue component, raw SVG string, URL or `data:` URI) or a full `MazIconProps` object for fine-grained control (size, title, svgAttributes, fallback, …).
|
|
314
|
+
- `end-icon` (`MazIconLike`): Icon displayed on the inline-end edge of the input (right in LTR, left in RTL). Accepts a bare value or a full `MazIconProps` object.
|
|
315
315
|
- `rounded-size` (`MazRoundedSize`, default: `'md'`): Controls the border radius of the input component. Values: `'none'`, `'sm'`, `'md'`, `'lg'`, `'xl'`, `'full'` (non exhaustive).
|
|
316
316
|
- `block` (`boolean`): Makes the input expand to the full width of its container.
|
|
317
317
|
- `name` (`string`): The name of the input field. Used for form submission and validation.
|
|
@@ -134,8 +134,8 @@ If no `to` or `href` is provided, the component will be a `button` by default. Y
|
|
|
134
134
|
- `underline` (`boolean`, default: `false`): Add an underline to the link.
|
|
135
135
|
- `underline-hover` (`boolean`, default: `true`): Add an underline only on hover.
|
|
136
136
|
- `auto-external` (`boolean`, default: `true`): Add an external icon to the link if target is '_blank'.
|
|
137
|
-
- `start-icon` (`
|
|
138
|
-
- `end-icon` (`
|
|
137
|
+
- `start-icon` (`MazIconLike`): Icon displayed on the inline-start edge (left in LTR, right in RTL). Accepts a bare value (Vue component, raw SVG string, URL or `data:` URI) or a full `MazIconProps` object for fine-grained control.
|
|
138
|
+
- `end-icon` (`MazIconLike`): Icon displayed on the inline-end edge (right in LTR, left in RTL). Accepts a bare value or a full `MazIconProps` object.
|
|
139
139
|
- `disabled` (`boolean`, default: `false`): The disabled state of the link if the component is a button.
|
|
140
140
|
|
|
141
141
|
### Slots
|
|
@@ -484,10 +484,10 @@ This ensures consistent internationalization across your application while provi
|
|
|
484
484
|
- `required` (`boolean`): Make the input required in the form.
|
|
485
485
|
- `placeholder` (`string`): The placeholder of the select.
|
|
486
486
|
- `label` (`string`): The label of the select.
|
|
487
|
+
- `search-function` (`((query: string, options: Option[]) => Option[] | undefined)`): Replace the default search function to provide a custom search function.
|
|
487
488
|
- `transition` (`string`, default: `'scale-fade'`): The transition name of the panel list options.
|
|
488
489
|
- `prefer-position` (`MazPopoverPreferPosition`, default: `'bottom-start'`): The prefer position of the list.
|
|
489
490
|
- `fallback-position` (`MazPopoverFallbackPosition`, default: `'top-start'`): The fallback position of the list.
|
|
490
|
-
- `search-function` (`((query: string, options: Option[]) => Option[] | undefined)`): Replace the default search function to provide a custom search function.
|
|
491
491
|
- `top-label` (`string`): Static label displayed above the input field. Unlike the floating label, this remains fixed.
|
|
492
492
|
- `autocomplete` (`string`, default: `'off'`): The autocomplete attribute of the input.
|
|
493
493
|
- `option-value-key` (`string`, default: `"code"`): The key of the option value.
|
|
@@ -22,7 +22,7 @@ Used inside [MazSidebar](./maz-sidebar.md): read its page for complete examples.
|
|
|
22
22
|
|
|
23
23
|
- `to` (`string | Record<string, unknown>`): Route for router-link navigation.
|
|
24
24
|
- `href` (`string`): URL for anchor navigation.
|
|
25
|
-
- `icon` (`
|
|
25
|
+
- `icon` (`MazIconLike`): Icon to display before the label. Accepts a bare icon value (Vue component, raw SVG string, URL) or a full `MazIconProps` object for fine-grained control (size, title, fallback, …).
|
|
26
26
|
- `label` (`string`): Label text.
|
|
27
27
|
- `badge` (`MazSidebarMenuButtonBadge`): Badge content. Pass a `string`/`number` for a simple primary badge, or a full `MazBadgeProps` object (with optional `text`) to customise color, size, outlined, ….
|
|
28
28
|
- `tooltip` (`string`): Tooltip text. When provided, shows a tooltip on hover via the `v-tooltip` directive.
|
|
@@ -21,7 +21,7 @@ Used inside [MazSidebar](./maz-sidebar.md): read its page for complete examples.
|
|
|
21
21
|
### Props
|
|
22
22
|
|
|
23
23
|
- `label` (`string`): Label for the sub-menu trigger button.
|
|
24
|
-
- `icon` (`
|
|
24
|
+
- `icon` (`MazIconLike`): Icon to display before the label. Accepts a bare icon value (Vue component, raw SVG string, URL) or a full `MazIconProps` object for fine-grained control.
|
|
25
25
|
- `default-open` (`boolean`, default: `false`): Whether the sub-menu is open by default.
|
|
26
26
|
|
|
27
27
|
### Slots
|
|
@@ -455,7 +455,7 @@ Customize the sidebar width using these CSS custom properties (also settable via
|
|
|
455
455
|
|
|
456
456
|
- `to` (`string | Record<string, unknown>`): Route for router-link navigation.
|
|
457
457
|
- `href` (`string`): URL for anchor navigation.
|
|
458
|
-
- `icon` (`
|
|
458
|
+
- `icon` (`MazIconLike`): Icon to display before the label. Accepts a bare icon value (Vue component, raw SVG string, URL) or a full `MazIconProps` object for fine-grained control (size, title, fallback, …).
|
|
459
459
|
- `label` (`string`): Label text.
|
|
460
460
|
- `badge` (`MazSidebarMenuButtonBadge`): Badge content. Pass a `string`/`number` for a simple primary badge, or a full `MazBadgeProps` object (with optional `text`) to customise color, size, outlined, ….
|
|
461
461
|
- `tooltip` (`string`): Tooltip text. When provided, shows a tooltip on hover via the `v-tooltip` directive.
|
|
@@ -482,7 +482,7 @@ Customize the sidebar width using these CSS custom properties (also settable via
|
|
|
482
482
|
### Props
|
|
483
483
|
|
|
484
484
|
- `label` (`string`): Label for the sub-menu trigger button.
|
|
485
|
-
- `icon` (`
|
|
485
|
+
- `icon` (`MazIconLike`): Icon to display before the label. Accepts a bare icon value (Vue component, raw SVG string, URL) or a full `MazIconProps` object for fine-grained control.
|
|
486
486
|
- `default-open` (`boolean`, default: `false`): Whether the sub-menu is open by default.
|
|
487
487
|
|
|
488
488
|
### Slots
|
|
@@ -138,11 +138,14 @@ import { MazStar } from '@maz-ui/icons/raw/MazStar'
|
|
|
138
138
|
|
|
139
139
|
**When to use which variant:**
|
|
140
140
|
|
|
141
|
-
|
|
|
141
|
+
| Usage | Variant | Import |
|
|
142
142
|
| --- | --- | --- |
|
|
143
|
-
|
|
|
144
|
-
|
|
|
145
|
-
|
|
|
143
|
+
| Icon props of the components (`<MazBtn :start-icon>`, `<MazIcon :icon>`...) | `raw`: SVG string, the lightest, no component nor async chunk | `@maz-ui/icons/raw/MazStar` |
|
|
144
|
+
| Directly in a template (`<MazStar class="size-5" />`) | `static`: Vue component, rendered immediately | `@maz-ui/icons/static/MazStar` |
|
|
145
|
+
| Icons not visible at first render (`v-if`, menus, dialogs, tabs) | `lazy`: async component, loaded when displayed | `@maz-ui/icons/lazy/MazStar` |
|
|
146
|
+
| `<img>` or CSS, for multicolor icons (flags, logos) | SVG file | `@maz-ui/icons/svg/star.svg` |
|
|
147
|
+
|
|
148
|
+
A `lazy` icon is a separate request: do not use it for icons visible on load. In an `<img>`, an icon does not inherit the color of the text (`currentColor`): keep it for multicolor icons.
|
|
146
149
|
|
|
147
150
|
**Benefits:**
|
|
148
151
|
|
package/docs/ecosystem/mcp.md
CHANGED
|
@@ -43,13 +43,42 @@ In Claude Code, they are available as `/maz-ui:build`, `/maz-ui:audit` and `/maz
|
|
|
43
43
|
|
|
44
44
|
## Version-matched docs
|
|
45
45
|
|
|
46
|
-
The server serves the documentation of the **maz-ui version installed in your project** (`node_modules/maz-ui/docs`), found from the directory it is started in (monorepos: the root, then `apps/*` and `packages/*`). Without maz-ui installed, it serves the docs bundled with `@maz-ui/mcp` (latest release).
|
|
46
|
+
The server serves the documentation of the **maz-ui version installed in your project** (`node_modules/maz-ui/docs`), found from the directory it is started in (monorepos: the root, then the workspaces of `pnpm-workspace.yaml` or of the `workspaces` field of `package.json`, `apps/*` and `packages/*` by default). Without maz-ui installed, it serves the docs bundled with `@maz-ui/mcp` (latest release).
|
|
47
47
|
|
|
48
48
|
To force a folder, pass `--docs <dir>` or set `MAZ_UI_DOCS_DIR`.
|
|
49
49
|
|
|
50
|
+
In a monorepo whose apps install different maz-ui versions, the first maz-ui found wins: an agent working on one app can get the docs of another app. Align the versions, or choose the app whose docs are served:
|
|
51
|
+
|
|
52
|
+
```json
|
|
53
|
+
{
|
|
54
|
+
"mcpServers": {
|
|
55
|
+
"maz-ui": {
|
|
56
|
+
"type": "stdio",
|
|
57
|
+
"command": "npx",
|
|
58
|
+
"args": ["-y", "@maz-ui/mcp@latest", "--docs", "apps/web/node_modules/maz-ui/docs"]
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
```
|
|
63
|
+
|
|
50
64
|
## Configuration
|
|
51
65
|
|
|
52
|
-
`npx @maz-ui/mcp init` writes the configuration of Claude Code, Cursor and VS Code for you.
|
|
66
|
+
`npx @maz-ui/mcp init` writes the configuration of Claude Code, Cursor and VS Code for you.
|
|
67
|
+
|
|
68
|
+
### In a project: install it
|
|
69
|
+
|
|
70
|
+
Install `@maz-ui/mcp` as a dev dependency of the project root, then run `init`:
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
pnpm add -D @maz-ui/mcp
|
|
74
|
+
pnpm exec maz-ui-mcp init
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
The MCP configs then start the installed version through your package manager (`pnpm exec maz-ui-mcp`, `yarn run maz-ui-mcp`, `npx --no-install maz-ui-mcp`...): it starts in about a second, needs no download and follows your lockfile. Without it, `init` writes `npx -y @maz-ui/mcp@<version>`, pinned to its own version.
|
|
78
|
+
|
|
79
|
+
### By hand
|
|
80
|
+
|
|
81
|
+
The examples below use `npx -y @maz-ui/mcp@latest`, which works without installing anything. In a project, prefer the installed version (`pnpm exec maz-ui-mcp`) or a pinned version (`@maz-ui/mcp@5.1.0`): with a dist-tag, `npx` queries the registry at every start.
|
|
53
82
|
|
|
54
83
|
### Claude Code
|
|
55
84
|
|
|
@@ -158,6 +187,22 @@ const findings = reviewCode('<template><MazBtn color="red" /></template>', {
|
|
|
158
187
|
})
|
|
159
188
|
```
|
|
160
189
|
|
|
190
|
+
## Troubleshooting
|
|
191
|
+
|
|
192
|
+
### The server does not start: `connection timed out`
|
|
193
|
+
|
|
194
|
+
Claude Code waits 30 seconds for a MCP server to start. The first `npx -y @maz-ui/mcp@latest` downloads the package, and behind a slow or proxied registry (Nexus, Artifactory...) it can exceed this delay. Then:
|
|
195
|
+
|
|
196
|
+
- install `@maz-ui/mcp` in the project and run `init` again (see In a project: install it),
|
|
197
|
+
- or pin a version instead of `@latest`: `npx -y @maz-ui/mcp@5.1.0` only queries the registry on the first start,
|
|
198
|
+
- or raise the timeout of Claude Code: `MCP_TIMEOUT=60000 claude`.
|
|
199
|
+
|
|
200
|
+
Measure the start time of a command up to the `initialize` response:
|
|
201
|
+
|
|
202
|
+
```bash
|
|
203
|
+
time (echo '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"t","version":"1"}}}' | npx -y @maz-ui/mcp@latest | head -1)
|
|
204
|
+
```
|
|
205
|
+
|
|
161
206
|
## Debugging
|
|
162
207
|
|
|
163
208
|
```bash
|
|
@@ -41,8 +41,11 @@ The content comes from the `docs/agents` folder of the `maz-ui` package installe
|
|
|
41
41
|
Guarantees:
|
|
42
42
|
|
|
43
43
|
- A file it did not generate is never overwritten (it is reported as `skip`).
|
|
44
|
+
- Generated rules edited by hand are kept and no longer updated (`skip`): their header records a checksum of the content. A formatter that only changes the whitespace does not count as an edit. Delete the file (or the `AGENTS.md` section) to get the rules of a new version.
|
|
44
45
|
- In `AGENTS.md`, only the delimited section is managed: your content stays as is.
|
|
45
46
|
- MCP config files are edited in place, keeping their formatting and comments. When a server already runs `@maz-ui/mcp` under another name, nothing is added.
|
|
47
|
+
- An existing entry of the maz-ui MCP server only gets a better command (the installed `@maz-ui/mcp`, a newer pinned version) and keeps its other fields (`env`...). A command written by hand (with `--docs`, for example) is never changed.
|
|
48
|
+
- In a monorepo, rules written by a newer maz-ui and a newer pinned `@maz-ui/mcp` are never downgraded by an app with an older version. Files are written atomically: apps started together never read a half-written file.
|
|
46
49
|
- Without `CLAUDE.md` in the project, Claude Code reads `AGENTS.md`: the Claude rule is then skipped to avoid loading the rules twice.
|
|
47
50
|
- Running it again is idempotent: unchanged files are reported as `unchanged`.
|
|
48
51
|
|
|
@@ -65,11 +68,79 @@ setupAgents({
|
|
|
65
68
|
remove: false,
|
|
66
69
|
// Folder of the maz-ui agent docs, default: node_modules/maz-ui/docs
|
|
67
70
|
docsDir: undefined,
|
|
68
|
-
//
|
|
69
|
-
|
|
71
|
+
// Version pinned in the npx command when the project does not install @maz-ui/mcp, default: latest
|
|
72
|
+
mcpVersion: '5.1.0',
|
|
73
|
+
// Command of the MCP server, default: mcpServerCommand(rootDir, mcpVersion, tool)
|
|
74
|
+
mcpServer: undefined,
|
|
75
|
+
// Tool whose agents are configured, default: MAZ_UI_AGENTS_TOOL
|
|
76
|
+
tool: undefined,
|
|
77
|
+
// Rules of the tool, required with another tool than maz-ui, default: the agent docs of docsDir
|
|
78
|
+
agentDocs: undefined,
|
|
70
79
|
})
|
|
71
80
|
```
|
|
72
81
|
|
|
82
|
+
## Use it for another tool
|
|
83
|
+
|
|
84
|
+
`setupAgents` configures maz-ui by default, but any package that ships an MCP server and rules for AI agents can reuse it with the `tool` option, and get the same guarantees. Its rules are passed with `agentDocs`, since they do not come from the maz-ui docs. For example, [relizy](https://relizy.dev) runs it in `relizy mcp init`:
|
|
85
|
+
|
|
86
|
+
```ts
|
|
87
|
+
import type { AgentsTool } from '@maz-ui/node'
|
|
88
|
+
import { setupAgents } from '@maz-ui/node'
|
|
89
|
+
|
|
90
|
+
const tool: AgentsTool = {
|
|
91
|
+
// Key of the MCP server, `.claude/rules/relizy.md` and markers of the generated content
|
|
92
|
+
name: 'relizy',
|
|
93
|
+
// Package that ships the MCP server, and the bin and arguments that start it
|
|
94
|
+
mcpPackage: 'relizy',
|
|
95
|
+
mcpBin: 'relizy',
|
|
96
|
+
mcpArgs: ['mcp'],
|
|
97
|
+
// Written in the header of the generated rules
|
|
98
|
+
generatedBy: '`relizy mcp init`',
|
|
99
|
+
// Line under the title of the rules, default: `> relizy <version> is installed: these rules match this version.`
|
|
100
|
+
versionNote: version => `> relizy ${version} is installed: these rules match this version.`,
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
setupAgents({
|
|
104
|
+
rootDir: process.cwd(),
|
|
105
|
+
tool,
|
|
106
|
+
agentDocs: {
|
|
107
|
+
directory: '/path/to/relizy/agent-docs',
|
|
108
|
+
version: '1.14.0',
|
|
109
|
+
claudeRule: '# relizy\n\n...',
|
|
110
|
+
agentsMdSection: '## relizy\n\n...',
|
|
111
|
+
},
|
|
112
|
+
mcpVersion: '1.14.0',
|
|
113
|
+
})
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
| Written for the tool | relizy | maz-ui (`MAZ_UI_AGENTS_TOOL`) |
|
|
117
|
+
| --- | --- | --- |
|
|
118
|
+
| Claude Code rule | `.claude/rules/relizy.md` | `.claude/rules/maz-ui.md` |
|
|
119
|
+
| `AGENTS.md` section | `<!-- BEGIN:relizy -->` ... `<!-- END:relizy -->` | `<!-- BEGIN:maz-ui -->` ... `<!-- END:maz-ui -->` |
|
|
120
|
+
| MCP server entry | `relizy` | `maz-ui` |
|
|
121
|
+
| Command, package installed with pnpm | `pnpm exec relizy mcp` | `pnpm exec maz-ui-mcp` |
|
|
122
|
+
| Command, package not installed | `npx -y relizy@<mcpVersion> mcp` | `npx -y @maz-ui/mcp@<mcpVersion>` |
|
|
123
|
+
|
|
124
|
+
Each tool only manages its own files, section and server entry: maz-ui and relizy can be set up in the same project, and removing one (`remove: true` with its `tool`) keeps the other. `mcpServerCommand`, `installsMcpPackage`, `readManagedVersion` and `isEditedManagedContent` also take the tool as last argument.
|
|
125
|
+
|
|
126
|
+
## Command of the MCP server
|
|
127
|
+
|
|
128
|
+
```ts
|
|
129
|
+
import { mcpServerCommand } from '@maz-ui/node'
|
|
130
|
+
|
|
131
|
+
mcpServerCommand(process.cwd(), '5.1.0')
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
| Project | Command |
|
|
135
|
+
| --- | --- |
|
|
136
|
+
| Installs `@maz-ui/mcp` with pnpm | `pnpm exec maz-ui-mcp` |
|
|
137
|
+
| Installs `@maz-ui/mcp` with yarn | `yarn run maz-ui-mcp` |
|
|
138
|
+
| Installs `@maz-ui/mcp` with bun | `bun x --no-install maz-ui-mcp` |
|
|
139
|
+
| Installs `@maz-ui/mcp` with npm | `npx --no-install maz-ui-mcp` |
|
|
140
|
+
| Does not install it | `npx -y @maz-ui/mcp@<mcpVersion>` |
|
|
141
|
+
|
|
142
|
+
The package manager comes from the `packageManager` field of `package.json`, else from the lockfile. The installed version starts in about a second and follows the lockfile. A pinned version avoids the registry query that `npx` makes at every start with a dist-tag (`@latest`).
|
|
143
|
+
|
|
73
144
|
## Result
|
|
74
145
|
|
|
75
146
|
```ts
|
|
@@ -79,6 +150,8 @@ const result = setupAgents({ rootDir: process.cwd(), dryRun: true })
|
|
|
79
150
|
|
|
80
151
|
result.version // version of the installed maz-ui
|
|
81
152
|
result.targets // configured agents
|
|
153
|
+
result.mcpServer // { command, args } registered in the MCP configs
|
|
154
|
+
result.localMcpServer // false when the server runs through npx -y
|
|
82
155
|
result.changes // [{ file: '.mcp.json', action: 'create' | 'update' | 'remove' | 'unchanged' | 'skip', reason?: string }]
|
|
83
156
|
```
|
|
84
157
|
|
|
@@ -99,4 +172,4 @@ detectAgentTargets(process.cwd()) // ['claude', 'agents-md']
|
|
|
99
172
|
|
|
100
173
|
## Errors
|
|
101
174
|
|
|
102
|
-
`setupAgents` throws when the rules are requested and `maz-ui` is not installed in `rootDir` (or its parent folders), or when the installed version does not ship the agent docs: upgrade maz-ui to the latest version. With `rules: false`, only the MCP server is registered and the docs are not needed.
|
|
175
|
+
`setupAgents` throws when the rules are requested and `maz-ui` is not installed in `rootDir` (or its parent folders), or when the installed version does not ship the agent docs: upgrade maz-ui to the latest version. With another `tool`, it throws when the rules are requested without `agentDocs`. With `rules: false`, only the MCP server is registered and the docs are not needed.
|