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

@mcp-web/tools

v0.1.3

Published

MCP Web tools collection

Readme

MCP Web Tools

A collection of reusable, pre-built tools for MCP-Web. Includes screenshot capture, DOM querying, and in-browser Python execution.

Overview

This package provides ready-to-use tool classes that can be registered directly with MCPWeb.addTool().

Quick Start

Installation

npm install @mcp-web/tools

Screenshot Tool

Capture screenshots of the page or specific elements. Returns a data URL that the bridge automatically converts into an MCP image content block.

import { ScreenshotTool } from '@mcp-web/tools/screenshot';

// Dynamic: AI chooses which element to capture
mcp.addTool(new ScreenshotTool({
  name: 'screenshot',
  description: 'Take a screenshot of any element',
}));

// Static: always captures a specific element
mcp.addTool(new ScreenshotTool({
  name: 'screenshot-chart',
  description: 'Take a screenshot of the chart',
  elementSelector: '#chart-container',
  format: 'jpeg',
}));

DOM Query Tool

Query and inspect DOM elements by CSS selector. Returns tag name, id, class, text content, and attributes for each match.

import { DOMQueryTool } from '@mcp-web/tools/dom';

mcp.addTool(new DOMQueryTool());

Python Tool

Execute Python code in the browser using Pyodide. Runs in a Web Worker with a 30-second timeout. Packages are loaded automatically from imports.

import { PythonTool } from '@mcp-web/tools/python';

const pythonTool = new PythonTool(
  // Provide datasets available to the Python script
  () => ({ data: getAppData() }),
  {
    name: 'analyze-data',
    description: 'Analyze application data with Python',
    defaultPackages: ['numpy', 'pandas'],
  }
);

mcp.addTool(pythonTool);

// Clean up when done
pythonTool.destroy();

Creating Custom Tools

Extend BaseTool to create your own reusable tools:

import { BaseTool } from '@mcp-web/tools';
import { z } from 'zod';

const InputSchema = z.object({
  query: z.string().describe('Search query'),
});

const OutputSchema = z.object({
  results: z.array(z.string()),
});

class SearchTool extends BaseTool<typeof InputSchema, typeof OutputSchema> {
  get name() { return 'search'; }
  get description() { return 'Search for items'; }
  get inputSchema() { return InputSchema; }
  get outputSchema() { return OutputSchema; }
  get handler() {
    return ({ query }: z.infer<typeof InputSchema>) => ({
      results: performSearch(query),
    });
  }
}

mcp.addTool(new SearchTool());

Exports

| Import Path | Export | Description | |-------------|--------|-------------| | @mcp-web/tools | BaseTool | Abstract base class for creating custom tools | | @mcp-web/tools/screenshot | ScreenshotTool | Capture page or element screenshots (png, jpeg, webp) | | @mcp-web/tools/dom | DOMQueryTool | Query and inspect DOM elements by CSS selector | | @mcp-web/tools/python | PythonTool | Run Python code in-browser via Pyodide Web Worker |

Learn More

For full documentation, guides, and examples, visit mcp-web.dev.