@maz-ui/mcp 5.1.0 → 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.
Files changed (37) hide show
  1. package/README.md +9 -2
  2. package/dist/chunks/files.mjs +70 -0
  3. package/dist/chunks/index.mjs +28535 -0
  4. package/dist/chunks/prompt.mjs +280 -0
  5. package/dist/chunks/theme.mjs +14789 -0
  6. package/dist/cli.mjs +9 -11
  7. package/dist/index.d.mts +90 -5
  8. package/dist/index.d.ts +90 -5
  9. package/dist/index.mjs +13 -11
  10. package/dist/shared/mcp.Ccxm-Aoc.mjs +3312 -0
  11. package/dist/shared/mcp.D3_Fk0U3.mjs +34563 -0
  12. package/docs/agents/agents-md.md +32 -17
  13. package/docs/agents/claude-rule.md +32 -17
  14. package/docs/components/maz-alert.md +1 -1
  15. package/docs/components/maz-bottom-sheet.md +1 -1
  16. package/docs/components/maz-btn.md +3 -3
  17. package/docs/components/maz-card.md +1 -1
  18. package/docs/components/maz-container.md +2 -2
  19. package/docs/components/maz-dialog-confirm.md +2 -2
  20. package/docs/components/maz-dropdown.md +1 -1
  21. package/docs/components/maz-dropzone.md +1 -1
  22. package/docs/components/maz-icon.md +2 -2
  23. package/docs/components/maz-input.md +2 -2
  24. package/docs/components/maz-link.md +3 -3
  25. package/docs/components/maz-sidebar-menu-button.md +1 -1
  26. package/docs/components/maz-sidebar-menu-sub.md +1 -1
  27. package/docs/components/maz-sidebar.md +2 -2
  28. package/docs/composables/use-dialog.md +2 -1
  29. package/docs/ecosystem/icons/index.md +29 -26
  30. package/docs/ecosystem/mcp.md +47 -2
  31. package/docs/ecosystem/node/setup-agents.md +76 -3
  32. package/docs/guide/ai-agents.md +52 -18
  33. package/docs/manifest.json +1 -1
  34. package/docs/plugins/dialog.md +9 -5
  35. package/docs/rules.md +32 -17
  36. package/package.json +28 -12
  37. package/dist/shared/mcp.BFjMMLqy.mjs +0 -2973
package/README.md CHANGED
@@ -7,15 +7,18 @@ MCP server and CLI that give AI coding agents (Claude Code, Cursor, GitHub Copil
7
7
  At the root of a project that uses maz-ui:
8
8
 
9
9
  ```bash
10
+ pnpm add -D @maz-ui/mcp # optional, for a fast start of the server
10
11
  npx @maz-ui/mcp init
11
12
  ```
12
13
 
14
+ When the project installs `@maz-ui/mcp`, the MCP configs start the installed version through your package manager (`pnpm exec maz-ui-mcp`, `yarn run maz-ui-mcp`, `npx --no-install maz-ui-mcp`...), in about a second and at the version of your lockfile. Otherwise they run `npx -y @maz-ui/mcp@<version>`, pinned.
15
+
13
16
  It detects your agents and configures them without touching your own instructions:
14
17
 
15
18
  - Claude Code: `.claude/rules/maz-ui.md` (rules, always loaded) and `.mcp.json`
16
19
  - Cursor, Copilot, Codex, Windsurf...: a delimited `maz-ui` section in `AGENTS.md`, and `.cursor/mcp.json` / `.vscode/mcp.json`
17
20
 
18
- Options: `--targets claude,agents-md,cursor,vscode`, `--no-rules` (MCP server only), `--no-mcp`, `--dry-run`, `--remove`. With Nuxt, the `mazUi.agents` option of `@maz-ui/nuxt` registers the MCP server of the detected agents automatically in development.
21
+ Options: `--targets claude,agents-md,cursor,vscode`, `--no-rules` (MCP server only), `--no-mcp`, `--dry-run`, `--remove`. In a project without maz-ui (`@maz-ui/utils` or `@maz-ui/node` only), `init` only registers the MCP server, with the docs bundled in `@maz-ui/mcp`. With Nuxt, the `mazUi.agents` option of `@maz-ui/nuxt` registers the MCP server of the detected agents automatically in development.
19
22
 
20
23
  To use it without writing anything in your projects, register the server once for your user: `claude mcp add maz-ui --scope user -- npx -y @maz-ui/mcp@latest` (its instructions carry the maz-ui rules), or install the Claude Code plugin below.
21
24
 
@@ -36,7 +39,7 @@ Prompts: `build`, `audit`, `setup`. The server serves the docs shipped in the ma
36
39
 
37
40
  ## Manual configuration
38
41
 
39
- Start the server with `npx -y @maz-ui/mcp@latest`:
42
+ Start the server with the installed package (`pnpm exec maz-ui-mcp`), or with `npx -y @maz-ui/mcp@latest` without installing anything (prefer a pinned version in a project: with a dist-tag, npx queries the registry at every start):
40
43
 
41
44
  ```json
42
45
  {
@@ -59,6 +62,10 @@ Claude Code users can also install the plugin (skill, MCP server and review hook
59
62
  /plugin install maz-ui@maz-ui
60
63
  ```
61
64
 
65
+ ## Troubleshooting
66
+
67
+ `connection timed out after 30000ms` in Claude Code: the first `npx -y` download exceeded the start timeout, usually behind a slow registry. Install `@maz-ui/mcp` in the project and run `init` again, pin a version (`npx -y @maz-ui/mcp@5.1.0`), or raise the timeout: `MCP_TIMEOUT=60000 claude`.
68
+
62
69
  ## CLI
63
70
 
64
71
  ```bash
@@ -0,0 +1,70 @@
1
+ import { readFileSync, existsSync, statSync } from 'node:fs';
2
+ import { dirname, join, relative, isAbsolute, resolve } from 'node:path';
3
+ import { g as glob } from '../shared/mcp.Ccxm-Aoc.mjs';
4
+ import { filterBySeverity, reviewCode } from './index.mjs';
5
+ import 'fs';
6
+ import 'path';
7
+ import 'url';
8
+ import 'module';
9
+ import '../shared/mcp.D3_Fk0U3.mjs';
10
+ import 'node:buffer';
11
+ import 'node:util';
12
+ import 'node:child_process';
13
+ import 'node:process';
14
+ import 'tty';
15
+ import 'node:tty';
16
+ import 'node:crypto';
17
+ import 'node:url';
18
+
19
+ const REVIEWABLE_EXTENSIONS = ["vue", "ts", "tsx", "js", "jsx", "mjs", "mts", "css", "scss", "pcss", "postcss"];
20
+ const MAX_REVIEWED_FILES = 200;
21
+ function detectFramework(fromDirectory) {
22
+ let directory = fromDirectory;
23
+ for (; ; ) {
24
+ if (["nuxt.config.ts", "nuxt.config.js", "nuxt.config.mjs"].some((file) => existsSync(join(directory, file))))
25
+ return "nuxt";
26
+ if (existsSync(join(directory, "package.json")))
27
+ return "vue";
28
+ const parent = dirname(directory);
29
+ if (parent === directory)
30
+ return "vue";
31
+ directory = parent;
32
+ }
33
+ }
34
+ async function expandPaths(patterns, cwd) {
35
+ const files = /* @__PURE__ */ new Set();
36
+ const globs = [];
37
+ for (const pattern of patterns) {
38
+ const absolute = isAbsolute(pattern) ? pattern : resolve(cwd, pattern);
39
+ if (existsSync(absolute) && statSync(absolute).isFile())
40
+ files.add(absolute);
41
+ else if (existsSync(absolute) && statSync(absolute).isDirectory())
42
+ globs.push(`${relative(cwd, absolute) || "."}/**/*.{${REVIEWABLE_EXTENSIONS.join(",")}}`);
43
+ else
44
+ globs.push(pattern);
45
+ }
46
+ if (globs.length > 0) {
47
+ const matches = await glob(globs, { cwd, absolute: true, ignore: ["**/node_modules/**", "**/dist/**", "**/.nuxt/**", "**/.output/**", "**/coverage/**"] });
48
+ for (const match of matches) files.add(match);
49
+ }
50
+ return [...files].filter((file) => REVIEWABLE_EXTENSIONS.includes(file.split(".").pop() ?? "")).sort();
51
+ }
52
+ function displayPath(cwd, file) {
53
+ const path = relative(cwd, file);
54
+ return path && !path.startsWith("..") && !isAbsolute(path) ? path : file;
55
+ }
56
+ async function reviewFiles(patterns, { knowledge, cwd, framework, minSeverity = "info" }) {
57
+ const files = await expandPaths(patterns, cwd);
58
+ return {
59
+ truncated: files.length > MAX_REVIEWED_FILES,
60
+ reviews: files.slice(0, MAX_REVIEWED_FILES).map((file) => ({
61
+ file: displayPath(cwd, file),
62
+ findings: filterBySeverity(
63
+ reviewCode(readFileSync(file, "utf8"), { knowledge, filename: file, framework: framework ?? detectFramework(dirname(file)) }),
64
+ minSeverity
65
+ )
66
+ }))
67
+ };
68
+ }
69
+
70
+ export { MAX_REVIEWED_FILES, REVIEWABLE_EXTENSIONS, detectFramework, displayPath, expandPaths, reviewFiles };