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

@kieksme/swetrix-events-mcp

v1.2.0

Published

MCP server for the Swetrix Events API – tracks pageviews, custom events, heartbeats, errors and revenue

Readme

@kieksme/swetrix-events-mcp

MCP server for the Swetrix Events API — 5 tools for tracking pageviews, custom events, heartbeats, errors, and revenue from AI assistants.

Installation

Claude Desktop

Add to ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "swetrix-events": {
      "command": "npx",
      "args": ["-y", "@kieksme/swetrix-events-mcp"],
      "env": {
        "SWETRIX_API_BASE_URL": "https://analytics.example.com"
      }
    }
  }
}

For revenue tracking, add your API key:

{
  "mcpServers": {
    "swetrix-events": {
      "command": "npx",
      "args": ["-y", "@kieksme/swetrix-events-mcp"],
      "env": {
        "SWETRIX_API_KEY": "your-api-key",
        "SWETRIX_API_BASE_URL": "https://analytics.example.com"
      }
    }
  }
}

Claude Code

# Without revenue tracking
claude mcp add swetrix-events -e SWETRIX_API_BASE_URL=https://analytics.example.com -- npx -y @kieksme/swetrix-events-mcp

# With revenue tracking
claude mcp add swetrix-events -e SWETRIX_API_KEY=your-key -e SWETRIX_API_BASE_URL=https://analytics.example.com -- npx -y @kieksme/swetrix-events-mcp

Environment variables

| Variable | Required | Description | |---|---|---| | SWETRIX_API_KEY | Only for swetrix_track_revenue | Your Swetrix API key | | SWETRIX_API_BASE_URL | No | Custom API base URL for self-hosted Swetrix (default: https://api.swetrix.com) |

Most tools only need the project ID (pid), not an API key.

Tools

| Tool | Auth required | Description | |---|---|---| | swetrix_track_pageview | No | Record a pageview with URL, referrer, user agent, and geo data | | swetrix_track_custom_event | No | Track a named custom event with optional metadata properties | | swetrix_track_heartbeat | No | Send a heartbeat to keep a session alive | | swetrix_track_error | No | Report a JavaScript or application error with optional stack trace | | swetrix_track_revenue | Yes (SWETRIX_API_KEY) | Track a revenue event with amount and currency |

Example prompts

  • "Track a pageview for project abc123 on the /checkout page."
  • "Send a custom event signup_completed with plan=pro to project abc123."
  • "Log an error: TypeError: Cannot read property 'id' of undefined from /app/cart.js."
  • "Record a revenue event of 49.99 USD for project abc123."

License

GPL-3.0-only — see LICENSE