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

@xpmetric/mcp

v0.1.3

Published

MCP server for XPmetric — read analytics and manage goals/funnels from your editor

Readme

@xpmetric/mcp

MCP server for XPmetric. Pull traffic and revenue into your editor, and create conversion goals and funnels against the same /api/v1 surface as the dashboard — while the agent has your checkout code open.

A goal only fires if window.xpmetric('event_name') exists in the page. The agent can add that call and create the matching goal in one turn.

Remote HTTP MCP is not supported. This package speaks stdio only — it is the xpmetric-mcp bin, not an importable library.

Setup

  1. Open Settings → General → API keys at xpmetric.com, name a key, and copy it once. The prefix is xpm_mcp_. A key covers every site on the account.
  2. Add the server to your editor (snippets below).
  3. Restart the MCP session.

Environment

| Variable | Required | Default | |---|---|---| | XPMETRIC_API_KEY | yes | — | | XPMETRIC_BASE_URL | no | https://xpmetric.com |

Point XPMETRIC_BASE_URL at http://127.0.0.1:3000 or http://localhost:<port> for local development. Any other host is rejected so the API key is never forwarded elsewhere.

Claude Code

{
  "mcpServers": {
    "xpmetric": {
      "command": "npx",
      "args": ["-y", "@xpmetric/mcp"],
      "env": {
        "XPMETRIC_API_KEY": "xpm_mcp_YOUR_KEY"
      }
    }
  }
}

Cursor

Add the same block under Cursor Settings → MCP (or .cursor/mcp.json):

{
  "mcpServers": {
    "xpmetric": {
      "command": "npx",
      "args": ["-y", "@xpmetric/mcp"],
      "env": {
        "XPMETRIC_API_KEY": "xpm_mcp_YOUR_KEY"
      }
    }
  }
}

Local checkout

For local development against a checkout, build once and point the editor at the compiled bin:

cd packages/mcp
npm install
npm run build
{
  "mcpServers": {
    "xpmetric": {
      "command": "node",
      "args": ["/ABS/PATH/TO/xpmetric/packages/mcp/dist/index.js"],
      "env": {
        "XPMETRIC_API_KEY": "xpm_mcp_YOUR_KEY",
        "XPMETRIC_BASE_URL": "http://127.0.0.1:3000"
      }
    }
  }
}

npx from that directory also works after a build: npx xpmetric-mcp (requires XPMETRIC_API_KEY).

CI

GitHub Actions workflow .github/workflows/mcp.yml runs npm ci && npm test && npm run build on every PR and main push that touches packages/mcp/**. It is independent of the production Docker deploy pipeline.

Tools

| Tool | Purpose | |---|---| | list_sites | Sites on the key (id, domain, trackingMode) — start here | | get_stats | Period totals (visitors, pageviews, bounce, session time, revenue, compare) | | get_timeseries | Bucketed traffic series | | get_breakdown | Ranked breakdown for one dimension (dim = path, country, channel, …) | | discover_goal_candidates | Custom events firing with no goal yet | | get_tracking_snippet | Guarded window.xpmetric('event') snippet to paste into the repo | | list_goals / create_goal / update_goal / delete_goal | Goal CRUD | | list_funnels / create_funnel / update_funnel / delete_funnel / get_funnel_data | Funnel CRUD + data |

Public install docs: xpmetric.com/docs/mcp-server. This server never writes the user's files.

License

MIT