@vezham/icons-mcp 1.0.5 → 1.0.7
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/README.md +11 -11
- package/dist/README.md +11 -11
- package/dist/cli/index.js +6 -6
- package/dist/core/codegen.js +5 -7
- package/dist/core/index-builder.js +5 -2
- package/dist/core/search.js +1 -1
- package/dist/core/types.d.ts +1 -1
- package/dist/data/icon-index.json +1 -1
- package/dist/package.json +3 -3
- package/dist/server/index.js +10 -9
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
#
|
|
1
|
+
# vezham-icons-mcp
|
|
2
2
|
|
|
3
|
-
MCP server and CLI for searching, previewing, and applying
|
|
3
|
+
MCP server and CLI for searching, previewing, and applying Vezham icons. Works fully offline with a prebuilt search index.
|
|
4
4
|
|
|
5
5
|
## MCP Server
|
|
6
6
|
|
|
@@ -9,9 +9,9 @@ Add to your MCP client config:
|
|
|
9
9
|
```json
|
|
10
10
|
{
|
|
11
11
|
"mcpServers": {
|
|
12
|
-
"
|
|
12
|
+
"vezham": {
|
|
13
13
|
"command": "npx",
|
|
14
|
-
"args": ["
|
|
14
|
+
"args": ["@vezham/icons-mcp"]
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
}
|
|
@@ -22,9 +22,9 @@ Or point directly at the local binary after building:
|
|
|
22
22
|
```json
|
|
23
23
|
{
|
|
24
24
|
"mcpServers": {
|
|
25
|
-
"
|
|
25
|
+
"vezham": {
|
|
26
26
|
"command": "node",
|
|
27
|
-
"args": ["/path/to/
|
|
27
|
+
"args": ["/path/to/vezham/packages/icons-mcp/bin/run.cjs"]
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
}
|
|
@@ -42,10 +42,10 @@ Or point directly at the local binary after building:
|
|
|
42
42
|
## CLI
|
|
43
43
|
|
|
44
44
|
```bash
|
|
45
|
-
npx
|
|
46
|
-
npx
|
|
47
|
-
npx
|
|
48
|
-
npx
|
|
45
|
+
npx @vezham/icons-mcp search "shopping cart"
|
|
46
|
+
npx @vezham/icons-mcp view heart --weight filled
|
|
47
|
+
npx @vezham/icons-mcp apply heart --framework react --size 32 --color "#ef4444"
|
|
48
|
+
npx @vezham/icons-mcp categories
|
|
49
49
|
```
|
|
50
50
|
|
|
51
51
|
### File write mode
|
|
@@ -53,7 +53,7 @@ npx reicon-mcp categories
|
|
|
53
53
|
For scripted insertion, replace a marker string in a target file:
|
|
54
54
|
|
|
55
55
|
```bash
|
|
56
|
-
npx
|
|
56
|
+
npx @vezham/icons-mcp apply heart --framework react --file src/App.tsx --marker "{/* ICON */}"
|
|
57
57
|
```
|
|
58
58
|
|
|
59
59
|
The marker must exist exactly once. The command exits non-zero if the marker is not found.
|
package/dist/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
#
|
|
1
|
+
# vezham-icons-mcp
|
|
2
2
|
|
|
3
|
-
MCP server and CLI for searching, previewing, and applying
|
|
3
|
+
MCP server and CLI for searching, previewing, and applying Vezham icons. Works fully offline with a prebuilt search index.
|
|
4
4
|
|
|
5
5
|
## MCP Server
|
|
6
6
|
|
|
@@ -9,9 +9,9 @@ Add to your MCP client config:
|
|
|
9
9
|
```json
|
|
10
10
|
{
|
|
11
11
|
"mcpServers": {
|
|
12
|
-
"
|
|
12
|
+
"vezham": {
|
|
13
13
|
"command": "npx",
|
|
14
|
-
"args": ["
|
|
14
|
+
"args": ["@vezham/icons-mcp"]
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
}
|
|
@@ -22,9 +22,9 @@ Or point directly at the local binary after building:
|
|
|
22
22
|
```json
|
|
23
23
|
{
|
|
24
24
|
"mcpServers": {
|
|
25
|
-
"
|
|
25
|
+
"vezham": {
|
|
26
26
|
"command": "node",
|
|
27
|
-
"args": ["/path/to/
|
|
27
|
+
"args": ["/path/to/vezham/packages/icons-mcp/bin/run.cjs"]
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
}
|
|
@@ -42,10 +42,10 @@ Or point directly at the local binary after building:
|
|
|
42
42
|
## CLI
|
|
43
43
|
|
|
44
44
|
```bash
|
|
45
|
-
npx
|
|
46
|
-
npx
|
|
47
|
-
npx
|
|
48
|
-
npx
|
|
45
|
+
npx @vezham/icons-mcp search "shopping cart"
|
|
46
|
+
npx @vezham/icons-mcp view heart --weight filled
|
|
47
|
+
npx @vezham/icons-mcp apply heart --framework react --size 32 --color "#ef4444"
|
|
48
|
+
npx @vezham/icons-mcp categories
|
|
49
49
|
```
|
|
50
50
|
|
|
51
51
|
### File write mode
|
|
@@ -53,7 +53,7 @@ npx reicon-mcp categories
|
|
|
53
53
|
For scripted insertion, replace a marker string in a target file:
|
|
54
54
|
|
|
55
55
|
```bash
|
|
56
|
-
npx
|
|
56
|
+
npx @vezham/icons-mcp apply heart --framework react --file src/App.tsx --marker "{/* ICON */}"
|
|
57
57
|
```
|
|
58
58
|
|
|
59
59
|
The marker must exist exactly once. The command exits non-zero if the marker is not found.
|
package/dist/cli/index.js
CHANGED
|
@@ -58,14 +58,14 @@ export async function run(argv) {
|
|
|
58
58
|
const { positional, flags } = parseArgs(argv);
|
|
59
59
|
const command = positional[0];
|
|
60
60
|
if (!command) {
|
|
61
|
-
console.error('Usage:
|
|
61
|
+
console.error('Usage: vezham-icons-mcp <search|view|apply|categories> [args]');
|
|
62
62
|
process.exit(1);
|
|
63
63
|
}
|
|
64
64
|
switch (command) {
|
|
65
65
|
case 'search': {
|
|
66
66
|
const query = positional.slice(1).join(' ');
|
|
67
67
|
if (!query) {
|
|
68
|
-
console.error('Usage:
|
|
68
|
+
console.error('Usage: vezham-icons-mcp search <query>');
|
|
69
69
|
process.exit(1);
|
|
70
70
|
}
|
|
71
71
|
const result = handleSearchIcons({
|
|
@@ -81,10 +81,10 @@ export async function run(argv) {
|
|
|
81
81
|
case 'view': {
|
|
82
82
|
const name = positional[1];
|
|
83
83
|
if (!name) {
|
|
84
|
-
console.error('Usage:
|
|
84
|
+
console.error('Usage: vezham-icons-mcp view <name> --weight outline|filled|duotone-outline|duotone-filled');
|
|
85
85
|
process.exit(1);
|
|
86
86
|
}
|
|
87
|
-
const weight = flags.weight || '
|
|
87
|
+
const weight = flags.weight || 'outline';
|
|
88
88
|
const result = handleViewIcon({ name, weight });
|
|
89
89
|
print(result);
|
|
90
90
|
if ('error' in result)
|
|
@@ -94,11 +94,11 @@ export async function run(argv) {
|
|
|
94
94
|
case 'apply': {
|
|
95
95
|
const name = positional[1];
|
|
96
96
|
if (!name) {
|
|
97
|
-
console.error('Usage:
|
|
97
|
+
console.error('Usage: vezham-icons-mcp apply <name> --framework react|react-native|vue|svelte|html|svg [--weight outline|filled|duotone-outline|duotone-filled] [--size 24] [--color #hex] [--file path] [--marker "{/* ICON */}"]');
|
|
98
98
|
process.exit(1);
|
|
99
99
|
}
|
|
100
100
|
const framework = flags.framework || 'react';
|
|
101
|
-
const weight = flags.weight || '
|
|
101
|
+
const weight = flags.weight || 'outline';
|
|
102
102
|
const result = handleApplyIcon({
|
|
103
103
|
name,
|
|
104
104
|
weight,
|
package/dist/core/codegen.js
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
function weightProp(weight, framework) {
|
|
2
|
-
if (weight === '
|
|
2
|
+
if (weight === 'outline')
|
|
3
3
|
return '';
|
|
4
|
-
if (framework === 'html')
|
|
5
|
-
return ' weight="filled"';
|
|
6
4
|
return ` weight="${weight}"`;
|
|
7
5
|
}
|
|
8
6
|
function sizeProp(size, framework) {
|
|
@@ -38,7 +36,7 @@ export function generateCode(icon, input) {
|
|
|
38
36
|
const colorAttr = (framework) => hasColor ? colorProp(color, framework) : '';
|
|
39
37
|
switch (input.framework) {
|
|
40
38
|
case 'react': {
|
|
41
|
-
const importStatement = `import { ${component} } from '
|
|
39
|
+
const importStatement = `import { ${component} } from '@vezham/icons-react';`;
|
|
42
40
|
const props = [
|
|
43
41
|
sizeProp(size, 'react'),
|
|
44
42
|
colorAttr('react'),
|
|
@@ -48,7 +46,7 @@ export function generateCode(icon, input) {
|
|
|
48
46
|
return { importStatement, docsSnippet };
|
|
49
47
|
}
|
|
50
48
|
case 'react-native': {
|
|
51
|
-
const importStatement = `import { ${component} } from '
|
|
49
|
+
const importStatement = `import { ${component} } from '@vezham/icons-react-native';`;
|
|
52
50
|
const props = [
|
|
53
51
|
sizeProp(size, 'react-native'),
|
|
54
52
|
colorAttr('react-native'),
|
|
@@ -58,7 +56,7 @@ export function generateCode(icon, input) {
|
|
|
58
56
|
return { importStatement, docsSnippet };
|
|
59
57
|
}
|
|
60
58
|
case 'vue': {
|
|
61
|
-
const importStatement = `import { ${component} } from '
|
|
59
|
+
const importStatement = `import { ${component} } from '@vezham/icons-vue';`;
|
|
62
60
|
const props = [
|
|
63
61
|
sizeProp(size, 'vue'),
|
|
64
62
|
colorAttr('vue'),
|
|
@@ -68,7 +66,7 @@ export function generateCode(icon, input) {
|
|
|
68
66
|
return { importStatement, docsSnippet };
|
|
69
67
|
}
|
|
70
68
|
case 'svelte': {
|
|
71
|
-
const importStatement = `import { ${component} } from '
|
|
69
|
+
const importStatement = `import { ${component} } from '@vezham/icons-svelte';`;
|
|
72
70
|
const props = [
|
|
73
71
|
sizeProp(size, 'svelte'),
|
|
74
72
|
colorAttr('svelte'),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const W_KEYS = ['
|
|
1
|
+
const W_KEYS = ['outline', 'filled', 'duotone-outline', 'duotone-filled'];
|
|
2
2
|
function toPascalCase(str) {
|
|
3
3
|
return str
|
|
4
4
|
.split('-')
|
|
@@ -11,7 +11,10 @@ function stripSvgWrapper(code) {
|
|
|
11
11
|
return code.replace(/^<svg[^>]*>/, '').replace(/<\/svg>\s*$/, '').trim();
|
|
12
12
|
}
|
|
13
13
|
function rewriteColors(svg) {
|
|
14
|
-
return svg
|
|
14
|
+
return svg
|
|
15
|
+
.replace(/#1C274C/gi, 'currentColor')
|
|
16
|
+
.replace(/fill="white"/g, 'fill="currentColor"')
|
|
17
|
+
.replace(/stroke="white"/g, 'stroke="currentColor"');
|
|
15
18
|
}
|
|
16
19
|
function generateTags(name, description) {
|
|
17
20
|
const tags = new Set();
|
package/dist/core/search.js
CHANGED
|
@@ -1235,7 +1235,7 @@ export function searchIcons(index, query, options = {}) {
|
|
|
1235
1235
|
// Default limit raised from 5 → 8 for better agent context
|
|
1236
1236
|
const limit = options.limit ?? 8;
|
|
1237
1237
|
const tokens = tokenize(query);
|
|
1238
|
-
const weights = options.weight ? [options.weight] : ['
|
|
1238
|
+
const weights = options.weight ? [options.weight] : ['outline', 'filled', 'duotone-outline', 'duotone-filled'];
|
|
1239
1239
|
const results = [];
|
|
1240
1240
|
for (const icon of index.icons) {
|
|
1241
1241
|
for (const weight of weights) {
|
package/dist/core/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type IconWeight = '
|
|
1
|
+
export type IconWeight = 'outline' | 'filled' | 'duotone-outline' | 'duotone-filled';
|
|
2
2
|
export type Framework = 'react' | 'react-native' | 'vue' | 'svelte' | 'html' | 'svg';
|
|
3
3
|
export interface IconWeightData {
|
|
4
4
|
code: string;
|