@iconaut/mcp 1.7.2 → 1.7.3

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 CHANGED
@@ -32,10 +32,11 @@ Cursor, Windsurf, Claude Desktop and other clients take the same command in thei
32
32
  | `get_icon` | One icon by name: the SVG at 16, 20 or 24px in line, solid or duo, the React import, the shadcn command and the CDN URL. |
33
33
  | `list_categories` | The 27 categories and how many icons each holds. |
34
34
 
35
- ## A real drawing at every size
35
+ ## Tuned for each size
36
36
 
37
- Sizes 16, 20 and 24 are separate drawings with their own stroke weight, not one drawing scaled,
38
- so `get_icon` takes the size the icon will be shown at:
37
+ 16, 20 and 24 are native sizes, each with its own stroke weight, so `get_icon` takes the size
38
+ the icon will be shown at. 16 also gets a simplified drawing that drops fine detail; 20 and 24
39
+ share the full drawing:
39
40
 
40
41
  | size | drawing | stroke |
41
42
  |---|---|---|
package/icons.json.br CHANGED
Binary file
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@iconaut/mcp",
3
- "version": "1.7.2",
3
+ "version": "1.7.3",
4
4
  "description": "MCP server for the free Iconaut icons: search the set, get the SVG at its native size, get the React import and shadcn command.",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
7
  "bin": {
8
- "iconaut-mcp": "./server.js"
8
+ "iconaut-mcp": "server.js"
9
9
  },
10
- "main": "./server.js",
10
+ "main": "server.js",
11
11
  "files": [
12
12
  "server.js",
13
13
  "icons.json.br",
package/server.js CHANGED
@@ -50,6 +50,16 @@ const pascal = (n) => n.split('-').map((p) => p[0].toUpperCase() + p.slice(1)).j
50
50
  const SUFFIX = { line: '', solid: 'Solid', duo: 'Duo' };
51
51
  const component = (name, style) => pascal(name) + SUFFIX[style];
52
52
  const slug = (name, style) => name + (style === 'line' ? '' : '-' + style);
53
+ // The sizes come in two detail tiers (design/GRID.md): 16 draws a simplified version, 20 and 24
54
+ // share the full drawing and differ in stroke. Said plainly, because "default drawing" read to an
55
+ // agent as if 20px were not a native size at all.
56
+ function tierNote(size) {
57
+ const d = data();
58
+ const tier = d.sizeTokens[size].tier;
59
+ const peers = d.sizes.filter((s) => s !== size && d.sizeTokens[s].tier === tier);
60
+ if (!peers.length) return `The ${size}px drawing, simplified for small sizes`;
61
+ return `The full drawing, shared with ${peers.map((s) => s + 'px').join(' and ')}`;
62
+ }
53
63
  const nearestSize = (n, sizes) => sizes.reduce((a, b) => (Math.abs(b - n) < Math.abs(a - n) ? b : a));
54
64
 
55
65
  // ── Search ─────────────────────────────────────────────────────────────────────────────────
@@ -145,15 +155,16 @@ const TOOLS = [
145
155
  title: 'Get an Iconaut icon',
146
156
  description:
147
157
  'Get one Iconaut icon by its exact name: the SVG source at a native size, the iconaut-react ' +
148
- 'import, the shadcn/ui registry command and the CDN URL. Sizes 16, 20 and 24 are separate ' +
149
- 'drawings with their own stroke weight, so ask for the size the icon will be shown at. ' +
158
+ 'import, the shadcn/ui registry command and the CDN URL. 16, 20 and 24 are native sizes, each ' +
159
+ 'with its own stroke weight; 16 is also a simplified drawing with less detail, while 20 and 24 ' +
160
+ 'share the full drawing. Ask for the size the icon will be shown at. ' +
150
161
  'Colors come from currentColor.',
151
162
  inputSchema: {
152
163
  type: 'object',
153
164
  properties: {
154
165
  name: { type: 'string', description: 'Exact icon name, e.g. "settings" or "arrow-left". Find it with search_icons.' },
155
166
  style: { type: 'string', enum: STYLE_ENUM, default: 'line', description: 'line (stroked), solid (filled) or duo (25% tint under the line).' },
156
- size: { type: 'integer', default: 24, description: 'Pixel size. 16, 20 and 24 are native drawings; any other value returns the nearest one.' },
167
+ size: { type: 'integer', default: 24, description: 'Pixel size. 16, 20 and 24 are native sizes; any other value returns the nearest one.' },
157
168
  },
158
169
  required: ['name'],
159
170
  },
@@ -211,7 +222,8 @@ const handlers = {
211
222
  const comp = component(name, style);
212
223
  const tok = d.sizeTokens[size];
213
224
  return [
214
- `${name} · ${style} · ${size}px (${tok.tier} drawing, stroke ${tok.stroke}) · category ${icon.category}`,
225
+ `${name} · ${style} · ${size}px · category ${icon.category}`,
226
+ `${tierNote(size)}, tuned to a ${tok.stroke}px stroke at this size.`,
215
227
  asked !== size ? `${asked}px is not a native size; this is the ${size}px drawing. Render it at ${asked}px by changing width and height.` : null,
216
228
  '',
217
229
  'SVG:',
@@ -262,7 +274,8 @@ function handle(msg) {
262
274
  capabilities: { tools: { listChanged: false } },
263
275
  serverInfo: { name: 'iconaut', title: 'Iconaut icons', version: PKG.version },
264
276
  instructions:
265
- 'Iconaut is an icon set in line, solid and duotone on a 24px grid, with separate drawings at 16, 20 and 24px. ' +
277
+ 'Iconaut is an icon set in line, solid and duotone on a 24px grid, with three native sizes (16, 20 and 24px), ' +
278
+ 'each with its own stroke weight, and a simplified drawing at 16px. ' +
266
279
  'This server covers the free MIT set. Look icons up with search_icons before naming one, then use get_icon ' +
267
280
  'for the SVG or the iconaut-react import. Do not invent icon names.',
268
281
  });