@slickfast/mcp 0.7.3 → 0.7.4

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
@@ -34,6 +34,10 @@ render_chart({ type: "bar", data: { labels: ["Q1","Q2","Q3"], series: [{ values:
34
34
  of any other type, composited into one image in a single render.
35
35
  - **`describe_type(type)`** → the exact data shape, a minimal working spec, and per-type
36
36
  gotchas. Call it first when you're unsure how to structure a type.
37
+ - **`gallery()`** → a curated demo gallery of example charts and dashboards — each as a
38
+ rendered image plus its spec. Just ask *"show me a demo"* or *"what can you make?"*.
39
+ - **`list_palettes()`** → every valid `palette` name, grouped into flat palettes and nested
40
+ themes, with their colors. Ask *"what palettes are available?"*.
37
41
 
38
42
  ## Install
39
43
 
package/dist/index.js CHANGED
@@ -2847,6 +2847,47 @@ var EXAMPLES = {
2847
2847
  swot: { type: "swot", cells: [{ title: "Strengths", items: ["Fast", "Cheap"] }, { title: "Weaknesses", items: ["New brand"] }, { title: "Opportunities", items: ["AI demand"] }, { title: "Threats", items: ["Incumbents"] }] },
2848
2848
  dashboard: { type: "dashboard", title: "Overview", layout: { cols: 2 }, tiles: [{ chart: { type: "kpi", label: "Revenue", value: 128400, valuePrefix: "$", delta: 12.4 } }, { chart: { type: "kpi", label: "Users", value: 8640, delta: 8.1 } }, { span: [2, 1], chart: { type: "bar", data: { labels: ["A", "B", "C"], series: [{ name: "Sales", values: [8, 5, 3] }] } } }] }
2849
2849
  };
2850
+ var GALLERY = [
2851
+ {
2852
+ name: "Dashboard \u2014 SaaS business review",
2853
+ blurb: "Nine charts tiled into one image in a single render.",
2854
+ spec: { type: "dashboard", title: "Acme \u2014 Monthly Business Review", palette: "Clean Corporate", layout: { cols: 3, tileHeight: 250 }, tiles: [
2855
+ { chart: { type: "kpi", label: "Monthly Recurring Revenue", value: 128400, valuePrefix: "$", delta: 12.4 } },
2856
+ { chart: { type: "kpi", label: "Active Users", value: 8640, delta: 8.1 } },
2857
+ { chart: { type: "kpi", label: "Churn", value: 2.3, valueUnit: "%", delta: -0.4, deltaUnit: "pt", deltaGoodWhen: "down" } },
2858
+ { span: [2, 1], chart: { type: "line", title: "Monthly active users", data: { labels: ["Jan", "Feb", "Mar", "Apr", "May", "Jun"], series: [{ name: "Product A", values: [120, 190, 170, 250, 230, 310] }, { name: "Product B", values: [80, 110, 160, 140, 210, 260] }] } } },
2859
+ { chart: { type: "gauge", title: "Net revenue retention", value: 112, min: 0, max: 150, valueUnit: "%" } },
2860
+ { chart: { type: "funnel", title: "Signup funnel", stages: [{ label: "Visitors", value: 12e3 }, { label: "Signups", value: 4200 }, { label: "Trials", value: 1800 }, { label: "Paid", value: 640 }] } },
2861
+ { chart: { type: "waffle", title: "Revenue by segment", parts: [{ label: "Enterprise", value: 45 }, { label: "SMB", value: 30 }, { label: "Other", value: 15 }] } },
2862
+ { chart: { type: "bar", title: "Deals by stage", data: { labels: ["Lead", "Demo", "Won"], series: [{ name: "Deals", values: [42, 24, 11] }] } } }
2863
+ ] }
2864
+ },
2865
+ {
2866
+ name: "Line \u2014 trend over time",
2867
+ blurb: "Multi-series line with legend.",
2868
+ spec: { type: "line", title: "Monthly active users", data: { labels: ["Jan", "Feb", "Mar", "Apr", "May", "Jun"], series: [{ name: "Product A", values: [120, 190, 170, 250, 230, 310] }, { name: "Product B", values: [80, 110, 160, 140, 210, 260] }] } }
2869
+ },
2870
+ {
2871
+ name: "Donut \u2014 part of whole",
2872
+ blurb: "Composition with a center total.",
2873
+ spec: { type: "donut", title: "Market share", data: { labels: ["Us", "Rival A", "Rival B", "Other"], series: [{ values: [38, 27, 20, 15] }] } }
2874
+ },
2875
+ {
2876
+ name: "Funnel \u2014 conversion",
2877
+ blurb: "Stages narrowing top \u2192 bottom with %.",
2878
+ spec: { type: "funnel", title: "Signup funnel", stages: [{ label: "Visitors", value: 12e3 }, { label: "Signups", value: 4200 }, { label: "Trials", value: 1800 }, { label: "Paid", value: 640 }] }
2879
+ },
2880
+ {
2881
+ name: "Heatmap \u2014 a grid of values",
2882
+ blurb: "Value \u2192 color intensity.",
2883
+ spec: { type: "heatmap", title: "Active users by day & time", rows: ["Mon", "Tue", "Wed", "Thu", "Fri"], columns: ["9a", "12p", "3p", "6p", "9p"], values: [[2, 5, 8, 3, 1], [1, 4, 9, 6, 2], [0, 3, 7, 8, 4], [2, 6, 9, 7, 3], [3, 7, 6, 4, 5]] }
2884
+ },
2885
+ {
2886
+ name: "Waterfall \u2014 running total",
2887
+ blurb: "Signed steps to a final total.",
2888
+ spec: { type: "waterfall", title: "Cash flow", start: 120, steps: [{ label: "Sales", value: 80 }, { label: "Refunds", value: -18 }, { label: "Costs", value: -42 }, { label: "Other", value: 12 }] }
2889
+ }
2890
+ ];
2850
2891
 
2851
2892
  // ../../packages/raster/raster.mjs
2852
2893
  import { Resvg } from "@resvg/resvg-js";
@@ -3057,7 +3098,7 @@ var inputSchema = {
3057
3098
  scale: z.number().optional().describe("png pixel-density multiplier (default 2 = retina)"),
3058
3099
  outputPath: z.string().optional().describe('LOCAL save: write the rendered chart to this file on disk AND still return the inline image. PNG by default, or SVG if the path ends in ".svg". Accepts absolute, ~, or relative paths (parent dirs auto-created). Works on a local stdio install only \u2014 a hosted/remote server has no access to your disk.')
3059
3100
  };
3060
- var server = new McpServer({ name: "slickfast", version: "0.7.3" });
3101
+ var server = new McpServer({ name: "slickfast", version: "0.7.4" });
3061
3102
  var GOTCHAS = {
3062
3103
  gantt: ["start/end are timeline positions; the axis spans min(start)\u2026max(end), so a non-zero-based timeline (years, offset quarters) fills the plot correctly."],
3063
3104
  diverging: ["needs 2 series \u2014 series A is forced positive (up), series B negative (down), regardless of stored sign."],
@@ -3141,6 +3182,55 @@ server.registerTool("describe_type", {
3141
3182
  const all = TYPES.map((t) => ({ type: t.type, family: t.family, summary: t.summary }));
3142
3183
  return { content: [{ type: "text", text: JSON.stringify({ count: all.length, types: all, hint: "call describe_type with a `type` for its fields + a minimal spec" }, null, 2) }] };
3143
3184
  });
3185
+ server.registerTool("gallery", {
3186
+ title: "Gallery / demo",
3187
+ description: 'Render a curated DEMO GALLERY of example charts and dashboards. Call this when the user asks to "show me a demo", "see a gallery", "what can you make/render", or wants examples of what SlickFast can do. Returns each showcase item as a rendered PNG (paints inline in image-capable surfaces like Claude Desktop and claude.ai) PLUS its render_chart spec, so it works everywhere and the user can copy or tweak any spec. Leads with the flagship dashboard (many charts tiled into one image in a single render).',
3188
+ inputSchema: {
3189
+ type: z.enum(TYPE_NAMES).optional().describe('render just this ONE type (its showcase spec, or its minimal example) \u2014 for "show me a <type>"; omit for the curated multi-type showcase'),
3190
+ limit: z.number().optional().describe("max items in the showcase (default all " + GALLERY.length + "); ignored when `type` is set")
3191
+ }
3192
+ }, async ({ type, limit }) => {
3193
+ let items;
3194
+ if (type) {
3195
+ const g = GALLERY.find((x) => x.spec.type === type);
3196
+ items = [{ name: type, blurb: g ? g.blurb : `Example ${type} chart.`, spec: g ? g.spec : EXAMPLES[type] }];
3197
+ } else {
3198
+ items = GALLERY.slice(0, limit && limit > 0 ? limit : GALLERY.length);
3199
+ }
3200
+ const content = [{ type: "text", text: `SlickFast gallery \u2014 ${items.length} example${items.length > 1 ? "s" : ""}. Each is one render_chart call; the spec is shown under it.` }];
3201
+ for (const it of items) {
3202
+ try {
3203
+ const png = svgToPng(renderSpec(it.spec), { scale: 2 });
3204
+ content.push({ type: "text", text: `### ${it.name}
3205
+ ${it.blurb}
3206
+ \`\`\`json
3207
+ ${JSON.stringify(it.spec)}
3208
+ \`\`\`` });
3209
+ content.push({ type: "image", data: png.toString("base64"), mimeType: "image/png" });
3210
+ } catch (e) {
3211
+ content.push({ type: "text", text: `(${it.name} failed to render: ${e?.message || e})` });
3212
+ }
3213
+ }
3214
+ return { content };
3215
+ });
3216
+ server.registerTool("list_palettes", {
3217
+ title: "List palettes",
3218
+ description: 'List every valid `palette` name, grouped into FLAT palettes (great for any chart) and NESTED themes (designed for pieofpie drill-downs, but accepted on any chart), each with its representative colors. Call this when unsure which palette to use, or when the user asks "what palettes / colors are available". Any name returned here is a valid `palette` value \u2014 anything else is rejected.',
3219
+ inputSchema: {}
3220
+ }, async () => {
3221
+ const flat = FLAT_PALETTES.map((p) => ({ name: p.name, colors: p.colors }));
3222
+ const nested = NESTED_THEMES.map((t) => ({
3223
+ name: t.name,
3224
+ anchor: t.tiers && t.tiers[0] && t.tiers[0][0] || t.pie1 && t.pie1[0] || null,
3225
+ colors: (t.tiers ? t.tiers.flat() : t.pie1) || [],
3226
+ dark: !!t.dark
3227
+ }));
3228
+ return { content: [{ type: "text", text: JSON.stringify({
3229
+ flat,
3230
+ nested,
3231
+ hint: 'pass any name as `palette`. Flat is the default for most charts; nested themes shine on pieofpie. "dark: true" themes assume a dark background.'
3232
+ }, null, 2) }] };
3233
+ });
3144
3234
  server.registerResource("chart-spec", "spec://chart-spec", {
3145
3235
  title: "ChartSpec contract",
3146
3236
  description: "Full field reference for render_chart.",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@slickfast/mcp",
3
- "version": "0.7.3",
3
+ "version": "0.7.4",
4
4
  "description": "SlickFast — render 47 chart & info-design types (bar, line, pie, KPI, cards, funnel, matrix, gauge, calendar…) plus multi-chart dashboards tiled into one image, as SVG/PNG via MCP. Local and deterministic; nothing leaves your machine.",
5
5
  "keywords": ["mcp", "model-context-protocol", "chart", "charts", "dashboard", "data-visualization", "svg", "png", "ai", "agent", "claude", "llm", "deterministic"],
6
6
  "license": "AGPL-3.0-only",