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

@context-action/webmcp

v0.1.2

Published

WebMCP imperative API adapter for Context-Action tool managers

Downloads

717

Readme

@context-action/webmcp

Browser adapter for exposing an explicit Context-Action tool scope through the experimental WebMCP imperative API. It does not create a second registry: ToolManagementInterface remains the authorization, validation, approval, and durable-execution boundary.

import { createWebMCPToolScope } from '@context-action/webmcp';

const scope = await createWebMCPToolScope(registry, {
  sessionId: 'shopping-page:42',
  toolNames: ['searchCatalog', 'addToCart'],
  exposedTo: ['https://agent.example'],
});

// Call on page teardown. WebMCP unregisters the scoped tools via AbortSignal.
scope.dispose();

For React, import useWebMCPToolScope from the experimental @context-action/react/webmcp subpath and pass a memoized options object; the hook unregisters the scope on unmount.

Each scope creates unique correlation IDs for canonical calls. WebMCP does not provide a stable native retry identity, so idempotency is disabled by default; pass getIdempotencyKey only with a domain-owned retry key. Use interaction for canonical policy-gated approval: it runs only after argument validation and a policy ask decision. afterExecute is a detached post-execution notification, not an authorization boundary. Select currentWebMCPProfile by default or import @context-action/webmcp/profiles/chrome-legacy for Chrome's older registration shape. errorMode defaults to structured; use throw when the host requires rejected browser callbacks.

The adapter is safe to import during SSR and in unsupported browsers: it returns { supported: false, activeTools: [] } when document.modelContext is unavailable. It only exposes the requested toolNames; omitting the list does not publish the entire registry.

WebMCP itself requires a visible browsing context, origin isolation, and the browser tools Permissions Policy. Cross-origin exposure must be explicitly listed through exposedTo; this adapter accepts HTTPS origins and local HTTP origins only for local development.