detrics
v0.1.16
Published
Detrics MCP server - Query marketing data from AI assistants
Maintainers
Readme
██████╗ ███████╗████████╗██████╗ ██╗ ██████╗███████╗ ███╗ ███╗ ██████╗██████╗
██╔══██╗██╔════╝╚══██╔══╝██╔══██╗██║██╔════╝██╔════╝ ████╗ ████║██╔════╝██╔══██╗
██║ ██║█████╗ ██║ ██████╔╝██║██║ ███████╗ ██╔████╔██║██║ ██████╔╝
██║ ██║██╔══╝ ██║ ██╔══██╗██║██║ ╚════██║ ██║╚██╔╝██║██║ ██╔═══╝
██████╔╝███████╗ ██║ ██║ ██║██║╚██████╗███████║ ██║ ╚═╝ ██║╚██████╗██║
╚═════╝ ╚══════╝ ╚═╝ ╚═╝ ╚═╝╚═╝ ╚═════╝╚══════╝ ╚═╝ ╚═╝ ╚═════╝╚═╝Query your marketing data directly from Claude, Cursor, or any MCP-compatible AI assistant.
Website · App · Docs · Privacy Policy · Terms of Service
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/mcp → API 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 detricsgemini mcp add -e DETRICS_API_KEY=dk_live_your_key_here detrics npx -- -y detrics3. 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 tool catalog is served live from the Detrics server: when Detrics ships new tools or parameters, they appear in your AI client automatically — no package update needed. (A bundled static catalog is the offline fallback.) The core tools:
| Tool | Description |
|------|-------------|
| query_marketing_data | Fetch metrics/dimensions from any connected platform |
| list_connections | Show all connected platforms and their status |
| list_fields | Discover metrics & dimensions for a platform — including a workspace's custom fields |
| 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 rangeCustom & dynamic fields
list_fields with just platform_api returns a platform's standard fields. To also discover a workspace's custom fields:
- Ad / analytics platforms (Meta custom conversions, GA4 custom dimensions & metrics, Klaviyo, AppsFlyer): pass
connection_id(fromlist_connections) andaccount_ids(fromlist_accounts). - CRM platforms (HubSpot, Salesforce): fields are per object type. Call once with just
platform_apito getavailable_entities, then re-call withconnection_id+entity(e.g.deals) to get that entity's standard and custom properties together.
Supported Platforms
Advertising — Meta Ads facebook-ads · Google Ads google-ads · TikTok Ads tiktok-ads · LinkedIn Ads linkedin-ads · Pinterest Ads pinterest-ads · Bing / Microsoft Ads bing-ads · X (Twitter) Ads x-ads · Snapchat Ads snapchat-ads · Amazon Ads amazon-ads · Apple Search Ads apple-search-ads · Mercado Ads mercado-ads · Google DV360 google-dv-360 · Campaign Manager 360 google-campaign-manager-360 · AppsFlyer appsflyer
Social / organic — Instagram Insights instagram-insights · Facebook Insights facebook-insights · Facebook Public Data facebook-public-data · TikTok Organic tiktok-organic · LinkedIn Pages linkedin-pages · YouTube Analytics youtube-analytics · Google Business Profile google-business-profile · Mercado Organic mercado-organic
E-commerce — Shopify shopify-store · WooCommerce woocommerce · Tiendanube tiendanube-store · VTEX vtex-store · Magento magento-orders · Google Merchant Center google-merchant-center
Analytics & search — Google Analytics 4 google-analytics-4 · Adobe Analytics adobe-analytics · Google Search Console google-search-console · Bing Webmaster Tools bing-webmaster-tools
Payments — Stripe stripe
CRM & email — HubSpot hubspot · Salesforce salesforce · Klaviyo klaviyo · Mailchimp mailchimp · Perfit perfit · Instantly instantly
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-serverYour AI client will handle the OAuth flow automatically.
Environment Variables
| Variable | Required | Description |
|----------|----------|-------------|
| DETRICS_API_KEY | Yes | API key from app.detrics.io/mcp |
| DETRICS_API_URL | No | Override the server URL (default https://mcp.detrics.io) |
| DETRICS_CLIENT_DESTINATION | No | Label identifying which surface this bridge serves, stored with usage analytics (default mcp-claude-code). Set it when embedding the CLI in another product. |
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
Privacy Policy · Terms of Service · Data Processing Agreement
