@ehrocks/fe-mcp-server 1.0.8 → 1.0.9
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 +39 -29
- package/package.json +3 -2
package/dist/index.js
CHANGED
|
@@ -92,7 +92,8 @@ async function startServer() {
|
|
|
92
92
|
const server = new McpServer({ name: "hero-design-mcp-server", version }, {
|
|
93
93
|
instructions: "Invoke for any @hero-design/react implementation task: selecting the right component for a UI need, retrieving JSX code examples, or exploring design patterns and design system resources.",
|
|
94
94
|
});
|
|
95
|
-
server.
|
|
95
|
+
server.registerTool("search_hero_design_component_examples", {
|
|
96
|
+
description: `Retrieve Hero Design System examples, patterns, and references using natural language.
|
|
96
97
|
|
|
97
98
|
Describe the UI behavior, component, or pattern you need. Covers component selection guidance, JSX code examples, design patterns, and use cases across @hero-design/react. Not a prop API reference — use the component library docs for precise prop signatures.
|
|
98
99
|
|
|
@@ -102,34 +103,43 @@ Returns for each match:
|
|
|
102
103
|
- Component name and similarity score
|
|
103
104
|
- Component and example descriptions
|
|
104
105
|
- Code example (JSX)
|
|
105
|
-
- Technical details, design patterns, and props context when available`,
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
106
|
+
- Technical details, design patterns, and props context when available`,
|
|
107
|
+
inputSchema: {
|
|
108
|
+
query: z
|
|
109
|
+
.string()
|
|
110
|
+
.trim()
|
|
111
|
+
.min(1, "query must not be empty")
|
|
112
|
+
.describe("The search query describing what you're looking for in the component examples. Be specific about what aspects you're interested in (code, usage, props, patterns, etc.)"),
|
|
113
|
+
limit: z
|
|
114
|
+
.string()
|
|
115
|
+
.transform((val) => {
|
|
116
|
+
const num = Number(val);
|
|
117
|
+
if (isNaN(num))
|
|
118
|
+
return 5;
|
|
119
|
+
return Math.min(Math.max(Math.round(num), 1), 5);
|
|
120
|
+
})
|
|
121
|
+
.optional()
|
|
122
|
+
.default("5")
|
|
123
|
+
.describe("Maximum number of distinct component examples to return (1–5)"),
|
|
124
|
+
threshold: z
|
|
125
|
+
.string()
|
|
126
|
+
.transform((val) => {
|
|
127
|
+
const num = parseFloat(val);
|
|
128
|
+
if (isNaN(num))
|
|
129
|
+
return 0.4;
|
|
130
|
+
return Math.min(Math.max(num, 0), 0.99);
|
|
131
|
+
})
|
|
132
|
+
.optional()
|
|
133
|
+
.default("0.4")
|
|
134
|
+
.describe("Minimum similarity score (0.0 to 0.99) for returned examples. Lower values return more results but might be less relevant"),
|
|
135
|
+
},
|
|
136
|
+
annotations: {
|
|
137
|
+
title: "Search Hero Design Component Examples",
|
|
138
|
+
readOnlyHint: true,
|
|
139
|
+
destructiveHint: false,
|
|
140
|
+
idempotentHint: true,
|
|
141
|
+
openWorldHint: false,
|
|
142
|
+
},
|
|
133
143
|
}, async ({ query, limit, threshold }) => {
|
|
134
144
|
const result = await searchHeroDesignComponentExamples(query, limit, threshold);
|
|
135
145
|
if (result.ok) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ehrocks/fe-mcp-server",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.9",
|
|
4
4
|
"description": "MCP server for searching Hero Design System components",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -23,7 +23,8 @@
|
|
|
23
23
|
"author": "",
|
|
24
24
|
"license": "MIT",
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@modelcontextprotocol/sdk": "^1.
|
|
26
|
+
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
27
|
+
"zod": "^3.25.0"
|
|
27
28
|
},
|
|
28
29
|
"devDependencies": {
|
|
29
30
|
"@types/node": "^22.14.1",
|