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-statistics-mcp

v1.2.0

Published

MCP server for the Swetrix Statistics API – read-only analytics queries

Readme

@kieksme/swetrix-statistics-mcp

MCP server for the Swetrix Statistics API — 34 read-only tools for querying traffic, performance, errors, funnels, goals, and more.

Installation

Claude Desktop

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

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

Claude Code

claude mcp add swetrix-statistics -e SWETRIX_API_KEY=your-key -e SWETRIX_API_BASE_URL=https://analytics.example.com -- npx -y @kieksme/swetrix-statistics-mcp

Environment variables

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

Tools

Traffic

| Tool | Description | |---|---| | swetrix_get_traffic | Aggregated traffic analytics (dashboard view): visitors, pageviews, bounce rate, session duration | | swetrix_get_traffic_chart | Time-series traffic chart data for a given period and interval | | swetrix_get_sessions | Paginated list of individual sessions with geo and device info | | swetrix_get_session_detail | Full event log for a single session | | swetrix_get_live_visitors | Current live visitor count | | swetrix_get_birdseye | Birdseye overview: top pages, countries, referrers, devices |

Performance

| Tool | Description | |---|---| | swetrix_get_performance | Web Vitals and performance metrics (LCP, FID, CLS, TTFB, etc.) | | swetrix_get_performance_chart | Time-series performance chart | | swetrix_get_performance_birdseye | Performance breakdown by page, country, browser, device |

Errors

| Tool | Description | |---|---| | swetrix_get_errors | Paginated list of error groups | | swetrix_get_error_detail | Full detail for a specific error including stack trace | | swetrix_get_error_overview | Error trend chart over time | | swetrix_get_error_sessions | Sessions in which a specific error occurred | | swetrix_get_errors_filters | Available filter values for error queries |

Custom Events

| Tool | Description | |---|---| | swetrix_get_event_meta | Metadata keys and values for a specific custom event | | swetrix_get_property | Aggregated stats for a custom event property | | swetrix_get_custom_events | All custom events with counts and trends | | swetrix_get_heartbeats | Heartbeat event data | | swetrix_get_keywords | Search keyword referrals |

Funnels

| Tool | Description | |---|---| | swetrix_get_funnel | Conversion funnel with per-step visitor and drop-off counts | | swetrix_get_funnel_sessions | Sessions that entered a specific funnel | | swetrix_get_user_flow | User flow / Sankey diagram data between pages |

Goals

| Tool | Description | |---|---| | swetrix_get_goal_stats | Conversion statistics for a goal (rate, trend, total) | | swetrix_get_goal_chart | Goal conversion chart over time | | swetrix_get_feature_flag_stats | Feature flag exposure and conversion stats | | swetrix_get_feature_flag_profiles | Visitor profiles that saw a feature flag | | swetrix_get_captcha | CAPTCHA solve statistics |

Visitor Profiles

| Tool | Description | |---|---| | swetrix_get_profiles | Paginated list of visitor profiles | | swetrix_get_profile_detail | Full profile for a single visitor | | swetrix_get_profile_sessions | All sessions for a specific visitor profile |

Filters

| Tool | Description | |---|---| | swetrix_get_filters | Available values for a filter dimension (browser, country, OS, etc.) | | swetrix_get_filter_versions | Browser or OS version values for a given filter column |

Example prompts

  • "Show me the traffic for project abc123 over the last 7 days."
  • "What are the top 5 error groups in my project this month?"
  • "How is the checkout funnel performing — where are users dropping off?"
  • "What's the current live visitor count for project abc123?"

License

GPL-3.0-only — see LICENSE