mozaic-mcp-server 2.1.0 → 2.2.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 (34) hide show
  1. package/README.md +11 -7
  2. package/SKILLS.md +53 -5
  3. package/bin/install-skills.js +1 -0
  4. package/data/mozaic.db +0 -0
  5. package/dist/__tests__/tools.integration.test.js +85 -0
  6. package/dist/__tests__/tools.integration.test.js.map +1 -1
  7. package/dist/index.js +55 -0
  8. package/dist/index.js.map +1 -1
  9. package/dist/parsers/web-components-parser.d.ts +3 -0
  10. package/dist/parsers/web-components-parser.d.ts.map +1 -0
  11. package/dist/parsers/web-components-parser.js +491 -0
  12. package/dist/parsers/web-components-parser.js.map +1 -0
  13. package/dist/tools/generate-webcomponent.d.ts +38 -0
  14. package/dist/tools/generate-webcomponent.d.ts.map +1 -0
  15. package/dist/tools/generate-webcomponent.js +83 -0
  16. package/dist/tools/generate-webcomponent.js.map +1 -0
  17. package/dist/tools/get-component-info.d.ts +1 -1
  18. package/dist/tools/get-component-info.d.ts.map +1 -1
  19. package/dist/tools/get-component-info.js +5 -1
  20. package/dist/tools/get-component-info.js.map +1 -1
  21. package/dist/tools/get-webcomponent-info.d.ts +52 -0
  22. package/dist/tools/get-webcomponent-info.d.ts.map +1 -0
  23. package/dist/tools/get-webcomponent-info.js +170 -0
  24. package/dist/tools/get-webcomponent-info.js.map +1 -0
  25. package/dist/tools/list-webcomponents.d.ts +32 -0
  26. package/dist/tools/list-webcomponents.d.ts.map +1 -0
  27. package/dist/tools/list-webcomponents.js +110 -0
  28. package/dist/tools/list-webcomponents.js.map +1 -0
  29. package/package.json +1 -1
  30. package/skills/mozaic-webcomponents-builder/scripts/generate-component.sh +67 -0
  31. package/skills/mozaic-webcomponents-builder/scripts/get-component.sh +105 -0
  32. package/skills/mozaic-webcomponents-builder/scripts/list-components.sh +42 -0
  33. package/skills/mozaic-webcomponents-builder/scripts/search-components.sh +34 -0
  34. package/skills/mozaic-webcomponents-builder/skill.md +292 -0
@@ -62,6 +62,10 @@ function generateBasicExample(componentName, framework) {
62
62
  return `<${tag}>Content</${tag}>`;
63
63
  case "react":
64
64
  return `<${tag}>Content</${tag}>`;
65
+ case "webcomponents": {
66
+ const tagName = componentName.replace(/^M/, "").toLowerCase();
67
+ return `<mozaic-${tagName}>Content</mozaic-${tagName}>`;
68
+ }
65
69
  case "html": {
66
70
  const cssClass = `mc-${componentName.replace(/^M/, "").toLowerCase()}`;
67
71
  return `<div class="${cssClass}">Content</div>`;
@@ -83,7 +87,7 @@ export const getComponentInfoTool = {
83
87
  },
84
88
  framework: {
85
89
  type: "string",
86
- enum: ["vue", "react", "html"],
90
+ enum: ["vue", "react", "html", "webcomponents"],
87
91
  default: "vue",
88
92
  description: "Framework for code examples",
89
93
  },
@@ -1 +1 @@
1
- {"version":3,"file":"get-component-info.js","sourceRoot":"","sources":["../../src/tools/get-component-info.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AA4BtD,MAAM,UAAU,sBAAsB,CACpC,EAAqB,EACrB,KAA4B;IAE5B,MAAM,EAAE,SAAS,EAAE,SAAS,GAAG,KAAK,EAAE,GAAG,KAAK,CAAC;IAE/C,mEAAmE;IACnE,MAAM,IAAI,GAAG,SAAS,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;IAExD,MAAM,aAAa,GAAG,kBAAkB,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;IAEnD,IAAI,CAAC,aAAa,EAAE,CAAC;QACnB,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,wBAAwB,SAAS,mEAAmE;iBAC3G;aACF;SACF,CAAC;IACJ,CAAC;IAED,+BAA+B;IAC/B,MAAM,gBAAgB,GAAG,CAAC,aAAa,CAAC,QAAQ,IAAI,EAAE,CAAC;SACpD,MAAM,CAAC,CAAC,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a,GAAG,GAAG,CAAC;QACpC,KAAK,OAAO;YACV,OAAO,IAAI,GAAG,aAAa,GAAG,GAAG,CAAC;QACpC,KAAK,eAAe,CAAC,CAAC,CAAC;YACrB,MAAM,OAAO,GAAG,aAAa,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;YAC9D,OAAO,WAAW,OAAO,oBAAoB,OAAO,GAAG,CAAC;QAC1D,CAAC;QACD,KAAK,MAAM,CAAC,CAAC,CAAC;YACZ,MAAM,QAAQ,GAAG,MAAM,aAAa,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC;YACvE,OAAO,eAAe,QAAQ,iBAAiB,CAAC;QAClD,CAAC;QACD;YACE,OAAO,IAAI,CAAC;IAChB,CAAC;AACH,CAAC;AAED,0BAA0B;AAC1B,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,IAAI,EAAE,oBAAoB;IAC1B,WAAW,EACT,oMAAoM;IACtM,WAAW,EAAE;QACX,IAAI,EAAE,QAAiB;QACvB,UAAU,EAAE;YACV,SAAS,EAAE;gBACT,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,kEAAkE;aAChF;YACD,SAAS,EAAE;gBACT,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,eAAe,CAAC;gBAC/C,OAAO,EAAE,KAAK;gBACd,WAAW,EAAE,6BAA6B;aAC3C;SACF;QACD,QAAQ,EAAE,CAAC,WAAW,CAAC;KACxB;CACF,CAAC"}
@@ -0,0 +1,52 @@
1
+ import type Database from "better-sqlite3";
2
+ export interface GetWebComponentInfoInput {
3
+ component: string;
4
+ }
5
+ export interface WebComponentInfoOutput {
6
+ name: string;
7
+ tagName: string;
8
+ description?: string;
9
+ attributes: Array<{
10
+ name: string;
11
+ type?: string;
12
+ default?: string;
13
+ required: boolean;
14
+ options?: string[];
15
+ description?: string;
16
+ }>;
17
+ slots: Array<{
18
+ name: string;
19
+ description?: string;
20
+ }>;
21
+ events: Array<{
22
+ name: string;
23
+ payload?: string;
24
+ description?: string;
25
+ }>;
26
+ cssProperties: string[];
27
+ examples: Array<{
28
+ title?: string;
29
+ code: string;
30
+ }>;
31
+ }
32
+ export declare function handleGetWebComponentInfo(db: Database.Database, input: GetWebComponentInfoInput): {
33
+ content: Array<{
34
+ type: "text";
35
+ text: string;
36
+ }>;
37
+ };
38
+ export declare const getWebComponentInfoTool: {
39
+ name: string;
40
+ description: string;
41
+ inputSchema: {
42
+ type: "object";
43
+ properties: {
44
+ component: {
45
+ type: string;
46
+ description: string;
47
+ };
48
+ };
49
+ required: string[];
50
+ };
51
+ };
52
+ //# sourceMappingURL=get-webcomponent-info.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-webcomponent-info.d.ts","sourceRoot":"","sources":["../../src/tools/get-webcomponent-info.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAG3C,MAAM,WAAW,wBAAwB;IACvC,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,KAAK,CAAC;QAChB,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,QAAQ,EAAE,OAAO,CAAC;QAClB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;QACnB,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB,CAAC,CAAC;IACH,KAAK,EAAE,KAAK,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB,CAAC,CAAC;IACH,MAAM,EAAE,KAAK,CAAC;QACZ,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB,CAAC,CAAC;IACH,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,QAAQ,EAAE,KAAK,CAAC;QACd,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,IAAI,EAAE,MAAM,CAAC;KACd,CAAC,CAAC;CACJ;AAED,wBAAgB,yBAAyB,CACvC,EAAE,EAAE,QAAQ,CAAC,QAAQ,EACrB,KAAK,EAAE,wBAAwB,GAC9B;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAAE,CA8JpD;AAQD,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;CAenC,CAAC"}
@@ -0,0 +1,170 @@
1
+ import { getComponentBySlug } from "../db/queries.js";
2
+ export function handleGetWebComponentInfo(db, input) {
3
+ const { component } = input;
4
+ // Normalize component name to slug (kebab-case)
5
+ const slug = component.toLowerCase().replace(/^mozaic-/, "");
6
+ const componentData = getComponentBySlug(db, slug);
7
+ if (!componentData) {
8
+ return {
9
+ content: [
10
+ {
11
+ type: "text",
12
+ text: `Web Component not found: ${component}. Try using the list_webcomponents tool to see available components.`,
13
+ },
14
+ ],
15
+ };
16
+ }
17
+ // Check if component supports webcomponents framework
18
+ const frameworks = componentData.frameworks || [];
19
+ if (!frameworks.includes("webcomponents")) {
20
+ return {
21
+ content: [
22
+ {
23
+ type: "text",
24
+ text: `Component "${component}" is not available as a web component. Available frameworks: ${frameworks.join(", ")}`,
25
+ },
26
+ ],
27
+ };
28
+ }
29
+ // Filter examples for webcomponents
30
+ const filteredExamples = (componentData.examples || [])
31
+ .filter((ex) => ex.framework === "webcomponents")
32
+ .map((ex) => ({
33
+ title: ex.title,
34
+ code: ex.code,
35
+ }));
36
+ // Build output
37
+ const output = {
38
+ name: componentData.name,
39
+ tagName: componentData.slug,
40
+ description: componentData.description,
41
+ attributes: (componentData.props || []).map((p) => ({
42
+ name: p.name,
43
+ type: p.type,
44
+ default: p.defaultValue,
45
+ required: p.required || false,
46
+ options: p.options,
47
+ description: p.description,
48
+ })),
49
+ slots: (componentData.slots || []).map((s) => ({
50
+ name: s.name,
51
+ description: s.description,
52
+ })),
53
+ events: (componentData.events || []).map((e) => ({
54
+ name: e.name,
55
+ payload: e.payload,
56
+ description: e.description,
57
+ })),
58
+ cssProperties: componentData.cssClasses || [],
59
+ examples: filteredExamples,
60
+ };
61
+ // Add basic example if none found
62
+ if (output.examples.length === 0) {
63
+ const basicExample = generateBasicWebComponentExample(output.tagName);
64
+ output.examples.push({ title: "Basic Usage", code: basicExample });
65
+ }
66
+ // Add formatted output with helpful information
67
+ let text = `# ${output.name} (${output.tagName})\n\n`;
68
+ if (output.description) {
69
+ text += `${output.description}\n\n`;
70
+ }
71
+ // Attributes section
72
+ if (output.attributes.length > 0) {
73
+ text += `## Attributes\n\n`;
74
+ for (const attr of output.attributes) {
75
+ text += `- **${attr.name}**`;
76
+ if (attr.type)
77
+ text += ` (${attr.type})`;
78
+ if (attr.required)
79
+ text += ` *required*`;
80
+ if (attr.default)
81
+ text += ` - default: \`${attr.default}\``;
82
+ if (attr.description)
83
+ text += `\n ${attr.description}`;
84
+ if (attr.options && attr.options.length > 0) {
85
+ text += `\n Options: ${attr.options.map((o) => `\`${o}\``).join(", ")}`;
86
+ }
87
+ text += `\n`;
88
+ }
89
+ text += `\n`;
90
+ }
91
+ // Slots section
92
+ if (output.slots.length > 0) {
93
+ text += `## Slots\n\n`;
94
+ for (const slot of output.slots) {
95
+ text += `- **${slot.name}**`;
96
+ if (slot.description)
97
+ text += ` - ${slot.description}`;
98
+ text += `\n`;
99
+ }
100
+ text += `\n`;
101
+ }
102
+ // Events section
103
+ if (output.events.length > 0) {
104
+ text += `## Events\n\n`;
105
+ for (const event of output.events) {
106
+ text += `- **${event.name}**`;
107
+ if (event.payload)
108
+ text += ` (payload: ${event.payload})`;
109
+ if (event.description)
110
+ text += `\n ${event.description}`;
111
+ text += `\n`;
112
+ }
113
+ text += `\n`;
114
+ }
115
+ // CSS Properties section
116
+ if (output.cssProperties.length > 0) {
117
+ text += `## CSS Custom Properties\n\n`;
118
+ for (const prop of output.cssProperties) {
119
+ text += `- \`${prop}\`\n`;
120
+ }
121
+ text += `\n`;
122
+ }
123
+ // Examples section
124
+ if (output.examples.length > 0) {
125
+ text += `## Examples\n\n`;
126
+ for (const example of output.examples) {
127
+ if (example.title) {
128
+ text += `### ${example.title}\n\n`;
129
+ }
130
+ text += `\`\`\`html\n${example.code}\n\`\`\`\n\n`;
131
+ }
132
+ }
133
+ // Installation
134
+ text += `## Installation\n\n`;
135
+ text += `\`\`\`javascript\n`;
136
+ text += `import '@adeo/mozaic-web-components/${slug}.js';\n`;
137
+ text += `\`\`\`\n\n`;
138
+ // JSON output for programmatic use
139
+ text += `---\n\n`;
140
+ text += `**JSON Output:**\n\n`;
141
+ text += `\`\`\`json\n${JSON.stringify(output, null, 2)}\n\`\`\``;
142
+ return {
143
+ content: [
144
+ {
145
+ type: "text",
146
+ text,
147
+ },
148
+ ],
149
+ };
150
+ }
151
+ // Generate a basic example
152
+ function generateBasicWebComponentExample(tagName) {
153
+ return `<${tagName}>\n Content\n</${tagName}>`;
154
+ }
155
+ // Tool definition for MCP
156
+ export const getWebComponentInfoTool = {
157
+ name: "get_webcomponent_info",
158
+ description: "Get detailed information about a Mozaic Web Component including attributes, slots, events, CSS custom properties, and usage examples.",
159
+ inputSchema: {
160
+ type: "object",
161
+ properties: {
162
+ component: {
163
+ type: "string",
164
+ description: "Web component name (e.g., 'button', 'card', 'mozaic-button'). Will be converted to tag name.",
165
+ },
166
+ },
167
+ required: ["component"],
168
+ },
169
+ };
170
+ //# sourceMappingURL=get-webcomponent-info.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-webcomponent-info.js","sourceRoot":"","sources":["../../src/tools/get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,CAAC,KAAK,EAAE,CAAC;gBAClB,IAAI,IAAI,OAAO,OAAO,CAAC,KAAK,MAAM,CAAC;YACrC,CAAC;YACD,IAAI,IAAI,eAAe,OAAO,CAAC,IAAI,cAAc,CAAC;QACpD,CAAC;IACH,CAAC;IAED,eAAe;IACf,IAAI,IAAI,qBAAqB,CAAC;IAC9B,IAAI,IAAI,oBAAoB,CAAC;IAC7B,IAAI,IAAI,uCAAuC,IAAI,SAAS,CAAC;IAC7D,IAAI,IAAI,YAAY,CAAC;IAErB,mCAAmC;IACnC,IAAI,IAAI,SAAS,CAAC;IAClB,IAAI,IAAI,sBAAsB,CAAC;IAC/B,IAAI,IAAI,eAAe,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,UAAU,CAAC;IAEjE,OAAO;QACL,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,MAAM;gBACZ,IAAI;aACL;SACF;KACF,CAAC;AACJ,CAAC;AAED,2BAA2B;AAC3B,SAAS,gCAAgC,CAAC,OAAe;IACvD,OAAO,IAAI,OAAO,mBAAmB,OAAO,GAAG,CAAC;AAClD,CAAC;AAED,0BAA0B;AAC1B,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,IAAI,EAAE,uBAAuB;IAC7B,WAAW,EACT,uIAAuI;IACzI,WAAW,EAAE;QACX,IAAI,EAAE,QAAiB;QACvB,UAAU,EAAE;YACV,SAAS,EAAE;gBACT,IAAI,EAAE,QAAQ;gBACd,WAAW,EACT,8FAA8F;aACjG;SACF;QACD,QAAQ,EAAE,CAAC,WAAW,CAAC;KACxB;CACF,CAAC"}
@@ -0,0 +1,32 @@
1
+ import type Database from "better-sqlite3";
2
+ export interface ListWebComponentsInput {
3
+ category?: "form" | "navigation" | "feedback" | "layout" | "data-display" | "action" | "all";
4
+ }
5
+ export interface WebComponentListItem {
6
+ name: string;
7
+ tagName: string;
8
+ category: string;
9
+ description?: string;
10
+ }
11
+ export declare function handleListWebComponents(db: Database.Database, input: ListWebComponentsInput): {
12
+ content: Array<{
13
+ type: "text";
14
+ text: string;
15
+ }>;
16
+ };
17
+ export declare const listWebComponentsTool: {
18
+ name: string;
19
+ description: string;
20
+ inputSchema: {
21
+ type: "object";
22
+ properties: {
23
+ category: {
24
+ type: string;
25
+ enum: string[];
26
+ default: string;
27
+ description: string;
28
+ };
29
+ };
30
+ };
31
+ };
32
+ //# sourceMappingURL=list-webcomponents.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list-webcomponents.d.ts","sourceRoot":"","sources":["../../src/tools/list-webcomponents.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAE3C,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,EAAE,MAAM,GAAG,YAAY,GAAG,UAAU,GAAG,QAAQ,GAAG,cAAc,GAAG,QAAQ,GAAG,KAAK,CAAC;CAC9F;AAED,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,wBAAgB,uBAAuB,CACrC,EAAE,EAAE,QAAQ,CAAC,QAAQ,EACrB,KAAK,EAAE,sBAAsB,GAC5B;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAAE,CAgHpD;AAGD,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;CAejC,CAAC"}
@@ -0,0 +1,110 @@
1
+ export function handleListWebComponents(db, input) {
2
+ const { category = "all" } = input;
3
+ // Query components with webcomponents framework
4
+ let query = `
5
+ SELECT name, slug, category, description, frameworks
6
+ FROM components
7
+ WHERE frameworks LIKE '%webcomponents%'
8
+ `;
9
+ const params = [];
10
+ if (category && category !== "all") {
11
+ query += ` AND category = ?`;
12
+ params.push(category);
13
+ }
14
+ query += ` ORDER BY category, name`;
15
+ const rows = db.prepare(query).all(...params);
16
+ if (rows.length === 0) {
17
+ return {
18
+ content: [
19
+ {
20
+ type: "text",
21
+ text: category === "all"
22
+ ? "No web components found in the database."
23
+ : `No web components found in category: ${category}`,
24
+ },
25
+ ],
26
+ };
27
+ }
28
+ // Group by category for better readability
29
+ const grouped = {};
30
+ for (const row of rows) {
31
+ const cat = row.category || "other";
32
+ if (!grouped[cat]) {
33
+ grouped[cat] = [];
34
+ }
35
+ grouped[cat].push({
36
+ name: row.name,
37
+ tagName: row.slug,
38
+ category: cat,
39
+ description: row.description,
40
+ });
41
+ }
42
+ // Format output
43
+ let text = `# Mozaic Web Components\n\n`;
44
+ text += `Total: ${rows.length} component${rows.length !== 1 ? "s" : ""}\n\n`;
45
+ if (category === "all") {
46
+ text += `## Categories\n\n`;
47
+ for (const [cat, components] of Object.entries(grouped)) {
48
+ text += `### ${cat.charAt(0).toUpperCase() + cat.slice(1)} (${components.length})\n\n`;
49
+ for (const comp of components) {
50
+ text += `- **${comp.name}** (\`<${comp.tagName}>\`)`;
51
+ if (comp.description) {
52
+ text += `\n ${comp.description}`;
53
+ }
54
+ text += `\n`;
55
+ }
56
+ text += `\n`;
57
+ }
58
+ }
59
+ else {
60
+ text += `## ${category.charAt(0).toUpperCase() + category.slice(1)} Components\n\n`;
61
+ for (const comp of rows) {
62
+ text += `- **${comp.name}** (\`<${comp.slug}>\`)`;
63
+ if (comp.description) {
64
+ text += `\n ${comp.description}`;
65
+ }
66
+ text += `\n`;
67
+ }
68
+ }
69
+ // JSON output
70
+ const jsonOutput = {
71
+ total: rows.length,
72
+ categories: Object.keys(grouped),
73
+ components: category === "all"
74
+ ? grouped
75
+ : rows.map((r) => ({
76
+ name: r.name,
77
+ tagName: r.slug,
78
+ category: r.category,
79
+ description: r.description,
80
+ })),
81
+ };
82
+ text += `\n---\n\n`;
83
+ text += `**JSON Output:**\n\n`;
84
+ text += `\`\`\`json\n${JSON.stringify(jsonOutput, null, 2)}\n\`\`\``;
85
+ return {
86
+ content: [
87
+ {
88
+ type: "text",
89
+ text,
90
+ },
91
+ ],
92
+ };
93
+ }
94
+ // Tool definition for MCP
95
+ export const listWebComponentsTool = {
96
+ name: "list_webcomponents",
97
+ description: "List available Mozaic Web Components by category. Returns custom element tag names and descriptions.",
98
+ inputSchema: {
99
+ type: "object",
100
+ properties: {
101
+ category: {
102
+ type: "string",
103
+ enum: ["form", "navigation", "feedback", "layout", "data-display", "action", "all"],
104
+ default: "all",
105
+ description: "Filter web components by category",
106
+ },
107
+ },
108
+ },
109
+ };
110
+ //# sourceMappingURL=list-webcomponents.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list-webcomponents.js","sourceRoot":"","sources":["../../src/tools/list-webcomponents.ts"],"names":[],"mappings":"AAaA,MAAM,UAAU,uBAAuB,CACrC,EAAqB,EACrB,KAA6B;IAE7B,MAAM,EAAE,QAAQ,GAAG,KAAK,EAAE,GAAG,KAAK,CAAC;IAEnC,gDAAgD;IAChD,IAAI,KAAK,GAAG;;;;GAIX,CAAC;IAEF,MAAM,MAAM,GAAa,EAAE,CAAC;IAE5B,IAAI,QAAQ,IAAI,QAAQ,KAAK,KAAK,EAAE,CAAC;QACnC,KAAK,IAAI,mBAAmB,CAAC;QAC7B,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACxB,CAAC;IAED,KAAK,IAAI,0BAA0B,CAAC;IAEpC,MAAM,IAAI,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,GAAG,MAAM,CAM1C,CAAC;IAEH,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACtB,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EACF,QAAQ,KAAK,KAAK;wBAChB,CAAC,CAAC,0CAA0C;wBAC5C,CAAC,CAAC,wCAAwC,QAAQ,EAAE;iBAC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AM;gBACZ,IAAI;aACL;SACF;KACF,CAAC;AACJ,CAAC;AAED,0BAA0B;AAC1B,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,IAAI,EAAE,oBAAoB;IAC1B,WAAW,EACT,sGAAsG;IACxG,WAAW,EAAE;QACX,IAAI,EAAE,QAAiB;QACvB,UAAU,EAAE;YACV,QAAQ,EAAE;gBACR,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,CAAC,MAAM,EAAE,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,cAAc,EAAE,QAAQ,EAAE,KAAK,CAAC;gBACnF,OAAO,EAAE,KAAK;gBACd,WAAW,EAAE,mCAAmC;aACjD;SACF;KACF;CACF,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mozaic-mcp-server",
3
- "version": "2.1.0",
3
+ "version": "2.2.0",
4
4
  "description": "Self-contained Claude Code skills for Mozaic Design System by ADEO",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -0,0 +1,67 @@
1
+ #!/bin/bash
2
+ # Generate Web Component usage code
3
+ # Usage: ./generate-component.sh <component-slug> [attributes-json] [children]
4
+
5
+ COMPONENT_SLUG="$1"
6
+ ATTRIBUTES_JSON="${2:-{}}"
7
+ CHILDREN="$3"
8
+ DB_PATH="${MOZAIC_DB_PATH:-${HOME}/.claude/mozaic.db}"
9
+
10
+ if [ -z "$COMPONENT_SLUG" ]; then
11
+ echo "Error: Component slug required"
12
+ echo "Usage: $0 <component-slug> [attributes-json] [children]"
13
+ echo "Example: $0 button '{\"theme\":\"primary\",\"size\":\"m\"}' 'Click me'"
14
+ exit 1
15
+ fi
16
+
17
+ if [ ! -f "$DB_PATH" ]; then
18
+ echo "Error: Database not found at $DB_PATH"
19
+ echo "Please run: npx -p mozaic-mcp-server@latest adeo-mozaic-install-tools skills"
20
+ exit 1
21
+ fi
22
+
23
+ # Get component info
24
+ COMPONENT_NAME=$(sqlite3 "$DB_PATH" <<EOF
25
+ SELECT name FROM components
26
+ WHERE slug = '$COMPONENT_SLUG'
27
+ AND frameworks LIKE '%webcomponents%'
28
+ LIMIT 1;
29
+ EOF
30
+ )
31
+
32
+ if [ -z "$COMPONENT_NAME" ]; then
33
+ echo "Error: Web Component '$COMPONENT_SLUG' not found"
34
+ exit 1
35
+ fi
36
+
37
+ # Generate import statement
38
+ echo "// Import web component"
39
+ echo "import '@adeo/mozaic-web-components/${COMPONENT_SLUG}.js';"
40
+ echo ""
41
+ echo "// Usage in HTML"
42
+
43
+ # Build attributes string
44
+ ATTRS=""
45
+ if [ "$ATTRIBUTES_JSON" != "{}" ]; then
46
+ # Parse JSON and build attributes (simplified - in production use jq)
47
+ ATTRS=$(echo "$ATTRIBUTES_JSON" | sed 's/[{}"]//g' | sed 's/,/ /g' | sed 's/:/=/g')
48
+ fi
49
+
50
+ # Generate component tag
51
+ TAG_NAME="$COMPONENT_SLUG"
52
+
53
+ if [ -n "$CHILDREN" ]; then
54
+ if [ -n "$ATTRS" ]; then
55
+ echo "<${TAG_NAME} ${ATTRS}>"
56
+ else
57
+ echo "<${TAG_NAME}>"
58
+ fi
59
+ echo " ${CHILDREN}"
60
+ echo "</${TAG_NAME}>"
61
+ else
62
+ if [ -n "$ATTRS" ]; then
63
+ echo "<${TAG_NAME} ${ATTRS}></${TAG_NAME}>"
64
+ else
65
+ echo "<${TAG_NAME}></${TAG_NAME}>"
66
+ fi
67
+ fi
@@ -0,0 +1,105 @@
1
+ #!/bin/bash
2
+ # Get detailed information about a Web Component
3
+ # Usage: ./get-component.sh <component-slug>
4
+
5
+ COMPONENT_SLUG="$1"
6
+ DB_PATH="${MOZAIC_DB_PATH:-${HOME}/.claude/mozaic.db}"
7
+
8
+ if [ -z "$COMPONENT_SLUG" ]; then
9
+ echo "Error: Component slug required"
10
+ echo "Usage: $0 <component-slug>"
11
+ echo "Example: $0 button"
12
+ exit 1
13
+ fi
14
+
15
+ if [ ! -f "$DB_PATH" ]; then
16
+ echo "Error: Database not found at $DB_PATH"
17
+ echo "Please run: npx -p mozaic-mcp-server@latest adeo-mozaic-install-tools skills"
18
+ exit 1
19
+ fi
20
+
21
+ COMPONENT_INFO=$(sqlite3 "$DB_PATH" <<EOF
22
+ .mode json
23
+ SELECT * FROM components
24
+ WHERE slug = '$COMPONENT_SLUG'
25
+ AND frameworks LIKE '%webcomponents%'
26
+ LIMIT 1;
27
+ EOF
28
+ )
29
+
30
+ if [ -z "$COMPONENT_INFO" ] || [ "$COMPONENT_INFO" = "[]" ]; then
31
+ echo "Error: Web Component '$COMPONENT_SLUG' not found"
32
+ exit 1
33
+ fi
34
+
35
+ PROPS=$(sqlite3 "$DB_PATH" <<EOF
36
+ .mode json
37
+ SELECT name, type, default_value, required, description
38
+ FROM component_props
39
+ WHERE component_id = (
40
+ SELECT id FROM components WHERE slug = '$COMPONENT_SLUG' AND frameworks LIKE '%webcomponents%'
41
+ )
42
+ ORDER BY required DESC, name;
43
+ EOF
44
+ )
45
+ PROPS="${PROPS:-[]}"
46
+
47
+ SLOTS=$(sqlite3 "$DB_PATH" <<EOF
48
+ .mode json
49
+ SELECT name, description
50
+ FROM component_slots
51
+ WHERE component_id = (
52
+ SELECT id FROM components WHERE slug = '$COMPONENT_SLUG' AND frameworks LIKE '%webcomponents%'
53
+ )
54
+ ORDER BY name;
55
+ EOF
56
+ )
57
+ SLOTS="${SLOTS:-[]}"
58
+
59
+ EVENTS=$(sqlite3 "$DB_PATH" <<EOF
60
+ .mode json
61
+ SELECT name, payload, description
62
+ FROM component_events
63
+ WHERE component_id = (
64
+ SELECT id FROM components WHERE slug = '$COMPONENT_SLUG' AND frameworks LIKE '%webcomponents%'
65
+ )
66
+ ORDER BY name;
67
+ EOF
68
+ )
69
+ EVENTS="${EVENTS:-[]}"
70
+
71
+ EXAMPLES=$(sqlite3 "$DB_PATH" <<EOF
72
+ .mode json
73
+ SELECT title, code, description
74
+ FROM component_examples
75
+ WHERE component_id = (
76
+ SELECT id FROM components WHERE slug = '$COMPONENT_SLUG' AND frameworks LIKE '%webcomponents%'
77
+ )
78
+ AND framework = 'webcomponents'
79
+ ORDER BY id;
80
+ EOF
81
+ )
82
+ EXAMPLES="${EXAMPLES:-[]}"
83
+
84
+ CSS_CLASSES=$(sqlite3 "$DB_PATH" <<EOF
85
+ .mode json
86
+ SELECT class_name
87
+ FROM component_css_classes
88
+ WHERE component_id = (
89
+ SELECT id FROM components WHERE slug = '$COMPONENT_SLUG' AND frameworks LIKE '%webcomponents%'
90
+ )
91
+ ORDER BY class_name;
92
+ EOF
93
+ )
94
+ CSS_CLASSES="${CSS_CLASSES:-[]}"
95
+
96
+ cat <<EOF
97
+ {
98
+ "component": $COMPONENT_INFO,
99
+ "attributes": $PROPS,
100
+ "slots": $SLOTS,
101
+ "events": $EVENTS,
102
+ "examples": $EXAMPLES,
103
+ "cssProperties": $CSS_CLASSES
104
+ }
105
+ EOF
@@ -0,0 +1,42 @@
1
+ #!/bin/bash
2
+ # List Web Components by category
3
+ # Usage: ./list-components.sh [category]
4
+ # Categories: form, navigation, feedback, layout, data-display, action, all (default)
5
+
6
+ CATEGORY="${1:-all}"
7
+ DB_PATH="${MOZAIC_DB_PATH:-${HOME}/.claude/mozaic.db}"
8
+
9
+ # Check if database exists
10
+ if [ ! -f "$DB_PATH" ]; then
11
+ echo "Error: Database not found at $DB_PATH"
12
+ echo "Please run: npx -p mozaic-mcp-server@latest adeo-mozaic-install-tools skills"
13
+ exit 1
14
+ fi
15
+
16
+ # Query components by category
17
+ if [ "$CATEGORY" = "all" ]; then
18
+ sqlite3 "$DB_PATH" <<EOF
19
+ .mode json
20
+ SELECT
21
+ name,
22
+ slug,
23
+ category,
24
+ description
25
+ FROM components
26
+ WHERE frameworks LIKE '%webcomponents%'
27
+ ORDER BY category, name;
28
+ EOF
29
+ else
30
+ sqlite3 "$DB_PATH" <<EOF
31
+ .mode json
32
+ SELECT
33
+ name,
34
+ slug,
35
+ category,
36
+ description
37
+ FROM components
38
+ WHERE frameworks LIKE '%webcomponents%'
39
+ AND category = '$CATEGORY'
40
+ ORDER BY name;
41
+ EOF
42
+ fi