Skip to main content

Architecture

Adaptive Slide is organized around a small, typed data model and a renderer that converts declarative deck JSON into host-ready HTML.

Flow

Author deck JSON
-> Validate against JSON Schemas
-> Render deck, slides, backgrounds, and tiles
-> Present through HTML or MCP App viewer

Data model

LevelResponsibility
AdaptiveDeckPresentation container with metadata, theme, defaults, and ordered slides.
AdaptiveSlideA single page with layout, background, transition, actions, and tile body.
AdaptiveTileA discriminated union of built-in tile types.
Tile.ContainerA recursive tile that nests other tiles for grouped layouts.

Source map

PathPurpose
schemas/deck.schema.jsonRoot deck schema and reusable metadata, theme, and defaults definitions.
schemas/slide.schema.jsonSlide schema, layout settings, backgrounds, and actions.
schemas/tile.schema.jsonTile union and shared tile base definitions.
schemas/tiles/*.schema.jsonConcrete schemas for text, image, code, chart, media, and container tiles.
src/types/index.tsTypeScript interfaces that mirror the JSON model.
src/transformer.tsPure rendering functions for tiles, slides, decks, and backgrounds.
src/plugins/mcp-app/server.tsMCP server factory and HTTP entry point.
src/plugins/mcp-app/viewer.htmlSelf-contained MCP App viewer HTML, CSS, and browser-side rendering logic.
examples/hello-world.deck.jsonEnd-to-end deck sample.
tests/mcp-app.test.jsNode test suite for renderer output, viewer protocol markers, and server exports.

Layout modes

ModeBehaviorBest for
stackTiles flow vertically in body order.Simple decks, generated summaries, notes-heavy slides.
gridTiles use gridPosition with row, column, and span metadata.Dashboards, comparisons, multi-column layouts.
freeformTiles use percentage-based absolute positioning.Designed slides that need precise placement.

Tile rendering

The renderer uses the type discriminator on each tile:

TileRenderer behavior
Tile.TextEscapes content, applies a markdown subset, and maps style, size, weight, color, and alignment to classes or inline styles.
Tile.ImageEmits an image with escaped URL and alt text, optional sizing, and optional caption.
Tile.CodeEmits a titled preformatted block with optional language and line-number metadata.
Tile.ChartEmits a lightweight visual representation for supported chart types.
Tile.MediaEmits audio or video tags with escaped sources and playback attributes.
Tile.ContainerRecursively renders nested tiles with stack, row, or wrap layout.

MCP App integration

MCP host
-> calls present-deck with deck JSON
-> fetches ui://adaptive-slide/viewer
-> embeds sandboxed viewer
-> viewer receives deck data through postMessage
-> viewer renders slides and navigation

The server uses @modelcontextprotocol/sdk, Express, CORS, and Streamable HTTP transport. The viewer intentionally avoids external scripts so it can run as a self-contained UI resource.

Extension points

ExtensionCurrent path
New tile typeAdd a schema under schemas/tiles/, update schemas/tile.schema.json, extend src/types/index.ts, and add renderer support.
Host-specific renderingAdd a renderer layer that consumes the same typed deck model and emits host-specific output.
Validation workflowsExtend scripts/validate.js to include additional examples, schema fixtures, or regression decks.
Viewer capabilitiesUpdate both src/transformer.ts and the browser-side transformer embedded in viewer.html when behavior must match.