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

adtivity-mcp

v1.1.0

Published

Adtivity MCP server — install Adtivity analytics, session replay, error tracking and churn prediction into any codebase via Claude Code or Cursor in under 10 minutes

Downloads

336

Readme

Adtivity MCP Server

Install Adtivity product analytics into any codebase in under 10 minutes — directly from Claude Code or Cursor.

The MCP server detects your framework, installs the SDK, writes initialization code, wraps key buttons, and confirms data is flowing. No manual SDK wrestling required.

What it does

  1. Detect framework — reads package.json to identify Next.js (App/Pages Router), React, Vue, Express, or React Native, and finds the right entry file
  2. Install SDK — runs npm/yarn/pnpm/bun install @adtivity/adtivity-sdk
  3. Write init code — creates AdtivityProvider.tsx (Next.js App Router) or patches your entry file with init(), initPageTracking(), initClickTracking(), and initLocationTracking()
  4. Wrap events — returns copy-paste snippets for trackEvent() on signup, upgrade, checkout, and any custom action
  5. Verify — checks SDK is installed, init code is present, and API key is configured

Install

Claude Code

claude mcp add adtivity -- npx adtivity-mcp

That's it. Claude Code will pick it up on the next session.

To make it available across all your projects, add it to your global config instead:

claude mcp add --scope user adtivity -- npx adtivity-mcp

Cursor

Add to your Cursor MCP config (~/.cursor/mcp.json or the project-level .cursor/mcp.json):

{
  "mcpServers": {
    "adtivity": {
      "command": "npx",
      "args": ["adtivity-mcp"]
    }
  }
}

Any other MCP-compatible client

Use npx adtivity-mcp as the command. The server communicates over stdio and requires Node 18+.


Usage

Once the MCP server is running, tell your AI assistant:

"Install Adtivity into this project"

The assistant will call the tools in order. You can also call them individually:

Step-by-step

1. adtivity_detect_framework   — detect framework + entry file
2. adtivity_install_sdk        — install @adtivity/adtivity-sdk
3. adtivity_write_init_code    — write provider / patch entry file
4. adtivity_add_monitoring     — switch on session replay / error tracking / support widget
5. adtivity_add_identify       — wire identify() so users are people, not device ids
6. adtivity_wrap_event         — get trackEvent() snippet for a button
7. adtivity_verify_integration — confirm everything is wired up

Prompts that work well in Claude Code / Cursor

Install Adtivity into this project and wrap the signup and upgrade buttons.
Run adtivity_detect_framework on /path/to/my/project
Add Adtivity event tracking to my checkout button

Tools reference

| Tool | What it does | |------|-------------| | adtivity_detect_framework | Reads package.json, returns { framework, packageManager, entryFile, projectName } | | adtivity_install_sdk | Installs @adtivity/adtivity-sdk with the detected package manager | | adtivity_write_init_code | Writes init code for the given framework (see details below). Pass features: ["replay","errors","widget"] to include monitoring from the start | | adtivity_add_monitoring | Adds session replay, error tracking or the support widget to a project that is already set up | | adtivity_add_identify | Returns the identify() / resetIdentity() code for the sign-in flow. Without this, every error, recording and churn prediction shows a device id instead of a person you can email | | adtivity_wrap_event | Returns a trackEvent() snippet for a named event | | adtivity_verify_integration | Returns a checklist: SDK installed / init code present / API key set / identify() wired / replay + error tracking enabled |

adtivity_write_init_code — what it writes per framework

Next.js App Router

  • Creates src/components/AdtivityProvider.tsx (client component with init, initPageTracking, initClickTracking, initLocationTracking)
  • Patches src/app/layout.tsx to wrap <body> children with <AdtivityProvider>

Next.js Pages Router

  • Patches pages/_app.tsx — adds useEffect with init, initPageTracking, initClickTracking

React (Vite/CRA)

  • Prepends init calls to src/main.tsx / src/index.tsx

Vue

  • Prepends init calls to src/main.ts / src/main.js

Express

  • Prepends init() to your server entry file

API key

After the MCP writes the init code, add your Adtivity API key to your env file:

# Next.js
NEXT_PUBLIC_ADTIVITY_API_KEY=your_key_here

# React / Vue (Vite)
VITE_ADTIVITY_API_KEY=your_key_here

# Express / Node
ADTIVITY_API_KEY=your_key_here

Get your key at adtivity.xyz/dashboard.


Development

git clone https://github.com/adtivity/mcp
cd mcp-server
npm install
npm run dev     # run with tsx (no build step)
npm run build   # compile to dist/

To test the server locally with Claude Code before publishing:

claude mcp add adtivity -- npx adtivity-mcp

Supported frameworks

| Framework | Detected via | Init target | |-----------|-------------|-------------| | Next.js App Router | next dep + src/app/ dir | AdtivityProvider.tsx + layout.tsx | | Next.js Pages Router | next dep + pages/ dir | pages/_app.tsx | | React (Vite/CRA) | react dep | src/main.tsx | | Vue | vue dep | src/main.ts | | Express | express dep | app.ts / index.ts | | React Native / Expo | react-native or expo dep | App.tsx |


Links