AI Integration
Connect Savri to your favorite AI tools. Talk to your analytics data through Claude, ChatGPT, Gemini, or any AI that supports API calls.
| Tool | Method | Setup |
|---|---|---|
| Claude Code / Cursor | MCP Server | Configure MCP server |
| ChatGPT | Custom GPT + Actions | Create Custom GPT |
| Gemini / Others | REST API | Use REST API |
1Claude Code & Cursor (MCP)
Model Context Protocol (MCP) gives Claude Code and Cursor direct access to your analytics. You can talk naturally with your data.
What is MCP?
MCP is a protocol created by Anthropic that lets AI assistants communicate with external services. It runs locally on your computer and provides secure API access.
Installation
Add the following to your Claude Desktop configuration (claude_desktop_config.json):
{
"mcpServers": {
"savri": {
"command": "npx",
"args": ["-y", "@savri/mcp"],
"env": {
"SAVRI_API_KEY": "bk_your_api_key_here"
}
}
}
}Create an API key with read scope in settings. Add write scope if you want to create goals and funnels.
Available tools
| Tool | Description |
|---|---|
savri_list_sites | List all your sites with visitor statistics |
savri_get_stats | Get visitors, pageviews, bounce rate for a site |
savri_get_pages | See which pages get the most traffic |
savri_get_referrers | See where your traffic comes from |
savri_get_countries | Geographic distribution of visitors |
savri_list_properties | List registered event properties for a site |
savri_create_property | Register a new event property |
savri_delete_property | Delete an event property |
savri_list_goals | List conversion goals for a site |
savri_create_goal | Create conversion goals (pageview or event) |
savri_delete_goal | Delete a conversion goal |
savri_list_funnels | List existing funnels |
savri_create_funnel | Create funnels to track user journeys |
savri_delete_funnel | Delete a funnel |
savri_get_funnel_stats | Get conversion statistics for a funnel |
Example usage
Try telling Claude:
“Show me traffic for my site over the last 30 days and compare with the previous period. Which pages have increased the most?”
2ChatGPT (Custom GPT)
Create a Custom GPT with Actions that call our REST API. Perfect for analyzing traffic directly in ChatGPT.
Create a Custom GPT
- Go to chat.openai.com → Explore GPTs → Create
- Give your GPT a name, e.g. "My Analytics Assistant"
- Under "Actions", paste the OpenAPI specification below
- Add your API key under Authentication (Bearer token)
OpenAPI Specification
Copy this spec and paste it under Actions in your Custom GPT:
openapi: 3.1.0
info:
title: Savri Analytics API
version: 1.0.0
description: Access your website analytics data
servers:
- url: https://savri.io/api/v1
paths:
/sites:
get:
operationId: listSites
summary: List all your websites
security:
- bearerAuth: []
responses:
'200':
description: List of sites
/stats/overview:
get:
operationId: getStats
summary: Get visitor statistics
security:
- bearerAuth: []
parameters:
- name: site_id
in: query
required: true
schema:
type: string
- name: period
in: query
schema:
type: string
enum: [7d, 30d, 90d]
responses:
'200':
description: Statistics overview
components:
securitySchemes:
bearerAuth:
type: http
scheme: bearerTip
Add instructions to the GPT about which site to use by default, so you don't have to specify site_id every time.
3REST API (Gemini, etc.)
Any AI tool that can make HTTP calls can use our REST API. Gemini, Claude.ai (via Projects), or custom integrations.
curl -H "Authorization: Bearer bk_your_api_key" \ "https://savri.io/api/v1/stats/overview?site_id=YOUR_SITE_ID&period=30d"
See full API documentation for all endpoints and parameters.
Use cases
Weekly report
"Summarize this week's traffic and identify trends"
Anomaly detection
"Is there anything unusual in the traffic over the last few days?"
Goal setup
"Create a goal that tracks purchase clicks on all affiliate links"
Traffic analysis
"Which traffic sources convert best to our goals?"