Connect AI assistants to PubPerf via Model Context Protocol
PubPerf provides a built-in Model Context Protocol (MCP) server that lets AI assistants like Claude, ChatGPT, and other MCP-compatible clients query your analytics data directly.
The MCP server exposes read-only access to all PubPerf analytics for your organization:
See API Keys & Integrations for detailed key management instructions.
Add the following to your Claude Desktop MCP configuration (claude_desktop_config.json):
{
"mcpServers": {
"pubperf": {
"type": "streamable-http",
"url": "https://app.pubperf.com/api/mcp",
"headers": {
"Authorization": "Bearer {your-api-key}"
}
}
}
}
Replace {your-api-key} with your API key.
The PubPerf MCP server uses the Streamable HTTP transport. Connect any MCP-compatible client to:
POST https://app.pubperf.com/api/mcp
Authorization: Bearer {your-api-key}
Once connected, the following tools are available to your AI assistant:
| Tool | Description |
|---|---|
list_projects | List all projects (id, name, domain). Use the id to call other project-scoped tools |
get_project | Get project configuration: name, domain, feature flags, GAM prefix, notification rules |
get_project_summary | Get a 24h overview: users, pageviews, sessions, pages per session, performance scores (mobile/desktop), impressions, viewability, monthly pageview totals |
get_project_top_traffic | Get top pages (href), referrers, languages, browsers and countries ranked by unique visitors |
get_project_traffic_by_type | Get a single traffic breakdown by dimension (href, referrer, language, browser, country) |
| Tool | Description |
|---|---|
list_web_vitals | List Web Vitals summaries (fcp_cost, lcp, cls, inp) for all projects |
get_web_vitals | Get FCP, LCP, CLS and INP for a project (last 24h) |
get_web_vitals_charts | Get a Web Vitals time-series with p50/p75/p90 percentiles per interval |
get_web_vitals_distribution | Get value distribution histogram as { value, count } buckets |
get_web_vitals_ratings | Get good / needs-improvement / poor rating breakdown over time |
get_web_vitals_top | Get worst-performing pages as { id (URL), v (value) } for LCP, CLS or INP |
| Tool | Description |
|---|---|
list_rum | List RUM summaries (DNS, connect, TTFB, DOM, FCP, FP, memory, LCP, CLS, INP) for all projects |
get_rum | Get RUM summary for a project: DNS, TCP connect, TTFB, DOM, JS cost, FCP, FP, memory, LCP, CLS, INP |
get_rum_charts | Get RUM time-series: users, pageviews, sessions, pages, FCP, FP, DNS, TTFB, scroll, connect, DOM, memory per interval |
| Tool | Description |
|---|---|
list_ads | List ad performance summaries (last 24h) for all projects |
get_ads | Get ad performance for a project: users, pageviews, sessions, pages per session, impressions, GPT load, auction times, time to render, viewability |
get_ads_charts | Get ad performance time-series: users, pageviews, IVT, sessions, GPT load, auctions, impressions, time to render, active views per interval |
| Tool | Description |
|---|---|
list_prebid | List prebid summaries for all projects, sorted by pageviews |
get_prebid | Get prebid summary: users, pageviews, CPM min/avg/max, revenue, RPM, bidders, timeout, ad units, viewability |
get_prebid_charts | Get prebid time-series by type: revenue (default), content, pageview, win-rate, ecpm, bidders, timeout, rpm, viewability |
get_prebid_top | Get top-N ranking by dimension: bidders, country, brand, size, adunit, domains, viewability, and more |
get_prebid_forecast | Get a prebid forecast time-series for a given metric |
get_prebid_revenue_forecast | Get hourly revenue forecast band with upper/lower bounds |
| Tool | Description |
|---|---|
list_content_summaries | List content summaries (distinct page count) for all projects |
get_content_summary | Get the distinct page count for a project (last 24h) |
get_content_charts | Get content time-series: users, pageviews and distinct pages per interval |
| Tool | Description |
|---|---|
get_content_metrics | Get content revenue analytics (last 24h): users, pageviews, impressions, prebid, CPM, RPM, revenue. Optionally filter by author, category or href |
get_content_analytics_top | Get top-N ranking by dimension: country, browser, referrer, author, category or href |
get_content_analytics_charts | Get content analytics time-series: summary, revenue, scroll depth, intents, impression breakdown, and top-N rankings |
list_content_authors | List top authors for a project as { author, cnt } sorted by pageviews |
list_content_categories | List top categories for a project as { category, cnt } sorted by pageviews |
Many tools accept these optional parameters:
range — Time range: 3h, 24h, 60h, 1w, 1m, 2m, 90d, 1y, or a custom YYYYMMDD-YYYYMMDD windowdevice — Device filter: 0 (all), 1 (mobile), 2 (desktop)projectId — Project ID as returned by list_projectsOnce connected, you can ask your AI assistant questions like: