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