@supericons/mcp 0.4.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/CHANGELOG.md +78 -0
- package/auth.js +69 -0
- package/converter.js +8 -0
- package/generated/mcp-output-locales.json +12436 -0
- package/generated/motion-lab-baseline.json +886 -0
- package/hosted-search-client.js +198 -0
- package/index.js +1240 -0
- package/material-export.js +174 -0
- package/mcp-output-localization.js +132 -0
- package/motion-lab-client.js +347 -0
- package/motion-lab.js +21 -0
- package/package.json +63 -0
- package/public/cjk-search-terms.json +63474 -0
- package/public/multilingual-search-aliases.json +4307 -0
- package/public/product-facts.json +25 -0
- package/recommend-icons.js +707 -0
- package/remote-server.js +465 -0
- package/runtime/cjk-search-core.js +82 -0
- package/runtime/converter-workflow.js +593 -0
- package/runtime/generated-search-intent-rules.js +1190 -0
- package/runtime/icon-semantic-aliases.js +330 -0
- package/runtime/icon-taxonomy-seed.js +461 -0
- package/runtime/public-metadata-sanitizer.js +171 -0
- package/runtime/search-intent-core.js +130 -0
- package/search.js +375 -0
- package/semantic-registry.js +212 -0
- package/server.json +27 -0
- package/telemetry.js +85 -0
- package/variant-support.js +236 -0
- package/workflow-access.js +65 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 0.4.5 - 2026-05-14
|
|
4
|
+
|
|
5
|
+
### Fixed
|
|
6
|
+
|
|
7
|
+
- fixed hosted MCP runtime dependency packaging for Railway deployments
|
|
8
|
+
- fixed hosted MCP fallback search for localized Chinese queries and solid icon styles
|
|
9
|
+
- improved settings-page recommendations across English and supported localized slot labels
|
|
10
|
+
|
|
11
|
+
## 0.4.4 - 2026-05-14
|
|
12
|
+
|
|
13
|
+
### Fixed
|
|
14
|
+
|
|
15
|
+
- improved `recommend_icons` for natural localized slot labels, including Chinese compound labels such as account/profile, notifications/settings, privacy/security, appearance/theme, and language/settings
|
|
16
|
+
- made slot recommendations ignore individual hosted search failures instead of failing the whole recommendation response
|
|
17
|
+
|
|
18
|
+
## 0.4.3 - 2026-05-14
|
|
19
|
+
|
|
20
|
+
### Fixed
|
|
21
|
+
|
|
22
|
+
- fixed npm/stdio multilingual search fallback so localized Chinese settings queries retry with the approved English concept when the hosted gateway returns no localized result
|
|
23
|
+
|
|
24
|
+
## 0.4.2 - 2026-05-14
|
|
25
|
+
|
|
26
|
+
### Fixed
|
|
27
|
+
|
|
28
|
+
- added hosted MCP fallback support for multilingual search when the public search gateway returns no localized result
|
|
29
|
+
- expanded Arabic category aliases so shorter queries such as `الأمان` match the same concepts as the full category label
|
|
30
|
+
|
|
31
|
+
## 0.4.1 - 2026-05-05
|
|
32
|
+
|
|
33
|
+
### Added
|
|
34
|
+
|
|
35
|
+
- added official MCP Registry metadata through `mcpName` and `server.json`
|
|
36
|
+
- documented both the hosted Streamable HTTP endpoint and the npm stdio package for registry discovery
|
|
37
|
+
|
|
38
|
+
## 0.4.0 - 2026-05-03
|
|
39
|
+
|
|
40
|
+
### Changed
|
|
41
|
+
|
|
42
|
+
- switched the free icon search tools to hosted semantic search by default
|
|
43
|
+
- removed bulk registry and icon-index JSON files from the npm package
|
|
44
|
+
- kept a local fallback path for internal development when `SUPERICONS_ALLOW_LOCAL_SEARCH_FALLBACK=1`
|
|
45
|
+
- packaged only the small runtime helpers needed for MCP startup and slot recommendations
|
|
46
|
+
|
|
47
|
+
## 0.3.1 - 2026-04-14
|
|
48
|
+
|
|
49
|
+
### Fixed
|
|
50
|
+
|
|
51
|
+
- packaged the MCP runtime dependencies needed for clean npm installs:
|
|
52
|
+
- `material-export.js`
|
|
53
|
+
- `public/icon-index.json`
|
|
54
|
+
- `public/synonyms.json`
|
|
55
|
+
- fixed the MCP server's package-local paths so installed copies no longer depend on repo-level `../public` or `../material-export.js`
|
|
56
|
+
|
|
57
|
+
## 0.3.0 - 2026-04-11
|
|
58
|
+
|
|
59
|
+
### Breaking changes
|
|
60
|
+
|
|
61
|
+
- Motion Lab MCP input parameters now use `snake_case`:
|
|
62
|
+
- `duration_ms`
|
|
63
|
+
- `intensity_percent`
|
|
64
|
+
- Motion Lab animated SVG responses now use `animated_svg` instead of `animatedSvg`
|
|
65
|
+
|
|
66
|
+
### Added
|
|
67
|
+
|
|
68
|
+
- `list_motion_presets` now returns the enriched Motion Lab preset metadata used by the agent library
|
|
69
|
+
- `get_motion_recipe` now returns enriched preset guidance fields such as:
|
|
70
|
+
- `technical_output_notes`
|
|
71
|
+
- `visual_character`
|
|
72
|
+
- `emotional_tone`
|
|
73
|
+
- `recommended_contexts`
|
|
74
|
+
- `avoid_for`
|
|
75
|
+
|
|
76
|
+
### Upgrade note
|
|
77
|
+
|
|
78
|
+
If you have an existing MCP client config or wrapper using the old Motion Lab parameter names, update those callers before using `0.3.0`.
|
package/auth.js
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SuperIcons MCP: API Key Authentication
|
|
3
|
+
* Validates SUPERICONS_API_KEY env var via the validate-mcp-key Edge Function.
|
|
4
|
+
* Returns auth tier: anonymous, authenticated (free), pack buyer, or Pro.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
export const SUPABASE_URL = process.env.SUPERICONS_SUPABASE_URL || 'https://kcjmkakdhsqplvasgkjv.supabase.co';
|
|
8
|
+
const FALLBACK_SUPABASE_PUBLISHABLE_KEY = 'sb_publishable_slbcWcnrQ45rkJPONFD7pw_hW0WpvBi';
|
|
9
|
+
export const SUPABASE_ANON = process.env.SUPABASE_ANON_KEY || process.env.SUPERICONS_SUPABASE_ANON || FALLBACK_SUPABASE_PUBLISHABLE_KEY;
|
|
10
|
+
|
|
11
|
+
export function getConfiguredApiKey() {
|
|
12
|
+
const apiKey = process.env.SUPERICONS_API_KEY;
|
|
13
|
+
if (typeof apiKey !== 'string') return null;
|
|
14
|
+
const trimmed = apiKey.trim();
|
|
15
|
+
return trimmed || null;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export async function hashApiKey(apiKey) {
|
|
19
|
+
const { createHash } = await import('crypto');
|
|
20
|
+
return createHash('sha256').update(apiKey).digest('hex');
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Validate API key and determine auth tier.
|
|
25
|
+
* @returns {{ authenticated: boolean, isPro: boolean, purchasedSlugs: string[], userId: string|null, error: string|null }}
|
|
26
|
+
*/
|
|
27
|
+
export async function validateApiKey() {
|
|
28
|
+
const apiKey = getConfiguredApiKey();
|
|
29
|
+
|
|
30
|
+
// No key: anonymous tier (free icons only)
|
|
31
|
+
if (!apiKey) {
|
|
32
|
+
return { authenticated: false, isPro: false, purchasedSlugs: [], userId: null, error: null };
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
try {
|
|
36
|
+
// SHA-256 hash the key (never send the raw key over the network)
|
|
37
|
+
const keyHash = await hashApiKey(apiKey);
|
|
38
|
+
|
|
39
|
+
// Validate via Edge Function (server-side, bypasses RLS)
|
|
40
|
+
const res = await fetch(
|
|
41
|
+
`${SUPABASE_URL}/functions/v1/validate-mcp-key`,
|
|
42
|
+
{
|
|
43
|
+
method: 'POST',
|
|
44
|
+
headers: {
|
|
45
|
+
'Content-Type': 'application/json',
|
|
46
|
+
'apikey': SUPABASE_ANON,
|
|
47
|
+
},
|
|
48
|
+
body: JSON.stringify({ key_hash: keyHash }),
|
|
49
|
+
}
|
|
50
|
+
);
|
|
51
|
+
|
|
52
|
+
if (!res.ok) {
|
|
53
|
+
const body = await res.text();
|
|
54
|
+
return { authenticated: false, isPro: false, purchasedSlugs: [], userId: null, error: `Validation failed (${res.status}): ${body}` };
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const result = await res.json();
|
|
58
|
+
return {
|
|
59
|
+
authenticated: result.authenticated ?? false,
|
|
60
|
+
isPro: result.isPro ?? false,
|
|
61
|
+
purchasedSlugs: result.purchasedSlugs ?? [],
|
|
62
|
+
userId: result.userId ?? null,
|
|
63
|
+
error: result.error ?? null,
|
|
64
|
+
};
|
|
65
|
+
} catch (err) {
|
|
66
|
+
console.error('[Auth] API key validation failed:', err.message);
|
|
67
|
+
return { authenticated: false, isPro: false, purchasedSlugs: [], userId: null, error: err.message };
|
|
68
|
+
}
|
|
69
|
+
}
|