Skip to main content
Glama

Playable local media inside chat, without burning context. Most AI coding environments render .mp4, .wav, and .png outputs as dead file pills—while base64-inlining media into HTML artifacts blows past token caps and iframe CSP rules. media-preview streams local files straight from 127.0.0.1 into an MCP App view, keeping raw bytes completely out of LLM history.

Highlights

  • 9:16 & 16:9 aware video players. Vertical Shorts and widescreen renders auto-fit inside inline chat height caps with a minimal overlay scrub bar, click-to-play, and fullscreen handoff that syncs playback timestamp on minimize.

  • 72-bar interactive audio waveforms. Samples normalized peak bars directly from RIFF PCM/float WAV files in < 1 ms with bounded memory, and decodes compressed formats (.mp3, .m4a, .ogg, .opus, .aac, .flac) via WebAudio in the client.

  • Three-tier image presentation. Automatically chooses a video-sized showcase card for 1 image, an 82px gallery strip for 2+ images, or right-aligned 30px micro-thumbnails (mode: "peek") when an agent silently inspects frames mid-task.

  • Session-resilient across restarts. Ships an app-only (0-token) resolve_media tool so reopening historical chats on a new ephemeral localhost port transparently re-hydrates every player.

  • Hardened localhost streaming. Binds strictly to 127.0.0.1:0 with a random 128-bit per-session token and serves only explicitly registered files.

  • Zero npm dependencies. Runs out of the box on Node.js >= 18 with no npm install or build step.

Related MCP server: local-vision-mcp

Native Desktop Lightbox

Clicking any image or video fullscreen button on Linux (Wayland/X11 with GTK4) launches a frameless translucent desktop overlay (src/modal.py) outside the narrow chat iframe—supporting scroll/pinch zoom up to 8×, drag pan, arrow-key gallery navigation, and live video timestamp sync. On macOS, Windows, or Linux setups without GTK4, media-preview detects availability via a startup handshake and falls back automatically to its built-in inline modal.

Installation

Google Antigravity

Clone directly into your Antigravity plugins directory:

git clone <repo-url> ~/.gemini/config/plugins/media-preview

Antigravity discovers plugin.json, mcp_config.json, and the bundled agent workflow rules (rules/AGENTS.md) automatically—no build or install step required. Toggle or manage it anytime at customization://media-preview.

Any MCP Apps Host (mcp_config.json)

Works with Claude Desktop and any client implementing MCP Apps (ext-apps):

{
  "mcpServers": {
    "media-preview": {
      "command": "node",
      "args": ["/absolute/path/to/media-preview/src/server.mjs"]
    }
  }
}

Optional: Linux GTK4 Overlay Packages

To enable the native desktop overlay outside the chat iframe on Linux:

# Ubuntu / Debian
sudo apt install python3-gi gir1.2-gtk-4.0 gstreamer1.0-gtk4

# Fedora
sudo dnf install python3-gobject gtk4 gstreamer1-plugin-gtk4

# Arch Linux
sudo pacman -S python-gobject gtk4 gst-plugin-gtk4

Tool Reference

preview_media

Parameter

Type

Default

Description

paths

string[]

required

Absolute paths or file:// URIs to .mp4, .m4v, .webm, .mov, .mkv, .wav, .mp3, .ogg, .opus, .m4a, .aac, .flac, .png, .jpg, .jpeg, .webp, .gif, .svg, or .avif files.

mode

"default" | "peek"

"default"

"default" renders full inline players, showcase cards, or gallery strips; "peek" renders tiny right-aligned micro-thumbnails for silent intermediate checks.

loop

boolean

false

Loop video or audio playback (useful for seamless Short loop checks).

autoplay

boolean

false

Autoplay on load (muted on video per browser policy).

Smoke Test

Verifies MCP stdio JSON-RPC framing, ui:// resource delivery, WAV RIFF peak extraction, open_modal path validation, and HTTP 206 Partial Content streaming:

npm test

License

MIT

Available Tools

3 tools
open_modalOpen Native Overlay ModalC

App-only helper to launch a frameless translucent desktop modal outside the chat iframe.

Inputs: mode (required), paths (required), loop, startTime, +1 more.

preview_mediaInline Media PreviewB

Render an inline video player (9:16 or 16:9), waveform audio player, or image filmstrip directly inside chat for local media files.

Inputs: paths (required), loop, mode, autoplay.

resolve_mediaRe-bind Media Stream URLsB

App-only helper to refresh localhost stream URLs when reopening historical chats.

Inputs: paths (required).

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    B3.2/5.0

    Scored across 3 tools

    Disambiguation4/5

    Each tool has a distinct action: preview_media renders inline content, resolve_media refreshes stream URLs, and open_modal launches a desktop window. preview_media and resolve_media both touch media and could be momentarily confused, but the descriptions make the render-vs-refresh distinction clear.

    Naming Consistency5/5

    All three tools follow a clean verb_noun snake_case pattern (preview_media, resolve_media, open_modal). The convention is applied uniformly with no stylistic drift.

    Tool Count4/5

    Three tools is a tight, well-scoped set for a narrow media-preview purpose, and each earns its place. It sits at the thin end of the range, with two of the three being narrow 'app-only helper' utilities.

    Completeness3/5

    The surface covers rendering, URL refreshing, and modal launch, but has gaps: no way to close or dismiss the modal, and no operation to discover or list local media files before previewing. Agents may hit dead ends when cleaning up or finding content to preview.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables coding agents to ask focused questions about local screenshots, video, audio, and music and receive compact text reports on OCR, layout, timestamps, sounds, and music description. Media stays on the machine and raw files are never loaded into the agent's context, with support for cropping, interval sampling, and durable background jobs.
      MIT