@volue/wave-mcp 0.1.14-next.4 → 0.2.0-next.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/README.md +10 -0
- package/dist/{index-7C65hTxB.js → index-YvazYQ9b.js} +20 -20
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/server-BUA33fNW.js +1 -0
- package/dist/transports/http.js +1 -1
- package/dist/transports/stdio.js +1 -1
- package/package.json +2 -2
- package/dist/server-DavBHU1k.js +0 -1
package/README.md
CHANGED
|
@@ -136,6 +136,16 @@ You can customize the port using environment variable:
|
|
|
136
136
|
PORT=8080 npx @volue/wave-mcp@latest http
|
|
137
137
|
```
|
|
138
138
|
|
|
139
|
+
#### Environment variables
|
|
140
|
+
|
|
141
|
+
| Variable | Default | Description |
|
|
142
|
+
| ----------------- | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
143
|
+
| `HOST` | `localhost` | Address the HTTP server binds to. |
|
|
144
|
+
| `PORT` | `3000` | Port the HTTP server listens on. |
|
|
145
|
+
| `CORS_ORIGIN` | `*` | Comma-separated list of allowed CORS origins. |
|
|
146
|
+
| `ALLOWED_HOSTS` | unset | Comma-separated list of allowed `Host` header values (e.g. `mcp.example.com`). Setting this (or `ALLOWED_ORIGINS`) enables DNS-rebinding protection. |
|
|
147
|
+
| `ALLOWED_ORIGINS` | unset | Comma-separated list of allowed `Origin` header values (e.g. `https://mcp.example.com`). |
|
|
148
|
+
|
|
139
149
|
## Docker Deployment
|
|
140
150
|
|
|
141
151
|
Pre-built Docker images are automatically published to GitHub Container Registry on every release.
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
var U=Object.defineProperty;var
|
|
1
|
+
var U=Object.defineProperty;var a=(e,t)=>U(e,"name",{value:t,configurable:!0});import{b as p,f as g,u as v,g as l}from"./server-BUA33fNW.js";import A from"@volue/design-colors/generic";import*as D from"@volue/design-icons";import*as N from"@volue/design-media-queries";import F from"remark-parse";import j from"unified";import{z as x}from"zod";import{core as O,background as H,foreground as V,border as G,rgb as X,data as q}from"@volue/design-colors/flat";function m(){return m=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)({}).hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},m.apply(null,arguments)}a(m,"_extends");const J="0 1px 2.5px hsla(var(--shadow-color, 166, 48%, 7%), calc(var(--shadow-intensity, 1) * 0.08)), 0 3px 9px hsla(var(--shadow-color, 166, 48%, 7%), calc(var(--shadow-intensity, 1) * 0.048))",Q="0 0.4px 2.2px hsla(var(--shadow-color, 166, 48%, 7%), calc(var(--shadow-intensity, 1) * 0.022)), 0 1.4px 5px hsla(var(--shadow-color, 166, 48%, 7%), calc(var(--shadow-intensity, 1) * 0.04)), 0 5px 14px hsla(var(--shadow-color, 166, 48%, 7%), calc(var(--shadow-intensity, 1) * 0.06))",Y="0 0.3px 2px hsla(var(--shadow-color, 166, 48%, 7%), calc(var(--shadow-intensity, 1) * 0.015)), 0 1.5px 8px hsla(var(--shadow-color, 166, 48%, 7%), calc(var(--shadow-intensity, 1) * 0.024)), 0 4px 16px hsla(var(--shadow-color, 166, 48%, 7%), calc(var(--shadow-intensity, 1) * 0.04)), 0 8px 24px hsla(var(--shadow-color, 166, 48%, 7%), calc(var(--shadow-intensity, 1) * 0.07))",K="0 0.7px 2px hsla(var(--shadow-color, 166, 48%, 7%), calc(var(--shadow-intensity, 1) * 0.015)), 0 1.6px 8px hsla(var(--shadow-color, 166, 48%, 7%), calc(var(--shadow-intensity, 1) * 0.024)), 0 3.3px 16px hsla(var(--shadow-color, 166, 48%, 7%), calc(var(--shadow-intensity, 1) * 0.034)), 0 5px 26px hsla(var(--shadow-color, 166, 48%, 7%), calc(var(--shadow-intensity, 1) * 0.06)), 0 12px 42px hsla(var(--shadow-color, 166, 48%, 7%), calc(var(--shadow-intensity, 1) * 0.08))";var Z=Object.freeze({__proto__:null,elevationL:K,elevationM:Y,elevationS:Q,elevationXs:J}),f={base:{2:"0.125rem",4:"0.25rem",6:"0.375rem",8:"0.5rem",12:"0.75rem",14:"0.875rem",16:"1rem",20:"1.25rem",24:"1.5rem",28:"1.75rem",32:"2rem",36:"2.25rem",40:"2.5rem",44:"2.75rem",48:"3rem",64:"4rem",72:"4.5rem",80:"5rem",96:"6rem",112:"7rem",128:"8rem"},borderRadius:{xs:"0.25rem",s:"0.375rem",m:"0.5rem",l:"0.75rem",xl:"1rem",full:"100vh"},spacing:{xs:"0.25rem",s:"0.5rem",m:"1rem",l:"1.5rem",xl:"2rem",xxl:"3rem",xxxl:"4.5rem"}},h={font:{family:{base:"'IBM Plex Sans', 'IBM Plex Sans Fallback: -apple-system', 'IBM Plex Sans Fallback: Segoe UI', 'IBM Plex Sans Fallback: Roboto', 'IBM Plex Sans Fallback: Arial', 'IBM Plex Sans Fallback: Noto Sans', -apple-system, 'Segoe UI', Roboto, Arial, 'Noto Sans', sans-serif",display:"'IBM Plex Sans', 'IBM Plex Sans Fallback: -apple-system', 'IBM Plex Sans Fallback: Segoe UI', 'IBM Plex Sans Fallback: Roboto', 'IBM Plex Sans Fallback: Arial', 'IBM Plex Sans Fallback: Noto Sans', -apple-system, 'Segoe UI', Roboto, Arial, 'Noto Sans', sans-serif",mono:"ui-monospace, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace"},weight:{normal:"400",semibold:"600"}},size:{font:{base:"16px",eta:"12px",zeta:"14px",epsilon:"16px",delta:"19px",gamma:"21px",beta:"28px",alpha:"38px",giga:"51px"},letterSpacing:{tighter:"-0.05em",tight:"-0.025em",normal:"normal",wide:"0.025em",wider:"0.05em",widest:"0.1em"},lineHeight:{none:"1",body:"1.5",base:"1.5rem",small:"1.25rem",xSmall:"1.125rem",zeta:"1.714286",epsilon:"1.5",delta:"1.263158",gamma:"1.52381",beta:"1.714286",alpha:"1.263158",giga:"1.411765"}}};function ee(e){return e.charAt(0).toUpperCase()+e.slice(1)}a(ee,"capitalizeFirstLetter");var B=Object.keys(f.spacing).reduce(function(e,t){var n;return m({},e,(n={},n["spacing"+ee(t)]=f.spacing[t],n))},{}),I={colors:m({},O,H,V,G,X,q),space:B,zIndices:{auto:"auto",0:"0",1:"100",2:"200",3:"300",4:"400",5:"500",9:"900"},fonts:h.font.family,fontWeights:h.font.weight,fontSizes:h.size.font,lineHeights:h.size.lineHeight,letterSpacings:h.size.letterSpacing,sizes:m({},f.base,{measureNarrow:"30ch",measureMedium:"60ch",measureWide:"90ch",containerNarrow:"32rem",containerMedium:"48rem",containerWide:"74rem"}),radii:m({},f.borderRadius,B),shadows:m({},Z,{lift:"0 10px 20px -5px rgba(0, 0, 0, 0.15)"})};const te=j().use(F),R={Components:"component","UX patterns":"pattern"};function ne(e,t){const n=te.parse(e),o=new URL(`${t}/`);let r=null;return n.children.reduce((s,i)=>{if(p(i,"heading")&&i.depth===2)return r=oe(i),s;if(!r||!p(i,"list"))return s;const c=r,d=i.children.map(u=>re(u,c,o)).filter(u=>u!==null);return s.concat(d)},[])}a(ne,"parseLlmsIndex");function oe(e){const[t]=e.children;if(!t||!p(t,"text"))return null;const n=t.value.trim();if(!(n in R))return null;const o=R[n];return{title:n,type:o}}a(oe,"extractSectionContext");function re(e,t,n){const[o]=e.children;if(!o||!p(o,"paragraph")||o.children.length!==2)return null;const[r,s]=o.children;if(!p(r,"link")||!p(s,"text")||r.children.length!==1)return null;const i=r.children[0];if(!p(i,"text"))return null;const c=i.value.trim(),d=new URL(r.url,n);if(d.origin!==n.origin)return console.warn(`Skipping llms.txt entry "${c}": ${r.url} is outside ${n.origin}`),null;const u=d.toString(),C=d.pathname.replace(/^\//,""),P=ae(C),W=se(t.title,C,t.type),z=ce(s.value);return{name:c,slug:P,category:W,section:t.title,type:t.type,url:u,description:z??void 0}}a(re,"listItemToResource");function ae(e){return e.replace(/\.md$/,"").split("/").pop()??""}a(ae,"deriveSlug");function se(e,t,n){const o=t.replace(/\.md$/,"").split("/");if(n==="component"||n==="pattern"){const r=o.length>=3?o[o.length-2]:null;return r?`${e} / ${ie(r)}`:e}return e}a(se,"deriveCategory");function ie(e){return e.split("-").filter(Boolean).map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}a(ie,"formatSegment");function ce(e){if(!e)return null;const t=e.replace(/^\s*:\s*/,"").trim();return t.toLowerCase()==="no description available"?null:t}a(ce,"normalizeDescription");const b=process.env.USE_STABLE_DOCS==="true"||process.env.USE_STABLE_DOCS==="1"?"https://wave.volue.com":"https://next.wave-design-system.pages.dev",le=`${b}/llms.txt`,de=1e3*60*15,pe=process.env.WAVE_RESOURCES_CACHE_TIME?Number.parseInt(process.env.WAVE_RESOURCES_CACHE_TIME,10):de;function S(e){const t=new URL(e,b);return t.pathname.endsWith(".md")||(t.pathname+=".md"),t.toString()}a(S,"createUrl");let w=null,E=0;async function me(){if(w!==null&&Date.now()<E)return w;const e=await ue();return w=e,E=Date.now()+pe,e}a(me,"listCachedResources");let y=null;async function ue(){return y||(y=ge().finally(()=>{y=null})),y}a(ue,"idempotentLoadResourcesFromLlms");async function ge(){const e=await g(le,void 0,"fetch llms.txt");return ne(e,b)}a(ge,"loadResourcesFromLlms");async function he(e){return g(e.url,void 0,`fetch ${e.name} documentation`)}a(he,"fetchComponent");function fe(e){return g(e.url,void 0,`fetch ${e.name} pattern`)}a(fe,"fetchPattern");async function ye(){return g(S("get-started/developing"),void 0,"fetch developing guide")}a(ye,"fetchDevelopingGuide");async function ve(){return g(S("tokens/colors"),void 0,"fetch color usage guidelines")}a(ve,"fetchColorUsageGuidelines");function k(){return Object.entries(D).map(([e,t])=>({name:e,svg:t}))}a(k,"listIcons");function xe(){const e=k();return v(e.map(t=>t.name))}a(xe,"getIconNames");function be(e,t){const n=t.trim().toLowerCase();return e.find(o=>o.name.toLowerCase()===n)}a(be,"findIconByName");async function M(e){return(await me()).filter(n=>n.type===e)}a(M,"listResourcesByType");function L(e,t){const n=t.trim().toLowerCase();return e.find(o=>o.name.toLowerCase()===n)}a(L,"findResourceByName");function T(){return M("component")}a(T,"listComponents");async function Se(){const e=await T();return v(e.map(t=>t.name))}a(Se,"getComponentNames");function $(){return M("pattern")}a($,"listPatterns");async function we(){const e=await $();return v(e.map(t=>t.name))}a(we,"getPatternNames");function _(e){return e.reduce((t,n)=>(t[n.category]||(t[n.category]=[]),t[n.category].push(n),t),{})}a(_,"groupResourcesByCategory");const ke={name:"get_color_usage",description:"Retrieve the Wave Design System color tokens and guidelines for applying color in user interfaces.",exec(e,{name:t,description:n}){e.registerTool(t,{description:n},async()=>{try{const o=await ve();return{content:[{type:"text",text:JSON.stringify(A)},{type:"text",text:`Here are the Wave Design System color usage guidelines:
|
|
2
2
|
|
|
3
3
|
${o}
|
|
4
4
|
|
|
5
5
|
---
|
|
6
|
-
Source: ${
|
|
6
|
+
Source: ${S("tokens/colors")}`}]}}catch(o){return{isError:!0,content:[{type:"text",text:`Failed to retrieve color usage guidelines: ${l(o)}`}]}}})}},Te={name:"get_component",description:"Retrieve comprehensive documentation for a specific Wave Design System component by name. This tool retrieves the import instructions, basic usage and advanced configuration examples, code snippets for common scenarios, available props/properties table and some general guidelines for a given Wave Design System component.",async ctx(){try{const e=await Se();if(e.length===0)throw new Error("llms.txt index contains no components");return{componentNames:e}}catch(e){throw new Error(`Failed to initialize component tool: ${l(e)}`)}},exec(e,{ctx:t,name:n,description:o}){e.registerTool(n,{description:o,inputSchema:{name:x.enum(t.componentNames).describe("The name of the component to retrieve documentation for. This can be derived from calling the `get_components` tool.")}},async({name:r})=>{try{const s=await T(),i=L(s,r);if(!i)throw new Error("Component not found");const c=await he(i);return c?{content:[{type:"text",text:`Here is the documentation for the \`${i.name}\` component from the Wave Design System:
|
|
7
7
|
|
|
8
8
|
${c}
|
|
9
9
|
|
|
10
10
|
---
|
|
11
|
-
Source: ${i.url}`}]}:{content:[{type:"text",text:`No documentation content found for the \`${i.name}\` component.`}]}}catch(
|
|
11
|
+
Source: ${i.url}`}]}:{content:[{type:"text",text:`No documentation content found for the \`${i.name}\` component.`}]}}catch(s){return{isError:!0,content:[{type:"text",text:`Failed to retrieve documentation for \`${r}\`: ${l(s)}`}]}}})}},$e={name:"get_icon",description:"Retrieve a specific icon information by name from Wave Design System.",exec(e,{name:t,description:n}){e.registerTool(t,{description:n,inputSchema:{name:x.enum(xe()).describe("The icon name to retrieve. This can be derived from calling the `list_icon` tool.")}},async({name:o})=>{try{const r=k(),s=be(r,o);if(!s)throw new Error("Icon not found.");const i=`<SvgIcon iconName="${s.name}" />`,c=`<div class="svgIcon svgIcon--stroked">
|
|
12
12
|
<svg focusable="false" aria-hidden="true">
|
|
13
|
-
<use xlink:href="#svg--${
|
|
13
|
+
<use xlink:href="#svg--${s.name}"></use>
|
|
14
14
|
</svg>
|
|
15
|
-
</div>`;return{content:[{type:"text",text:`# ${
|
|
15
|
+
</div>`;return{content:[{type:"text",text:`# ${s.name} icon
|
|
16
16
|
|
|
17
17
|
## React component:
|
|
18
18
|
|
|
@@ -29,13 +29,13 @@ ${c}
|
|
|
29
29
|
## Raw SVG code:
|
|
30
30
|
|
|
31
31
|
\`\`\`svg
|
|
32
|
-
${
|
|
33
|
-
\`\`\``}]}}catch(r){return{isError:!0,content:[{type:"text",text:`Failed to retrieve icon \`${o}\`: ${
|
|
32
|
+
${s.svg}
|
|
33
|
+
\`\`\``}]}}catch(r){return{isError:!0,content:[{type:"text",text:`Failed to retrieve icon \`${o}\`: ${l(r)}`}]}}})}},Ce={name:"get_pattern",description:"Retrieve documentation for a specific Wave Design System UX pattern by name. This tool provides guidance, examples and components that implement the selected pattern.",async ctx(){try{const e=await we();if(e.length===0)throw new Error("llms.txt index contains no patterns");return{patternNames:e}}catch(e){throw new Error(`Failed to initialize pattern tool: ${l(e)}`)}},exec(e,{ctx:t,name:n,description:o}){e.registerTool(n,{description:o,inputSchema:{name:x.enum(t.patternNames).describe("The name of the UX pattern to retrieve documentation for. This can be derived from calling the `list_patterns` tool.")}},async({name:r})=>{try{const s=await $(),i=L(s,r);if(!i)throw new Error("Pattern not found");const c=await fe(i);return{content:[{type:"text",text:`Here are the guidelines for the \`${i.name}\` UX pattern from the Wave Design System:
|
|
34
34
|
|
|
35
35
|
${c}
|
|
36
36
|
|
|
37
37
|
---
|
|
38
|
-
Source: ${i.url}`}]}}catch(
|
|
38
|
+
Source: ${i.url}`}]}}catch(s){return{isError:!0,content:[{type:"text",text:`Failed to retrieve documentation for \`${r}\`: ${l(s)}`}]}}})}},Be={name:"get_styling_guidelines",description:"Retrieve guidelines for styling Wave Design System components and creating custom styled components.",exec(e,{name:t,description:n}){e.registerTool(t,{description:n},async()=>({content:[{type:"text",text:`Wave Design System components can be styled using standard React approaches (className, style prop), but Wave provides specialized styling APIs for customizing component styles and creating custom styled components. These APIs are powered by Stitches.js, a CSS-in-JS library with near-zero runtime. They are the recommended approach because they integrate seamlessly with Wave's design tokens and provide type-safe styles.
|
|
39
39
|
|
|
40
40
|
## Styling APIs
|
|
41
41
|
|
|
@@ -117,7 +117,7 @@ Wave provides a comprehensive set of design tokens for colors, spacing, typograp
|
|
|
117
117
|
|
|
118
118
|
Wave provides media query tokens for responsive design. Use these tokens to create breakpoint-based styles:
|
|
119
119
|
|
|
120
|
-
${Object.entries(
|
|
120
|
+
${Object.entries(N).map(([r,s])=>`- \`@${r}\`: ${s}`).join(`
|
|
121
121
|
`)}
|
|
122
122
|
|
|
123
123
|
### Responsive styling examples
|
|
@@ -190,11 +190,11 @@ const Button = styled('button', {
|
|
|
190
190
|
1. **Use design tokens**: Always prefer design tokens (prefixed with \`$\`) over hardcoded values for consistency. Use the \`get_tokens\` tool to discover available tokens.
|
|
191
191
|
2. **Choose the right API**: Use \`css\` prop for one-off styles, \`styled()\` for reusable components
|
|
192
192
|
3. **Semantic breakpoints**: Use Wave's semantic media query tokens rather than arbitrary pixel values
|
|
193
|
-
`}]}))}},Ie={colors:["background","backgroundColor","backgroundImage","border","borderBlock","borderBlockEnd","borderBlockStart","borderBottom","borderBottomColor","borderColor","borderInline","borderInlineEnd","borderInlineStart","borderLeft","borderLeftColor","borderRight","borderRightColor","borderTop","borderTopColor","caretColor","color","columnRuleColor","fill","outlineColor","stroke","textDecorationColor"],fonts:["fontFamily"],fontSizes:["fontSize"],fontWeights:["fontWeight"],lineHeights:["lineHeight"],letterSpacings:["letterSpacing"],radii:["borderRadius","borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"],sizes:["blockSize","minBlockSize","maxBlockSize","inlineSize","minInlineSize","maxInlineSize","width","minWidth","maxWidth","height","minHeight","maxHeight","flexBasis","gridTemplateColumns","gridTemplateRows"],space:["gap","gridGap","columnGap","gridColumnGap","rowGap","gridRowGap","inset","insetBlock","insetBlockEnd","insetBlockStart","insetInline","insetInlineEnd","insetInlineStart","margin","marginTop","marginRight","marginBottom","marginLeft","marginBlock","marginBlockEnd","marginBlockStart","marginInline","marginInlineEnd","marginInlineStart","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingBlock","paddingBlockEnd","paddingBlockStart","paddingInline","paddingInlineEnd","paddingInlineStart","top","right","bottom","left","scrollMargin","scrollMarginTop","scrollMarginRight","scrollMarginBottom","scrollMarginLeft","scrollMarginX","scrollMarginY","scrollMarginBlock","scrollMarginBlockEnd","scrollMarginBlockStart","scrollMarginInline","scrollMarginInlineEnd","scrollMarginInlineStart","scrollPadding","scrollPaddingTop","scrollPaddingRight","scrollPaddingBottom","scrollPaddingLeft","scrollPaddingX","scrollPaddingY","scrollPaddingBlock","scrollPaddingBlockEnd","scrollPaddingBlockStart","scrollPaddingInline","scrollPaddingInlineEnd","scrollPaddingInlineStart"],zIndices:["zIndex"],shadows:["boxShadow","textShadow"],transitions:["transition"],borderWidths:["borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth"],borderStyles:["borderStyle","borderTopStyle","borderRightStyle","borderBottomStyle","borderLeftStyle"]},Re={name:"get_tokens",description:"Retrieve the Wave Design System design tokens (colors, fonts, spacing, font styles, etc.) exposed by the `@volue/wave-react` package. Includes token type mappings to CSS properties and usage examples.",exec(e,{name:t,description:n}){e.
|
|
193
|
+
`}]}))}},Ie={colors:["background","backgroundColor","backgroundImage","border","borderBlock","borderBlockEnd","borderBlockStart","borderBottom","borderBottomColor","borderColor","borderInline","borderInlineEnd","borderInlineStart","borderLeft","borderLeftColor","borderRight","borderRightColor","borderTop","borderTopColor","caretColor","color","columnRuleColor","fill","outlineColor","stroke","textDecorationColor"],fonts:["fontFamily"],fontSizes:["fontSize"],fontWeights:["fontWeight"],lineHeights:["lineHeight"],letterSpacings:["letterSpacing"],radii:["borderRadius","borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"],sizes:["blockSize","minBlockSize","maxBlockSize","inlineSize","minInlineSize","maxInlineSize","width","minWidth","maxWidth","height","minHeight","maxHeight","flexBasis","gridTemplateColumns","gridTemplateRows"],space:["gap","gridGap","columnGap","gridColumnGap","rowGap","gridRowGap","inset","insetBlock","insetBlockEnd","insetBlockStart","insetInline","insetInlineEnd","insetInlineStart","margin","marginTop","marginRight","marginBottom","marginLeft","marginBlock","marginBlockEnd","marginBlockStart","marginInline","marginInlineEnd","marginInlineStart","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingBlock","paddingBlockEnd","paddingBlockStart","paddingInline","paddingInlineEnd","paddingInlineStart","top","right","bottom","left","scrollMargin","scrollMarginTop","scrollMarginRight","scrollMarginBottom","scrollMarginLeft","scrollMarginX","scrollMarginY","scrollMarginBlock","scrollMarginBlockEnd","scrollMarginBlockStart","scrollMarginInline","scrollMarginInlineEnd","scrollMarginInlineStart","scrollPadding","scrollPaddingTop","scrollPaddingRight","scrollPaddingBottom","scrollPaddingLeft","scrollPaddingX","scrollPaddingY","scrollPaddingBlock","scrollPaddingBlockEnd","scrollPaddingBlockStart","scrollPaddingInline","scrollPaddingInlineEnd","scrollPaddingInlineStart"],zIndices:["zIndex"],shadows:["boxShadow","textShadow"],transitions:["transition"],borderWidths:["borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth"],borderStyles:["borderStyle","borderTopStyle","borderRightStyle","borderBottomStyle","borderLeftStyle"]},Re={name:"get_tokens",description:"Retrieve the Wave Design System design tokens (colors, fonts, spacing, font styles, etc.) exposed by the `@volue/wave-react` package. Includes token type mappings to CSS properties and usage examples.",exec(e,{name:t,description:n}){e.registerTool(t,{description:n},async()=>{const o=Object.entries(Ie).map(([r,s])=>`| ${r} | ${s.join(", ")} |`).join(`
|
|
194
194
|
`);return{content:[{type:"text",text:`Below is a list of design tokens available from Wave Design System.
|
|
195
|
-
There are ${Object.keys(
|
|
195
|
+
There are ${Object.keys(I).length} token types available:
|
|
196
196
|
|
|
197
|
-
${JSON.stringify(
|
|
197
|
+
${JSON.stringify(I)}`},{type:"text",text:`## Token Type to CSS Property Mapping
|
|
198
198
|
|
|
199
199
|
Token types are automatically mapped to CSS Properties:
|
|
200
200
|
|
|
@@ -256,7 +256,7 @@ const rawSize = theme.sizes['20'].value;
|
|
|
256
256
|
// .computedValue (or default) returns serialized CSS variables ("var(--colors-foregroundAccent)")
|
|
257
257
|
const cssVar = theme.colors.foregroundAccent.computedValue;
|
|
258
258
|
\`\`\`
|
|
259
|
-
`}]}})}},Ee={name:"init",description:"Get guide on how to setup or create a project that includes Wave Design System.",exec(e,{name:t,description:n}){e.
|
|
259
|
+
`}]}})}},Ee={name:"init",description:"Get guide on how to setup or create a project that includes Wave Design System.",exec(e,{name:t,description:n}){e.registerTool(t,{description:n},async()=>{try{return{content:[{type:"text",text:`The getting started documentation for developing with Wave Design System is included below.
|
|
260
260
|
|
|
261
261
|
It's **important** that if the project is using a tool like Vite or Next.js, one of the pre-configured starter templates should be used instead of manual configuration:
|
|
262
262
|
|
|
@@ -266,27 +266,27 @@ It's **important** that if the project is using a tool like Vite or Next.js, one
|
|
|
266
266
|
---
|
|
267
267
|
|
|
268
268
|
${await ye()}
|
|
269
|
-
`}]}}catch(o){return{isError:!0,content:[{type:"text",text:`Failed to retrieve getting started documentation: ${
|
|
269
|
+
`}]}}catch(o){return{isError:!0,content:[{type:"text",text:`Failed to retrieve getting started documentation: ${l(o)}`}]}}})}},Me={name:"list_components",description:"List all components available from the Wave Design System. This tool retrieves the names of all available Wave Design System components grouped by category.",exec(e,{name:t,description:n}){e.registerTool(t,{description:n},async()=>{try{const o=await T(),r=_(o);return{content:[{type:"text",text:`The following components are available in the Wave Design System:
|
|
270
270
|
|
|
271
271
|
${Object.entries(r).map(([i,c])=>`## ${i}
|
|
272
|
-
${c.map(
|
|
272
|
+
${c.map(d=>`- ${d.name}`).join(`
|
|
273
273
|
`)}`).join(`
|
|
274
274
|
|
|
275
275
|
`)}
|
|
276
276
|
|
|
277
277
|
Use the \`get_component\` tool to get more information about a specific component.
|
|
278
278
|
|
|
279
|
-
Use these components from the \`@volue/wave-react\` package.`}]}}catch(o){return{isError:!0,content:[{type:"text",text:`Failed to retrieve the component index: ${
|
|
279
|
+
Use these components from the \`@volue/wave-react\` package.`}]}}catch(o){return{isError:!0,content:[{type:"text",text:`Failed to retrieve the component index: ${l(o)}`}]}}})}},Le={name:"list_icons",description:"List all icons available from the Wave Design System. Icons are sourced directly from the `@volue/design-icons` package.",exec(e,{name:t,description:n}){e.registerTool(t,{description:n},async()=>{try{return{content:[{type:"text",text:`The following icons are available in the Wave Design System:
|
|
280
280
|
|
|
281
|
-
${
|
|
281
|
+
${k().map(s=>`- ${s.name}`).join(`
|
|
282
282
|
`)}
|
|
283
283
|
|
|
284
|
-
Use the \`get_icon\` tool to retrieve the SVG markup and usage guidelines for a specific icon.`}]}}catch(o){return{isError:!0,content:[{type:"text",text:`Failed to retrieve the icon data: ${
|
|
284
|
+
Use the \`get_icon\` tool to retrieve the SVG markup and usage guidelines for a specific icon.`}]}}catch(o){return{isError:!0,content:[{type:"text",text:`Failed to retrieve the icon data: ${l(o)}`}]}}})}},_e={name:"list_patterns",description:"List all UX patterns available from the Wave Design System. This tool retrieves the names of all available Wave Design System patterns grouped by category.",exec(e,{name:t,description:n}){e.registerTool(t,{description:n},async()=>{try{const o=await $(),r=_(o);return{content:[{type:"text",text:`The following UX patterns are available in the Wave Design System:
|
|
285
285
|
|
|
286
286
|
${Object.entries(r).map(([i,c])=>`## ${i}
|
|
287
|
-
${c.map(
|
|
287
|
+
${c.map(d=>`- ${d.name}`).join(`
|
|
288
288
|
`)}`).join(`
|
|
289
289
|
|
|
290
290
|
`)}
|
|
291
291
|
|
|
292
|
-
Use the \`get_pattern\` tool to access detailed guidance for a specific pattern.`}]}}catch(o){return{isError:!0,content:[{type:"text",text:`Failed to retrieve the pattern index: ${
|
|
292
|
+
Use the \`get_pattern\` tool to access detailed guidance for a specific pattern.`}]}}catch(o){return{isError:!0,content:[{type:"text",text:`Failed to retrieve the pattern index: ${l(o)}`}]}}})}},Pe=[Ee,Me,Te,_e,Ce,ke,Le,$e,Re,Be];async function We(e){await Promise.all(Pe.map(async t=>{let n;try{n=await t.ctx?.()}catch(o){console.error(`Skipping tool "${t.name}":`,o);return}t.exec(e,{name:t.name,description:t.description,ctx:n})}))}a(We,"initializeTools");export{We as i};
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
var
|
|
2
|
+
var a=Object.defineProperty;var o=(t,r)=>a(t,"name",{value:r,configurable:!0});import{i}from"./server-BUA33fNW.js";import{c as g}from"./server-BUA33fNW.js";import"node:fs";import"node:url";import"@modelcontextprotocol/sdk/server/mcp.js";if(i(import.meta.url)){const r=process.argv.slice(2)[0]||"stdio";async function s(){try{switch(r){case"stdio":await import("./transports/stdio.js");break;case"http":process.argv.push("--auto-run"),await import("./transports/http.js");break;default:console.error(`Unknown transport: ${r}`),console.error("Available transports: stdio, http"),process.exit(1)}}catch(e){console.error("Error running transport:",e),process.exit(1)}}o(s,"run"),s()}export{g as createServer};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var f=Object.defineProperty;var e=(r,t)=>f(r,"name",{value:t,configurable:!0});import{realpathSync as u}from"node:fs";import{pathToFileURL as p}from"node:url";import{McpServer as l}from"@modelcontextprotocol/sdk/server/mcp.js";const i=1e4;async function m(r,t,o){const a=o??`fetch ${r}`,s=AbortSignal.timeout(i);try{const n=await fetch(r,{signal:s,...t});if(!n.ok)throw new Error(`Failed to ${a}: ${n.status} ${n.statusText}`);return await n.text()}catch(n){throw s.aborted?new Error(`Failed to ${a}: timed out after ${i}ms`):n}}e(m,"fetchMarkdown");function v(r,t){return r.type===t}e(v,"isNodeType");function h(r){return Array.from(new Set(r))}e(h,"uniq");function g(r){return r instanceof Error?r.message:"Unknown error"}e(g,"getErrorMessage");function w(r){const t=r?.split(",").map(o=>o.trim()).filter(Boolean);return t?.length?t:void 0}e(w,"parseCsvEnv");function y(r){if(!process.argv[1])return!1;const t=u(process.argv[1]),o=p(t);return r===o.href}e(y,"isEntryFile");var E="0.2.0-next.0",c={version:E};function d(){return new l({name:"Wave Design System",version:c.version},{capabilities:{tools:{}}})}e(d,"createServer");export{c as a,v as b,d as c,m as f,g,y as i,w as p,h as u};
|
package/dist/transports/http.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
var
|
|
2
|
+
var g=Object.defineProperty;var n=(o,e)=>g(o,"name",{value:e,configurable:!0});import{StreamableHTTPServerTransport as h}from"@modelcontextprotocol/sdk/server/streamableHttp.js";import S from"cors";import p from"express";import{p as i,c as f,a as w,i as O}from"../server-BUA33fNW.js";import{i as T}from"../index-YvazYQ9b.js";import"node:fs";import"node:url";import"@modelcontextprotocol/sdk/server/mcp.js";import"@volue/design-colors/generic";import"@volue/design-icons";import"@volue/design-media-queries";import"remark-parse";import"unified";import"zod";import"@volue/design-colors/flat";const r=p(),P=i(process.env.CORS_ORIGIN)??"*";r.use(S({origin:P})),r.use(p.json());const l=i(process.env.ALLOWED_HOSTS),m=i(process.env.ALLOWED_ORIGINS);r.post("/mcp",async(o,e)=>{try{const s=f();await T(s);const t=new h({sessionIdGenerator:void 0,enableDnsRebindingProtection:!!(l||m),allowedHosts:l,allowedOrigins:m});e.on("close",()=>{t.close(),s.close()}),await s.connect(t),await t.handleRequest(o,e,o.body)}catch(s){console.error("Error handling MCP request:",s),e.headersSent||e.status(500).json({jsonrpc:"2.0",error:{code:-32603,message:"Internal server error"},id:null})}});const v=n((o,e)=>{e.status(405).json({jsonrpc:"2.0",error:{code:-32e3,message:"Method not allowed"},id:null})},"methodNotAllowed");r.get("/mcp",v),r.delete("/mcp",v),r.get("/",(o,e)=>{e.json({name:"Wave MCP Server",version:w.version,description:"MCP server for Wave Design System",endpoints:{"/":"Server information (this response)","/mcp":"Streamable HTTP endpoint for MCP connection","/health":"Health check endpoint"}})}),r.get("/health",(o,e)=>{e.json({status:"healthy",timestamp:new Date().toISOString(),uptime:process.uptime()})});const a=process.env.HOST??"localhost",c=process.env.PORT?Number(process.env.PORT):3e3;let u=null;(process.argv.includes("--auto-run")||O(import.meta.url))&&(u=r.listen(c,a,o=>{o&&(console.error("\u274C Failed to start server:",o),process.exit(1)),console.log(`\u{1F680} Wave MCP Server running on http://${a}:${c}`),console.log(`\u{1F517} Connect via http://${a}:${c}/mcp`)}));const d=n(async()=>{const o=u;o&&await new Promise(e=>o.close(()=>e())),console.log("\u{1F44B} Server shut down gracefully"),process.exit(0)},"cleanup");process.on("SIGTERM",d),process.on("SIGINT",d);export{r as default};
|
package/dist/transports/stdio.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
var
|
|
2
|
+
var e=Object.defineProperty;var t=(o,r)=>e(o,"name",{value:r,configurable:!0});import{StdioServerTransport as s}from"@modelcontextprotocol/sdk/server/stdio.js";import{c as p}from"../server-BUA33fNW.js";import{i as a}from"../index-YvazYQ9b.js";import"node:fs";import"node:url";import"@modelcontextprotocol/sdk/server/mcp.js";import"@volue/design-colors/generic";import"@volue/design-icons";import"@volue/design-media-queries";import"remark-parse";import"unified";import"zod";import"@volue/design-colors/flat";async function c(){const o=p();await a(o);const r=new s;await o.connect(r);const i=t(async()=>{await r.close(),process.exit(0)},"cleanup");process.on("SIGTERM",i),process.on("SIGINT",i)}t(c,"main"),c().catch(o=>{console.error("\u274C Failed to start server:",o),process.exit(1)});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@volue/wave-mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0-next.0",
|
|
4
4
|
"description": "An MCP server that connects AI tools to the Wave Design System",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"repository": {
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"devDependencies": {
|
|
70
70
|
"@types/node": "22.20.1",
|
|
71
71
|
"@volue/eslint-config": "1.3.12",
|
|
72
|
-
"@volue/wave-react": "2.0.0-next.
|
|
72
|
+
"@volue/wave-react": "2.0.0-next.10",
|
|
73
73
|
"eslint": "9.39.5",
|
|
74
74
|
"npm-run-all2": "8.0.4",
|
|
75
75
|
"pkgroll": "2.27.1",
|
package/dist/server-DavBHU1k.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var i=Object.defineProperty;var t=(e,r)=>i(e,"name",{value:r,configurable:!0});import{realpathSync as c}from"node:fs";import{pathToFileURL as f}from"node:url";import{McpServer as p}from"@modelcontextprotocol/sdk/server/mcp.js";async function u(e,r,s){const n=await fetch(e,r);if(!n.ok){const a=s??`fetch ${e}`;throw new Error(`Failed to ${a}: ${n.status} ${n.statusText}`)}return n.text()}t(u,"fetchMarkdown");function v(e,r){return e.type===r}t(v,"isNodeType");function m(e){return Array.from(new Set(e))}t(m,"uniq");function h(e){return e instanceof Error?e.message:"Unknown error"}t(h,"getErrorMessage");function g(e){if(!process.argv[1])return!1;const r=c(process.argv[1]),s=f(r);return e===s.href}t(g,"isEntryFile");var l="0.1.14-next.4",o={version:l};const w=new p({name:"Wave Design System",version:o.version},{capabilities:{tools:{}}});export{v as a,u as f,h as g,g as i,o as p,w as s,m as u};
|