@primevue/mcp 0.0.1-alpha.4 → 0.0.1-alpha.6

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/dist/index.js ADDED
@@ -0,0 +1,132 @@
1
+ #!/usr/bin/env node
2
+
3
+ // src/index.ts
4
+ import { runPrimeMcpServer } from "@primeuix/mcp";
5
+ import ComponentJson from "@primevue/mcp/data/components.json";
6
+ import pkg from "@primevue/mcp/package.json";
7
+ var composables = [
8
+ {
9
+ name: "useToast",
10
+ description: "Programmatically display toast messages",
11
+ related_component: "Toast",
12
+ usage: `import { useToast } from 'primevue/usetoast';
13
+ const toast = useToast();`,
14
+ example: `toast.add({ severity: 'success', summary: 'Success', detail: 'Message', life: 3000 });`
15
+ },
16
+ {
17
+ name: "useConfirm",
18
+ description: "Programmatically display confirmation dialogs",
19
+ related_component: "ConfirmDialog",
20
+ usage: `import { useConfirm } from 'primevue/useconfirm';
21
+ const confirm = useConfirm();`,
22
+ example: `confirm.require({ message: 'Are you sure?', header: 'Confirm', accept: () => {} });`
23
+ },
24
+ {
25
+ name: "useDialog",
26
+ description: "Programmatically create dynamic dialogs",
27
+ related_component: "DynamicDialog",
28
+ usage: `import { useDialog } from 'primevue/usedialog';
29
+ const dialog = useDialog();`,
30
+ example: `dialog.open(MyComponent, { props: { header: 'Dialog' } });`
31
+ },
32
+ {
33
+ name: "useStyle",
34
+ description: "Inject custom styles",
35
+ related_component: null,
36
+ usage: `import { useStyle } from 'primevue/usestyle';
37
+ useStyle(css, { name: 'my-styles' });`,
38
+ example: `useStyle('.my-class { color: red; }', { name: 'custom' });`
39
+ },
40
+ {
41
+ name: "usePrimeVue",
42
+ description: "Access PrimeVue configuration",
43
+ related_component: null,
44
+ usage: `import { usePrimeVue } from 'primevue/config';
45
+ const primevue = usePrimeVue();`,
46
+ example: `primevue.config.ripple = true;`
47
+ }
48
+ ];
49
+ runPrimeMcpServer({
50
+ name: "@primevue/mcp",
51
+ version: pkg.version,
52
+ baseUrl: "https://primevue.org",
53
+ frameworkName: "PrimeVue",
54
+ slotKey: "slots",
55
+ codeLanguage: "javascript",
56
+ compatibility: "Vue 3.x",
57
+ loadComponentsData: async () => ComponentJson,
58
+ customTools: [
59
+ // Vue-specific: list_composables
60
+ {
61
+ name: "list_composables",
62
+ description: "List all available PrimeVue composables with their descriptions",
63
+ parameters: {},
64
+ handler: async () => {
65
+ return {
66
+ content: [
67
+ {
68
+ type: "text",
69
+ text: JSON.stringify(
70
+ {
71
+ total: composables.length,
72
+ composables: composables.map((c) => ({
73
+ name: c.name,
74
+ description: c.description,
75
+ related_component: c.related_component
76
+ }))
77
+ },
78
+ null,
79
+ 2
80
+ )
81
+ }
82
+ ]
83
+ };
84
+ }
85
+ },
86
+ // Vue-specific: get_composable
87
+ {
88
+ name: "get_composable",
89
+ description: "Get detailed information about a specific PrimeVue composable",
90
+ parameters: {
91
+ name: {
92
+ type: "string",
93
+ description: "Composable name (e.g., 'useToast', 'useConfirm')",
94
+ required: true
95
+ }
96
+ },
97
+ handler: async (_data, args) => {
98
+ const nameArg = args?.name;
99
+ if (!nameArg) {
100
+ return {
101
+ content: [
102
+ {
103
+ type: "text",
104
+ text: `Please provide a composable name. Available: ${composables.map((c) => c.name).join(", ")}`
105
+ }
106
+ ]
107
+ };
108
+ }
109
+ const name = nameArg.toLowerCase();
110
+ const composable = composables.find((c) => c.name.toLowerCase() === name);
111
+ if (!composable) {
112
+ return {
113
+ content: [
114
+ {
115
+ type: "text",
116
+ text: `Composable "${nameArg}" not found. Available: ${composables.map((c) => c.name).join(", ")}`
117
+ }
118
+ ]
119
+ };
120
+ }
121
+ return {
122
+ content: [
123
+ {
124
+ type: "text",
125
+ text: JSON.stringify(composable, null, 2)
126
+ }
127
+ ]
128
+ };
129
+ }
130
+ }
131
+ ]
132
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@primevue/mcp",
3
- "version": "0.0.1-alpha.4",
3
+ "version": "0.0.1-alpha.6",
4
4
  "author": "PrimeTek Informatics",
5
5
  "description": "Model Context Protocol (MCP) server for PrimeVue component library",
6
6
  "homepage": "https://primevue.org/",
@@ -23,23 +23,26 @@
23
23
  "components"
24
24
  ],
25
25
  "bin": {
26
- "primevue-mcp": "./dist/index.mjs"
26
+ "primevue-mcp": "./dist/index.js"
27
27
  },
28
- "main": "./dist/index.mjs",
29
- "module": "./dist/index.mjs",
30
- "types": "./dist/index.d.mts",
28
+ "type": "module",
29
+ "main": "./dist/index.js",
30
+ "module": "./dist/index.js",
31
+ "types": "./dist/index.d.ts",
31
32
  "exports": {
32
33
  ".": {
33
- "types": "./dist/index.d.mts",
34
- "import": "./dist/index.mjs",
35
- "default": "./dist/index.mjs"
36
- }
34
+ "types": "./dist/index.d.ts",
35
+ "import": "./dist/index.js",
36
+ "default": "./dist/index.js"
37
+ },
38
+ "./*": "./*"
37
39
  },
38
40
  "publishConfig": {
39
41
  "access": "public"
40
42
  },
41
43
  "files": [
42
44
  "dist",
45
+ "data",
43
46
  "README.md",
44
47
  "LICENSE"
45
48
  ],