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

gravity-lite

v3.0.5

Published

AI-powered CSS layout diagnostics — zero-config MCP server for developers

Downloads

750

Readme

gravity-lite

AI-powered CSS layout diagnostics. Zero-config MCP server for AI assistants.

npm version license

Give your AI assistant (Kiro, Cursor, Claude, etc.) the ability to see what actually renders in your browser — not just read source code. Gravity bridges AI tools to live Chrome tabs via the Chrome DevTools Protocol.

Install

npm install -g gravity-lite

Requirements: Node.js ≥ 16, Chrome ≥ 116


Setup (one-time, ~2 minutes)

1. Add to your IDE MCP config

Kiro (.kiro/settings/mcp.json), Cursor (~/.cursor/mcp.json), or Claude Desktop (claude_desktop_config.json):

{
  "mcpServers": {
    "gravity": { "command": "gravity" }
  }
}

Restart your IDE. The MCP server starts automatically.

2. Load the Chrome extension

chrome://extensions  →  enable Developer Mode  →  Load unpacked

Point it at the extension/ folder inside the package:

# Print the exact path to load
gravity doctor

3. Connect to a tab

Click the Gravity icon in Chrome → Connect to Tab.

Done. The extension connects to the MCP server automatically.


Tools

| Tool | What it does | |---|---| | connect_browser | Check extension connection status | | diagnose_layout | Detect overflow, hidden, offscreen, unresolved CSS vars | | inspect_stacking | Debug z-index failures and stacking context traps | | check_accessibility | WCAG contrast ratio, touch targets, ARIA tree | | inspect_responsive | Fixed widths that break on mobile, viewport overflow | | debug_flexgrid | Flexbox/Grid container + children deep analysis | | get_computed_layout | Full computed style snapshot with CSS rule specificity | | highlight_element | Color-coded overlay in the browser (content/padding/border/margin) | | screenshot_element | Capture any element as a base64 PNG | | get_page_performance | Layout thrash metrics, paint timings |

Example prompts

diagnose the #header element
why is .modal behind everything — inspect stacking context
check accessibility of the .submit-btn
screenshot the #hero section
highlight .nav-bar for 5 seconds
debug the flex container .card-grid

How it works

IDE / AI  ──stdio──►  MCP Server (Node.js)
                           │
                      WS :9224  ◄── extension connects OUT to server
                           │         (no native messaging, no OS setup)
                    Chrome Extension (MV3)
                     ├── offscreen.js  — persistent WebSocket
                     └── background.js — chrome.debugger API
                           │
                       Active Tab (CDP)

The key insight: The extension connects out to the MCP server, not the other way around. No native messaging, no registry keys, no OS-specific setup. Works on Linux, macOS, and Windows.


Commands

gravity           # start MCP server (called by IDE automatically)
gravity doctor    # check setup status and print extension path

Environment variables

| Variable | Default | Description | |---|---|---| | GRAVITY_PORT | 9224 | WebSocket bridge port |


Troubleshooting

| Problem | Fix | |---|---| | "Browser extension not connected" | Open Chrome, load the extension, click "Connect to Tab" | | "Port 9224 already in use" | Set GRAVITY_PORT=9225 in your MCP config | | MCP server dot stays red in popup | Make sure gravity is running (check IDE MCP status) | | "Element not found: #selector" | Verify the selector exists on the current page | | Chrome ≥ 116 required | The offscreen documents API was added in Chrome 116 |