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

astro-click-to-ai

v0.2.2

Published

Astro Dev Toolbar app: click elements to capture context with annotations for AI coding assistants.

Downloads

679

Readme

astro-click-to-ai

Astro Dev Toolbar plugin that captures clicked elements with annotations for AI coding assistants. Includes an MCP server with resource and channel support — clicks arrive live in your AI session.

Install

npm install -D astro-click-to-ai
// astro.config.mjs
import { defineConfig } from "astro/config";
import clickToAi from "astro-click-to-ai";

export default defineConfig({
  integrations: [clickToAi()],
});

On first npm run dev, the integration automatically:

  • Adds .astroclick to .gitignore
  • Configures the MCP server in .mcp.json

Workflow

  1. npm run dev — the toolbar shows a clipboard icon.
  2. Toggle the app on. A side panel opens and a hover highlight follows your cursor.
  3. Click any element. A note popup appears inline — type what you want changed, then press Enter to add it (or Escape to add without a note).
  4. Repeat for more elements. Edit notes in the side panel, remove items with x, or clear all.
  5. Your AI assistant receives the clicks:
    • MCP channel — clicks push live into Claude Code sessions
    • MCP resourceclick-to-ai://clicks returns pending captures (drains on read)
    • File@.astroclick for clients without MCP support
  6. Toggle off — clicks pass through normally.

MCP Server

The package includes a stdio MCP server (no SDK dependency, pure JSON-RPC). It's auto-configured in .mcp.json on first run.

Resource click-to-ai://clicks — returns captured clicks, drains on read. Works with any MCP client.

Channel — pushes new clicks live as <channel source="click-to-ai"> events. For Claude Code, start with:

claude --dangerously-load-development-channels server:click-to-ai

The file is cleared on each npm run dev and capped at 50 items.

Captured fields

Each entry contains:

type CapturedClick = {
  timestamp: string; // ISO timestamp
  url: string; // full page URL
  pathname: string; // pathname only
  tag: string; // lowercase tag name
  id: string; // element id, if any
  classes: string[]; // class list
  selector: string; // computed CSS selector path
  text: string; // truncated textContent (200 chars)
  outerHtml: string; // truncated outerHTML (600 chars)
  rect: { x: number; y: number; width: number; height: number };
  note: string; // your annotation
};

AI assistant prompt

Copy and paste this into your AI assistant to set up the plugin:

Install astro-click-to-ai and add it to astro.config.mjs:

npm install -D astro-click-to-ai

Then add clickToAi() to the integrations array:

import clickToAi from "astro-click-to-ai";
export default defineConfig({ integrations: [clickToAi()] });

Run npm run dev — it auto-configures .mcp.json and .gitignore.

When I click elements in the browser, they arrive via MCP channel or the
click-to-ai://clicks resource. Each entry has a selector, outerHtml, and
a note field describing what I want changed. Use selector and outerHtml to
find the element in src/, then follow the note.

What it does NOT do

  • No .astro source mapping — Astro doesn't annotate rendered DOM with source files. The captured selector and outerHTML are usually enough context for an AI to find the right component.
  • No production output — uses Astro's dev toolbar API; nothing ships in your build.

License

MIT