SayShape
This server has a remotely hosted endpoint. Open its connector listing for connection details, authentication requirements, and setup instructions:
The picture is one request, answered by the same model in two formats and replayed in real time. The SayShape answer is a working chart after 2.2 seconds and 616 characters. The HTML answer takes 11.8 seconds and 5,196 characters.
Why not let the model write HTML?
Models can write good HTML. SayShape takes a different route: rendering, styling, interactions and validation are built into the engine, so the model only has to describe the interface. Your theme decides how it looks, and the engine decides how it behaves.
Model-generated HTML/CSS/JavaScript | SayShape | |
Execution | Generated JavaScript needs controlled execution or a sandbox. | Specs describe UI through supported elements, expressions and actions. They can't run arbitrary JavaScript, images load only from hosts you allow, and links are handed to your app, never opened. |
Design consistency | Consistency depends on the styling instructions and on what each answer generates. | Standard elements use your theme automatically. The model picks semantic roles such as |
Generation size | The model may need to write markup, styles and interaction code. | Rendering and interactions are built in, so the model describes the interface in a compact spec. |
Error handling | Validation and recovery depend on the host integration. | Built-in validation reports problems with their line numbers and how to fix them, skips what is invalid and draws the rest, so the model can correct itself. |
Streaming | HTML can render progressively; interactivity depends on when the scripts and handlers it needs are ready. | Each complete, valid line can draw during generation, with its interactions already implemented by the engine. |
Related MCP server: Photon MCP Server
What a model writes
This is the whole SayShape answer from the picture above, exactly as the model wrote it:
state view="Week" week=[{label: "Mon", signups: 30}, {label: "Tue", signups: 42}, {label: "Wed", signups: 38}, {label: "Thu", signups: 51}, {label: "Fri", signups: 47}, {label: "Sat", signups: 22}, {label: "Sun", signups: 18}] month=[{label: "Week 1", signups: 210}, {label: "Week 2", signups: 245}, {label: "Week 3", signups: 230}, {label: "Week 4", signups: 268}]
derive shown={view == 'Week' ? week : month}
card
text "Signups" style=title
segmented bind=view options="Week,Month"
stat label="Total signups" value={number(sum(shown, 'signups'))}
chart kind=bar items=shown x=label y=signups format=numberOne element per line, indentation for nesting. Every finished line can be drawn at once, and a half-finished answer is still a valid, smaller screen.
State and values worked out from it.
stateholds the data,derivekeeps a value up to date,bind=connects a control to state, and{…}reads it. Pressing Month changesview; the total and the chart follow.No colors, fonts or pixel sizes. The model picks roles such as
style=title. The engine and your theme decide how they look, so every screen matches. A model can still give a screen its own character with roles: a look line (look mood=bold type=editorial), entrances (enter=rise) and words over a photo, made readable by the engine.No code.
{…}can read state, do arithmetic and call a fixed list of functions. There is no route from a spec to JavaScript, so there is nothing to sandbox.
Try it
In the browser, nothing to install. Browse the examples and watch each one render live.
In Claude, ChatGPT, VS Code or another chat app. SayShape is an MCP Apps server: ask for a chart, a table or a calculator and the assistant answers with a working one inside the conversation. The setup for each app is in mcp/README.md.
npx -y sayshape-mcpIn your own app.
npm install sayshapeimport { SayShape, coreComponents } from "sayshape";
const ui = new SayShape(document.querySelector("canvas")!, { components: coreComponents });
ui.setSpec(`
state count=0
card
text "Pressed {count} times"
button "Press me" on=inc:count
button "Save" variant=secondary on=emit:save:{count}
`);
// The only thing that leaves a screen: an action your app chose to listen for.
ui.on("action", ({ name, value }) => console.log(name, value));To have a model write the spec, sayshape/model streams it from any OpenAI-compatible endpoint into ui.push(), checks it with the parser and asks once for a fix. See Connecting a model.
A spec can also be a presentation: deck and slide show 16:9 slides one at a time, in every theme, with no flag to turn on (slide decks).
Experimental: drawing and behavior
Two features are experimental and off by default. They work, they have tests, and they may still change. Turn them on only where you want them.
Drawing (scene). The model paints a picture or an animation from shapes, for what no ready-made element shows: a diagram to press, a ball that bounces, a sun that rises. Any value can be a formula of t, the seconds since it started. shadow=, glow= and shine= give shapes depth.
state colors=["accent", "warn", "good"]
scene "Three balls bouncing on a floor" w=600 h=260 duration=1
each items={range(3)} as=i
ellipse x={150 + 150*i} y=236 rx={50 - 22*abs(sin(PI*(t + i/3)))} ry=7 fill="ink 20%"
circle x={150 + 150*i} y={204 - 140*abs(sin(PI*(t + i/3)))} r=30 fill={pick(colors, i)} shine=trueBehavior. A spec can change by itself and be dragged. every runs state changes on a timer, and drag=true lets people move a shape in a scene. Rules only ever write state: they still can't run code.
state x=300 left=10 running=true
every 1s if={running && left > 0} do=dec:left
card
text "Drag the ball. {left} seconds left." style=title
scene "A ball you can drag" w=600 h=160
line x1=40 y1=118 x2=560 y2=118 stroke=line width=2
circle x={clamp(x, 40, 560)} y=84 r=30 fill=accent shine=true shadow=md drag=true
button "Pause or resume" variant=secondary on=toggle:runningBoth pictures are recorded from the engine running those exact specs (npm run readme:demos).
How to turn them on:
Where | Drawing | Behavior |
Chat apps (MCP server) |
| add |
Your own app |
|
|
The model guide | pass the same components to |
|
Local playground ( |
|
|
Dragging needs both, because it happens inside a scene.
import { SayShape, coreComponents } from "sayshape";
import { sceneComponents } from "sayshape/scene";
const ui = new SayShape(canvas, {
components: [...coreComponents, ...sceneComponents],
behavior: true,
});Scenes are the one place a spec may name its own colors, because a sunset can't be drawn in brand colors. Everywhere else the theme decides. Using the engine has the details and the limits.
Which models can write it
Not every model can produce a good interface as HTML: a full page of markup, styles and script is a lot to get right. SayShape asks for much less. The language is small, there is nothing to style, and the parser tells the model which line was wrong and how to fix it. That puts cards, forms, tables and charts within reach of small, fast and local models, not only the largest ones.
The experimental features ask more of a model. Drawing a scene means placing every shape, and behavior means reasoning about change over time. In our own use so far, these come out well with stronger models, such as GPT-6 Luna, Claude Haiku 5.5 and the models above them, and less reliably below that. This is what we have seen, not a measured result; score any model yourself with npm run eval (Connecting a model).
What's in it
65 components, each drawn by the engine: layout, text and icons, forms (inputs, selects, a date picker, sliders, menus, dialogs), tables, and data views that would otherwise need a library each: 14 kinds of chart including sankey, treemap, heatmap and scatter, with target lines and notes on top, plus boards, org charts, flow diagrams, schedules and Gantt timelines. Browse them all.
An engine with no dependencies. Its own parser, layout, painter and input handling on one
<canvas>, about 170 KB gzipped. No React, no CSS layout, no build step for specs.Errors that don't break the screen. A bad line is skipped and reported with its line number and how to fix it; the rest still draws.
A model guide that can't go stale. Each component is defined once, and that definition drives validation, the docs and the prompt that teaches a model the language.
Accessibility. A hidden mirror gives screen readers, keyboards and phones a role, a name and a state for everything drawn.
Themes. Light and dark, your own tokens in code or CSS variables, or your brand colors (
--accentor--colorson the MCP server).Testing tools.
sayshape/testingruns the real engine in Node, so a generated screen can be pressed and checked without a browser.Any model, anywhere. It works with any OpenAI-compatible endpoint, including one on your own servers.
Documentation
The website is the best place to read, because every example on it runs live. The same reference is in this repository:
Elements, state, derived values, expressions, actions, lists, screens and conditions | |
Every component's props and an example, generated from the code | |
Options, methods, events, theming, accessibility and debugging | |
React, web component, Vue and Svelte |
|
| |
SayShape inside chat apps, and hosting it for a team | |
Commands, tests, writing a component and the project's layout | |
Limitations and the plan | What's missing today and what comes next |
Contributing
git clone https://github.com/premmannava/sayshape.git
cd sayshape
npm install
npm run dev # the playground, with live reload
npm testWorking on SayShape has the rest. The rules that keep the project's guarantees are in CLAUDE.md, written for AI assistants and just as useful to people.
License
MIT.
Available Tools
2 toolssayshape_docsSayShape docsARead-onlyInspect
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.
Inputs: topics, elements.
show_interfaceShow an interfaceARead-onlyInspect
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, 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. The result lists lines the parser skipped, with the docs for those elements, so you can fix them.
HOW SAYSHAPE FITS TOGETHER (one element per line, children indented 2 spaces, no code)
state holds values: state budget=500 picked="All". derive works a value out from others and updates by itself: derive left={budget - spent}
{…} reads them in text and props. Controls write them with bind=; on= actions change them (set, inc, add) or tell the app (emit)
each repeats elements for every item of a list; if= shows or hides an element
data from the app may hold numbers and dates as text: read them with num('$36,626') and date('9 Jan 2026') (YYYY-MM-DD; month(), quarter(), year() of it), and tidy names with tidy() so they group. Totals and charts already read numbers written as text
CAPABILITIES (building blocks; name several together)
lists: lists and records in state: repeat with each; filter, sort, group and total them
calculations: values worked out from other values with derive, updating as people change inputs
forms: fields, choices and buttons people fill in: required=, error= and disabled= checks, and emit: to send it
actions: what presses do: change state (set, inc, add, remove), go between screens, notify, or tell the app (emit)
layout: cards, rows, grids, columns, accordions, carousels, scroll areas, dialogs and slide decks
content: text, images, badges, avatars, callouts, icons and code
data: numbers and records: charts, tables, stats, meters, details, compare, boards, trees, flows, schedules
navigation: several screens, tabs, breadcrumbs and pages
feedback: progress, loading placeholders and empty states
full: the whole guide, when nothing narrower fits
ELEMENTS (ask for one by name for its props and example)
layout: column, row, overlap, grid, card, list, list-item, accordion, divider, spacer, each, timeline, step, carousel, scroll, deck, slide
content: text, image, code, badge, avatar, callout, icon, tile
data: stat, rating, chart, chart-line, chart-rule, chart-band, chart-note, meter, table, table-column, compare, compare-row, details, detail, schedule, board, tree, flow
input: button, link, check, switch, radio, select, date-picker, stepper, slider, input, segmented, menu, menu-item
navigation: screen, tabs, tab, breadcrumb, pagination
feedback: progress, skeleton, empty, dialog
For anything else, call sayshape_docs once with every capability and element the screen needs, such as topics: ["forms", "calculations"], elements: ["slider"], then write it. Other topics: expressions, rules, examples, chat.
IN A CHAT: under 600px. Title, filters, a few KPIs in grid min=140, one main chart; no nested cards. Caption estimates.
This chat app shows interfaces as a page outside the chat, so emit: can't reach you: don't use it. Buttons can still change the page (set:, inc:, go:); ask the person to reply in the chat for anything you need back.
Inputs: spec (required), title, colors.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 2 tools
The two tools have clearly distinct purposes: one retrieves documentation, the other renders an interface from a spec. There is no practical overlap, and the workflow between them is obvious.
Both names use snake_case, but sayshape_docs uses a server-prefix pattern while show_interface follows verb_noun. This is a minor inconsistency rather than a readability problem.
Two tools are well matched to the server's purpose: documentation lookup and interface rendering. Neither feels superfluous, and the small surface keeps the workflow focused.
The set covers the full lifecycle: retrieve relevant docs, then render and surface parser issues with documentation for fixing them. No obvious operation is missing for generating SayShape interfaces.
Maintenance
Related MCP Connectors
An AI concierge that turns static forms into adaptive AI conversations. From any MCP client.
One message in, a full agentic application out: website and MCP app, live. Built from any AI client.
Build your own tools from chat: design, test and host them on a shareable MCP server URL.
AI video, image and audio generation with 140+ AI models from any MCP agent
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceAn MCP server that turns natural-language descriptions into interactive HTML/JS UI components, leveraging OpenGenerativeUI and AG-UI protocol.12MIT
- AlicenseNot gradedqualityBmaintenanceAutomatically generates MCP tools, CLI, and web UI from TypeScript methods, enabling AI agents and chat clients to interact with custom capabilities defined once.219 npm101MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to generate and serve ephemeral, interactive user interfaces over MCP through natural language descriptions.44Apache 2.0
- AlicenseNot gradedqualityDmaintenanceDynamically generates MCP tools from any OData or OpenAPI spec, enabling natural-language queries via SAP AI Core.MIT