npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

presentation-api-mcp

v1.0.3

Published

Docker API for generating standalone HTML presentations from JSON data

Downloads

6

Readme

Presentation Generator API

A Docker-based REST API for generating standalone HTML presentations from JSON data.

Features

  • 🚀 REST API endpoint for presentation generation
  • 🐳 Docker containerized for easy deployment
  • 🔒 Signed URLs for secure file access with expiration
  • 📁 Automatic file storage and management
  • 🎨 Support for all existing presentation components
  • 🖼️ Image embedding and processing
  • 🗜️ HTML minification and obfuscation
  • 📦 Fully self-contained builds (no host dependencies)

Quick Start

Using Docker Compose (Recommended)

  1. Clone the repository and navigate to the directory
  2. Build and start the container:
docker-compose up --build

The API will be available at http://localhost:3000

Using Docker directly

# Build the image
docker build -t presentation-api .

# Run the container
docker run -p 3000:3000 -e SIGNED_URL_SECRET=your-secret-key presentation-api

API Endpoints

Health Check

GET /health

Returns the API status and version information.

Generate Presentation

POST /api/generate
Content-Type: application/json

Send your presentation JSON data in the request body. Returns a response with a signed download URL.

Example request:

curl -X POST http://localhost:3000/api/generate \
  -H "Content-Type: application/json" \
  -d @presentation-data.json

Example response:

{
  "success": true,
  "filename": "presentation-12345678-1234-1234-1234-123456789012.html",
  "downloadUrl": "http://localhost:3000/api/download/presentation-12345678-1234-1234-1234-123456789012.html?expires=1642694400&signature=abc123...",
  "size": 156789,
  "expiresIn": 3600,
  "generatedAt": "2024-01-20T10:30:00.000Z"
}

Download Presentation

GET /api/download/:filename?expires=timestamp&signature=hash

Download the generated presentation using the signed URL. URLs expire after the configured time (default: 1 hour).

List Generated Files (Debug)

GET /api/files

Returns a list of all generated presentation files (useful for debugging).

Environment Variables

| Variable | Default | Description | |----------|---------|-------------| | PORT | 3000 | Port for the API server | | OUTPUT_DIR | ./generated | Directory for generated presentations | | SIGNED_URL_SECRET | your-secret-key-change-in-production | Secret for signing URLs | | SIGNED_URL_EXPIRY | 3600 | URL expiration time (seconds) | | NODE_ENV | - | Node environment (development, production) |

Security

  • URLs are signed with HMAC-SHA256 and expire after a configurable time
  • Container runs as non-root user
  • Input validation on all endpoints
  • File path validation to prevent directory traversal
  • CORS and security headers enabled

File Storage

Generated presentations are stored in the /app/generated directory inside the container. For persistent storage across container restarts, mount a volume:

docker run -p 3000:3000 -v $(pwd)/generated:/app/generated presentation-api

Development

To run in development mode:

npm install
npm run dev

Original CLI Usage

The original command-line interface is still available:

node generate-presentation.js [input-file.json] [--both]

JSON Format

The API expects the same JSON format as the original CLI tool. See presentation-data.json for an example.

Required fields:

  • meta.title: Presentation title
  • meta.totalSlides: Number of slides
  • slides: Array of slide objects

Error Handling

The API returns appropriate HTTP status codes:

  • 200: Success
  • 400: Bad request (invalid JSON, missing fields)
  • 403: Forbidden (invalid/expired download link)
  • 404: File not found
  • 500: Server error

Error responses include a descriptive message:

{
  "error": "Invalid presentation data. Missing meta.title.",
  "message": "Additional error details"
}

MCP STDIO Mode (Experimental)

You can now run the presentation generator as an MCP-compliant STDIO server, suitable for LLM agent integration and npx-based workflows. This mode does not affect the existing REST API.

Usage

npx @modelcontextprotocol/sdk run ./mcp-stdio-server.js
  • Accepts MCP messages via STDIO (see Model Context Protocol docs)
  • Supports the same presentation generation logic as the REST API
  • Does not start an HTTP server or interfere with API endpoints