@maz-ui/mcp 4.0.0-beta.26
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/LICENSE +21 -0
- package/README.md +264 -0
- package/bin/maz-ui-mcp.mjs +7 -0
- package/dist/mcp.d.mts +13 -0
- package/dist/mcp.d.ts +13 -0
- package/dist/mcp.mjs +586 -0
- package/docs/generated-docs/maz-accordion.doc.md +21 -0
- package/docs/generated-docs/maz-animated-counter.doc.md +17 -0
- package/docs/generated-docs/maz-animated-element.doc.md +14 -0
- package/docs/generated-docs/maz-animated-text.doc.md +14 -0
- package/docs/generated-docs/maz-avatar.doc.md +44 -0
- package/docs/generated-docs/maz-backdrop.doc.md +61 -0
- package/docs/generated-docs/maz-badge.doc.md +16 -0
- package/docs/generated-docs/maz-bottom-sheet.doc.md +21 -0
- package/docs/generated-docs/maz-btn.doc.md +30 -0
- package/docs/generated-docs/maz-card-spotlight.doc.md +16 -0
- package/docs/generated-docs/maz-card.doc.md +39 -0
- package/docs/generated-docs/maz-carousel.doc.md +16 -0
- package/docs/generated-docs/maz-chart.doc.md +10 -0
- package/docs/generated-docs/maz-checkbox.doc.md +34 -0
- package/docs/generated-docs/maz-checklist.doc.md +30 -0
- package/docs/generated-docs/maz-circular-progress-bar.doc.md +27 -0
- package/docs/generated-docs/maz-date-picker.doc.md +52 -0
- package/docs/generated-docs/maz-dialog-confirm.doc.md +24 -0
- package/docs/generated-docs/maz-dialog.doc.md +22 -0
- package/docs/generated-docs/maz-drawer.doc.md +26 -0
- package/docs/generated-docs/maz-dropdown.doc.md +42 -0
- package/docs/generated-docs/maz-dropzone.doc.md +82 -0
- package/docs/generated-docs/maz-expand-animation.doc.md +12 -0
- package/docs/generated-docs/maz-fullscreen-loader.doc.md +13 -0
- package/docs/generated-docs/maz-gallery.doc.md +17 -0
- package/docs/generated-docs/maz-icon.doc.md +18 -0
- package/docs/generated-docs/maz-input-code.doc.md +25 -0
- package/docs/generated-docs/maz-input-number.doc.md +31 -0
- package/docs/generated-docs/maz-input-phone-number.doc.md +56 -0
- package/docs/generated-docs/maz-input-price.doc.md +26 -0
- package/docs/generated-docs/maz-input-tags.doc.md +24 -0
- package/docs/generated-docs/maz-input.doc.md +54 -0
- package/docs/generated-docs/maz-lazy-img.doc.md +31 -0
- package/docs/generated-docs/maz-link.doc.md +31 -0
- package/docs/generated-docs/maz-loading-bar.doc.md +6 -0
- package/docs/generated-docs/maz-pagination.doc.md +22 -0
- package/docs/generated-docs/maz-popover.doc.md +70 -0
- package/docs/generated-docs/maz-pull-to-refresh.doc.md +31 -0
- package/docs/generated-docs/maz-radio-buttons.doc.md +33 -0
- package/docs/generated-docs/maz-radio.doc.md +33 -0
- package/docs/generated-docs/maz-reading-progress-bar.doc.md +18 -0
- package/docs/generated-docs/maz-select-country.doc.md +44 -0
- package/docs/generated-docs/maz-select.doc.md +65 -0
- package/docs/generated-docs/maz-slider.doc.md +20 -0
- package/docs/generated-docs/maz-spinner.doc.md +6 -0
- package/docs/generated-docs/maz-stepper.doc.md +29 -0
- package/docs/generated-docs/maz-switch.doc.md +31 -0
- package/docs/generated-docs/maz-table-cell.doc.md +5 -0
- package/docs/generated-docs/maz-table-row.doc.md +11 -0
- package/docs/generated-docs/maz-table-title.doc.md +5 -0
- package/docs/generated-docs/maz-table.doc.md +66 -0
- package/docs/generated-docs/maz-tabs-bar.doc.md +18 -0
- package/docs/generated-docs/maz-tabs-content-item.doc.md +11 -0
- package/docs/generated-docs/maz-tabs-content.doc.md +5 -0
- package/docs/generated-docs/maz-tabs.doc.md +17 -0
- package/docs/generated-docs/maz-textarea.doc.md +41 -0
- package/docs/src/components/index.md +8 -0
- package/docs/src/components/maz-accordion.md +80 -0
- package/docs/src/components/maz-animated-counter.md +124 -0
- package/docs/src/components/maz-animated-element.md +36 -0
- package/docs/src/components/maz-animated-text.md +36 -0
- package/docs/src/components/maz-avatar.md +179 -0
- package/docs/src/components/maz-backdrop.md +16 -0
- package/docs/src/components/maz-badge.md +222 -0
- package/docs/src/components/maz-bottom-sheet.md +398 -0
- package/docs/src/components/maz-btn.md +526 -0
- package/docs/src/components/maz-card-spotlight.md +163 -0
- package/docs/src/components/maz-card.md +447 -0
- package/docs/src/components/maz-carousel.md +127 -0
- package/docs/src/components/maz-chart.md +346 -0
- package/docs/src/components/maz-checkbox.md +168 -0
- package/docs/src/components/maz-checklist.md +414 -0
- package/docs/src/components/maz-circular-progress-bar.md +147 -0
- package/docs/src/components/maz-date-picker.md +1078 -0
- package/docs/src/components/maz-dialog-confirm.md +240 -0
- package/docs/src/components/maz-dialog.md +208 -0
- package/docs/src/components/maz-drawer.md +177 -0
- package/docs/src/components/maz-dropdown.md +650 -0
- package/docs/src/components/maz-dropzone.md +442 -0
- package/docs/src/components/maz-expand-animation.md +99 -0
- package/docs/src/components/maz-fullscreen-loader.md +58 -0
- package/docs/src/components/maz-gallery.md +85 -0
- package/docs/src/components/maz-icon.md +85 -0
- package/docs/src/components/maz-input-code.md +61 -0
- package/docs/src/components/maz-input-number.md +81 -0
- package/docs/src/components/maz-input-phone-number.md +867 -0
- package/docs/src/components/maz-input-price.md +58 -0
- package/docs/src/components/maz-input-tags.md +114 -0
- package/docs/src/components/maz-input.md +453 -0
- package/docs/src/components/maz-lazy-img.md +24 -0
- package/docs/src/components/maz-link.md +156 -0
- package/docs/src/components/maz-loading-bar.md +26 -0
- package/docs/src/components/maz-pagination.md +81 -0
- package/docs/src/components/maz-popover.md +1414 -0
- package/docs/src/components/maz-pull-to-refresh.md +49 -0
- package/docs/src/components/maz-radio-buttons.md +456 -0
- package/docs/src/components/maz-radio.md +141 -0
- package/docs/src/components/maz-reading-progress-bar.md +74 -0
- package/docs/src/components/maz-select-country.md +636 -0
- package/docs/src/components/maz-select.md +439 -0
- package/docs/src/components/maz-slider.md +191 -0
- package/docs/src/components/maz-spinner.md +93 -0
- package/docs/src/components/maz-stepper.md +418 -0
- package/docs/src/components/maz-switch.md +92 -0
- package/docs/src/components/maz-table.md +571 -0
- package/docs/src/components/maz-tabs.md +231 -0
- package/docs/src/components/maz-textarea.md +218 -0
- package/docs/src/composables/use-aos.md +34 -0
- package/docs/src/composables/use-breakpoints.md +35 -0
- package/docs/src/composables/use-dialog.md +88 -0
- package/docs/src/composables/use-display-names.md +174 -0
- package/docs/src/composables/use-form-validator.md +1149 -0
- package/docs/src/composables/use-idle-timeout.md +256 -0
- package/docs/src/composables/use-reading-time.md +168 -0
- package/docs/src/composables/use-string-matching.md +63 -0
- package/docs/src/composables/use-swipe.md +223 -0
- package/docs/src/composables/use-timer.md +130 -0
- package/docs/src/composables/use-toast.md +71 -0
- package/docs/src/composables/use-user-visibility.md +169 -0
- package/docs/src/composables/use-wait.md +62 -0
- package/docs/src/composables/use-window-size.md +18 -0
- package/docs/src/demo/DemoAuthPage.vue +178 -0
- package/docs/src/demo/DemoDashboardPage.vue +298 -0
- package/docs/src/demo/DemoProductPage.vue +135 -0
- package/docs/src/directives/click-outside.md +275 -0
- package/docs/src/directives/fullscreen-img.md +101 -0
- package/docs/src/directives/lazy-img.md +184 -0
- package/docs/src/directives/tooltip.md +458 -0
- package/docs/src/directives/zoom-img.md +127 -0
- package/docs/src/guide/cli.md +144 -0
- package/docs/src/guide/getting-started.md +284 -0
- package/docs/src/guide/icon-set.md +60 -0
- package/docs/src/guide/icons.md +481 -0
- package/docs/src/guide/mcp.md +210 -0
- package/docs/src/guide/migration-v4.md +898 -0
- package/docs/src/guide/nuxt.md +411 -0
- package/docs/src/guide/resolvers.md +697 -0
- package/docs/src/guide/themes.md +789 -0
- package/docs/src/guide/translations.md +1173 -0
- package/docs/src/guide/vue.md +243 -0
- package/docs/src/helpers/camel-case.md +14 -0
- package/docs/src/helpers/capitalize.md +51 -0
- package/docs/src/helpers/check-availability.md +14 -0
- package/docs/src/helpers/country-code-to-unicode-flag.md +213 -0
- package/docs/src/helpers/currency.md +67 -0
- package/docs/src/helpers/date.md +67 -0
- package/docs/src/helpers/debounce-callback.md +14 -0
- package/docs/src/helpers/debounce-id.md +14 -0
- package/docs/src/helpers/debounce.md +14 -0
- package/docs/src/helpers/get-country-flag-url.md +156 -0
- package/docs/src/helpers/is-client.md +14 -0
- package/docs/src/helpers/is-equal.md +14 -0
- package/docs/src/helpers/is-standalone-mode.md +14 -0
- package/docs/src/helpers/kebab-case.md +14 -0
- package/docs/src/helpers/normalize-string.md +14 -0
- package/docs/src/helpers/number.md +65 -0
- package/docs/src/helpers/pascal-case.md +14 -0
- package/docs/src/helpers/script-loader.md +14 -0
- package/docs/src/helpers/sleep.md +14 -0
- package/docs/src/helpers/snake-case.md +14 -0
- package/docs/src/helpers/throttle-id.md +14 -0
- package/docs/src/helpers/throttle.md +14 -0
- package/docs/src/index.md +555 -0
- package/docs/src/made-with-maz-ui.md +58 -0
- package/docs/src/plugins/aos.md +347 -0
- package/docs/src/plugins/dialog.md +411 -0
- package/docs/src/plugins/toast.md +349 -0
- package/docs/src/plugins/wait.md +109 -0
- package/package.json +84 -0
package/dist/mcp.mjs
ADDED
|
@@ -0,0 +1,586 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { getErrorMessage } from '@maz-ui/utils';
|
|
3
|
+
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
4
|
+
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
5
|
+
import { ListResourcesRequestSchema, ReadResourceRequestSchema, ListToolsRequestSchema, CallToolRequestSchema } from '@modelcontextprotocol/sdk/types.js';
|
|
6
|
+
import { existsSync, readFileSync, readdirSync } from 'node:fs';
|
|
7
|
+
import { resolve, join } from 'node:path';
|
|
8
|
+
|
|
9
|
+
const version = "4.0.0-beta.25";
|
|
10
|
+
|
|
11
|
+
class DocumentationService {
|
|
12
|
+
docsRoot;
|
|
13
|
+
componentsDir;
|
|
14
|
+
generatedDocsDir;
|
|
15
|
+
guidesDir;
|
|
16
|
+
composablesDir;
|
|
17
|
+
directivesDir;
|
|
18
|
+
pluginsDir;
|
|
19
|
+
helpersDir;
|
|
20
|
+
constructor() {
|
|
21
|
+
const localDocsRoot = resolve(process.cwd(), "docs/src");
|
|
22
|
+
const localGeneratedDocsDir = resolve(process.cwd(), "docs/generated-docs");
|
|
23
|
+
this.docsRoot = localDocsRoot;
|
|
24
|
+
this.generatedDocsDir = localGeneratedDocsDir;
|
|
25
|
+
this.componentsDir = join(this.docsRoot, "components");
|
|
26
|
+
this.guidesDir = join(this.docsRoot, "guide");
|
|
27
|
+
this.composablesDir = join(this.docsRoot, "composables");
|
|
28
|
+
this.directivesDir = join(this.docsRoot, "directives");
|
|
29
|
+
this.pluginsDir = join(this.docsRoot, "plugins");
|
|
30
|
+
this.helpersDir = join(this.docsRoot, "helpers");
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Convert un nom de composant PascalCase vers kebab-case
|
|
34
|
+
* MazBtn -> maz-btn
|
|
35
|
+
*/
|
|
36
|
+
pascalToKebabCase(pascalName) {
|
|
37
|
+
return pascalName.replace(/([A-Z])/g, "-$1").toLowerCase().replace(/^-/, "");
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Lit un fichier markdown et retourne son contenu ou une chaîne vide
|
|
41
|
+
*/
|
|
42
|
+
readMarkdownFile(filePath) {
|
|
43
|
+
try {
|
|
44
|
+
if (!existsSync(filePath)) {
|
|
45
|
+
return "";
|
|
46
|
+
}
|
|
47
|
+
return readFileSync(filePath, "utf-8");
|
|
48
|
+
} catch {
|
|
49
|
+
return "";
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Liste les fichiers markdown dans un répertoire
|
|
54
|
+
*/
|
|
55
|
+
listMarkdownFiles(dirPath) {
|
|
56
|
+
try {
|
|
57
|
+
if (!existsSync(dirPath)) {
|
|
58
|
+
return [];
|
|
59
|
+
}
|
|
60
|
+
const files = readdirSync(dirPath);
|
|
61
|
+
return files.filter((file) => file.endsWith(".md") && file !== "index.md").map((file) => file.replace(".md", "")).sort();
|
|
62
|
+
} catch {
|
|
63
|
+
return [];
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
// ========== COMPOSANTS ==========
|
|
67
|
+
/**
|
|
68
|
+
* Récupère la documentation complète d'un composant (manuelle + générée)
|
|
69
|
+
*/
|
|
70
|
+
getComponentDocumentation(componentName) {
|
|
71
|
+
const kebabName = componentName.startsWith("Maz") ? this.pascalToKebabCase(componentName) : componentName;
|
|
72
|
+
const manualDocPath = join(this.componentsDir, `${kebabName}.md`);
|
|
73
|
+
const generatedDocPath = join(this.generatedDocsDir, `${kebabName}.doc.md`);
|
|
74
|
+
const [manualDoc, generatedDoc] = [
|
|
75
|
+
this.readMarkdownFile(manualDocPath),
|
|
76
|
+
this.readMarkdownFile(generatedDocPath)
|
|
77
|
+
];
|
|
78
|
+
if (!manualDoc && !generatedDoc) {
|
|
79
|
+
return "";
|
|
80
|
+
}
|
|
81
|
+
let combinedDoc = "";
|
|
82
|
+
if (manualDoc) {
|
|
83
|
+
combinedDoc += `${manualDoc}
|
|
84
|
+
|
|
85
|
+
`;
|
|
86
|
+
}
|
|
87
|
+
if (generatedDoc) {
|
|
88
|
+
combinedDoc += `---
|
|
89
|
+
|
|
90
|
+
# API Reference
|
|
91
|
+
|
|
92
|
+
${generatedDoc}`;
|
|
93
|
+
}
|
|
94
|
+
return combinedDoc.trim();
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Liste tous les composants disponibles
|
|
98
|
+
*/
|
|
99
|
+
getAllComponents() {
|
|
100
|
+
const [manualFiles, generatedFiles] = [
|
|
101
|
+
this.listMarkdownFiles(this.componentsDir),
|
|
102
|
+
this.listMarkdownFiles(this.generatedDocsDir).map((file) => file.replace(".doc", ""))
|
|
103
|
+
];
|
|
104
|
+
const allComponents = /* @__PURE__ */ new Set([...manualFiles, ...generatedFiles]);
|
|
105
|
+
return Array.from(allComponents).sort();
|
|
106
|
+
}
|
|
107
|
+
// ========== GUIDES ==========
|
|
108
|
+
/**
|
|
109
|
+
* Récupère la documentation d'un guide
|
|
110
|
+
*/
|
|
111
|
+
getGuideDocumentation(guideName) {
|
|
112
|
+
const guidePath = join(this.guidesDir, `${guideName}.md`);
|
|
113
|
+
return this.readMarkdownFile(guidePath);
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Liste tous les guides disponibles
|
|
117
|
+
*/
|
|
118
|
+
getAllGuides() {
|
|
119
|
+
return this.listMarkdownFiles(this.guidesDir);
|
|
120
|
+
}
|
|
121
|
+
// ========== COMPOSABLES ==========
|
|
122
|
+
/**
|
|
123
|
+
* Récupère la documentation d'un composable
|
|
124
|
+
*/
|
|
125
|
+
getComposableDocumentation(composableName) {
|
|
126
|
+
const composablePath = join(this.composablesDir, `${composableName}.md`);
|
|
127
|
+
return this.readMarkdownFile(composablePath);
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Liste tous les composables disponibles
|
|
131
|
+
*/
|
|
132
|
+
getAllComposables() {
|
|
133
|
+
return this.listMarkdownFiles(this.composablesDir);
|
|
134
|
+
}
|
|
135
|
+
// ========== DIRECTIVES ==========
|
|
136
|
+
/**
|
|
137
|
+
* Récupère la documentation d'une directive
|
|
138
|
+
*/
|
|
139
|
+
getDirectiveDocumentation(directiveName) {
|
|
140
|
+
const directivePath = join(this.directivesDir, `${directiveName}.md`);
|
|
141
|
+
return this.readMarkdownFile(directivePath);
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Liste toutes les directives disponibles
|
|
145
|
+
*/
|
|
146
|
+
getAllDirectives() {
|
|
147
|
+
return this.listMarkdownFiles(this.directivesDir);
|
|
148
|
+
}
|
|
149
|
+
// ========== PLUGINS ==========
|
|
150
|
+
/**
|
|
151
|
+
* Récupère la documentation d'un plugin
|
|
152
|
+
*/
|
|
153
|
+
getPluginDocumentation(pluginName) {
|
|
154
|
+
const pluginPath = join(this.pluginsDir, `${pluginName}.md`);
|
|
155
|
+
return this.readMarkdownFile(pluginPath);
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Liste tous les plugins disponibles
|
|
159
|
+
*/
|
|
160
|
+
getAllPlugins() {
|
|
161
|
+
return this.listMarkdownFiles(this.pluginsDir);
|
|
162
|
+
}
|
|
163
|
+
// ========== HELPERS ==========
|
|
164
|
+
/**
|
|
165
|
+
* Récupère la documentation d'un helper
|
|
166
|
+
*/
|
|
167
|
+
getHelperDocumentation(helperName) {
|
|
168
|
+
const helperPath = join(this.helpersDir, `${helperName}.md`);
|
|
169
|
+
return this.readMarkdownFile(helperPath);
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Liste tous les helpers disponibles
|
|
173
|
+
*/
|
|
174
|
+
getAllHelpers() {
|
|
175
|
+
return this.listMarkdownFiles(this.helpersDir);
|
|
176
|
+
}
|
|
177
|
+
// ========== UTILITAIRES ==========
|
|
178
|
+
/**
|
|
179
|
+
* Récupère la vue d'ensemble de la librairie
|
|
180
|
+
*/
|
|
181
|
+
getOverview() {
|
|
182
|
+
const overviewPath = join(this.docsRoot, "index.md");
|
|
183
|
+
return this.readMarkdownFile(overviewPath);
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Recherche dans toute la documentation
|
|
187
|
+
*/
|
|
188
|
+
// eslint-disable-next-line sonarjs/cognitive-complexity
|
|
189
|
+
searchDocumentation(query) {
|
|
190
|
+
const searchTerm = query.toLowerCase();
|
|
191
|
+
const results = [];
|
|
192
|
+
const components = this.getAllComponents();
|
|
193
|
+
for (const component of components) {
|
|
194
|
+
if (component.toLowerCase().includes(searchTerm)) {
|
|
195
|
+
results.push(`component:${component}`);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
const guides = this.getAllGuides();
|
|
199
|
+
for (const guide of guides) {
|
|
200
|
+
if (guide.toLowerCase().includes(searchTerm)) {
|
|
201
|
+
results.push(`guide:${guide}`);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
const composables = this.getAllComposables();
|
|
205
|
+
for (const composable of composables) {
|
|
206
|
+
if (composable.toLowerCase().includes(searchTerm)) {
|
|
207
|
+
results.push(`composable:${composable}`);
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
const directives = this.getAllDirectives();
|
|
211
|
+
for (const directive of directives) {
|
|
212
|
+
if (directive.toLowerCase().includes(searchTerm)) {
|
|
213
|
+
results.push(`directive:${directive}`);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
const plugins = this.getAllPlugins();
|
|
217
|
+
for (const plugin of plugins) {
|
|
218
|
+
if (plugin.toLowerCase().includes(searchTerm)) {
|
|
219
|
+
results.push(`plugin:${plugin}`);
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
const helpers = this.getAllHelpers();
|
|
223
|
+
for (const helper of helpers) {
|
|
224
|
+
if (helper.toLowerCase().includes(searchTerm)) {
|
|
225
|
+
results.push(`helper:${helper}`);
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
return results;
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* Récupère les diagnostics détaillés pour debugging
|
|
232
|
+
*/
|
|
233
|
+
getDiagnostics() {
|
|
234
|
+
const [components, guides, composables, directives, plugins, helpers] = [
|
|
235
|
+
this.getAllComponents(),
|
|
236
|
+
this.getAllGuides(),
|
|
237
|
+
this.getAllComposables(),
|
|
238
|
+
this.getAllDirectives(),
|
|
239
|
+
this.getAllPlugins(),
|
|
240
|
+
this.getAllHelpers()
|
|
241
|
+
];
|
|
242
|
+
let withManualDoc = 0;
|
|
243
|
+
let withGeneratedDoc = 0;
|
|
244
|
+
let withBothDocs = 0;
|
|
245
|
+
for (const component of components) {
|
|
246
|
+
const manualExists = existsSync(join(this.componentsDir, `${component}.md`));
|
|
247
|
+
const generatedExists = existsSync(join(this.generatedDocsDir, `${component}.doc.md`));
|
|
248
|
+
if (manualExists)
|
|
249
|
+
withManualDoc++;
|
|
250
|
+
if (generatedExists)
|
|
251
|
+
withGeneratedDoc++;
|
|
252
|
+
if (manualExists && generatedExists)
|
|
253
|
+
withBothDocs++;
|
|
254
|
+
}
|
|
255
|
+
return {
|
|
256
|
+
components: {
|
|
257
|
+
total: components.length,
|
|
258
|
+
withManualDoc,
|
|
259
|
+
withGeneratedDoc,
|
|
260
|
+
withBothDocs
|
|
261
|
+
},
|
|
262
|
+
guides: {
|
|
263
|
+
total: guides.length,
|
|
264
|
+
list: guides
|
|
265
|
+
},
|
|
266
|
+
composables: {
|
|
267
|
+
total: composables.length,
|
|
268
|
+
list: composables
|
|
269
|
+
},
|
|
270
|
+
directives: {
|
|
271
|
+
total: directives.length,
|
|
272
|
+
list: directives
|
|
273
|
+
},
|
|
274
|
+
plugins: {
|
|
275
|
+
total: plugins.length,
|
|
276
|
+
list: plugins
|
|
277
|
+
},
|
|
278
|
+
helpers: {
|
|
279
|
+
total: helpers.length,
|
|
280
|
+
list: helpers
|
|
281
|
+
},
|
|
282
|
+
paths: {
|
|
283
|
+
docsRoot: this.docsRoot,
|
|
284
|
+
componentsDir: this.componentsDir,
|
|
285
|
+
generatedDocsDir: this.generatedDocsDir,
|
|
286
|
+
guidesDir: this.guidesDir,
|
|
287
|
+
composablesDir: this.composablesDir,
|
|
288
|
+
directivesDir: this.directivesDir,
|
|
289
|
+
pluginsDir: this.pluginsDir,
|
|
290
|
+
helpersDir: this.helpersDir
|
|
291
|
+
}
|
|
292
|
+
};
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
class MazUiMcpServer {
|
|
297
|
+
server;
|
|
298
|
+
documentationService = new DocumentationService();
|
|
299
|
+
constructor() {
|
|
300
|
+
this.server = new Server(
|
|
301
|
+
{
|
|
302
|
+
name: "maz-ui-mcp",
|
|
303
|
+
version
|
|
304
|
+
},
|
|
305
|
+
{
|
|
306
|
+
capabilities: {
|
|
307
|
+
resources: {},
|
|
308
|
+
tools: {}
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
);
|
|
312
|
+
this.setupHandlers();
|
|
313
|
+
}
|
|
314
|
+
setupHandlers() {
|
|
315
|
+
this.server.setRequestHandler(ListResourcesRequestSchema, () => {
|
|
316
|
+
const [components, guides, composables, directives, plugins, helpers] = [
|
|
317
|
+
this.documentationService.getAllComponents(),
|
|
318
|
+
this.documentationService.getAllGuides(),
|
|
319
|
+
this.documentationService.getAllComposables(),
|
|
320
|
+
this.documentationService.getAllDirectives(),
|
|
321
|
+
this.documentationService.getAllPlugins(),
|
|
322
|
+
this.documentationService.getAllHelpers()
|
|
323
|
+
];
|
|
324
|
+
const resources = [];
|
|
325
|
+
resources.push({
|
|
326
|
+
uri: "maz-ui://overview",
|
|
327
|
+
name: "Maz-UI Library Overview",
|
|
328
|
+
description: "Complete overview of the Maz-UI component library",
|
|
329
|
+
mimeType: "text/markdown"
|
|
330
|
+
});
|
|
331
|
+
for (const component of components) {
|
|
332
|
+
const pascalName = component.split("-").map(
|
|
333
|
+
(part) => part.charAt(0).toUpperCase() + part.slice(1)
|
|
334
|
+
).join("");
|
|
335
|
+
resources.push({
|
|
336
|
+
uri: `maz-ui://component/${pascalName}`,
|
|
337
|
+
name: `${pascalName} Component`,
|
|
338
|
+
description: `Documentation for the ${pascalName} Vue component`,
|
|
339
|
+
mimeType: "text/markdown"
|
|
340
|
+
});
|
|
341
|
+
}
|
|
342
|
+
for (const guide of guides) {
|
|
343
|
+
resources.push({
|
|
344
|
+
uri: `maz-ui://guide/${guide}`,
|
|
345
|
+
name: `Guide: ${guide}`,
|
|
346
|
+
description: `Guide for ${guide}`,
|
|
347
|
+
mimeType: "text/markdown"
|
|
348
|
+
});
|
|
349
|
+
}
|
|
350
|
+
for (const composable of composables) {
|
|
351
|
+
resources.push({
|
|
352
|
+
uri: `maz-ui://composable/${composable}`,
|
|
353
|
+
name: `Composable: ${composable}`,
|
|
354
|
+
description: `Documentation for ${composable} Vue composable`,
|
|
355
|
+
mimeType: "text/markdown"
|
|
356
|
+
});
|
|
357
|
+
}
|
|
358
|
+
for (const directive of directives) {
|
|
359
|
+
resources.push({
|
|
360
|
+
uri: `maz-ui://directive/${directive}`,
|
|
361
|
+
name: `Directive: ${directive}`,
|
|
362
|
+
description: `Documentation for ${directive} Vue directive`,
|
|
363
|
+
mimeType: "text/markdown"
|
|
364
|
+
});
|
|
365
|
+
}
|
|
366
|
+
for (const plugin of plugins) {
|
|
367
|
+
resources.push({
|
|
368
|
+
uri: `maz-ui://plugin/${plugin}`,
|
|
369
|
+
name: `Plugin: ${plugin}`,
|
|
370
|
+
description: `Documentation for ${plugin} Vue plugin`,
|
|
371
|
+
mimeType: "text/markdown"
|
|
372
|
+
});
|
|
373
|
+
}
|
|
374
|
+
for (const helper of helpers) {
|
|
375
|
+
resources.push({
|
|
376
|
+
uri: `maz-ui://helper/${helper}`,
|
|
377
|
+
name: `Helper: ${helper}`,
|
|
378
|
+
description: `Documentation for ${helper} utility function`,
|
|
379
|
+
mimeType: "text/markdown"
|
|
380
|
+
});
|
|
381
|
+
}
|
|
382
|
+
return { resources };
|
|
383
|
+
});
|
|
384
|
+
this.server.setRequestHandler(ReadResourceRequestSchema, (request) => {
|
|
385
|
+
const { uri } = request.params;
|
|
386
|
+
if (!uri || !uri.startsWith("maz-ui://")) {
|
|
387
|
+
throw new Error("Invalid URI");
|
|
388
|
+
}
|
|
389
|
+
const path = uri.replace("maz-ui://", "");
|
|
390
|
+
const [type, name] = path.split("/");
|
|
391
|
+
let content = "";
|
|
392
|
+
switch (type) {
|
|
393
|
+
case "overview":
|
|
394
|
+
content = this.documentationService.getOverview();
|
|
395
|
+
break;
|
|
396
|
+
case "component":
|
|
397
|
+
content = this.documentationService.getComponentDocumentation(name);
|
|
398
|
+
break;
|
|
399
|
+
case "guide":
|
|
400
|
+
content = this.documentationService.getGuideDocumentation(name);
|
|
401
|
+
break;
|
|
402
|
+
case "composable":
|
|
403
|
+
content = this.documentationService.getComposableDocumentation(name);
|
|
404
|
+
break;
|
|
405
|
+
case "directive":
|
|
406
|
+
content = this.documentationService.getDirectiveDocumentation(name);
|
|
407
|
+
break;
|
|
408
|
+
case "plugin":
|
|
409
|
+
content = this.documentationService.getPluginDocumentation(name);
|
|
410
|
+
break;
|
|
411
|
+
case "helper":
|
|
412
|
+
content = this.documentationService.getHelperDocumentation(name);
|
|
413
|
+
break;
|
|
414
|
+
default:
|
|
415
|
+
throw new Error(`Unknown resource type: ${type}`);
|
|
416
|
+
}
|
|
417
|
+
if (!content) {
|
|
418
|
+
throw new Error("Resource not found");
|
|
419
|
+
}
|
|
420
|
+
return {
|
|
421
|
+
contents: [{
|
|
422
|
+
uri,
|
|
423
|
+
mimeType: "text/markdown",
|
|
424
|
+
text: content
|
|
425
|
+
}]
|
|
426
|
+
};
|
|
427
|
+
});
|
|
428
|
+
this.server.setRequestHandler(ListToolsRequestSchema, () => {
|
|
429
|
+
return {
|
|
430
|
+
tools: [
|
|
431
|
+
{
|
|
432
|
+
name: "list_all_components",
|
|
433
|
+
description: "Get complete list of all available Vue components",
|
|
434
|
+
inputSchema: {
|
|
435
|
+
type: "object",
|
|
436
|
+
properties: {}
|
|
437
|
+
}
|
|
438
|
+
},
|
|
439
|
+
{
|
|
440
|
+
name: "list_guides",
|
|
441
|
+
description: "List all documentation guides (installation, setup, etc.)",
|
|
442
|
+
inputSchema: {
|
|
443
|
+
type: "object",
|
|
444
|
+
properties: {}
|
|
445
|
+
}
|
|
446
|
+
},
|
|
447
|
+
{
|
|
448
|
+
name: "get_getting_started",
|
|
449
|
+
description: "Get installation and setup guide for Maz-UI",
|
|
450
|
+
inputSchema: {
|
|
451
|
+
type: "object",
|
|
452
|
+
properties: {}
|
|
453
|
+
}
|
|
454
|
+
},
|
|
455
|
+
{
|
|
456
|
+
name: "list_composables",
|
|
457
|
+
description: "List all Vue 3 composables (useToast, useDialog, etc.)",
|
|
458
|
+
inputSchema: {
|
|
459
|
+
type: "object",
|
|
460
|
+
properties: {}
|
|
461
|
+
}
|
|
462
|
+
},
|
|
463
|
+
{
|
|
464
|
+
name: "list_directives",
|
|
465
|
+
description: "List all Vue directives (v-tooltip, v-click-outside, etc.)",
|
|
466
|
+
inputSchema: {
|
|
467
|
+
type: "object",
|
|
468
|
+
properties: {}
|
|
469
|
+
}
|
|
470
|
+
},
|
|
471
|
+
{
|
|
472
|
+
name: "list_plugins",
|
|
473
|
+
description: "List all Vue plugins (Toast, Dialog, AOS, Wait)",
|
|
474
|
+
inputSchema: {
|
|
475
|
+
type: "object",
|
|
476
|
+
properties: {}
|
|
477
|
+
}
|
|
478
|
+
},
|
|
479
|
+
{
|
|
480
|
+
name: "list_helpers",
|
|
481
|
+
description: "List all utility functions (string, date, number formatting)",
|
|
482
|
+
inputSchema: {
|
|
483
|
+
type: "object",
|
|
484
|
+
properties: {}
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
]
|
|
488
|
+
};
|
|
489
|
+
});
|
|
490
|
+
this.server.setRequestHandler(CallToolRequestSchema, (request) => {
|
|
491
|
+
const { name } = request.params;
|
|
492
|
+
switch (name) {
|
|
493
|
+
case "list_all_components": {
|
|
494
|
+
const components = this.documentationService.getAllComponents();
|
|
495
|
+
return {
|
|
496
|
+
content: [{
|
|
497
|
+
type: "text",
|
|
498
|
+
text: `Available components (${components.length}):
|
|
499
|
+
|
|
500
|
+
${components.map((c) => `- ${c}`).join("\n")}`
|
|
501
|
+
}]
|
|
502
|
+
};
|
|
503
|
+
}
|
|
504
|
+
case "list_guides": {
|
|
505
|
+
const guides = this.documentationService.getAllGuides();
|
|
506
|
+
return {
|
|
507
|
+
content: [{
|
|
508
|
+
type: "text",
|
|
509
|
+
text: `Available guides (${guides.length}):
|
|
510
|
+
|
|
511
|
+
${guides.map((g) => `- ${g}`).join("\n")}`
|
|
512
|
+
}]
|
|
513
|
+
};
|
|
514
|
+
}
|
|
515
|
+
case "get_getting_started": {
|
|
516
|
+
const guide = this.documentationService.getGuideDocumentation("getting-started");
|
|
517
|
+
return {
|
|
518
|
+
content: [{
|
|
519
|
+
type: "text",
|
|
520
|
+
text: guide || "Getting started guide not found"
|
|
521
|
+
}]
|
|
522
|
+
};
|
|
523
|
+
}
|
|
524
|
+
case "list_composables": {
|
|
525
|
+
const composables = this.documentationService.getAllComposables();
|
|
526
|
+
return {
|
|
527
|
+
content: [{
|
|
528
|
+
type: "text",
|
|
529
|
+
text: `Available composables (${composables.length}):
|
|
530
|
+
|
|
531
|
+
${composables.map((c) => `- ${c}`).join("\n")}`
|
|
532
|
+
}]
|
|
533
|
+
};
|
|
534
|
+
}
|
|
535
|
+
case "list_directives": {
|
|
536
|
+
const directives = this.documentationService.getAllDirectives();
|
|
537
|
+
return {
|
|
538
|
+
content: [{
|
|
539
|
+
type: "text",
|
|
540
|
+
text: `Available directives (${directives.length}):
|
|
541
|
+
|
|
542
|
+
${directives.map((d) => `- ${d}`).join("\n")}`
|
|
543
|
+
}]
|
|
544
|
+
};
|
|
545
|
+
}
|
|
546
|
+
case "list_plugins": {
|
|
547
|
+
const plugins = this.documentationService.getAllPlugins();
|
|
548
|
+
return {
|
|
549
|
+
content: [{
|
|
550
|
+
type: "text",
|
|
551
|
+
text: `Available plugins (${plugins.length}):
|
|
552
|
+
|
|
553
|
+
${plugins.map((p) => `- ${p}`).join("\n")}`
|
|
554
|
+
}]
|
|
555
|
+
};
|
|
556
|
+
}
|
|
557
|
+
case "list_helpers": {
|
|
558
|
+
const helpers = this.documentationService.getAllHelpers();
|
|
559
|
+
return {
|
|
560
|
+
content: [{
|
|
561
|
+
type: "text",
|
|
562
|
+
text: `Available helpers (${helpers.length}):
|
|
563
|
+
|
|
564
|
+
${helpers.map((h) => `- ${h}`).join("\n")}`
|
|
565
|
+
}]
|
|
566
|
+
};
|
|
567
|
+
}
|
|
568
|
+
default:
|
|
569
|
+
throw new Error(`Unknown tool: ${name}`);
|
|
570
|
+
}
|
|
571
|
+
});
|
|
572
|
+
}
|
|
573
|
+
async run() {
|
|
574
|
+
const transport = new StdioServerTransport();
|
|
575
|
+
await this.server.connect(transport);
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
if (import.meta.url === `file://${process.argv[1]}`) {
|
|
579
|
+
const server = new MazUiMcpServer();
|
|
580
|
+
server.run().catch((error) => {
|
|
581
|
+
console.error("Failed to start MCP server:", getErrorMessage(error));
|
|
582
|
+
process.exit(1);
|
|
583
|
+
});
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
export { MazUiMcpServer };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
## Props
|
|
2
|
+
|
|
3
|
+
| Name | Description | Type | Required | Default |
|
|
4
|
+
| ----------------- | ----------- | --------- | -------- | ----------- |
|
|
5
|
+
| **id** | | `string` | No | `undefined` |
|
|
6
|
+
| **model-value** | | `number` | No | `0` |
|
|
7
|
+
| **content-class** | | `unknown` | No | `undefined` |
|
|
8
|
+
|
|
9
|
+
## Events
|
|
10
|
+
|
|
11
|
+
| Event name | Properties | Description |
|
|
12
|
+
| ------------------ | ---------- | ----------- |
|
|
13
|
+
| update:model-value | |
|
|
14
|
+
|
|
15
|
+
## Slots
|
|
16
|
+
|
|
17
|
+
| Name | Description | Bindings |
|
|
18
|
+
| ----------------- | ----------- | -------- |
|
|
19
|
+
| `title-${step}` | | <br/> |
|
|
20
|
+
| content | | |
|
|
21
|
+
| `content-${step}` | | <br/> |
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
## Props
|
|
2
|
+
|
|
3
|
+
| Name | Description | Type | Required | Default |
|
|
4
|
+
| ------------ | ------------------------------------------------- | --------- | -------- | ----------- |
|
|
5
|
+
| **count** | The number to animate | `number` | Yes | `undefined` |
|
|
6
|
+
| **duration** | Duration of the animation in milliseconds | `number` | No | `1000` |
|
|
7
|
+
| **prefix** | Suffix to display next to the number | `string` | No | `undefined` |
|
|
8
|
+
| **suffix** | Suffix to display next to the number | `string` | No | `undefined` |
|
|
9
|
+
| **delay** | Delay before the animation starts in milliseconds | `number` | No | `100` |
|
|
10
|
+
| **once** | Play the animation only once | `boolean` | No | `true` |
|
|
11
|
+
|
|
12
|
+
## Slots
|
|
13
|
+
|
|
14
|
+
| Name | Description | Bindings |
|
|
15
|
+
| ------ | ----------- | -------- |
|
|
16
|
+
| prefix | | |
|
|
17
|
+
| suffix | | |
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
## Props
|
|
2
|
+
|
|
3
|
+
| Name | Description | Type | Required | Default | Possible values |
|
|
4
|
+
| ------------- | ------------------------------ | ------------------------------------- | -------- | ------- | ----------------------------- |
|
|
5
|
+
| **direction** | The direction of the animation | `"up" \| "down" \| "left" \| "right"` | No | `up` | `up", "down", "left", "right` |
|
|
6
|
+
| **delay** | The delay of the animation | `number` | No | `0` | - |
|
|
7
|
+
| **duration** | The duration of the animation | `number` | No | `2000` | - |
|
|
8
|
+
| **once** | Play the animation only once | `boolean` | No | `true` | - |
|
|
9
|
+
|
|
10
|
+
## Slots
|
|
11
|
+
|
|
12
|
+
| Name | Description | Bindings |
|
|
13
|
+
| ------- | ----------- | -------- |
|
|
14
|
+
| default | | |
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
## Props
|
|
2
|
+
|
|
3
|
+
| Name | Description | Type | Required | Default | Possible values |
|
|
4
|
+
| -------------- | ------------------------------------------------------------- | ------------------------------------- | -------- | ----------- | ----------------------------- |
|
|
5
|
+
| **text** | The text to animate<br/>**Example:** `"Hello"` | `string` | Yes | `undefined` | - |
|
|
6
|
+
| **last-word** | The last word(s) to be highlighted<br/>**Example:** `"world"` | `string` | No | `undefined` | - |
|
|
7
|
+
| **delay** | The delay of the animation | `number` | No | `0` | - |
|
|
8
|
+
| **direction** | The direction of the animation | `"up" \| "down" \| "left" \| "right"` | No | `up` | `up", "down", "left", "right` |
|
|
9
|
+
| **tag** | The tag to use for the text | `string` | No | `span` | - |
|
|
10
|
+
| **word-delay** | The delay between each word | `number` | No | `75` | - |
|
|
11
|
+
| **column-gap** | The column gap between each word | `number` | No | `0.5` | - |
|
|
12
|
+
| **row-gap** | The row gap between each word | `number` | No | `0` | - |
|
|
13
|
+
| **duration** | The duration of the animation | `number` | No | `2000` | - |
|
|
14
|
+
| **once** | Play the animation only once | `boolean` | No | `true` | - |
|