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

detrics

v0.1.2

Published

Detrics MCP server - Query marketing data from AI assistants

Readme

██████╗ ███████╗████████╗██████╗ ██╗ ██████╗███████╗    ███╗   ███╗ ██████╗██████╗
██╔══██╗██╔════╝╚══██╔══╝██╔══██╗██║██╔════╝██╔════╝    ████╗ ████║██╔════╝██╔══██╗
██║  ██║█████╗     ██║   ██████╔╝██║██║     ███████╗    ██╔████╔██║██║     ██████╔╝
██║  ██║██╔══╝     ██║   ██╔══██╗██║██║     ╚════██║    ██║╚██╔╝██║██║     ██╔═══╝
██████╔╝███████╗   ██║   ██║  ██║██║╚██████╗███████║    ██║ ╚═╝ ██║╚██████╗██║
╚═════╝ ╚══════╝   ╚═╝   ╚═╝  ╚═╝╚═╝ ╚═════╝╚══════╝    ╚═╝     ╚═╝ ╚═════╝╚═╝

Query your marketing data directly from Claude, Cursor, or any MCP-compatible AI assistant.

npm version npm downloads License: ISC MCP

Website · App · Docs


What is this?

Detrics MCP is a Model Context Protocol server that gives AI assistants direct access to your marketing data. Connect once, then ask anything:

"What was my blended ROAS across Meta and Google Ads last 30 days?"
"Which TikTok campaigns are overspending vs. target this week?"
"Show me Shopify revenue by product category broken down by day."
"Compare CPL across all platforms for Q1 vs Q4."

No dashboards. No exports. No SQL. Just your AI and your data.


Quick Start

1. Get an API key

Go to app.detrics.io/mcpAPI Keys → generate a key.

2. Add to your AI client

{
  "mcpServers": {
    "detrics": {
      "command": "npx",
      "args": ["-y", "detrics"],
      "env": {
        "DETRICS_API_KEY": "dk_live_your_key_here"
      }
    }
  }
}
{
  "mcpServers": {
    "detrics": {
      "command": "npx",
      "args": ["-y", "detrics"],
      "env": {
        "DETRICS_API_KEY": "dk_live_your_key_here"
      }
    }
  }
}

Add to your MCP settings:

{
  "detrics": {
    "command": "npx",
    "args": ["-y", "detrics"],
    "env": {
      "DETRICS_API_KEY": "dk_live_your_key_here"
    }
  }
}
claude mcp add detrics -e DETRICS_API_KEY=dk_live_your_key_here -- npx -y detrics

3. Start asking

Restart your AI client and start querying. The server runs on stdio — no ports, no daemons, no config beyond the API key.


Available Tools

The MCP server exposes 8 tools your AI can call:

| Tool | Description | |------|-------------| | query_marketing_data | Fetch metrics/dimensions from any connected platform | | list_connections | Show all connected platforms and their status | | list_fields | Discover available metrics & dimensions for a platform | | list_accounts | List ad accounts or store accounts for a platform | | connect_platform | Start an OAuth flow to connect a new platform | | check_connection_status | Poll the status of an in-progress connection | | list_contexts | List AI Contexts (saved sets of accounts) | | get_context | Get details of a specific AI Context |

Recommended workflow

1. list_contexts          → pick a context_id for your client
2. list_fields            → discover valid metric/dimension IDs
3. query_marketing_data   → pass context_id + fields + date range

Supported Platforms

| Platform | ID | |----------|----| | Meta Ads | facebook-ads | | Google Ads | google-ads | | TikTok Ads | tiktok-ads | | TikTok Organic | tiktok-organic | | LinkedIn Ads | linkedin-ads | | Pinterest Ads | pinterest-ads | | Bing / Microsoft Ads | bing-ads | | X (Twitter) Ads | x-ads | | Mercado Ads | mercado-ads | | Google Analytics 4 | google-analytics-4 | | Google Search Console | google-search-console | | Instagram Insights | instagram-insights | | Facebook Insights | facebook-insights | | Shopify | shopify-store | | WooCommerce | woocommerce | | Tiendanube | tiendanube-store | | Stripe | stripe | | Klaviyo | klaviyo | | HubSpot | hubspot |


AI Contexts

AI Contexts let you pre-define which accounts the AI should query — so you don't have to specify connection_id and account_ids on every request.

Create a context at app.detrics.io/mcp/contexts/new, then:

"Use my Q1 Campaign context and show me weekly spend vs revenue for all platforms."

The AI calls list_contexts, picks the right context, and passes context_id to query_marketing_data automatically.


OAuth Connection (Claude Web / ChatGPT)

If you're using Claude Web or ChatGPT instead of the CLI, Detrics supports OAuth 2.1. No API key needed — just connect at:

https://mcp.detrics.io/.well-known/oauth-authorization-server

Your AI client will handle the OAuth flow automatically.


Requirements

  • Node.js ≥ 18
  • A Detrics account at app.detrics.io
  • At least one connected platform

Built with the Model Context Protocol SDK

detrics.io · Made with care by the Detrics team