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

@yavio/sdk

v0.1.4

Published

Yavio SDK for instrumenting MCP servers with analytics, session tracking, and a React widget

Readme

@yavio/sdk

Instrument MCP servers with analytics, session tracking, and an optional React widget — all in one line of code.

Install

npm install @yavio/sdk

Requires @modelcontextprotocol/sdk >=1.0.0 as a peer dependency.

Quick Start

import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { withYavio, yavio } from "@yavio/sdk";

const server = withYavio(
  new McpServer({ name: "my-server", version: "1.0.0" }),
);

server.registerTool("search", { inputSchema: { query: z.string() } }, async ({ query }) => {
  yavio.identify("user-123");
  yavio.step("search");
  yavio.track("search_executed", { query });

  const results = await doSearch(query);
  return { content: [{ type: "text", text: JSON.stringify(results) }] };
});

Tool calls, inputs, outputs, and timing are captured automatically. Custom events are optional.

Configuration

The SDK resolves config in order:

  1. Options passed to withYavio(server, options)
  2. Environment variables YAVIO_API_KEY and YAVIO_ENDPOINT
  3. .yaviorc.json (walks up from cwd)

If no API key is found, withYavio() returns the original server unchanged — zero overhead, no HTTP requests.

Options

withYavio(server, {
  apiKey: "yav_...",
  endpoint: "https://ingest.yavio.app",
  capture: {
    inputValues: true,   // capture tool input values (default: true)
    outputValues: true,  // capture tool output values (default: true)
    geo: true,           // capture geo data (default: true)
    tokens: true,        // capture token counts (default: true)
    retries: true,       // capture retry attempts (default: true)
  },
});

Tracking API

Import yavio and call methods inside tool handlers — context is propagated automatically:

import { yavio } from "@yavio/sdk";

// Associate events with a user
yavio.identify("user-123", { plan: "pro" });

// Record funnel steps (auto-incrementing sequence)
yavio.step("onboarding_start");
yavio.step("onboarding_complete");

// Record custom events
yavio.track("file_uploaded", { size: 1024 });

// Record revenue
yavio.conversion("purchase", {
  value: 29.99,
  currency: "USD",
});

React Widget

For client-side tracking in MCP-powered UIs:

npm install @yavio/sdk react react-dom
import { useYavio } from "@yavio/sdk/react";

function App() {
  const yavio = useYavio();

  // yavio.identify(), yavio.track(), yavio.step(), yavio.conversion()

  return <div>...</div>;
}

The widget auto-captures clicks, scrolls, form interactions, navigation, errors, performance metrics, and rage clicks. Configuration is resolved from tool result metadata (_meta.yavio) or passed explicitly to the hook.

PII Protection

Email addresses, credit card numbers, SSNs, and phone numbers are automatically stripped from event payloads before they leave the client.

Documentation

Full documentation is available at docs.yavio.ai.

License

MIT