What it does

Register a new site. privacy_mode cannot be changed later.

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:

  • strict (recommended for EU sites): no cookies, no persistent visitor ID, daily-rotating salt. No cookie banner required under typical EU interpretation.
  • balanced: no cookies, same-day session/visitor dedup via salted hash. Most common middle ground.
  • all: persistent cookie, cross-session tracking. You handle the consent banner.

This is one of two write tools you'll call regularly during onboarding (the other being get_tracking_snippet when you lose the snippet and need it again). Claude will prompt for your approval before invoking it on the first call.

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 (recommended): no cookies, visitor_id always 0, salt rotates daily. balanced: no cookies, daily-rotating hash, same-day visitor dedup. all: persistent cookie, cross-session tracking, you handle the consent banner.
default: strict

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.
  • remove_site: Soft-delete a site.
  • list_sites: List all sites on the authenticated account.
  • top_user_agents: Top User-Agent strings with their traffic_class.
  • breakdown: Breakdown of visits by browser, os, device_type, or country (country empty in MVP).