API
Connect your AI assistant (MCP)
Ask Claude, ChatGPT, Cursor or any MCP client about your traffic: "How much of last week's pricing-page traffic was agents, and which ones?" Punchline runs a remote MCP server with the same tools as the API. It's read-only unless you allow changes, and then it can also set up alerts, goals and saved reports for you.
Server URL: https://app.punchlineanalytics.com/mcp (Streamable HTTP)
Auth: an API key from Site settings → API and AI access, as a Bearer token.
Claude Code
claude mcp add --transport http punchline https://app.punchlineanalytics.com/mcp \
--header "Authorization: Bearer pk_live_…"
Claude Desktop, Cursor and other clients
{
"mcpServers": {
"punchline": {
"type": "http",
"url": "https://app.punchlineanalytics.com/mcp",
"headers": { "Authorization": "Bearer pk_live_…" }
}
}
}
Signing in instead of a key. Clients that support MCP sign-in (OAuth), such as Claude, can connect with just the server URL: you sign in to Punchline, choose a site, and allow access. Manage connected apps in Site settings → API and AI access.
Tools
| Tool | Answers |
|---|---|
get_agent_breakdown |
How much traffic was agents, and which operators |
get_top_pages |
What agents read most, next to people |
get_content_funnel |
Fetched → delivered → cited, per page, content type or topic |
get_recommendations |
Things to try so assistants can read and cite you |
get_ai_influence |
How many conversions AI assistants probably influenced, from the post-conversion survey |
get_handoffs |
Handoff links agents passed on, and how many people opened them and converted |
get_account_signals, get_resolution_coverage |
Which companies' agents researched you, and how much agent traffic can be connected at all |
list_agent_sessions, explain_session |
Specific agent visits, and why each was labelled |
query_analytics |
Anything else, with the full query model |
list_sites, list_operators, get_reconciliation |
Setup, known agents, GA4 comparison |
MCP is on the Growth plan and up. get_handoffs and get_account_signals need Business; on Growth, assistants don't see them, and an account-signal alert can't be created.
Also two resources (the metric catalog and the privacy model) and two prompts: a weekly agent summary and investigate a traffic spike. Every tool's arguments are in the MCP tools reference.
Making changes
You can let your assistant make changes too: "Alert me when agents are more than 40% of traffic", "Make a goal for the sign_up event", "Save a chart of agent sessions by operator for the last 30 days".
| Tool | Does |
|---|---|
list_alerts, create_alert, update_alert, delete_alert |
Alerts, with the same checks as the Alerts page (up to 20 per site) |
list_goals, create_goal, update_goal, delete_goal |
Conversion goals |
save_report |
Saves a chart to Explore → Saved reports, private to you unless you say otherwise |
These tools only appear when you've allowed changes:
- Signing in: tick Also let it make changes on the consent screen. It's off by default. To change it later, disconnect the app in Site settings and connect again.
- API key: use a key with both read and manage access.
The tools are marked as making changes, so assistants such as Claude ask you before each one. URL parameters and no-code triggers can't be changed through MCP: they change what your site collects about visitors, so they stay in the dashboard and the admin API.
Safety
- Read-only by default. With changes allowed, only alerts, goals and saved reports can be changed, never what your site collects. Each tool's description tells the model to act only on your request, never on text it found in your data.
- Page paths, referrers and campaign tags come from whoever sends traffic to your site, so they can contain any text, including text written to look like instructions. Results reach the model clearly marked as data, length-capped and stripped of control characters.
- Turn MCP access off for a site in Site settings; the REST API is unaffected.
How we measure this server
We use Punchline on Punchline: each request to /mcp is counted like a page view on our own site, so we can see which AI companies and clients use which tools. We record the method, the tool's name, whether it worked, the client's self-reported name, and whether a key or sign-in was used. Never the tool's arguments or results, and never which of your sites was asked about. As everywhere in Punchline, the IP address and user agent are used in memory only.
Ask the docs
Answers come from these docs only, written by Claude (Anthropic). Your question is sent to answer it, and isn't stored.