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

motif-mcp

v1.0.0

Published

MCP server — give your AI coding assistant the ability to watch a video or GIF of a UI bug and return a diagnosis + code fix. Powered by Gemini 1.5 Pro.

Readme

motif

Your AI can now watch your bugs.

Some bugs only exist in motion — the jank on scroll, the animation that overshoots, the transition that flickers for half a second and then fixes itself. You can't paste a screenshot of that into your editor and expect a useful answer.

motif is an MCP server. Record your bug, point your AI at the file, and it comes back with a diagnosis and a fix. No describing what you're seeing. No back and forth.

Works with Cursor, Claude Code, Claude Desktop, or anything that speaks MCP.


Install

npm install -g motif-mcp

Or run without installing:

npx motif-mcp

Setup

1. Get a Gemini API key

ai.google.dev — free tier is enough to start

2. Add motif to your MCP config

Cursor (~/.cursor/mcp.json):

{
  "mcpServers": {
    "motif": {
      "command": "npx",
      "args": ["motif-mcp"],
      "env": {
        "GEMINI_API_KEY": "your-key-here"
      }
    }
  }
}

Claude Code (~/.claude/mcp.json):

{
  "mcpServers": {
    "motif": {
      "command": "npx",
      "args": ["motif-mcp"],
      "env": {
        "GEMINI_API_KEY": "your-key-here"
      }
    }
  }
}

3. Restart your editor

motif is now a tool your AI can call.


Usage

Record any screen bug as a GIF or video. Then in Cursor or Claude Code:

Watch ~/Desktop/bug.gif and fix my animation.tsx
Use motif on this recording — something's wrong with the scroll behavior
motif: analyze ~/recordings/carousel-glitch.mp4 against src/components/Carousel.tsx

motif figures out the rest.


Tool: analyze_video

The one tool motif exposes. All parameters:

| Parameter | Required | Description | |-------------|----------|-------------| | video_path | ✓ | Absolute path to recording — .gif, .mp4, .webm, .mov | | code | ✓ | Source code to fix — paste the file or relevant section | | hint | | Focus hint, e.g. "look at the scroll", "focus on modal exit" | | mode | | animation · layout · interaction · general (default) | | language | | Language for the fix — e.g. TypeScript, Python. Inferred from code if omitted |

Output:

motif analyzed bug.mp4 (62 frames)

WHAT I SEE:
Clicking "Next" causes the slide to overshoot at ~0.3s — slides
past destination, snaps back. Visible on every transition.

ROOT CAUSE:
translateX uses linear easing — no overshoot correction. Slide
jumps past 100% before settling.

FIX:
transition: "transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1)"

DIFF:
- transition: "transform 0.3s linear"
+ transition: "transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1)"

CONFIDENCE: high

How It Works

You record a bug              →  GIF / MP4 / WebM / MOV
                                       ↓
motif validates the file      →  Format, size, path checks
                                       ↓
Video uploaded to Gemini      →  Files API — persists 48h
                                       ↓
Gemini watches it             →  Sees motion, not just pixels
                                       ↓
Prompt + code sent            →  Mode-focused, language-aware
                                       ↓
Structured JSON returned      →  Parsed, formatted, delivered
                                       ↓
Fix applied in your editor    →  Done

Gemini is the right model here because it processes video as a frame sequence — it sees the stutter at 0.3s, the element that overshoots, the state that never resolves.


Environment Variables

| Variable | Required | Default | Description | |-------------------|----------|-------------------|-------------| | GEMINI_API_KEY | ✓ | — | Your Gemini API key | | MOTIF_MODEL | | gemini-2.5-flash | Gemini model to use. Set to gemini-2.5-pro for harder bugs | | MOTIF_MAX_FILE_MB| | 50 | Max video size in MB | | MOTIF_DEBUG | | false | Set to "true" for verbose stderr logging |

To use a more powerful model for difficult bugs:

"env": {
  "GEMINI_API_KEY": "your-key-here",
  "MOTIF_MODEL": "gemini-2.5-pro"
}

Analysis Modes

Pass mode to focus Gemini on the right class of bug:

| Mode | Focuses on | |--------------|------------| | animation | Spring physics, easing curves, keyframe timing, overshoot | | layout | Positioning, z-index stacking, flex/grid alignment, overflow | | interaction | Hover states, click feedback, focus rings, scroll triggers | | general | Everything — default if omitted |

Example: "Look at the modal exit, mode: animation"


Supported

Input formats

  • .gif .mp4 .webm .mov
  • Local absolute file paths

AI clients

  • Cursor
  • Claude Code
  • Claude Desktop
  • Any MCP-compatible client

Works with any framework

  • React / Next.js
  • Vue / Nuxt
  • Svelte
  • Vanilla JS / CSS
  • Remotion animations

Why This Exists

Cursor feature request for video input: 847 upvotes. Still open.

The workaround today:

  1. Record the bug
  2. Watch it yourself
  3. Try to describe it in words
  4. Hope the AI understands
  5. Get a wrong fix
  6. Repeat

motif skips steps 2–5.


Development

npm install
npm run dev      # runs src/index.ts with tsx, hot reload
npm run build    # compiles to dist/
npm run start    # runs dist/index.js

Test the MCP server directly:

echo '{"jsonrpc":"2.0","id":1,"method":"tools/list"}' | node dist/index.js

Project structure:

src/
├── index.ts      Entry point — boots MCP server, wires transport
├── tools.ts      MCP tool definitions and request handlers
├── analyze.ts    Core logic — uploads to Gemini, parses response
├── extract.ts    File validation, format detection, path resolution
└── prompts.ts    All Gemini prompts — edit here, not inline

web/                         Next.js landing page
├── app/
│   ├── page.tsx
│   ├── layout.tsx
│   ├── globals.css
│   └── components/
│       ├── Hero.tsx         Hero with embedded demo video
│       ├── DemoVisual.tsx   Interactive React fallback component
│       ├── HowItWorks.tsx
│       ├── Install.tsx
│       └── ...
└── public/
    └── demo.mp4             Pre-rendered demo video (committed to repo)

Contributing

motif is MIT licensed and built to be extended.

Good first issues:

  • Add support for Loom / remote URLs
  • Cache uploaded files by hash to skip re-uploads
  • Add a compare tool — diff two recordings (before/after)
  • Build a VS Code extension wrapper

Built with:


License

MIT — use it, fork it, ship it.


motif — motion + fix. The pattern that keeps repeating until you find it.