@kieksme/swetrix-events-mcp
v1.2.0
Published
MCP server for the Swetrix Events API – tracks pageviews, custom events, heartbeats, errors and revenue
Maintainers
Readme
@kieksme/swetrix-events-mcp
MCP server for the Swetrix Events API — 5 tools for tracking pageviews, custom events, heartbeats, errors, and revenue from AI assistants.
Installation
Claude Desktop
Add to ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"swetrix-events": {
"command": "npx",
"args": ["-y", "@kieksme/swetrix-events-mcp"],
"env": {
"SWETRIX_API_BASE_URL": "https://analytics.example.com"
}
}
}
}For revenue tracking, add your API key:
{
"mcpServers": {
"swetrix-events": {
"command": "npx",
"args": ["-y", "@kieksme/swetrix-events-mcp"],
"env": {
"SWETRIX_API_KEY": "your-api-key",
"SWETRIX_API_BASE_URL": "https://analytics.example.com"
}
}
}
}Claude Code
# Without revenue tracking
claude mcp add swetrix-events -e SWETRIX_API_BASE_URL=https://analytics.example.com -- npx -y @kieksme/swetrix-events-mcp
# With revenue tracking
claude mcp add swetrix-events -e SWETRIX_API_KEY=your-key -e SWETRIX_API_BASE_URL=https://analytics.example.com -- npx -y @kieksme/swetrix-events-mcpEnvironment variables
| Variable | Required | Description |
|---|---|---|
| SWETRIX_API_KEY | Only for swetrix_track_revenue | Your Swetrix API key |
| SWETRIX_API_BASE_URL | No | Custom API base URL for self-hosted Swetrix (default: https://api.swetrix.com) |
Most tools only need the project ID (pid), not an API key.
Tools
| Tool | Auth required | Description |
|---|---|---|
| swetrix_track_pageview | No | Record a pageview with URL, referrer, user agent, and geo data |
| swetrix_track_custom_event | No | Track a named custom event with optional metadata properties |
| swetrix_track_heartbeat | No | Send a heartbeat to keep a session alive |
| swetrix_track_error | No | Report a JavaScript or application error with optional stack trace |
| swetrix_track_revenue | Yes (SWETRIX_API_KEY) | Track a revenue event with amount and currency |
Example prompts
- "Track a pageview for project
abc123on the/checkoutpage." - "Send a custom event
signup_completedwith plan=proto projectabc123." - "Log an error:
TypeError: Cannot read property 'id' of undefinedfrom/app/cart.js." - "Record a revenue event of 49.99 USD for project
abc123."
License
GPL-3.0-only — see LICENSE
