@volue/wave-mcp 0.1.2-next.0 → 0.1.2-next.1
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
|
@@ -109,3 +109,33 @@ You can customize the port using environment variable:
|
|
|
109
109
|
```bash
|
|
110
110
|
PORT=8080 npx @volue/wave-mcp@latest http
|
|
111
111
|
```
|
|
112
|
+
|
|
113
|
+
## Docker Deployment
|
|
114
|
+
|
|
115
|
+
Pre-built Docker images are automatically published to GitHub Container Registry on every release.
|
|
116
|
+
|
|
117
|
+
### Running the Container
|
|
118
|
+
|
|
119
|
+
The container runs the HTTP transport by default on port 3000:
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
docker run -p 3000:3000 ghcr.io/volue/wave-mcp:latest
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
The MCP endpoint will be available at `http://localhost:3000/mcp`.
|
|
126
|
+
|
|
127
|
+
### Custom Configuration
|
|
128
|
+
|
|
129
|
+
Override the default port:
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
docker run -p 8080:8080 -e PORT=8080 ghcr.io/volue/wave-mcp:latest
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
### Building Locally
|
|
136
|
+
|
|
137
|
+
To build the image yourself from source:
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
docker buildx build -f mcp/Dockerfile -t wave-mcp .
|
|
141
|
+
```
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _=Object.defineProperty;var s=(e,t)=>_(e,"name",{value:t,configurable:!0});import{a as p,f as m,u as g,g as d}from"./server-
|
|
1
|
+
var _=Object.defineProperty;var s=(e,t)=>_(e,"name",{value:t,configurable:!0});import{a as p,f as m,u as g,g as d}from"./server-Ck6G1608.js";import U from"@volue/design-colors/generic";import*as P from"@volue/design-icons";import*as A from"@volue/design-media-queries";import k from"@volue/wave-react/tokens";import D from"remark-parse";import M from"unified";import{z as f}from"zod";const z=M().use(D),w={Components:"component","UX patterns":"pattern"};function N(e,t){const o=z.parse(e);let n=null;return o.children.reduce((r,i)=>{if(p(i,"heading")&&i.depth===2)return n=j(i),r;if(!n||!p(i,"list"))return r;const a=n,c=i.children.map(l=>F(l,a,t)).filter(l=>l!==null);return r.concat(c)},[])}s(N,"parseLlmsIndex");function j(e){const[t]=e.children;if(!t||!p(t,"text"))return null;const o=t.value.trim();if(!(o in w))return null;const n=w[o];return{title:o,type:n}}s(j,"extractSectionContext");function F(e,t,o){const[n]=e.children;if(!n||!p(n,"paragraph")||n.children.length!==2)return null;const[r,i]=n.children;if(!p(r,"link")||!p(i,"text")||r.children.length!==1)return null;const a=r.children[0];if(!p(a,"text"))return null;const c=a.value.trim(),l=r.url.replace(/^\//,""),R=new URL(l,`${o}/`).toString(),I=O(l),L=G(t.title,l,t.type),W=V(i.value);return{name:c,slug:I,category:L,section:t.title,type:t.type,url:R,description:W??void 0}}s(F,"listItemToResource");function O(e){return e.replace(/\.md$/,"").split("/").pop()??""}s(O,"deriveSlug");function G(e,t,o){const n=t.replace(/\.md$/,"").split("/");if(o==="component"||o==="pattern"){const r=n.length>=3?n[n.length-2]:null;return r?`${e} / ${H(r)}`:e}return e}s(G,"deriveCategory");function H(e){return e.split("-").filter(Boolean).map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}s(H,"formatSegment");function V(e){if(!e)return null;const t=e.replace(/^\s*:\s*/,"").trim();return t.toLowerCase()==="no description available"?null:t}s(V,"normalizeDescription");const h=process.env.USE_STABLE_DOCS==="true"||process.env.USE_STABLE_DOCS==="1"?"https://wave.volue.com":"https://wave-design-system.vercel.app",q=`${h}/llms.txt`,X=1e3*60*15,Q=process.env.WAVE_RESOURCES_CACHE_TIME?Number.parseInt(process.env.WAVE_RESOURCES_CACHE_TIME,10):X;function y(e){const t=new URL(e,h);return t.pathname.endsWith(".md")||(t.pathname+=".md"),t.toString()}s(y,"createUrl");let v=null,$=0;async function Y(){if(v!==null&&Date.now()<$)return v;const e=await J();return v=e,$=Date.now()+Q,e}s(Y,"listCachedResources");let u=null;async function J(){return u||(u=K().finally(()=>{u=null})),u}s(J,"idempotentLoadResourcesFromLlms");async function K(){const e=await m(q,void 0,"fetch llms.txt");return N(e,h)}s(K,"loadResourcesFromLlms");async function Z(e){return m(e.url,void 0,`fetch ${e.name} documentation`)}s(Z,"fetchComponent");function ee(e){return m(e.url,void 0,`fetch ${e.name} pattern`)}s(ee,"fetchPattern");async function te(){return m(y("get-started/developing"),void 0,"fetch developing guide")}s(te,"fetchDevelopingGuide");async function ne(){return m(y("tokens/colors"),void 0,"fetch color usage guidelines")}s(ne,"fetchColorUsageGuidelines");function b(){return Object.entries(P).map(([e,t])=>({name:e,svg:t}))}s(b,"listIcons");function oe(){const e=b();return g(e.map(t=>t.name))}s(oe,"getIconNames");function re(e,t){const o=t.trim().toLowerCase();return e.find(n=>n.name.toLowerCase()===o)}s(re,"findIconByName");async function T(e){return(await Y()).filter(o=>o.type===e)}s(T,"listResourcesByType");function C(e,t){const o=t.trim().toLowerCase();return e.find(n=>n.name.toLowerCase()===o)}s(C,"findResourceByName");function S(){return T("component")}s(S,"listComponents");async function ie(){const e=await S();return g(e.map(t=>t.name))}s(ie,"getComponentNames");function x(){return T("pattern")}s(x,"listPatterns");async function se(){const e=await x();return g(e.map(t=>t.name))}s(se,"getPatternNames");function B(e){return e.reduce((t,o)=>(t[o.category]||(t[o.category]=[]),t[o.category].push(o),t),{})}s(B,"groupResourcesByCategory");const ae={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:o}){e.tool(t,o,async()=>{try{const n=await ne();return{content:[{type:"text",text:JSON.stringify(U)},{type:"text",text:`Here are the Wave Design System color usage guidelines:
|
|
2
2
|
|
|
3
3
|
${n}
|
|
4
4
|
|
|
@@ -241,7 +241,7 @@ const Button = styled('button', {
|
|
|
241
241
|
});
|
|
242
242
|
\`\`\`
|
|
243
243
|
|
|
244
|
-
For more comprehensive styling guidelines including responsive design, variants, and best practices,
|
|
244
|
+
For more comprehensive styling guidelines including responsive design, variants, and best practices, use the \`get_styling_guidelines\` tool.
|
|
245
245
|
`}]}})}},ge={name:"init",description:"Get guide on how to setup or create a project that includes Wave Design System.",exec(e,{name:t,description:o}){e.tool(t,o,async()=>{try{return{content:[{type:"text",text:`The getting started documentation for developing with Wave Design System is included below.
|
|
246
246
|
|
|
247
247
|
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:
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
var e=Object.defineProperty;var t=(o,r)=>e(o,"name",{value:r,configurable:!0});import{i}from"./server-
|
|
2
|
+
var e=Object.defineProperty;var t=(o,r)=>e(o,"name",{value:r,configurable:!0});import{i}from"./server-Ck6G1608.js";import{s as g}from"./server-Ck6G1608.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(a){console.error("Error running transport:",a),process.exit(1)}}t(s,"run"),s()}export{g as server};
|
|
@@ -1 +1 @@
|
|
|
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,n){const s=await fetch(e,r);if(!s.ok){const a=n??`fetch ${e}`;throw new Error(`Failed to ${a}: ${s.status} ${s.statusText}`)}return s.text()}t(u,"fetchMarkdown");function m(e,r){return e.type===r}t(m,"isNodeType");function v(e){return Array.from(new Set(e))}t(v,"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]),n=f(r);return e===n.href}t(g,"isEntryFile");var l="0.1.2-next.
|
|
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,n){const s=await fetch(e,r);if(!s.ok){const a=n??`fetch ${e}`;throw new Error(`Failed to ${a}: ${s.status} ${s.statusText}`)}return s.text()}t(u,"fetchMarkdown");function m(e,r){return e.type===r}t(m,"isNodeType");function v(e){return Array.from(new Set(e))}t(v,"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]),n=f(r);return e===n.href}t(g,"isEntryFile");var l="0.1.2-next.1",o={version:l};const w=new p({name:"Wave Design System",version:o.version,capabilities:{prompts:{},resources:{},tools:{}}});export{m as a,u as f,h as g,g as i,o as p,w as s,v as u};
|
package/dist/transports/http.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
var h=Object.defineProperty;var i=(e,s)=>h(e,"name",{value:s,configurable:!0});import{StreamableHTTPServerTransport as f}from"@modelcontextprotocol/sdk/server/streamableHttp.js";import{isInitializeRequest as g}from"@modelcontextprotocol/sdk/types.js";import I from"cors";import l from"express";import{randomUUID as S}from"node:crypto";import{s as m,p as T,i as w}from"../server-
|
|
2
|
+
var h=Object.defineProperty;var i=(e,s)=>h(e,"name",{value:s,configurable:!0});import{StreamableHTTPServerTransport as f}from"@modelcontextprotocol/sdk/server/streamableHttp.js";import{isInitializeRequest as g}from"@modelcontextprotocol/sdk/types.js";import I from"cors";import l from"express";import{randomUUID as S}from"node:crypto";import{s as m,p as T,i as w}from"../server-Ck6G1608.js";import{i as y}from"../index-CUIMoEN5.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"@volue/wave-react/tokens";import"remark-parse";import"unified";import"zod";const t=l(),P=process.env.CORS_ORIGIN?.split(",")??"*";t.use(I({origin:P,exposedHeaders:["Mcp-Session-Id"],allowedHeaders:["Content-Type","mcp-session-id"]})),t.use(l.json());const r=new Map;t.post("/mcp",async(e,s)=>{const n=e.headers["mcp-session-id"];let o;if(n&&r.has(n))o=r.get(n);else if(!n&&g(e.body))o=new f({sessionIdGenerator:i(()=>S(),"sessionIdGenerator"),onsessioninitialized:i(v=>{r.set(v,o)},"onsessioninitialized")}),o.onclose=()=>{o.sessionId&&r.has(o.sessionId)&&r.delete(o.sessionId)},await y(m),await m.connect(o);else return s.status(400).json({error:{message:"Bad Request: No valid session ID provided"}});await o.handleRequest(e,s,e.body)});const d=i(async(e,s)=>{const n=e.headers["mcp-session-id"];if(!n||!r.has(n))return s.status(404).send("Invalid or missing session ID");await r.get(n).handleRequest(e,s)},"handleSessionRequest");t.get("/mcp",d),t.delete("/mcp",d),t.get("/",(e,s)=>{s.json({name:"Wave MCP Server",version:T.version,description:"MCP server for Wave Design System",endpoints:{"/":"Server information (this response)","/mcp":"Streamable HTTP endpoint for MCP connection","/health":"Health check endpoint"}})}),t.get("/health",(e,s)=>{s.json({status:"healthy",timestamp:new Date().toISOString(),uptime:process.uptime()})});const a=process.env.HOST??"localhost",p=process.env.PORT?Number(process.env.PORT):3e3;let c=null;(process.argv.includes("--auto-run")||w(import.meta.url))&&(c=t.listen(p,a,e=>{e&&(console.error("\u274C Failed to start server:",e),process.exit(1)),console.log(`\u{1F680} Wave MCP Server running on http://${a}:${p}`),console.log(`\u{1F517} Connect via http://${a}:${p}/mcp`)}));const u=i(async()=>{const e=Array.from(r.values()).map(s=>s.close());c&&e.push(new Promise(s=>c.close(()=>s()))),await Promise.allSettled(e),console.log("\u{1F44B} Server shut down gracefully"),process.exit(0)},"cleanup");process.on("SIGTERM",u),process.on("SIGINT",u);export{t as default};
|
package/dist/transports/stdio.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
var s=Object.defineProperty;var t=(o,r)=>s(o,"name",{value:r,configurable:!0});import{StdioServerTransport as e}from"@modelcontextprotocol/sdk/server/stdio.js";import{s as i}from"../server-
|
|
2
|
+
var s=Object.defineProperty;var t=(o,r)=>s(o,"name",{value:r,configurable:!0});import{StdioServerTransport as e}from"@modelcontextprotocol/sdk/server/stdio.js";import{s as i}from"../server-Ck6G1608.js";import{i as p}from"../index-CUIMoEN5.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"@volue/wave-react/tokens";import"remark-parse";import"unified";import"zod";async function a(){await p(i);const o=new e;await i.connect(o);const r=t(async()=>{await o.close(),process.exit(0)},"cleanup");process.on("SIGTERM",r),process.on("SIGINT",r)}t(a,"main"),a().catch(o=>{console.error("\u274C Failed to start server:",o),process.exit(1)});
|