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

@uitoolbar/provider-mcp

v0.1.2

Published

UiToolbar provider for MCP tool integration

Readme

@uitoolbar/provider-mcp

MCP (Model Context Protocol) server for UiToolbar. Receives element selection data from the browser extension and can be extended for AI-powered code modifications.

Features

  • Element Selection API - Receives selected element context from extension
  • Health Checks - Simple endpoint for connection detection
  • Extensible - Add your own processing logic for element data
  • CORS Enabled - Works with browser extensions

Installation

pnpm add @uitoolbar/provider-mcp

Usage

Starting the Server

# Via CLI
pnpm exec uitoolbar-mcp

# Or programmatically
import { startServer } from '@uitoolbar/provider-mcp/server'
startServer(3001)

API Endpoints

GET /health

Check server status.

{
  "status": "ok",
  "provider": "mcp",
  "timestamp": 1704567890123,
  "available_tools": ["file_search", "code_modification"]
}

POST /api/select

Receive element selection from extension.

// Request
{
  element: {
    html: string           // Element's outerHTML
    tagName: string        // Tag name (lowercase)
    id?: string            // Element ID
    className?: string     // Class names
    textContent?: string   // Text content (truncated to 200 chars)
    attributes: Array<{ name: string, value: string }>
    bounds: {
      x: number
      y: number
      width: number
      height: number
      borderRadius?: string
      transform?: string
    }
    componentName?: string // React component name (if detected)
    filePath?: string      // Source file (if detected)
    lineNumber?: number    // Source line (if detected)
  }
  page: {
    url: string            // Page URL
    title: string          // Page title
  }
  prompt?: string          // Optional user instruction
  timestamp: number        // Selection timestamp
  react?: {                // React DevTools info (if available)
    component?: string
    filePath?: string
    lineNumber?: number
  }
}

// Response
{
  success: true,
  openFile?: {
    path: string
    line?: number
  },
  modifiedCode?: string
}

Client Usage

import { createMCPClient } from '@uitoolbar/provider-mcp/client'

const client = createMCPClient('http://localhost:3001')

// Check connection
const isConnected = await client.checkHealth()

// Send element selection
const result = await client.sendElement({
  element: { html: '<button>Click</button>', tagName: 'button', ... },
  page: { url: 'http://localhost:3000', title: 'My App' }
})

Configuration

| Option | Default | Description | |--------|---------|-------------| | port | 3001 | Server port |

How It Works

  1. Browser extension detects element under cursor
  2. On click, extension sends element context to MCP server
  3. Server logs the selection and processes it
  4. Currently returns placeholder response (extend for AI integration)

Extending

The processElementSelection function in server.ts is where you add custom logic:

const processElementSelection = async (data) => {
  // Your logic here:
  // - Search codebase for component file
  // - Send to AI for code suggestions
  // - Return file path to open in IDE
  
  return {
    filePath: '/src/components/Button.tsx',
    lineNumber: 42,
    code: '// Modified code'
  }
}

Development

# Run server in dev mode
pnpm dev

# Run tests
pnpm test

# Build
pnpm build

Integration with Extension

The extension auto-detects MCP server on http://localhost:3001. When active:

  1. Extension checks /health endpoint
  2. If healthy, sends element data to /api/select
  3. Server processes and optionally returns file to open