sayshape-mcp 0.8.0 → 0.8.2
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 +1 -1
- package/dist/server.js +10 -8
- package/dist/ui.html +1 -1
- package/package.json +10 -3
package/README.md
CHANGED
|
@@ -322,7 +322,7 @@ To give Claude, ChatGPT and other chat apps a permanent HTTPS address, run the H
|
|
|
322
322
|
Start it with an exact version, never `@latest`, so what runs is what you checked:
|
|
323
323
|
|
|
324
324
|
```bash
|
|
325
|
-
npx -y sayshape-mcp@0.8.
|
|
325
|
+
npx -y sayshape-mcp@0.8.2 --http --host 0.0.0.0 --trust-proxy
|
|
326
326
|
```
|
|
327
327
|
|
|
328
328
|
| | |
|
package/dist/server.js
CHANGED
|
@@ -32774,7 +32774,7 @@ function loadPackedEngine() {
|
|
|
32774
32774
|
throw e;
|
|
32775
32775
|
});
|
|
32776
32776
|
}
|
|
32777
|
-
const VERSION = "0.8.
|
|
32777
|
+
const VERSION = "0.8.2";
|
|
32778
32778
|
const UI_URI = "ui://sayshape/interface.html";
|
|
32779
32779
|
const MAX_SPEC_CHARS = 2e4;
|
|
32780
32780
|
const MAX_REPORTED = 12;
|
|
@@ -33052,7 +33052,9 @@ function createServer(opts) {
|
|
|
33052
33052
|
const server = new McpServer(
|
|
33053
33053
|
{ name: "sayshape", title: "SayShape", version: VERSION },
|
|
33054
33054
|
{
|
|
33055
|
-
|
|
33055
|
+
// Says what SayShape is and does, never what to do instead of other tools or apps: Claude's connector
|
|
33056
|
+
// directory refuses instructions about model behavior or other tools (mcp/test/server.test.ts checks).
|
|
33057
|
+
instructions: "SayShape draws interactive interfaces inside the chat from a short spec: charts, tables, dashboards, stat cards, forms, calculators, trackers and checklists. show_interface draws a spec. Its description has a map of SayShape, enough to write a report at once; sayshape_docs returns the guide for every capability and element a screen needs, in one call. An interface's theme and sizes come from the chat app, so a request to restyle one (dark mode, bigger text) doesn't change it." + (data ? " A database is connected: describe_data and query_data read it, and show_interface's data argument shows a query's rows without retyping them." : mcpResults ? " Imported MCP result datasets are listed by list_datasets and shown through show_interface's data argument." : "")
|
|
33056
33058
|
}
|
|
33057
33059
|
);
|
|
33058
33060
|
const docsShape = (textOnly) => {
|
|
@@ -33068,14 +33070,14 @@ function createServer(opts) {
|
|
|
33068
33070
|
title: "SayShape docs",
|
|
33069
33071
|
description: 'Returns one SayShape guide for every capability and element you name together: the syntax, how they connect, and a short example. Ask once, for everything the screen needs, e.g. topics: ["forms", "calculations"], elements: ["slider"]. With nothing named, returns the map.',
|
|
33070
33072
|
inputSchema: docsShape(false),
|
|
33071
|
-
annotations: { readOnlyHint: true, openWorldHint: false }
|
|
33073
|
+
annotations: { title: "SayShape docs", readOnlyHint: true, openWorldHint: false }
|
|
33072
33074
|
},
|
|
33073
33075
|
async ({ elements, topics: names }) => {
|
|
33074
33076
|
const textOnly = cannotDrawViews(server);
|
|
33075
33077
|
return text(docsText(elements ?? [], names ?? [], !!data, !!mcpResults, textOnly, fileModeFor(textOnly), pressesSavedFor(textOnly)));
|
|
33076
33078
|
}
|
|
33077
33079
|
);
|
|
33078
|
-
const showDescription = (textOnly) => (textOnly ? "Draws an interactive interface from a spec
|
|
33080
|
+
const showDescription = (textOnly) => (textOnly ? "Draws an interactive interface from a spec, with the SayShape engine: suited to charts, tables, dashboards, stat cards, forms, calculators and trackers. This chat app can't show it in the conversation, " + (fileModeFor(textOnly) ? "so when the spec has nothing to fix the result gives the path of a file that draws it, to create a widget from for the person. " : "so when the spec has nothing to fix the result gives a small web page that draws it, to publish or save for the person. ") + "Specs can't run code or choose colors. " : "Shows an interactive interface inside the conversation, drawn by the SayShape engine from a spec: suited to charts, tables, dashboards, stat cards, forms, calculators and trackers. Specs can't run code or choose colors. ") + "The result lists lines the parser skipped, with the docs for those elements, so you can fix them." + (data ? ' To show rows from the database, pass data={"name": "d1"} with a dataset id from query_data and use that name in the spec (items=name).' : "") + (mcpResults ? " For imported MCP results, call list_datasets then pass the selected id in data. The model never needs the full rows." : "") + "\n\n" + adaptiveStart(!!data, !!mcpResults, textOnly, fileModeFor(textOnly), pressesSavedFor(textOnly));
|
|
33079
33081
|
const showTool = registerAppTool(
|
|
33080
33082
|
server,
|
|
33081
33083
|
"show_interface",
|
|
@@ -33091,7 +33093,7 @@ function createServer(opts) {
|
|
|
33091
33093
|
data: z.record(z.string(), z.string()).optional().describe('Datasets to load into the interface, by the name the spec uses: {"sales": "d1"}. Ids come from query_data.')
|
|
33092
33094
|
} : {}
|
|
33093
33095
|
},
|
|
33094
|
-
annotations: { readOnlyHint: true, openWorldHint: false },
|
|
33096
|
+
annotations: { title: "Show an interface", readOnlyHint: true, openWorldHint: false },
|
|
33095
33097
|
_meta: { ui: { resourceUri: UI_URI } }
|
|
33096
33098
|
},
|
|
33097
33099
|
async (args) => {
|
|
@@ -33199,7 +33201,7 @@ ${elementGuide(registry, failing).text}`);
|
|
|
33199
33201
|
{
|
|
33200
33202
|
title: "Describe the database",
|
|
33201
33203
|
description: "Lists the connected database's tables and views with their columns, row counts and how they join. Call it before writing a query.",
|
|
33202
|
-
annotations: { readOnlyHint: true, openWorldHint: false }
|
|
33204
|
+
annotations: { title: "Describe the database", readOnlyHint: true, openWorldHint: false }
|
|
33203
33205
|
},
|
|
33204
33206
|
async () => text(data.describe())
|
|
33205
33207
|
);
|
|
@@ -33209,7 +33211,7 @@ ${elementGuide(registry, failing).text}`);
|
|
|
33209
33211
|
title: "Query the database",
|
|
33210
33212
|
description: "Runs one read-only SQL SELECT on the connected SQLite database and keeps the result as a dataset (at most 500 rows). Returns the dataset id, its columns and a few sample rows; show it with show_interface's data argument. Aggregate in SQL rather than fetching raw rows.",
|
|
33211
33213
|
inputSchema: { sql: z.string().min(1).max(1e4).describe("One SELECT (or WITH … SELECT) statement in SQLite syntax.") },
|
|
33212
|
-
annotations: { readOnlyHint: true, openWorldHint: false }
|
|
33214
|
+
annotations: { title: "Query the database", readOnlyHint: true, openWorldHint: false }
|
|
33213
33215
|
},
|
|
33214
33216
|
async ({ sql }) => {
|
|
33215
33217
|
try {
|
|
@@ -33226,7 +33228,7 @@ ${elementGuide(registry, failing).text}`);
|
|
|
33226
33228
|
{
|
|
33227
33229
|
title: "List imported MCP result datasets",
|
|
33228
33230
|
description: "Lists ids, column names and types for tool results ingested by the trusted host. Never returns full rows.",
|
|
33229
|
-
annotations: { readOnlyHint: true, openWorldHint: false }
|
|
33231
|
+
annotations: { title: "List imported MCP result datasets", readOnlyHint: true, openWorldHint: false }
|
|
33230
33232
|
},
|
|
33231
33233
|
async () => text(listMcpDatasets(mcpResults))
|
|
33232
33234
|
);
|
package/dist/ui.html
CHANGED
|
@@ -331,7 +331,7 @@ ${l}
|
|
|
331
331
|
%%EOF
|
|
332
332
|
`)),_c(t)}let _f=null;function AG(e){if(!_f){_f=new Uint32Array(256);for(let n=0;n<256;n++){let i=n;for(let o=0;o<8;o++)i=i&1?3988292384^i>>>1:i>>>1;_f[n]=i>>>0}}let t=4294967295;for(let n=0;n<e.length;n++)t=(_f[(t^(e[n]??0))&255]??0)^t>>>8;return(t^4294967295)>>>0}function Y0(e){const t=new Uint8Array(e.reduce((o,[r])=>o+r,0)),n=new DataView(t.buffer);let i=0;for(const[o,r]of e)o===2?n.setUint16(i,r,!0):n.setUint32(i,r>>>0,!0),i+=o;return t}function OG(e){const t=[],n=[];let i=0;const o=0,r=23585;for(const[a,l]of e){const c=Zn(a),u=AG(l),d=Y0([[4,67324752],[2,20],[2,0],[2,0],[2,o],[2,r],[4,u],[4,l.length],[4,l.length],[2,c.length],[2,0]]);n.push(_c([Y0([[4,33639248],[2,20],[2,20],[2,0],[2,0],[2,o],[2,r],[4,u],[4,l.length],[4,l.length],[2,c.length],[2,0],[2,0],[2,0],[2,0],[4,0],[4,i]]),c])),t.push(d,c,l),i+=d.length+c.length+l.length}const s=_c(n);return _c([...t,s,Y0([[4,101010256],[2,0],[2,0],[2,e.length],[2,e.length],[4,s.length],[4,i],[2,0]])])}const J0=12192e3,Q0=6858e3,mr=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
333
333
|
`,Mf='xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:p="http://schemas.openxmlformats.org/presentationml/2006/main"',EG="http://schemas.openxmlformats.org/officeDocument/2006/relationships",Mc="application/vnd.openxmlformats-officedocument",NG=e=>e.replace(/[&<>"]/g,t=>t==="&"?"&":t==="<"?"<":t===">"?">":"""),xc=e=>`${mr}<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">${e.map(([t,n,i])=>`<Relationship Id="${t}" Type="${EG}/${n}" Target="${i}"/>`).join("")}</Relationships>`,e1='<p:nvGrpSpPr><p:cNvPr id="1" name=""/><p:cNvGrpSpPr/><p:nvPr/></p:nvGrpSpPr><p:grpSpPr><a:xfrm><a:off x="0" y="0"/><a:ext cx="0" cy="0"/><a:chOff x="0" y="0"/><a:chExt cx="0" cy="0"/></a:xfrm></p:grpSpPr>',Z6=e=>`<a:solidFill><a:schemeClr val="${e}"/></a:solidFill>`,PG='<a:ln w="9525"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill></a:ln>',q6=e=>`<a:${e}><a:latin typeface="Arial"/><a:ea typeface=""/><a:cs typeface=""/></a:${e}>`,CG=`${mr}<a:theme xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" name="SayShape"><a:themeElements><a:clrScheme name="SayShape"><a:dk1><a:srgbClr val="000000"/></a:dk1><a:lt1><a:srgbClr val="FFFFFF"/></a:lt1><a:dk2><a:srgbClr val="1F2937"/></a:dk2><a:lt2><a:srgbClr val="F3F4F6"/></a:lt2><a:accent1><a:srgbClr val="0F766E"/></a:accent1><a:accent2><a:srgbClr val="2563EB"/></a:accent2><a:accent3><a:srgbClr val="7C3AED"/></a:accent3><a:accent4><a:srgbClr val="D97706"/></a:accent4><a:accent5><a:srgbClr val="DC2626"/></a:accent5><a:accent6><a:srgbClr val="4B5563"/></a:accent6><a:hlink><a:srgbClr val="2563EB"/></a:hlink><a:folHlink><a:srgbClr val="7C3AED"/></a:folHlink></a:clrScheme><a:fontScheme name="SayShape">${q6("majorFont")}${q6("minorFont")}</a:fontScheme><a:fmtScheme name="SayShape"><a:fillStyleLst>${Z6("phClr").repeat(3)}</a:fillStyleLst><a:lnStyleLst>${PG.repeat(3)}</a:lnStyleLst><a:effectStyleLst>${"<a:effectStyle><a:effectLst/></a:effectStyle>".repeat(3)}</a:effectStyleLst><a:bgFillStyleLst>${Z6("phClr").repeat(3)}</a:bgFillStyleLst></a:fmtScheme></a:themeElements></a:theme>`,LG=`${mr}<p:sldMaster ${Mf}><p:cSld><p:bg><p:bgRef idx="1001"><a:schemeClr val="bg1"/></p:bgRef></p:bg><p:spTree>${e1}</p:spTree></p:cSld><p:clrMap bg1="lt1" tx1="dk1" bg2="lt2" tx2="dk2" accent1="accent1" accent2="accent2" accent3="accent3" accent4="accent4" accent5="accent5" accent6="accent6" hlink="hlink" folHlink="folHlink"/><p:sldLayoutIdLst><p:sldLayoutId id="2147483649" r:id="rId1"/></p:sldLayoutIdLst></p:sldMaster>`,zG=`${mr}<p:sldLayout ${Mf} type="blank" preserve="1"><p:cSld name="Blank"><p:spTree>${e1}</p:spTree></p:cSld><p:clrMapOvr><a:masterClrMapping/></p:clrMapOvr></p:sldLayout>`;function DG(e){return`${mr}<p:sld ${Mf}><p:cSld><p:spTree>${e1}<p:pic><p:nvPicPr><p:cNvPr id="2" name="Slide" descr="${NG(e)}"/><p:cNvPicPr><a:picLocks noChangeAspect="1"/></p:cNvPicPr><p:nvPr/></p:nvPicPr><p:blipFill><a:blip r:embed="rId2"/><a:stretch><a:fillRect/></a:stretch></p:blipFill><p:spPr><a:xfrm><a:off x="0" y="0"/><a:ext cx="${J0}" cy="${Q0}"/></a:xfrm><a:prstGeom prst="rect"><a:avLst/></a:prstGeom></p:spPr></p:pic></p:spTree></p:cSld><p:clrMapOvr><a:masterClrMapping/></p:clrMapOvr></p:sld>`}function RG(e,t=[]){const n=e.map((s,a)=>a+1),i=`${mr}<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types"><Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/><Default Extension="xml" ContentType="application/xml"/><Default Extension="jpg" ContentType="image/jpeg"/><Default Extension="png" ContentType="image/png"/><Override PartName="/ppt/presentation.xml" ContentType="${Mc}.presentationml.presentation.main+xml"/><Override PartName="/ppt/slideMasters/slideMaster1.xml" ContentType="${Mc}.presentationml.slideMaster+xml"/><Override PartName="/ppt/slideLayouts/slideLayout1.xml" ContentType="${Mc}.presentationml.slideLayout+xml"/><Override PartName="/ppt/theme/theme1.xml" ContentType="${Mc}.theme+xml"/>`+n.map(s=>`<Override PartName="/ppt/slides/slide${s}.xml" ContentType="${Mc}.presentationml.slide+xml"/>`).join("")+"</Types>",o=`${mr}<p:presentation ${Mf}><p:sldMasterIdLst><p:sldMasterId id="2147483648" r:id="rId1"/></p:sldMasterIdLst><p:sldIdLst>${n.map(s=>`<p:sldId id="${255+s}" r:id="rId${s+2}"/>`).join("")}</p:sldIdLst><p:sldSz cx="${J0}" cy="${Q0}"/><p:notesSz cx="${Q0}" cy="${J0}"/></p:presentation>`,r=[["[Content_Types].xml",io(i)],["_rels/.rels",io(xc([["rId1","officeDocument","ppt/presentation.xml"]]))],["ppt/presentation.xml",io(o)],["ppt/_rels/presentation.xml.rels",io(xc([["rId1","slideMaster","slideMasters/slideMaster1.xml"],["rId2","theme","theme/theme1.xml"],...n.map(s=>[`rId${s+2}`,"slide",`slides/slide${s}.xml`])]))],["ppt/theme/theme1.xml",io(CG)],["ppt/slideMasters/slideMaster1.xml",io(LG)],["ppt/slideMasters/_rels/slideMaster1.xml.rels",io(xc([["rId1","slideLayout","../slideLayouts/slideLayout1.xml"],["rId2","theme","../theme/theme1.xml"]]))],["ppt/slideLayouts/slideLayout1.xml",io(zG)],["ppt/slideLayouts/_rels/slideLayout1.xml.rels",io(xc([["rId1","slideMaster","../slideMasters/slideMaster1.xml"]]))]];return e.forEach((s,a)=>{const l=a+1;r.push([`ppt/slides/slide${l}.xml`,io(DG(t[a]||`Slide ${l}`))]);const c=s.format==="png"?"png":"jpg";r.push([`ppt/slides/_rels/slide${l}.xml.rels`,io(xc([["rId1","slideLayout","../slideLayouts/slideLayout1.xml"],["rId2","image",`../media/image${l}.${c}`]]))]),r.push([`ppt/media/image${l}.${c}`,s.data])}),OG(r)}const FG=Object.freeze({themePicker:!1,theme:N6,saveImage:!0,copyText:!0}),UG="sayshape-view",HG=Sc.map(e=>e.id),jG=e=>!!e&&HG.includes(e),V6=/^(\*\.)?[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)+$/,WG=1200;function BG(e){return e.reduce((t,n)=>t+8+n.length+1,0)}function ZG(e){const t=[...new Set(e.split(",").map(n=>n.trim().toLowerCase()).filter(Boolean))];return t.length&&BG(t)<=WG&&t.every(n=>V6.test(n))?t:null}function qG(e,t=!1){const n=typeof e=="string"?e.split(","):Array.isArray(e)?e.filter(o=>typeof o=="string"):[],i=n[n.length-1];return t&&i!==void 0&&!/^#?[0-9a-f]{6}$/i.test(i.trim())&&n.pop(),n}function VG(e){try{const t=new URL(e);return t.protocol!=="https:"||t.username||t.password||!V6.test(t.hostname)||t.hostname.includes("*")?null:t.href.length<=500?t.href:null}catch{return null}}function GG(e){const t={...FG};if(!e)return t;const n=new URLSearchParams(e);n.get("picker")==="1"&&(t.themePicker=!0),n.get("save")==="0"&&(t.saveImage=!1),n.get("copy")==="0"&&(t.copyText=!1),n.get("select")==="0"&&(t.selectText=!1),n.get("chat")==="0"&&(t.chatLook=!1),n.get("touch")==="0"&&(t.selectTouch=!1),n.get("touch")==="1"&&(t.selectTouch=!0),n.get("model")==="0"&&(t.modelColors=!1),n.get("scene")==="1"&&(t.scene=!0),n.get("behavior")==="1"&&(t.behavior=!0),n.get("presets")==="1"&&(t.presets=!0);const i=n.get("images"),o=i?ZG(i):null;o&&(t.imageHosts=o);const r=n.get("logo"),s=r?VG(r):null;s&&t.imageHosts?.includes(new URL(s).hostname)&&(t.logo=s);const a=n.get("theme");jG(a)&&(t.theme=a);const l=n.get("colors")?.split(",")??[],c=l.length<=O6&&l.every(d=>/^[0-9a-f]{6}$/.test(d))?l:[],u=n.get("accent");return!c.length&&u&&/^[0-9a-f]{6}$/.test(u)&&c.push(u),c.length&&(t.colors=c.map(d=>"#"+d)),t}function XG(e){return GG(e.querySelector(`meta[name="${UG}"]`)?.content)}function KG(e,t,n){return n&&(t==="light"||t==="dark")?"transparent":e.colors.surface}const YG=[{match:["claude"],color:"#D97757"},{match:["chatgpt","openai"],color:"#10A37F"},{match:["visual studio code","vscode"],color:"#007ACC"},{match:["gemini"],color:"#4285F4"},{match:["grok"],color:"#000000"}];function JG(e){if(typeof e!="string")return;const t=e.toLowerCase();return YG.find(n=>n.match.some(i=>t.includes(i)))?.color}function QG(e){return`SayShape view: host announced name=${JSON.stringify(e?.name)} version=${JSON.stringify(e?.version)}`}const eX="teal";function tX(e){if(e.conversationColors?.length)return e.conversationColors;if(e.operatorColors?.length)return e.operatorColors;if(!(e.picked||e.startupPreset!==eX))return e.brand?[e.brand]:void 0}function G6(e,t,n=!1){if(!t)return;const i=q0(qG(e?.colors,n));return i.length?i:void 0}function nX(e,t){return(e??[]).join(",")===(t??[]).join(",")}function oX(e,t){const n=t.split(`
|
|
334
|
-
`).filter(i=>i.trim()!=="").length;return`SayShape view: colors ${e.join(", ")} arrived ${n?`after ${n} line${n===1?"":"s"} of the spec`:"before the spec's first line"}`}const iX=['400 15px "Instrument Sans"','600 15px "Instrument Sans"','700 15px "Instrument Sans"'],gr=document.querySelector("#bar"),X6=document.querySelector("#view-tools"),zt=XG(document),t1=document.querySelector("#sayshape"),yt=new xy({name:"SayShape",version:"0.8.
|
|
334
|
+
`).filter(i=>i.trim()!=="").length;return`SayShape view: colors ${e.join(", ")} arrived ${n?`after ${n} line${n===1?"":"s"} of the spec`:"before the spec's first line"}`}const iX=['400 15px "Instrument Sans"','600 15px "Instrument Sans"','700 15px "Instrument Sans"'],gr=document.querySelector("#bar"),X6=document.querySelector("#view-tools"),zt=XG(document),t1=document.querySelector("#sayshape"),yt=new xy({name:"SayShape",version:"0.8.2"},{},{autoResize:!0});let we=null,rn=null,xf=zt.theme,K6=!1,Y6,n1,o1=0,J6=!1,Tc="",Tf=null;const Q6=new Map;let If=null;const Xs=new Set;let Ks=!1;const rX=`card
|
|
335
335
|
skeleton lines=1
|
|
336
336
|
skeleton shape=block height=150
|
|
337
337
|
skeleton lines=2
|
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sayshape-mcp",
|
|
3
|
-
"
|
|
4
|
-
"
|
|
3
|
+
"mcpName": "io.github.premmannava/sayshape-mcp",
|
|
4
|
+
"version": "0.8.2",
|
|
5
|
+
"description": "Open-source generative UI for Claude, ChatGPT, Cursor and VS Code: an MCP server that lets your AI answer with interactive screens. Set up with npx -y sayshape-mcp install.",
|
|
5
6
|
"type": "module",
|
|
6
7
|
"license": "MIT",
|
|
7
8
|
"bin": {
|
|
@@ -48,7 +49,13 @@
|
|
|
48
49
|
"generative-ui",
|
|
49
50
|
"claude",
|
|
50
51
|
"chatgpt",
|
|
51
|
-
"sayshape"
|
|
52
|
+
"sayshape",
|
|
53
|
+
"generative-ui-library",
|
|
54
|
+
"ai-ui",
|
|
55
|
+
"llm-ui",
|
|
56
|
+
"cursor",
|
|
57
|
+
"vscode",
|
|
58
|
+
"open-source"
|
|
52
59
|
],
|
|
53
60
|
"bugs": {
|
|
54
61
|
"url": "https://github.com/premmannava/sayshape/issues"
|