Skip to main content
Glama

slideshot

npm npm downloads npm mcp GitHub stars license

将 AI 生成的 HTML 轮播图转换为高分辨率的 PNG、WebP、PDF 和 PPTX —— 支持 CLI、Web 应用、MCP 服务器 或 REST API。

Web 应用 · npm CLI · npm MCP · API 规范

架构

slideshot/
  packages/
    cli/           ← Core Puppeteer rendering engine + CLI
    mcp-server/    ← MCP stdio server for AI tools
    webapp/        ← Next.js web app with live preview
  prompts/
    generic.md           ← Clean minimal
    branded.md           ← Ketan Slides design system
    instagram-carousel.md ← Bold vibrant IG style
    infographic.md       ← Data-heavy charts
    pitch-deck.md        ← Professional presentations
    dark-modern.md       ← Neon glassmorphism
    editorial.md         ← Magazine serif

Related MCP server: cardnews-mcp-server

快速开始

CLI

npx slideshot ./my-carousel.html --formats png,webp,pdf --scale 4

选项:

标志

默认值

描述

-s, --selector

.slide

幻灯片元素的 CSS 选择器

-W, --width

540

幻灯片宽度 (CSS px)

-H, --height

675

幻灯片高度 (CSS px)

--scale

4

设备缩放比例 (4x = 2160x2700)

-f, --formats

png,webp,pdf

输出格式 (png, webp, pdf, pptx)

-q, --quality

95

WebP 质量 (0-100)

-o, --out

./slides

输出目录

Web 应用

在线访问: slideshot.vercel.app

或在本地运行:

cd packages/webapp && npm install && npm run dev

打开 http://localhost:3000 —— 粘贴 HTML,预览并导出。

MCP 服务器

添加到 Claude Desktop 或 Cursor 配置中:

{
  "mcpServers": {
    "slideshot": {
      "command": "npx",
      "args": ["-y", "slideshot-mcp"]
    }
  }
}

工具:

  • create_slides — 引导式创建工作流,包含 7 种主题和输出预设

  • render_html_to_images — 将 HTML 渲染为 PNG/WebP/PDF/PPTX

  • get_slide_prompt — 获取任意主题变体的 AI 提示词模板

  • health_check — 验证 Puppeteer/Chromium 可用性

提示词(7 种主题):

  • generic-slides — 简洁极简风格

  • branded-slides — Ketan Slides 设计系统

  • instagram-carousel-slides — 大胆鲜艳的 IG 风格

  • infographic-slides — 数据密集型图表和统计信息

  • pitch-deck-slides — 专业演示文稿

  • dark-modern-slides — 霓虹玻璃拟态风格

  • editorial-slides — 带有金色点缀的杂志衬线风格

REST API (ChatGPT Actions / OpenWebUI)

该 Web 应用在 https://slideshot.vercel.app 提供兼容 OpenAPI 的 REST API。

端点:

方法

路径

描述

POST

/api/render

将 HTML 幻灯片渲染为 PNG/WebP/PDF (返回 ZIP)

GET

/api/prompt?variant=generic

获取 AI 提示词模板

GET

/api/openapi.json

OpenAPI 3.1.0 规范

平台支持:

平台

方法

设置

Cursor

MCP

在 .cursor/mcp.json 中使用 npx slideshot-mcp

Claude Desktop

MCP

在配置文件中使用 npx slideshot-mcp

ChatGPT

OpenAPI Action

导入 /api/openapi.json

OpenWebUI

OpenAPI Tool

导入 /api/openapi.json

AI 提示词模板

prompts/ 目录下有 7 种提示词变体 —— 可直接复制粘贴或通过 get_slide_prompt 工具使用:

变体

文件

风格

Generic

prompts/generic.md

简洁极简,Inter 字体

Branded

prompts/branded.md

Space Mono 字体,青色/珊瑚色点缀

Instagram

prompts/instagram-carousel.md

大胆渐变,Poppins 字体

Infographic

prompts/infographic.md

DM Sans 字体,统计卡片

Pitch Deck

prompts/pitch-deck.md

专业,KPI 卡片

Dark Modern

prompts/dark-modern.md

霓虹,玻璃拟态

Editorial

prompts/editorial.md

Playfair Display 字体,金色

构建所有内容

npm install   # from root — installs all workspaces
npm run build # builds cli → mcp-server
cd packages/webapp && npm run build  # builds webapp separately

链接

许可证

MIT

Available Tools

6 tools
create_slidesA
Idempotent

Create slides. IMPORTANT: Use mode=default unless the user explicitly chose token_saver. mode=default = AI writes full HTML (best quality). mode=token_saver = AI sends JSON, server uses basic templates. REQUIRES discover_themes first AND user must have confirmed the data outline. After this tool saves the HTML, you MUST show the htmlPath as a code preview artifact. Then STOP and ask the user to confirm. DO NOT call render_slides until the user explicitly confirms.

Inputs: mode (required), theme (required), orientation, width, +4 more.

discover_themesA
Read-onlyIdempotent

MANDATORY first step — all other tools REJECT until this is called. Returns themes, orientation presets, token-usage modes, and output formats. Use ONLY the native selector prompts from the "ask" array — DO NOT render themes as a separate markdown list. DO NOT ask how many slides (you decide based on topic). After user picks options, show a data outline of proposed slides and WAIT for confirmation before calling create_slides.

Inputs: no named parameters.

edit_slidesA

Token-efficient partial edits on a previously-generated HTML deck. Use this INSTEAD of regenerating the whole deck for small changes — it saves 60-90% tokens vs a full rewrite. Operations: replace_slide (swap one slide block by 1-indexed slideIndex), patch_css (append CSS rules to ), swap_token (replace a CSS variable's value, e.g. {"--coral": "#FF0000"}), patch_class (add/remove a class on a specific slide, e.g. {"add": "dark"}). Reads from cache or htmlPath; saves the updated HTML and returns the new htmlPath. After editing, show the htmlPath as a preview artifact and STOP — do NOT call render_slides until the user confirms.

Inputs: operation (required), payload (required), htmlPath, slideIndex.

health_checkA
Read-onlyIdempotent

Verify Puppeteer/Chromium can launch. Use when render fails.

Inputs: no named parameters.

list_themesA
Read-onlyIdempotent

Idempotent read-only listing of all available themes (8+). Unlike discover_themes, this does NOT start a slide-creation workflow — call it any time the user asks "what themes are there?" mid-conversation. Returns the same tiered theme catalog (primary/secondary). Models MUST present every theme returned, never truncate.

Inputs: no named parameters.

render_slidesA
Idempotent

Final render to PDF/WebP/PNG/PPTX. Accepts html string OR htmlPath. Supports width, height, selector, scale, webpQuality, orientation, pptxMode, pptxFilename, slideRange. NEVER call render_slides in the same turn as create_slides. When the user provides an existing HTML file path, pass it as htmlPath and call this tool directly — no discover_themes or create_slides needed. For the full slide-creation workflow, REQUIRES both discover_themes AND create_slides first, and ONLY call AFTER user confirms the preview. Returns file paths on disk.

Inputs: htmlPath, html, selector, width, +10 more.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A4.4/5.0

    Scored across 6 tools

    Disambiguation4/5

    All tools have distinct responsibilities, but discover_themes and list_themes both surface the theme catalog and could be confused if an agent only glances at names; the descriptions do clarify that one is a mandatory workflow bootstrap and the other is a read-only listing. create_slides, edit_slides, and render_slides are otherwise cleanly separated by operation.

    Naming Consistency4/5

    Most names follow the verb_noun snake_case pattern consistently: discover_themes, create_slides, render_slides, list_themes, edit_slides. health_check breaks the pattern slightly by being a noun phrase rather than a verb-first command, though it remains simple and readable.

    Tool Count5/5

    Six tools is a well-scoped count for a slide-generation and rendering server: health check, theme discovery, theme listing, create, render, and edit. Each tool has a clear role, and none feels like unnecessary surface area.

    Completeness4/5

    The core lifecycle is covered: discover themes, create slides, render to output formats, and apply token-efficient partial edits. Minor gaps exist, like no explicit slide deletion or no tool to inspect a previously generated deck's structure, but most workflows can be completed without them.

    Maintenance

    ActivityStale
    ResponsivenessLimited data

    Related MCP Connectors

    Related MCP Servers