# Simple Analytics — how to use (mcp.ai)

Connect your Simple Analytics account and use 4 tools for analytics straight from your AI agent. Connect with your own API key. Simple Analytics is a privacy-friendly and simple alternative to Google Analytics, offering straightforward analytics without cookies or trackers.

## Option A — via MCP (recommended)
Remote MCP endpoint (HTTP, streamable): `https://api.mcp.ai/p_simple_analytics?ms=1787295720000`
Add it as a custom/remote MCP connector in your client (Claude, Cursor, VS Code…), then authenticate when prompted. Once connected, ask the agent to use the server's tools (e.g. `simple_analytics_admin_api_list_websites`).

## Option B — via direct REST API
Base URL: `https://api.mcp.ai/api/simple_analytics`
Auth: `Authorization: Bearer sk_live_…` — create a workspace API key at https://mcp.ai/settings/api-keys
Discover endpoints: `GET https://api.mcp.ai/api/simple_analytics/_endpoints`

### Endpoints
- `POST https://api.mcp.ai/api/simple_analytics/admin/api/list/websites` — Tool to list all websites associated with the authenticated user. Use after authenticating an admin account to retrieve website list.
- `POST https://api.mcp.ai/api/simple_analytics/export/api/get/raw/data` — Tool to export raw data points (page views and events) for a specific website. Use when you need to download CSV or JSON exports of site traffic.
  - body: { fields?: string[], format?: string, to_date?: string, website: string, from_date?: string }
- `POST https://api.mcp.ai/api/simple_analytics/get/aggregated/stats` — Tool to retrieve aggregated statistics for a specified website. Use when you need an overview of key metrics like visitors, pageviews, bounce rate, and more.
  - body: { end?: string, page?: string, start?: string, source?: string, compare?: string, website: string, referrer?: string }
- `POST https://api.mcp.ai/api/simple_analytics/send/event` — Tool to submit server-side events or pageviews to Simple Analytics. Use for mobile apps, backend tracking, or scenarios where JavaScript is not available. Supports custom metadata for enriched event d
  - body: { ua: string, path?: string, type: string, event: string, https?: boolean, medium?: string, source?: string, unique?: boolean, content?: string, campaign?: string, hostname: string, language?: string, metadata?: object, referrer?: string, timezone?: string, screen_width?: integer, screen_height?: integer, viewport_width?: integer, viewport_height?: integer }

## Example prompts
- "What can I do in Simple Analytics?"
- "Show me a summary of my Simple Analytics account"

## More
- Page: https://mcp.ai/simple_analytics
- Agent spec (llms.txt): https://mcp.ai/simple_analytics/llms.txt
- Postman collection: https://mcp.ai/simple_analytics/postman.json
