What it does
Register a new site. privacy_mode is chosen at creation and cannot be changed later; it defaults to 'balanced' when omitted. The modes trade visitor metrics against privacy posture (see the privacy_mode parameter for specifics) — surface that trade-off to the user before creating the site rather than silently accepting the default.
Example prompts
Ask:
"Add example.com to my mcp-analytics account in strict privacy mode."
"Set up tracking for newsite.com in balanced mode."
"Add mysecondsite.com."
A typical response (after Claude requests your approval to call this write tool):
Added example.com to your account.
site_id: abc12345
privacy_mode: strict (no cookies, daily-rotating salt)
created_at: 2026-05-19T14:33:21Z
Paste this snippet into the <head> of every page you want
tracked:
<script defer
data-site="abc12345"
src="https://t.mcp-analytics.com/script.js"></script>
That's it. No further configuration needed.
Returns the new site object plus the tracking snippet. The
site_id is permanent and public. The
privacy_mode is set once at creation and cannot be changed
later. Choose carefully:
balanced(default): no cookies, same-day visitor dedup via a daily-rotating salted hash. Daily uniques are exact, multi-day uniques overcount. The industry-standard cookieless model (Plausible and Fathom work the same way); no banner needed.strict: no cookies and no visitor IDs at all,unique_visitorsstays 0. The most conservative option; no banner needed.all: persistent cookie, exact cross-session tracking. You handle the consent banner.
This is the write tool you'll call during onboarding, so Claude will
prompt for your approval before invoking it on the first call. If you
lose the snippet later,
get_tracking_snippet
returns it again; that one is read-only and changes nothing.
Free tier allows unlimited sites. The 100k hits/month cap is account-wide across all sites combined.
Arguments
| Name | Type | Required | Description / Default |
|---|---|---|---|
domain |
string | required | Site hostname without scheme. Examples: 'mysite.com', 'blog.example.org'. |
privacy_mode |
string enum: strict, balanced, all |
optional |
strict: no cookies, no visitor IDs ever computed — unique_visitors is permanently 0, sessions still work (daily-rotating server-side salt); the most conservative option. balanced (default): no cookies or client-side storage; visitors counted via a server-side hash of IP + user agent + a salt that is forgotten every UTC day — daily unique visitors are exact, multi-day uniques overcount (the industry-standard cookieless model, as used by Plausible/Fathom); respects Do-Not-Track, no consent banner needed. all: persistent cookie + localStorage visitor ID, exact cross-session visitor counts, ignores Do-Not-Track — fullest data, and the site owner is responsible for consent/GDPR.
default: balanced
|
How to call it directly
If you're integrating from your own code rather than a chat client, this is the JSON-RPC payload:
curl -X POST https://mcp-analytics.com/mcp \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "add_site",
"arguments": {
"domain": "example.com"
}
}
}'
Token comes from /settings after you sign up. Replace any required arguments above.
Related tools
regenerate_api_token: Invalidate the current API token and issue a new one.traffic_class_breakdown: Hit counts and percentages by traffic_class for the period.viewport_breakdown: Pageviews bucketed by viewport width: mobile_xs (<480), mobile (<768), tablet (<1024), desktop (<1440), desktop_xl (≥1440).list_events: All event names with counts (includes 'pageview' and custom events).get_overview: TL;DR for the period: headline metrics (pageviews, visitors, sessions, bounce rate, avg session duration) plus pageviews_change_pct vs the previous equivalent window, top page, top traffic source, bot share, and top 3 custom events.