wunderui-mcp 1.1.0 → 1.2.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wunderui-mcp",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "mcpName": "io.github.Kl-webmedia/wunderui-mcp",
5
5
  "description": "MCP server that gives AI coding agents the WunderUI design system: tokens, component props, templates and starters. Works with Claude Code, Cursor, Windsurf, Cline and Codex.",
6
6
  "keywords": [
package/src/index.mjs CHANGED
@@ -377,7 +377,16 @@ server.registerTool(
377
377
 
378
378
  const siteUrl = () => (process.env.WUNDERUI_SITE ?? design.site ?? "https://wunderui.com").replace(/\/$/, "")
379
379
  const licenseKey = () => process.env.WUNDERUI_LICENSE_KEY?.trim() || null
380
- const authHeaders = () => (licenseKey() ? { authorization: `Bearer ${licenseKey()}` } : {})
380
+ /** The key goes to wunderui.com (or a local dev server) only, never to another WUNDERUI_SITE. */
381
+ const keyAllowed = () => {
382
+ try {
383
+ const { protocol, hostname } = new URL(siteUrl())
384
+ return (protocol === "https:" && (hostname === "wunderui.com" || hostname === "www.wunderui.com")) || ["localhost", "127.0.0.1", "[::1]"].includes(hostname)
385
+ } catch {
386
+ return false
387
+ }
388
+ }
389
+ const authHeaders = () => (licenseKey() && keyAllowed() ? { authorization: `Bearer ${licenseKey()}` } : {})
381
390
  let instructions = null
382
391
  try {
383
392
  instructions = readFileSync(resolve(dataDir, "INSTRUCTIONS.md"), "utf8")