Back to Browse

Swetrix Admin MCP MCP Server

by vergissberlin
Data & AnalyticsUse Caution4.8LocalNew
Free

Manage Swetrix projects and organisations with MCP

About

MCP server for the Swetrix Admin API with 34 tools for managing projects, funnels, annotations, views, and organisations. It supports administrative read and write operations through the Swetrix API.

Security Report

4.8
Use Caution4.8High Risk

This is a well-structured MCP server suite for the Swetrix analytics platform with proper authentication, input validation, and appropriate permissions. Authentication via API keys and bearer tokens is correctly implemented and stored in environment variables. The codebase demonstrates good security practices with Zod schema validation, proper error handling, and clear separation of read-only vs. write operations. No critical vulnerabilities or malicious patterns detected. Supply chain analysis found 1 known vulnerability in dependencies (1 critical, 0 high severity). Package verification found 1 issue (1 critical, 0 high severity).

8 files analyzed · 6 issues found

Security scores are indicators to help you make informed decisions, not guarantees. Always review permissions before connecting any MCP server.

Permissions Required

This plugin requests these system permissions. Most are normal for its category.

HTTP Network Access

Connects to external APIs or services over the internet.

env_vars

Check that this permission is expected for this type of plugin.

Unverified package source

We couldn't verify that the installable package matches the reviewed source code. Proceed with caution.

What You'll Need

Set these up before or after installing:

Swetrix API key from Account Settings → API keysRequired

Environment variable: SWETRIX_API_KEY

Sign up free

How to Install

Add this to your MCP configuration file:

{
  "mcpServers": {
    "swetrix-admin-mcp": {
      "env": {
        "SWETRIX_API_KEY": "your-swetrix-api-key-here"
      },
      "args": [
        "-y",
        "mcp-swetrix"
      ],
      "command": "npx"
    }
  }
}

Getting Started

Once installed, try these example prompts and explore these capabilities:

  • 1Run npx -y @kieksme/swetrix-admin-mcp; set SWETRIX_API_KEY in your MCP client environment

Documentation

View on GitHub

From the project's GitHub README.

mcp-swetrix

Swetrix MCP

MCP (Model Context Protocol) servers for the Swetrix analytics platform. Lets AI assistants like Claude query analytics data, track events, and manage projects directly via the Swetrix API.

CI SkillAudit

One-click install

Each server can be installed directly into Cursor or VS Code. These buttons prefill the server's command/args/env — you'll still need to fill in your own SWETRIX_API_KEY and, if self-hosting, SWETRIX_API_BASE_URL.

PackageCursorVS Code
@kieksme/swetrix-statistics-mcpInstall in CursorInstall in VS Code
@kieksme/swetrix-events-mcpInstall in CursorInstall in VS Code
@kieksme/swetrix-admin-mcpInstall in CursorInstall in VS Code

Packages

PackageVersionSecurityDescription
@kieksme/swetrix-statistics-mcpnpmSocket34 read-only tools for traffic, performance, errors, funnels, goals and more
@kieksme/swetrix-events-mcpnpmSocket5 tools for tracking pageviews, custom events, heartbeats, errors and revenue
@kieksme/swetrix-admin-mcpnpmSocket34 tools for managing projects, funnels, annotations, views and organisations

Quick start

Each package can be used standalone. Pick the one(s) you need.

Claude Desktop

Add to ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "swetrix-statistics": {
      "command": "npx",
      "args": ["-y", "@kieksme/swetrix-statistics-mcp"],
      "env": {
        "SWETRIX_API_KEY": "your-api-key",
        "SWETRIX_API_BASE_URL": "https://analytics.example.com"
      }
    },
    "swetrix-events": {
      "command": "npx",
      "args": ["-y", "@kieksme/swetrix-events-mcp"]
    },
    "swetrix-admin": {
      "command": "npx",
      "args": ["-y", "@kieksme/swetrix-admin-mcp"],
      "env": {
        "SWETRIX_API_KEY": "your-api-key",
        "SWETRIX_API_BASE_URL": "https://analytics.example.com"
      }
    }
  }
}

Get your API key at swetrix.com → Account Settings → API keys.

Claude Code

claude mcp add swetrix-statistics -e SWETRIX_API_KEY=your-key -e SWETRIX_API_BASE_URL=https://analytics.example.com -- npx -y @kieksme/swetrix-statistics-mcp
claude mcp add swetrix-events -e SWETRIX_API_BASE_URL=https://analytics.example.com -- npx -y @kieksme/swetrix-events-mcp
claude mcp add swetrix-admin -e SWETRIX_API_KEY=your-key -e SWETRIX_API_BASE_URL=https://analytics.example.com -- npx -y @kieksme/swetrix-admin-mcp

Self-hosted Swetrix / custom API URL

All packages support an optional SWETRIX_API_BASE_URL environment variable.

  • Default: https://api.swetrix.com
  • Self-hosted: set it to your Swetrix API origin, for example https://analytics.example.com

When omitted, the servers continue using the public Swetrix Cloud API.

Remote MCP via Docker

Each package can also run as a standalone remote MCP server instead of a local stdio process spawned by npx. In this mode the server speaks the MCP Streamable HTTP transport over a plain HTTP endpoint (/mcp by default) — this is exactly what the Dockerfile shipped with each package builds and runs. Use it when you want to:

  • host one server centrally so multiple clients/teammates can connect to it,
  • run the MCP server in your own infrastructure (Kubernetes, ECS, Cloud Run, a VM, …) instead of on every developer machine,
  • keep SWETRIX_API_KEY on the server side instead of distributing it to every client.

Build and run a single package

# Build context is the repository root (this is a pnpm workspace)
docker build -f packages/swetrix-statistics-mcp-server/Dockerfile -t swetrix-statistics-mcp:http .

docker run -d --name swetrix-statistics-mcp \
  -p 3000:3000 \
  -e SWETRIX_API_KEY=your-key \
  -e SWETRIX_API_BASE_URL=https://analytics.example.com \
  -e MCP_HTTP_AUTH_TOKEN="$(openssl rand -hex 32)" \
  swetrix-statistics-mcp:http

The same pattern applies to swetrix-events-mcp-server and swetrix-admin-mcp-server — swap the -f/-t paths. See each package's README for package-specific env vars: statistics, events, admin.

One-click deploy (Railway)

PackageDeploy
StatisticsDeploy on Railway
EventsDeploy on Railway
AdminDeploy on Railway

Each button provisions a Railway service from this repo's Dockerfile in HTTP mode. You'll be prompted for SWETRIX_API_KEY where required; MCP_HTTP_AUTH_TOKEN is generated automatically. Set SWETRIX_API_BASE_URL on the service afterwards if you're using a self-hosted Swetrix instance.

Pre-built images

Images are published to the GitHub Container Registry on every release, tagged with the released package version and latest:

docker pull ghcr.io/kieksme/swetrix-statistics-mcp:latest
docker pull ghcr.io/kieksme/swetrix-events-mcp:latest
docker pull ghcr.io/kieksme/swetrix-admin-mcp:latest

Running all three together with Docker Compose

services:
  swetrix-statistics:
    image: ghcr.io/kieksme/swetrix-statistics-mcp:latest
    ports: ["3001:3000"]
    environment:
      SWETRIX_API_KEY: ${SWETRIX_API_KEY}
      SWETRIX_API_BASE_URL: ${SWETRIX_API_BASE_URL}
      MCP_HTTP_AUTH_TOKEN: ${MCP_HTTP_AUTH_TOKEN}
    restart: unless-stopped

  swetrix-events:
    image: ghcr.io/kieksme/swetrix-events-mcp:latest
    ports: ["3002:3000"]
    environment:
      MCP_HTTP_AUTH_TOKEN: ${MCP_HTTP_AUTH_TOKEN}
    restart: unless-stopped

  swetrix-admin:
    image: ghcr.io/kieksme/swetrix-admin-mcp:latest
    ports: ["3003:3000"]
    environment:
      SWETRIX_API_KEY: ${SWETRIX_API_KEY}
      SWETRIX_API_BASE_URL: ${SWETRIX_API_BASE_URL}
      MCP_HTTP_AUTH_TOKEN: ${MCP_HTTP_AUTH_TOKEN}
    restart: unless-stopped

Provide SWETRIX_API_KEY, SWETRIX_API_BASE_URL and MCP_HTTP_AUTH_TOKEN via a local, git-ignored .env file or your secrets manager — never commit real values.

Connecting a client to the remote server

Once the container is reachable at a URL (behind your own TLS-terminating reverse proxy — see security notes below), point a client at it instead of using command/args:

Claude Code CLI:

claude mcp add --transport http swetrix-statistics https://mcp.example.com/mcp \
  --header "Authorization: Bearer <MCP_HTTP_AUTH_TOKEN>"

Claude Desktop / .mcp.json:

{
  "mcpServers": {
    "swetrix-statistics": {
      "type": "http",
      "url": "https://mcp.example.com/mcp",
      "headers": {
        "Authorization": "Bearer <MCP_HTTP_AUTH_TOKEN>"
      }
    }
  }
}

Security notes

  • The container listens on plain HTTP — always terminate TLS in front of it (reverse proxy, load balancer, or ingress) before exposing it beyond localhost.
  • MCP_HTTP_AUTH_TOKEN is the only thing standing between the internet and your Swetrix data/API key. Generate it with openssl rand -hex 32 (or your secrets manager's generator), and rotate it if it is ever leaked.
  • Keep SWETRIX_API_KEY and MCP_HTTP_AUTH_TOKEN out of image layers and shell history — inject them at runtime via --env-file, orchestrator secrets, or a secrets manager (e.g. AWS Secrets Manager, GCP Secret Manager, Kubernetes Secret).
  • Apply least privilege: scope the Swetrix API key to only what each server needs, especially for swetrix-admin-mcp, which performs write operations.

Contributing

For development setup and contribution workflow, see CONTRIBUTING.md.

License

GPL-3.0-only — see LICENSE

Reviews

No reviews yet

Be the first to review this server!