media-preview
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@media-preview show an inline preview of ./renders/final-cut.mp4"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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 mswith 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
82pxgallery strip for 2+ images, or right-aligned30pxmicro-thumbnails (mode: "peek") when an agent silently inspects frames mid-task.Session-resilient across restarts. Ships an app-only (
0-token)resolve_mediatool 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:0with a random 128-bit per-session token and serves only explicitly registered files.Zero npm dependencies. Runs out of the box on Node.js
>= 18with nonpm installor 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-previewAntigravity 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-gtk4Tool Reference
preview_media
Parameter | Type | Default | Description |
|
| required | Absolute paths or |
|
|
|
|
|
|
| Loop video or audio playback (useful for seamless Short loop checks). |
|
|
| 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 testLicense
Available Tools
3 toolsopen_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
Scored across 3 tools
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.
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.
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.
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
Related MCP Connectors
Generate AI images, videos, music, SFX & speech in any AI assistant. Results appear inline in chat.
Generate images, video and audio in Claude, Codex and any MCP-ready AI agent.
LLM chat, text tools, image generation, editing, batch image jobs, and asynchronous video generation
Background removal, captions, noise removal and voiceovers on private hardware, for any AI agent.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceProvides local, offline transcription, keyframe extraction, OCR, and pre-publish review of audio, video, and image files, enabling AI agents to see and hear media without cloud or API keys.52 npmApache 2.0
- AlicenseNot gradedqualityCmaintenanceEnables 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
- AlicenseAqualityBmaintenanceEnables vision-capable AI assistants to inspect local videos by returning frames as images, sampling clips, generating contact sheets, detecting scene cuts, auto-picking platform-sized thumbnails, and exporting GIF, MP4, or WebP previews.8MIT
- AlicenseNot gradedqualityCmaintenanceEnables coding agents to inspect, transcribe, compress, and analyze images, video, and audio locally without loading heavy media into the main context, using subscription-backed workers and caching to avoid extra API costs.23 PyPIMIT