detrics
v0.1.2
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.
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 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 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 rangeSupported 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-serverYour 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
