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

clickcontext

v0.1.13

Published

Select a live UI element in a localhost app and ask your AI IDE about it — grounded in real DOM, accessibility, React component stack, and source.

Readme

clickcontext

Click a UI element in your localhost app — ask your AI IDE why it looks the way it does.

Captures the real DOM, accessibility tree, React component stack (props + hook state), and source file:line of whatever you click. Sends it to a local MCP server your IDE reads automatically.

npx clickcontext init      # patch your app's dev config (Next.js / Vite)
npx clickcontext daemon    # start the capture daemon (keep running)

Then open http://127.0.0.1:7456/install → drag the bookmarklet to your bookmarks bar → click any element → ask your IDE.


Install

1. Register the MCP with your IDE (once per machine):

Claude Code:

claude mcp add --scope user clickcontext -- npx -y clickcontext@latest mcp

--scope user makes it available in every project, not just the current directory.

Claude Desktop — edit ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):

{
  "mcpServers": {
    "clickcontext": {
      "command": "npx",
      "args": ["-y", "clickcontext@latest", "mcp"]
    }
  }
}

Restart Claude Desktop after saving.

Any other MCP-capable IDE — point it at:

npx -y clickcontext@latest mcp

2. Patch your app (once per project — adds a dev-only source loader):

cd your-app
npx clickcontext init

Detects Next.js and Vite. Installs the right loader and patches your config. Restart your dev server after.

Skip this step if you just want to try it — you'll still get DOM, accessibility, and React component data. Source resolution just won't have exact file:line.

3. Start the daemon (every session):

npx clickcontext daemon

4. Install the bookmarklet (once):

Open http://127.0.0.1:7456/install in your browser and drag the button to your bookmarks bar.


Use

  1. Open your localhost app in the browser.
  2. Click the clickcontext bookmark. A picker activates — hover to see component names.
  3. Click the element you want to inspect. A Captured ✓ toast confirms it.
  4. In your IDE, ask anything: "Why is this button disabled?", "What component renders this?", "Where is this defined?"

The IDE calls get_latest_ui_context automatically and reasons over the real data.


What gets captured

| Layer | Contents | |---|---| | DOM | HTML, attributes, computed styles, bounding box | | Accessibility | ARIA role, computed name (W3C), disabled state | | React | Component stack, props, hook types + values | | Source | File path, line number, surrounding code lines |

React layers require a React dev build. Source layer is richest when clickcontext init has been run.


Requirements

  • Node.js 18+
  • A React app running in dev mode (Next.js, Vite, CRA, etc.)
  • An MCP-capable IDE (Claude Code, Cursor, Zed, etc.)

Architecture

browser bookmarklet  →  POST /capture  →  daemon (127.0.0.1:7456)
                                               ↓
                                    $TMPDIR/clickcontext-latest.json
                                               ↓
                              MCP server (stdio)  →  IDE

The daemon and MCP server are both started by the clickcontext CLI. The bookmarklet runs entirely in your browser's main world (no extension required) and communicates with the daemon over localhost using a per-install token stored in ~/.clickcontext/token.


Security

The daemon binds to 127.0.0.1 only and requires the per-install token on every capture request. The token is injected into the bookmarklet at runtime by the CLI — it never leaves your machine. Captured HTML and props are treated as plain text data, never executed.


Contributing

git clone https://github.com/gautham-psnl/clickcontext.git
cd clickcontext
npm install
npm run build   # → dist/cli.js + dist/bookmarklet.browser.js
npm test        # 70 tests

Issues and PRs welcome at github.com/gautham-psnl/clickcontext.