[FEATURE] Add analytics investigation capabilities to the Dub MCP server
Problem
Dub already has powerful analytics and an "Ask AI" experience for generating analytics filters.
However, when an AI agent uses Dub through MCP, there is still a gap between having access to analytics data and being able to perform a useful multi-step investigation.
Questions like:
- "Why did conversions drop last month?"
- "Which links caused the largest decrease in conversion rate?"
- "Compare this month with last month and explain the biggest changes."
- "Which partners are driving the increase in revenue, and what changed?"
often require the agent to discover the right filters, make multiple analytics queries, compare time periods, break results down by different dimensions, and then combine the results itself.
Describe the solution you'd like
Add analytics investigation capabilities to the Dub MCP server so agents can perform these multi-step investigations more efficiently.
A possible initial interface could expose read-only primitives such as:
analytics_compare— compare two time ranges using the same filtersanalytics_breakdown— break a metric down by a supported dimension and identify the largest contributorsanalytics_explain_change— identify the segments that contributed most to a change between two periods
For example, an MCP client could ask:
Why did conversion rate decrease over the last 30 days?
The MCP server could return structured evidence such as:
{
"metric": "conversionRate",
"comparison": {
"current": 3.1,
"previous": 4.4,
"change": -1.3
},
"topContributors": [
{
"dimension": "country",
"value": "US",
"impact": -0.7
},
{
"dimension": "device",
"value": "mobile",
"impact": -0.4
}
]
}
### Contribution
I'd be happy to work on an initial implementation of this if the direction makes sense.
- [x] I'd like to work on this
- [x] I'd appreciate guidance from maintainersSource: dubinc/dub