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 🙏

© 2026 – Pkg Stats / Ryan Hefner

openrouter-media

v0.1.0

Published

MCP server exposing OpenRouter's image + async video generation as tools, bundled with companion SKILL.md skills that teach agents the creative workflows. Live model catalog, per-generation cost estimates, and a robust async video poll lifecycle.

Readme

openrouter-media

npm version CI npm downloads node License: MIT

An MCP server that exposes OpenRouter's image and asynchronous video generation as tools — bundled with companion SKILL.md skills that teach an agent the creative workflows (cinematic shorts, feature demos, hero images, image-to-video).

It speaks the Model Context Protocol over stdio, so any MCP-capable agent (Claude Code, Claude Desktop, etc.) can browse the live media-model catalog, generate images, submit and poll video jobs, and budget spend — without writing any OpenRouter glue code.

Why this server

  • Image + video in one place. Image output via OpenRouter's chat/completions (modalities: ["image","text"]) and the asynchronous video API (/videos) under one MCP surface.
  • Cost-aware by design. Every tool returns cost-relevant fields: image tools report the real usage.cost; video tools return a per-second estimate up front and the real cost on completion — so a spend governor can see and bound spend. (Video is priced per output second; some providers add a per-clip minimum, so estimates are an honest lower-ish bound, never a guarantee.)
  • Robust async lifecycle. generate_video_sync submits and polls with exponential backoff up to a timeout, then hands back the job_id to resume — it surfaces failed/partial/timeout states honestly instead of pretending.
  • No media bytes through the protocol. Tools return URLs / compact references (mime + size) plus metadata, not multi-megabyte blobs inline.
  • Ships real skills. The skills/ directory contains practical, cost-honest SKILL.md procedures an agent can follow for real marketing/creative work.

Tools

| Tool | What it does | |---|---| | list_media_models | Image + video catalog with per-model resolutions, aspect ratios, durations, frame-image (image-to-video) support, audio capability, and pricing SKUs. Use it to choose a model and budget. | | generate_image | Generate an image from a prompt. Returns a data URL + compact ref (mime/size) and the real cost in USD. | | generate_video | Submit an async video job. Returns { job_id, status, est_cost_usd, est_pricing_sku }. | | get_video | Poll a job_id → status; on completion returns result_url + real cost. | | generate_video_sync | Submit + poll to completion within timeout_sec; returns the result_url + real cost, or the job_id to resume on timeout. |

Skills

Bundled in skills/ (and shipped in the npm package):

| Skill | Teaches | |---|---| | cinematic-short | Produce a short product cinematic — model choice (Veo for hero/audio, Kling/Grok for fast/cheap), prompt structure, resolution/duration budgeting, submit→poll discipline. | | feature-demo-short | A feature-explainer short via image-to-video from a screenshot (frame_images). | | hero-image | High-quality marketing image (gpt-5-image / Gemini 3 Pro Image) with aspect-ratio + brand-consistency guidance. | | image-to-video | Animate a still image into a short clip. |

Install

npm install -g openrouter-media   # or run via npx

Set your OpenRouter key in the server environment:

export OPENROUTER_API_KEY="sk-or-v1-..."

Use with Claude Code / Claude Desktop

Add it to your MCP server config (stdio):

{
  "mcpServers": {
    "openrouter-media": {
      "command": "npx",
      "args": ["-y", "openrouter-media"],
      "env": { "OPENROUTER_API_KEY": "sk-or-v1-..." }
    }
  }
}

Or, for a global install: "command": "openrouter-media".

Configuration (environment)

| Variable | Default | Notes | |---|---|---| | OPENROUTER_API_KEY | — | required | | OPENROUTER_BASE_URL | https://openrouter.ai/api/v1 | override for proxies/gateways | | OPENROUTER_SITE_URL | this repo | sent as HTTP-Referer for OpenRouter attribution | | OPENROUTER_SITE_TITLE | openrouter-media | sent as X-Title for OpenRouter attribution |

Notes on cost & honesty

  • Images bill per token; image output dominates the completion-token cost. The real cost is returned in every generate_image result (cost_usd).
  • Video bills per output second. est_cost_usd is computed from the model's pricing SKU × duration, but some providers (observed: Kling) charge a per-clip minimum above that, so the authoritative cost is the cost_usd returned by the completed job. Always read the real cost from get_video / generate_video_sync.
  • Some video models can be blocked by your OpenRouter account's data/privacy policy and return a 404; the tools call this out with a hint. Adjust at https://openrouter.ai/settings/privacy or pick a different model.

Develop

npm install
npm run typecheck   # tsc --noEmit
npm test            # compiles + runs node:test unit tests (no network)
npm run build       # emits dist/
npm start           # run the stdio server locally

See CONTRIBUTING.md. Security policy: SECURITY.md.

License

MIT — free for everyone, always.