Skip to main content
Glama

๐ŸŽฌ Demo Studio MCP Server

A Python Model Context Protocol (MCP) server (official mcp 2.x SDK) that turns a structured JSON storyboard into a narrated MP4 software demo video โ€” combining animated architecture flow diagrams, annotated screenshots, scripted web recordings, text-to-speech voiceover, and SRT/VTT captions via FFmpeg.

Python 3.10+ MCP Protocol License: MIT


๐Ÿ“‹ Table of Contents


Related MCP server: aidemo

๐ŸŒ Overview

Instead of recording raw desktop screens, Demo Studio MCP Server builds software walkthroughs programmatically from a storyboard (project.json). An AI assistant creates a project, adds scenes, previews individual frames, and runs a render job to produce a finished .mp4 and .srt (plus optional .vtt).

  • Voice-led demos by default: Narration timing drives scene durations. Subtitles are always written to an .srt sidecar file and are not burned into the video unless burn_subtitles=true.

  • Zero paid keys required: edge-tts is the default narration engine; OpenAI and ElevenLabs TTS are optional when you provide an API key.

  • Incremental scene cache: Every scene is hashed (content_hash) from its inputs, theme, settings, audio, and RENDERER_VERSION โ€” re-rendering skips unchanged scenes.

  • Local stdio or HTTP: Use stdio for local IDEs (files read directly from your disk), or streamable-http / sse for containerized deployments. (Note: HTTP mode reads/writes paths on the server's filesystem; there is no file upload endpoint.)


โœจ Key Features

Feature

Details

Animated Flow Diagrams

Pure-Python rank layout + barycenter crossing minimization + cubic Bezier edges, paired with Chromium/GSAP capture: browser-measured node cards, frame-proportional gaps, edge-label chips, glowing packets, pulsing active halos, short step pills, and guided (overview โ†’ step focus โ†’ overview) or static camera modes.

Annotated Screenshots

Optional macOS or browser window chrome, smooth Ken Burns pan/zoom, spotlight dimming around highlighted regions with accent outlines, and callout badges.

Scripted Web Walkthroughs

Playwright browser automation (goto, click, fill, press, scroll, hover, wait, wait_for) with a visible animated cursor overlay.

Video Clips & Slides

Trim, speed-adjust (0.25xโ€“4x), and zoom existing .mp4/.mov/.webm/.mkv clips (holding the final frame if narration runs longer), plus themed title and animated summary bullet/card slides.

PowerPoint (.pptx) Export

Pure-Python 16:9 OOXML presentation generator (demo_export_presentation) that turns any storyboard into a themed deck with an optional agenda slide, overview or step_by_step flow slides, screenshot/video visuals, and narration in Speaker Notes.

TTS & Punctuation-Safe Captions

Word-level alignment (edge-tts WordBoundary events or duration estimation) with align_words_to_script restoring script punctuation; writes SRT/VTT sidecars and optional lower-third or word-highlight ASS burned subtitles.

FFmpeg Composition

Normalizes clips to target resolution/fps, joins with xfade/acrossfade transitions or concat demuxer, applies loudness normalization (loudnorm with digital-silence guard) and optional background-music ducking, and cleans temporary work files from scenes/_compose/ after writing deliverables to out/.

Themes, Backdrops & Flow Styles

25 built-in themes, thousands more generated from any colour (gen-2563eb-dark-triadic-aurora) or mood (mood-calm), and custom JSON themes an LLM can create with demo_create_theme. 13 canvas backdrops (aurora, mesh, waves, particles, bokeh, blueprint, โ€ฆ), per-scene backdrop overrides, and flow-diagram styles (node shape/fill/border, straight/elbow/bezier edges, dashed or marching lines, packet shape) in six directions including radial.

Background Jobs & Previews

Asynchronous JobManager worker threads with progress percentages, cancellation support, and single-frame demo_preview_frame inspection before rendering.


โš™๏ธ How It Works

AI Client (Cursor, Claude, Antigravity, VS Code, Windsurf)
        โ”‚
        โ”‚  MCP (stdio by default, or streamable-http / sse)
        โ–ผ
demo_studio_mcp.server (MCPServer โ€” 28 tools, 4 prompts, 3 resources, /health)
        โ”œโ”€โ”€ ProjectStore (project_store.py, models.py)
        โ”‚     โ”œโ”€โ”€ Stores storyboard in <project>/project.json (atomic writes)
        โ”‚     โ”œโ”€โ”€ Copies external media into <project>/assets/
        โ”‚     โ””โ”€โ”€ Computes per-scene SHA-256 content_hash for cache reuse
        โ”œโ”€โ”€ Narration & Captions (tts_engine.py, subtitles.py)
        โ”‚     โ”œโ”€โ”€ Synthesizes audio (edge-tts / OpenAI / ElevenLabs) + word timings
        โ”‚     โ””โ”€โ”€ Restores punctuation, builds SRT/VTT cues & ASS karaoke/lower-third
        โ”œโ”€โ”€ Scene Renderers & PPTX Exporter
        โ”‚     โ”œโ”€โ”€ flow_layout.py + flow_renderer.py -> Chromium + GSAP seekTo() -> MP4 / PNG
        โ”‚     โ”œโ”€โ”€ summary_slide.html.j2 + screenshot_animator.py -> Chromium + GSAP -> MP4 / PNG
        โ”‚     โ”œโ”€โ”€ web_recorder.py -> Playwright actions + cursor_overlay.js -> WebM
        โ”‚     โ”œโ”€โ”€ ffmpeg_composer.py -> video clip trim / speed / zoom / tpad hold
        โ”‚     โ””โ”€โ”€ pptx_exporter.py -> themed 16:9 PowerPoint (.pptx) with Speaker Notes
        โ””โ”€โ”€ JobManager + FFmpeg Composition (render_jobs.py, render_tools.py)
              โ”œโ”€โ”€ Renders/reuses cached scene clips in <project>/scenes/<hash>.mp4
              โ”œโ”€โ”€ Composes transitions, loudnorm/ducking & optional captions in scenes/_compose/<id>/
              โ””โ”€โ”€ Writes final MP4 + SRT (+ optional VTT) to <project>/out/ and removes _compose/
  1. Create & Populate: Call demo_create_project, then add title, flow diagram, screenshot, web recording, or video clip scenes. Input assets are copied inside the project folder so renders stay self-contained.

  2. Preview First: Call demo_preview_frame at any timestamp to inspect a PNG of a scene (and adjust layout, highlights, or camera mode) before running a full video encode.

  3. Render & Cache: demo_render_project runs in a background worker (async_mode=true by default). Each scene checks scenes/<content_hash>.mp4; unchanged scenes are skipped on subsequent renders.

  4. Clean Deliverables: FFmpeg normalizes streams, applies xfade transitions and audio mastering inside scenes/_compose/<render_id>/, writes <slug>-<render_id>.mp4 and .srt to out/, and removes the _compose work folder on success (or preserves it with compose.log if composition fails).


๐Ÿ“ Project Layout

demo-studio-mcp/
โ”œโ”€โ”€ src/demo_studio_mcp/
โ”‚   โ”œโ”€โ”€ __init__.py              # Package metadata
โ”‚   โ”œโ”€โ”€ __main__.py              # `python -m demo_studio_mcp` entry point
โ”‚   โ”œโ”€โ”€ server.py                # MCPServer setup, Category 1-2 tools, /health, CLI transport
โ”‚   โ”œโ”€โ”€ models.py                # Pydantic storyboard/scene/theme models & RENDERER_VERSION
โ”‚   โ”œโ”€โ”€ themes.py                # Theme presets, colour generator, custom theme library, CSS variables
โ”‚   โ”œโ”€โ”€ theme_tools.py           # List/create/preview/delete theme tools
โ”‚   โ”œโ”€โ”€ project_store.py         # Project CRUD, atomic JSON writes, asset copy, content hashing
โ”‚   โ”œโ”€โ”€ scene_tools.py           # Title, screenshot, reorder, and delete scene tools
โ”‚   โ”œโ”€โ”€ flow_tools.py            # FlowSpec validation and flow diagram scene tool
โ”‚   โ”œโ”€โ”€ flow_layout.py           # Graph ranking, cycle breaking, barycenter ordering, Bezier edges
โ”‚   โ”œโ”€โ”€ flow_renderer.py         # Deterministic Chromium + GSAP frame capture & PNG preview
โ”‚   โ”œโ”€โ”€ screenshot_animator.py   # Annotated screenshot HTML rendering
โ”‚   โ”œโ”€โ”€ web_recorder.py          # Playwright scripted recording with cursor overlay
โ”‚   โ”œโ”€โ”€ recording_tools.py       # Web recording, video clip, and audio/transcript import tools
โ”‚   โ”œโ”€โ”€ tts_engine.py            # edge-tts, OpenAI, and ElevenLabs TTS providers
โ”‚   โ”œโ”€โ”€ subtitles.py             # Word alignment, SRT/VTT generation, ASS burned captions
โ”‚   โ”œโ”€โ”€ ffmpeg_composer.py       # FFmpeg filter graph builders (xfade, loudnorm, duck, captions)
โ”‚   โ”œโ”€โ”€ render_jobs.py           # Background render job queue, state persistence, cancellation
โ”‚   โ”œโ”€โ”€ render_tools.py          # Preview, render, status, cancel, and PPTX export tools
โ”‚   โ”œโ”€โ”€ pptx_exporter.py         # Pure-Python 16:9 OOXML PowerPoint presentation builder
โ”‚   โ”œโ”€โ”€ prompts_resources.py     # MCP resources (demo://*) and planning prompts
โ”‚   โ”œโ”€โ”€ credential_store.py      # Optional API key storage in cache dir
โ”‚   โ”œโ”€โ”€ binaries.py              # ffmpeg/ffprobe/Chromium discovery & stderr duration parsing
โ”‚   โ””โ”€โ”€ templates/               # Jinja2 HTML/SVG templates, cursor overlay JS, vendored GSAP
โ”œโ”€โ”€ examples/
โ”‚   โ””โ”€โ”€ build_sample_demo.py     # End-to-end 1080p sample storyboard + cache-hit check
โ”œโ”€โ”€ tests/                       # 105 unittest tests (unit, stdio, FFmpeg, Playwright, PPTX, enterprise TLS)
โ”œโ”€โ”€ pyproject.toml               # Hatchling build config + `demo-studio-mcp` console script + ruff T20
โ”œโ”€โ”€ Dockerfile                   # Streamable HTTP container with FFmpeg + Chromium
โ”œโ”€โ”€ mcpize.yaml                  # Hosted HTTP runtime config
โ””โ”€โ”€ smithery.yaml                # Smithery stdio config

๐Ÿ“ฆ Prerequisites

  • Python 3.10+

  • uv

  • FFmpeg on PATH (or automatically resolved from the bundled imageio-ffmpeg dependency)

  • Playwright Chromium: uv run playwright install chromium

ffprobe is optional โ€” if absent, media durations are parsed from ffmpeg -i stderr.


๐Ÿ“ฅ Installation & Setup

Run directly with uvx (once published)

uvx demo-studio-mcp

Clone and install locally

git clone https://github.com/Pawangunjkar/demo-studio-mcp.git
cd demo-studio-mcp
uv sync
uv run playwright install chromium
uv run demo-studio-mcp

Optional extras: uv sync --extra yaml for YAML storyboards, uv sync --extra verify for transcript checks in demo_verify_render (faster-whisper).

Windows App Control note: On Windows machines with Smart App Control, uv.lock pins pydantic==2.13.5 and pydantic-core==2.46.5 (and keeps mcp>=2.3,<3). Run uv sync --locked (or use the locked versions) rather than upgrading native wheels unnecessarily. See DECISIONS.md.


โš™๏ธ Configuring Your AI Client

Cursor (.cursor/mcp.json)

{
  "mcpServers": {
    "demo-studio": {
      "command": "uv",
      "args": ["run", "--frozen", "--directory", "/absolute/path/to/demo-studio-mcp", "demo-studio-mcp"]
    }
  }
}

Claude Code

claude mcp add demo-studio -- uv run --frozen --directory /absolute/path/to/demo-studio-mcp demo-studio-mcp

Claude Desktop / Antigravity / VS Code (Continue/Cline) / Windsurf

{
  "mcpServers": {
    "demo-studio": {
      "command": "uv",
      "args": ["run", "--frozen", "--directory", "/absolute/path/to/demo-studio-mcp", "demo-studio-mcp"]
    }
  }
}

Offline / enterprise startup alternative (skip uv on every start):

Point your MCP client directly at the virtual environment's Python interpreter so startup never contacts PyPI or checks uv.lock:

{
  "mcpServers": {
    "demo-studio": {
      "command": "C:\\AI_Workspaces\\Anti_Workspace\\demo-studio-mcp\\.venv\\Scripts\\python.exe",
      "args": ["-m", "demo_studio_mcp"]
    }
  }
}

(On macOS/Linux use /absolute/path/to/demo-studio-mcp/.venv/bin/python.)

On Windows, use a path like C:\\AI_Workspaces\\Anti_Workspace\\demo-studio-mcp.


๐Ÿ”ง Environment Variables

All settings are optional โ€” see .env.example.

Variable

Default

Purpose

DEMO_STUDIO_HOME

~/demo-studio

Projects, scene caches, logs, and job files.

DEMO_STUDIO_CACHE_DIR

~/.demo-studio-mcp-cache

Optional TTS credential store and voice cache.

DEMO_STUDIO_FFMPEG

discovered, then imageio-ffmpeg

Custom ffmpeg binary path.

DEMO_STUDIO_FFPROBE

ffprobe on PATH

Custom ffprobe path (falls back to ffmpeg -i).

DEMO_STUDIO_BROWSER_CHANNEL

auto

auto (Playwright Chromium, then Chrome/Edge fallback), chromium, chrome, or msedge. Set chrome/msedge if Chromium downloads are blocked.

DEMO_STUDIO_RENDER_WORKERS

1

Maximum concurrent renders per server process, for both async jobs and async_mode=false renders.

DEMO_STUDIO_SCENE_WORKERS

CPU cores รท 4 (1โ€“3)

Scenes rendered in parallel inside one render (1โ€“8). Lower it on small machines.

DEMO_STUDIO_THEMES_DIR

unset

Extra folder of shared *.json themes (read-only); new themes are saved to DEMO_STUDIO_HOME/themes.

DEMO_STUDIO_ALLOW_FILE_URLS

unset

Set to 1 to allow file:// URLs in demo_record_web_clip.

OPENAI_API_KEY

unset

Optional OpenAI TTS key.

ELEVENLABS_API_KEY

unset

Optional ElevenLabs TTS key.

MCP_TRANSPORT

stdio

stdio, sse, or streamable-http (http aliases streamable-http; --http flag also works).

HOST / PORT

0.0.0.0 / 8080

Bind address and port in HTTP mode.


๐Ÿงฐ Complete Tool Reference (41 tools)

All tools return plain text prefixed with โœ…, โš ๏ธ, or โŒ (with a fenced JSON block when structured data is returned) and never raise unhandled exceptions to the MCP client.

Category 1: Environment & TTS Setup (3)

Tool

Parameters

Description

demo_check_environment

(none)

Checks Python, ffmpeg, ffprobe, Playwright Chromium, edge-tts, and writable data root.

demo_set_tts_credentials

provider, api_key, save_to_cache

Configures openai or elevenlabs key in memory (and optionally credentials.json). Never echoes keys.

demo_list_voices

provider, language

Lists available voices for edge, openai, or elevenlabs.

Category 2: Projects (5)

Tool

Parameters

Description

demo_create_project

name, output_dir?, theme, aspect_ratio, resolution?, fps

Creates a project with any theme (built-in, gen-โ€ฆ, mood-โ€ฆ, or custom; see Category 8), 16:9, 9:16, or 1:1, at 24/30/60 fps.

demo_list_projects

(none)

Lists project IDs, names, scene counts, and timestamps.

demo_get_project

project_id

Returns settings, scene cache status table, and full project JSON.

demo_update_project_settings

project_id, theme?, primary_color?, accent_color?, text_color?, background_color?, font_family?, backdrop?, flow_style?, default_voice?, fps?, transition_type?, transition_sec?, scene_padding_before_sec?, scene_padding_after_sec?, min_scene_duration_sec?, narration_mode?, line_gap_sec?, pronunciations?, voice_rate?, voice_pitch?, voice_volume?, kicker?

Changes theme, brand colours (hex/rgb), font, project-wide backdrop and flow style, voice and prosody, fps, transition, padding, the narration clock (scene or per-sentence lines), the pronunciation dictionary, and the slide header kicker. A theme change clears colour overrides unless colours are passed too; 'theme' resets a single override. Affected scenes re-render.

demo_delete_project

project_id, confirm

Dry-run preview unless confirm=true.

Category 3: Title, Summary & Screenshot Scenes (3)

Tool

Parameters

Description

demo_add_title_scene

project_id, title, subtitle?, narration_script?, badge_text?, style, duration_sec?, badge_case?, background_path?, background_dim?

Appends an intro, section, or outro title card, optionally over a dimmed background image or looping video.

demo_add_summary_slide

project_id, title, bullets, subtitle?, badge_text?, layout, narration_script?, duration_sec?, badge_case?, background_path?, background_dim?

Appends an animated list or cards bullet slide (1โ€“8 items) for both video renders and .pptx decks.

badge_case is auto (default: uppercases plain words but keeps deliberate mixed case such as aOS or iPhone), upper, or as_typed. | demo_add_screenshot_scene | project_id, image_path, narration_script?, zoom_target?, highlights?, callouts?, window_frame, ken_burns | Copies image into assets/ and adds browser/macOS chrome, spotlights, callouts, and Ken Burns motion. |

Category 4: Flow Diagrams (2)

Tool

Parameters

Description

demo_validate_flow_spec

flow_spec

Validates FlowSpec JSON without saving; returns errors, warnings, and layout summary.

demo_add_flow_diagram_scene

project_id, title, flow_spec, narration_script?, theme?, background_path?, background_dim?

Adds an animated flow diagram scene (steps can align to {"sentence": n} or {"time_sec": t}).

Built-in node icons: browser, gateway, server, database, queue, cloud, user, lock, cache, function, generic. Unknown icons fall back to generic with a warning; > 8 nodes warns; > 12 nodes errors. camera_mode supports "guided" (default: overview โ†’ step focus โ†’ overview) or "static" (the whole diagram stays framed for the full scene). Node labels and subtitles are scaled up when needed so they stay readable on screen (subtitles at least 2% of the frame height).

Category 5: Web Recording, Video Clips & Audio (3)

Tool

Parameters

Description

demo_record_web_clip

project_id, url, actions, viewport?, narration_script?

Records Playwright actions (goto, click, fill, press, scroll, hover, wait, wait_for) with a visible cursor; password selectors are redacted in logs.

demo_add_video_clip_scene

project_id, video_path, start_sec?, end_sec?, speed, narration_script?, mute_original_audio, zoom_regions?, speed_mode?, insert_at?, transcript_path?, original_audio_volume?, audio_fade_out_sec?

Imports .mp4/.mov/.webm/.mkv, trims, retimes, and zooms. The scene lasts as long as the clip at its speed (or the narration, if longer).

Video clip details:

  • Length: clip length รท speed, or the narration length if that is longer; a short clip holds its last frame. speed_mode="fit" retimes the clip (0.25ร—โ€“4ร—) to last exactly as long as its narration, so no speed maths is needed.

  • Audio: mute_original_audio=false keeps the clip's own sound for the whole scene; narration, when present, plays over it with the original ducked underneath. original_audio_volume (0โ€“2) and audio_fade_out_sec set its level and end fade, e.g. a music intro at 0.55 fading over 0.6 s.

  • Zoom regions: [{start_sec, end_sec, x, y, w, h}], timed in seconds of the trimmed clip (before speed) in source pixels. Any rectangle works: it is grown to the output aspect ratio around its centre and kept inside the picture. Regions must not overlap.

  • Prepend/append around a finished video: add it with mute_original_audio=false, no narration_script, and transcript_path set to its SRT so subtitles match; insert_at=0 puts it first. | demo_import_audio_or_transcript | project_id, scene_id?, audio_path?, transcript_path? | Imports custom audio and/or SRT/VTT timings (preserving exact imported cue times). |

Category 6: Storyboard Editing (3)

Tool

Parameters

Description

demo_update_scene

project_id, scene_id, title?, subtitle?, narration_script?, duration_sec?, patch?

Edits any scene field. patch is a JSON object deep-merged into the scene (lists replace, null clears), e.g. {"flow_spec": {"camera_mode": "static"}}. Validated before saving; narration changes reset cached audio.

demo_reorder_scenes

project_id, ordered_scene_ids

Reorders every scene ID in the storyboard.

demo_delete_scene

project_id, scene_id, confirm

Dry-run description unless confirm=true.

Category 7: Preview, Render & Presentation Export (5)

Tool

Parameters

Description

demo_preview_frame

project_id, scene_id, timestamp_sec, burn_subtitles?, synthesize_narration?

Renders one PNG frame of any scene type at timestamp_sec; video clips and web recordings go through the same trim/zoom/speed filter as the render. By default narration is synthesized once (and reused by the render) so timing matches the final video.

demo_render_project

project_id, voice?, tts_provider, bg_music_path?, music_volume, music_start_sec?, burn_subtitles, caption_style, transition_type, async_mode, write_vtt?, overwrite, draft?

Renders storyboard (default: burn_subtitles=false, transition_type="fade", async_mode=true) plus an SRT and a timeline.json. draft=true is a fast half-resolution check render. bg_music_path="builtin:ambient" adds a generated soft pad (no file needed); music fades in and out, is ducked under the voice, and by default enters just before the end of an opening clip that has its own sound.

demo_get_render_status

job_id

Returns state, stage, progress percent, output paths, and log_path. A job waiting behind another render shows stage: waiting_for_slot, its queue_position, and which render it is waiting_behind.

demo_cancel_render

job_id

Signals cancellation (checked between scenes and every 10 frames).

demo_export_presentation

project_id, flow_mode, include_agenda, include_notes, render_visuals, output_path?

Exports a themed 16:9 PowerPoint (.pptx) deck with overview or step_by_step flows, optional agenda slide, and Speaker Notes.

Category 8: Themes (4)

Tool

Parameters

Description

demo_list_themes

query?, mode?

Lists built-in and custom themes (filter by text or dark/light) and explains the gen-โ€ฆ / mood-โ€ฆ generators.

demo_create_theme

name, extends?, base_color?, mode?, mood?, harmony?, palette?, backdrop?, node_style?, edge_style?, packet_style?, font?, heading_font?, title_layout?, corner_radius?, label?, description?, overwrite?

Saves a reusable JSON theme. Start from a theme, a colour, or a mood, then override any part. Low-contrast palettes return warnings.

demo_preview_theme

theme, kind, at_sec?

Renders a 1280ร—720 PNG of the theme on a title, summary, or flow sample scene.

demo_delete_theme

name, confirm

Deletes a custom theme (dry run unless confirm=true; lists projects that still use it).

demo_set_project_theme

project_id, theme_path? or theme_json?, name?, overwrite?, keep_brand?

Loads a brand theme file (full theme format or the simple brand format: colors, gradients, fonts, card, background, header kicker/chapter chip, status colours), saves it to the library, and makes it the project theme in one call.

Theme names:

  • Built-in (31): saas-dark, saas-light, terminal, minimal, midnight-aurora, ocean, sunset, forest, neon-cyber, blueprint, paper, nord, dracula, solarized-dark, solarized-light, github-dark, github-light, corporate, glass, mono-light, high-contrast, pastel, royal, ember, matrix, and the slide presets amdocs-aos, executive-light, telco-blue, neon-dark, minimal-mono, corporate-gradient (glass cards, gradient titles, chapter chips).

  • Generated: gen-<rrggbb>[-dark|-light][-<harmony>][-<backdrop>], where harmony is complementary, analogous, triadic, split, or mono; and mood-<mood>[-dark|-light] (calm, energetic, luxury, playful, technical, โ€ฆ). Colours are nudged to meet WCAG text contrast.

  • Custom: anything saved by demo_create_theme, plus JSON files in DEMO_STUDIO_THEMES_DIR.

Per-scene looks: theme_override and backdrop on title, summary, and flow scenes; layout (center, left, split) on title cards; flow_spec.layout (left_to_right, right_to_left, top_to_bottom, bottom_to_top, radial, auto) and flow_spec.style (node, edge, packet) on flow diagrams.

Category 9: Slide Templates (8)

Executive-style slides on a 1920-wide stage (scaled to the output), sharing one kit: glass cards with glow, pills, icon tiles, gradient text, glow dots, speech bubbles, and an app window. Slide headers get a chapter chip (chapter="auto" numbers them; consecutive slides with the same title share a number) and the project kicker. Every add tool takes insert_at and extra (any other scene field as JSON).

Tool

Parameters

Description

demo_add_hero_scene

project_id, title, title_line2?, kicker?, subtitle?, chips?, badge?, footer?, align, background_path?, video_start_sec, video_end_sec?, fade_out_sec, narration_lines?

Opening (left) or closing (center) card over a darkened image or video range stretched to the scene.

demo_add_demo_split_scene

project_id, title, video_path, segments, cards, window_label?, window_status?, window_side, crossfade_sec, narration_lines?

Screen recording in an app window (cropped segments, crossfaded) beside key-message cards; segment k and card k switch on sentence k. A segment focus (box in source pixels, at_frac, zoom_max) plays the footage in the first part of its slot, then freezes, zooms into the box, and outlines it in the card's colour.

demo_add_story_scene

project_id, title, cards, links?, steps?, bubbles?, counters?, banner?, narration_lines?

Story diagram: cards joined by request/response lanes, packets and bursts with counters, thinking dots, speech bubbles, and a takeaway banner, all on sentence anchors.

demo_add_timeline_scene

project_id, title, milestones, today?, today_label, narration_lines?

Roadmap line with a TODAY marker, status pills, and milestone cards that pulse as they are named.

demo_add_process_kpi_scene

project_id, title, steps?, stats?, footnote?, narration_lines?

Process steps with flowing arrows, plus count-up KPI tiles with optional unit blocks.

demo_add_tiles_scene

project_id, title, tiles, columns?, narration_lines?

Value slide: 2-6 icon tiles in a grid; each lights up (glow and top bar) as it is narrated while the others dim. The last len(tiles) lines light them, so earlier lines can introduce the slide.

demo_add_multi_clip_scene

project_id, title, video_path, segments, crossfade_sec, narration_lines?, duration_sec?

Several cropped pieces of one or more recordings as one full-frame scene, cut on sentence anchors.

demo_add_scene

project_id, scene, insert_at?

Adds any scene type from one JSON object.

demo_duplicate_scene

project_id, scene_id, insert_at?, patch?

Copies a scene under a new id (right after the original by default), optionally patching fields.

Narration clock. With narration_mode="lines" (or narration_lines on a scene) every sentence is synthesized on its own, trimmed of silence, cached by voice and text, and placed at lead + previous lines + gap. Anchors {"sentence": k, "frac": f, "offset_sec": s} or {"time_sec": t} drive every animation, so the picture follows the voice exactly. Scenes take lead_sec, gap_sec, tail_sec, voice_rate, voice_pitch, and voice_volume; the project pronunciations map ({"CES": "C E S"}) is applied before TTS.

Layout checks. demo_preview_frame reports layout: notes for slide scenes: text overflowing its box, overlapping cards, text under 15 px on the 1920 stage, and text leaving the frame.

Category 10: Storyboards (2)

Tool

Parameters

Description

demo_export_storyboard

project_id, path?, format?

Writes settings and every scene as editable JSON or YAML (YAML needs the yaml extra). Managed fields are left out and paths are absolute.

demo_import_storyboard

project_id, storyboard, mode, apply_settings, insert_at?, confirm

Builds or extends a storyboard from a file or text. Every scene is validated before anything is saved; mode="replace" needs confirm=true.

Category 11: Review (2)

Tool

Parameters

Description

demo_contact_sheet

project_id, mp4_path?, frames, columns, thumb_width

One PNG of labelled thumbnails (one per scene, two for long scenes) from the newest render.

demo_verify_render

project_id, mp4_path?, transcribe?, whisper_model?

Checks length against the timeline, black frames, and narration lines that came out silent; with transcribe=true (the verify extra, faster-whisper) also compares each line with what is heard.

Every render writes <name>.timeline.json next to the MP4: each scene's start, length, and narration lines with absolute times. demo_render_project(draft=true) renders a quick 960-wide, 15 fps check copy (...-draft.mp4) and keeps the synthesized narration for the full render. Background music is ducked under the voice with a sidechain compressor, and loudness is normalised once on the final mix.


๐Ÿงฉ MCP Prompts & Resources

  • Prompts:

    • plan_demo_from_codebase(repo_path, audience, length_sec) โ€” guides an agent to map architecture and assemble a full storyboard.

    • design_animated_flow(system_description) โ€” generates and validates a FlowSpec JSON object.

    • plan_presentation_from_demo(project_id, audience) โ€” organizes summary slides, speaker notes, and .pptx export for leadership/engineering presentations.

    • design_theme(brand, mood, audience) โ€” turns a brand or mood into a saved, previewed theme and applies it.

  • Resources:

    • demo://projects โ€” JSON list of projects under DEMO_STUDIO_HOME.

    • demo://project/{project_id}/storyboard โ€” Markdown scene table and narration scripts.

    • demo://presets/themes โ€” Every built-in and custom theme spec, plus the generator name syntax.


๐ŸŽž๏ธ Example Workflow

examples/build_sample_demo.py builds and verifies a complete 1080p acceptance demo:

  1. Creates a 1920x1080, 30 fps, saas-dark project (and generates tests/fixtures/dashboard.png if missing).

  2. Adds an intro title (Order Service Walkthrough), a 4-node checkout flow diagram (Web Client โ†’ API Gateway โ†’ Order Service โ†’ PostgreSQL), a browser-framed screenshot with spotlight & callout, and an outro card.

  3. Renders asynchronously with burn_subtitles=false and transition_type="fade", polling demo_get_render_status every 2 seconds.

  4. Verifies the output MP4 via ffmpeg (1920x1080, 30 fps, 1 H.264 stream, 1 AAC stream) and .srt sidecar, exports QA frames into examples/qa_frames/, and renders a second time asserting scenes_cached=4 and scenes_rendered=0.

uv run python examples/build_sample_demo.py

๐Ÿ”’ Security Best Practices

  • Input images, videos, audio, and transcripts are copied into the project assets/ folder before rendering.

  • All project reads/writes stay confined to the project folder and DEMO_STUDIO_HOME.

  • Only http:// and https:// URLs are allowed for demo_record_web_clip unless DEMO_STUDIO_ALLOW_FILE_URLS=1.

  • demo_set_tts_credentials never echoes API keys back in tool responses.

  • fill actions targeting password selectors are logged as ***.

  • Project deletion, scene deletion, and overwriting existing renders require explicit confirmation flags (confirm=true / overwrite=true).

  • MCP stdio safety is enforced with ruff T20 print checks on library/tool modules.


๐Ÿ› ๏ธ Troubleshooting

Symptom

What to do

FFmpeg not found

Install FFmpeg on PATH, let imageio-ffmpeg supply it, or set DEMO_STUDIO_FFMPEG.

Chromium missing

Run uv run playwright install chromium, or set DEMO_STUDIO_BROWSER_CHANNEL=chrome / msedge to use an installed browser (auto also falls back to Chrome/Edge).

edge-tts SSL / CERTIFICATE_VERIFY_FAILED

truststore loads the OS certificate store automatically. Ensure your corporate proxy/Zscaler root CA is trusted by the OS, or pass tts_provider="openai" / "elevenlabs".

App Control blocks a DLL on Windows

Keep locked pins (pydantic==2.13.5, pydantic-core==2.46.5) and mcp>=2.3,<3. See DECISIONS.md.

ffprobe missing

Expected when not installed globally; durations are parsed from ffmpeg -i stderr.

HTTP mode cannot access local paths

Paths are resolved on the server filesystem; use stdio when assets are on your local machine.

Render stays queued

Another render holds the slot. demo_get_render_status shows waiting_for_slot, queue_position, and waiting_behind. Wait, cancel the other job, or raise DEMO_STUDIO_RENDER_WORKERS.

async_mode=false returns "render slot(s) are busy"

Synchronous renders now honor DEMO_STUDIO_RENDER_WORKERS too. Use async_mode=true to queue instead.

Two server processes share one DEMO_STUDIO_HOME

Supported: each job records its owner process, so a newly started server only marks jobs failed (interrupted_by_restart) when their owner process is gone.


๐Ÿงช Development & Tests

uv run ruff check .
uv run python -m unittest discover -s tests -v

The test suite (105 tests) covers the theme engine (presets, generated and custom themes, contrast, every backdrop style, flow styles and directions, title layouts, theme previews), models, project store/caching, render job queueing and restart recovery, nested render progress, video clip timing, segment-based zoom regions and original-audio ducking, scene patches and project settings, previews of every scene type, background media, flow layout and readable node subtitles, subtitle punctuation alignment, orphan-free cue splitting & ASS/SRT/VTT round-trips, FFmpeg command builders, stdio JSON-RPC compliance, cancellation & web recording integration, Playwright visual/layout assertions, summary slides, .pptx presentation export, and enterprise TLS/browser fallback.


๐Ÿ‘ค Author & License

Pawan Gunjkar โ€” pawangunjkar@gmail.com ยท GitHub

MIT License โ€” see LICENSE.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelogโ€ฆ

    Related MCP Connectors

    Related MCP Servers