Skip to main content
Glama
Pirsch Analytics MCP Server

Pirsch Analytics MCP Server

Pirsch MCP Server

npm

A focused, read-only Model Context Protocol server for Pirsch Analytics API v1. It uses MCP SDK v2 and returns both structured results and JSON text for every successful tool call.

Requirements

  • Node.js 22.19.0 or later

  • A Pirsch OAuth API client with read access. Do not use a write-only access key.

Related MCP server: plausible-whenever-mcp

Configure

{
  "mcpServers": {
    "pirsch": {
      "command": "npx",
      "args": ["-y", "@verygoodplugins/mcp-pirsch@latest"],
      "env": {
        "PIRSCH_CLIENT_ID": "your-read-only-oauth-client-id",
        "PIRSCH_CLIENT_SECRET": "your-oauth-client-secret",
        "PIRSCH_DEFAULT_DOMAIN_ID": "optional-default-domain-id"
      }
    }
  }
}

PIRSCH_DEFAULT_DOMAIN_ID is optional. When it is unset, every query tool requires domainId; the server never picks the first accessible domain. Use pirsch_list_domains to discover IDs safely.

Optional PIRSCH_TIMEZONE supplies the default timezone for requests that do not explicitly include timezone.

Tools

Tool

Purpose

pirsch_list_domains

Lists only id, hostname, display name, and timezone.

pirsch_query_statistics

Reads one documented v1 metric, with dates and filters.

pirsch_list_filter_options

Lists allowed values for a documented filter dimension.

pirsch_compare_periods

Compares actual totals and visitor series for two periods.

All tools are read-only. They return structuredContent matching their output schema as well as an equivalent JSON text block. Input or API failures use MCP isError: true and do not expose credentials or raw upstream bodies.

Querying statistics

pirsch_query_statistics accepts a metric, optional domainId, and flat camel-case filters. Most metrics require ISO dates:

{
  "metric": "pages",
  "domainId": "your-domain-id",
  "from": "2026-08-01",
  "to": "2026-08-23",
  "limit": 20,
  "sort": "visitors",
  "direction": "desc"
}

The server maps public camel-case fields such as eventMetaKey, entryPath, operatingSystem, and utmCampaign to Pirsch's documented API-v1 parameter names. limit is constrained to 1–100 and active visitor start to 0–3600 seconds.

Metrics include totals, visitors, pages and entry/exit pages, session and page duration, goals, events and event metadata, growth, active visitors, time breakdowns, acquisition, browser/device, geographic, UTM, tags, keywords, funnels, sessions, and session details. session_details requires both visitorId and sessionId; event-specific metrics require event.

Comparing periods

Provide a named period (today, yesterday, week, lastWeek, month, or lastMonth) or both explicit date pairs:

{
  "domainId": "your-domain-id",
  "from": "2026-08-01",
  "to": "2026-08-07",
  "compareFrom": "2026-07-25",
  "compareTo": "2026-07-31",
  "scale": "day"
}

The response compares /statistics/total and retains the two /statistics/visitor series; it does not estimate totals by summing charts.

1.0 migration

Version 1.0 intentionally replaces the former 17-tool interface. There are no default aliases because aliases would keep unsafe domain-selection and ambiguous input behavior alive.

Previous tools

Replacement

pirsch_overview, pirsch_total, pirsch_pages, pirsch_events, and other statistic tools

pirsch_query_statistics with metric

pirsch_utm

pirsch_query_statistics with one of the utm_* metrics

pirsch_compare

pirsch_compare_periods

Domain discovery

pirsch_list_domains

Input names are now camel-case and flat (domainId, compareFrom, eventMetaKey), not domain_id, nested filter, or compatibility aliases.

Development

npm install
npm run typecheck
npm run lint
npm test
npm run build
npx -y @modelcontextprotocol/inspector@latest --cli node dist/index.js --method tools/list --format json

The release workflow publishes to npm with trusted publishing and then publishes the same tagged manifest to the MCP Registry through GitHub OIDC. Local development and CI never publish anything.

Support

For bugs and feature requests, open an issue in this repository. Pirsch questions are best answered through the Pirsch documentation; package support is maintained by Very Good Plugins.

Built with 🧡 by Very Good Plugins.

Available Tools

4 tools
pirsch_compare_periodsCompare Pirsch periodsA
Read-only

Compare Pirsch totals and visitor series for a named or explicitly supplied pair of periods.

Inputs: to, city, from, path, +43 more. Returns: series, totals, current, domainId, +1 more

pirsch_list_domainsList Pirsch domainsA
Read-only

List safe summaries of domains available to the configured read-only Pirsch OAuth client.

Inputs: no named parameters. Returns: domains

pirsch_list_filter_optionsList Pirsch filter optionsC
Read-only

List supported values for one documented Pirsch Analytics API v1 filter dimension.

Inputs: option (required), to, city, from, +41 more. Returns: data, option, domainId

pirsch_query_statisticsQuery Pirsch analyticsB
Read-only

Read one documented Pirsch Analytics API v1 metric for an explicitly selected domain and filter.

Inputs: metric (required), to, city, from, +41 more. Returns: data, metric, domainId

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.7/5.0

    Scored across 4 tools

    Disambiguation5/5

    Each tool targets a distinct concern: listing domains, querying a metric, enumerating filter options, and comparing periods. There is no overlap or ambiguity between them.

    Naming Consistency5/5

    All tools follow a consistent 'pirsch_verb_noun' pattern (list_domains, query_statistics, list_filter_options, compare_periods). The naming style is uniform and predictable.

    Tool Count5/5

    Four tools is well-scoped for a read-only analytics server. Each tool covers a necessary high-level operation without unnecessary bloat or redundancy.

    Completeness4/5

    The set covers the core read-only needs: domain discovery, metric querying, filter exploration, and period comparison. A minor gap is the lack of a more comprehensive report endpoint, but the available tools can be combined to cover most scenarios.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      D
      maintenance
      Enables natural language interaction with Plausible Analytics data to query traffic, visitors, engagement, and more using conversational questions.
      4
      1
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      MCP server that provides read access to Plausible Analytics data with natural-language date resolution, enabling users to query analytics like 'yesterday' or 'last week' without needing to know exact date formats.
      8
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      Exposes Rybbit Analytics as MCP tools for querying site traffic, page views, visitor sessions, and live visitor counts through natural language.
      9
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables querying Google Analytics 4 data using natural language through MCP clients like Claude and Cursor, supporting 200+ dimensions and metrics for traffic, user behavior, and e-commerce analysis.
      MIT