Skip to main content
Glama
plausible-mcp

plausible-mcp

by surendranb

plausible-mcp

PyPI version npm version License: MIT

Fast, privacy-first Plausible Analytics Model Context Protocol (MCP) server for AI coding agents and LLM harnesses. Works seamlessly with both Plausible Cloud and self-hosted Plausible installations.

Quick Start

Run with uvx (Python)

export PLAUSIBLE_API_KEY="your_api_key_here"
uvx plausible-mcp

Run with npx (Node / npm bridge)

export PLAUSIBLE_API_KEY="your_api_key_here"
npx -y plausible-analytics-mcp

Related MCP server: Umami MCP Server

Environment Configuration

Variable

Description

Default

PLAUSIBLE_API_KEY

Your Plausible Stats/Sites API token

Required (or pass via tool token arg)

PLAUSIBLE_BASE_URL

Base URL for self-hosted Plausible

https://plausible.io

DO_NOT_TRACK

Set to 1 to disable anonymous telemetry

0

Getting an API Key

  1. Log in to Plausible (Cloud or your self-hosted instance).

  2. Go to Settings (user profile menu) -> API Keys.

  3. Click + New Key, name it mcp-agent, and copy the token.

  4. Export as PLAUSIBLE_API_KEY="your_token".

Available Tools

Tool

Description

get_aggregate_stats(site_id, date_range="30d", metrics=None, token=None)

High-level visitor, pageview, bounce rate, and session duration totals

get_breakdown(site_id, property_name="event:page", date_range="30d", limit=20, token=None)

Segment metrics by pages, traffic sources, countries, browsers, OS, devices

get_realtime_visitors(site_id, token=None)

Current count of active visitors on the site right now

get_timeseries(site_id, date_range="30d", interval="date", token=None)

Daily or monthly trendline data points for chart generation

doctor(token=None)

Test Plausible API connectivity and validate the configured API token

skills_list()

List dynamic analytics playbooks and methodology guides

skill_read(name)

Fetch full markdown playbook by name (e.g. plausible-overview, analytics-recipes)

check_for_updates()

Check PyPI for newer versions and view upgrade commands

Error Absorption Standard

Errors returned to agents are explicitly classified:

  • [INPUT_FIXABLE]: Parameter errors (e.g., misspelled site_id, unknown dimension). Fix arguments and retry.

  • [ENVIRONMENT_FIXABLE: STOP & ASK HUMAN]: Missing, expired, or unauthorized API key. Prompt user with guided setup steps.

  • [TRANSIENT]: Upstream rate limits (HTTP 429) or network hiccups. Wait briefly and retry.

site_id is validated before any request leaves the process: only a bare domain (letters, digits, dots, hyphens) is accepted. Schemes, slashes, colons, whitespace, IP literals, and traversal segments return [INPUT_FIXABLE] Invalid site_id and make no outbound call.

MCP Client Setup

Claude Desktop (claude_desktop_config.json)

{
  "mcpServers": {
    "plausible": {
      "command": "uvx",
      "args": ["plausible-mcp"],
      "env": {
        "PLAUSIBLE_API_KEY": "YOUR_PLAUSIBLE_API_KEY"
      }
    }
  }
}

Or using the npm bridge:

{
  "mcpServers": {
    "plausible": {
      "command": "npx",
      "args": ["-y", "plausible-analytics-mcp"],
      "env": {
        "PLAUSIBLE_API_KEY": "YOUR_PLAUSIBLE_API_KEY"
      }
    }
  }
}

License

MIT License. See LICENSE for details.

Available Tools

8 tools
check_for_updatesA

Check PyPI for newer versions of plausible-mcp and get upgrade instructions.

Inputs: no named parameters. Returns: result

doctorA

Test connectivity to Plausible Cloud or self-hosted instance (PLAUSIBLE_BASE_URL) and validate API token.

Args: token: Optional Plausible API token to test. If omitted, tests PLAUSIBLE_API_KEY from environment.

Inputs: token. Returns: result

get_aggregate_statsB

Get aggregate website performance totals: visitors, pageviews, bounce_rate, and visit_duration.

Args: site_id: Domain name of the site in Plausible (e.g. 'surendranb.com', 'freeinference.dev'). date_range: Time period ('day', 'today', 'yesterday', '7d', '30d', 'month', '6mo', '12mo', or 'YYYY-MM-DD,YYYY-MM-DD'). Default '30d'. metrics: Optional list of metrics (e.g. ['visitors', 'pageviews', 'bounce_rate', 'visit_duration', 'visits']). Defaults to standard 4 metrics. token: Optional Plausible API token. If omitted, uses PLAUSIBLE_API_KEY environment variable.

Inputs: site_id (required), token, metrics, date_range. Returns: result

get_breakdownA

Get metrics breakdown by dimension: pages, sources, countries, browsers, operating systems, or devices.

Args: site_id: Domain name of the site in Plausible (e.g. 'surendranb.com'). property_name: Dimension to segment by. Accepts aliases: 'page', 'source', 'country', 'browser', 'os', 'device', 'entry_page', 'exit_page', 'city', 'region', or full Plausible names like 'event:page', 'visit:source'. date_range: Time period ('day', '7d', '30d', 'month', '6mo', '12mo', or 'YYYY-MM-DD,YYYY-MM-DD'). Default '30d'. limit: Maximum number of rows to return (default 20, max 100). token: Optional Plausible API token. If omitted, uses PLAUSIBLE_API_KEY environment variable.

Inputs: site_id (required), limit, token, date_range, +1 more. Returns: result

get_realtime_visitorsA

Get the current count of active real-time visitors on the website right now.

Args: site_id: Domain name of the site in Plausible (e.g. 'surendranb.com'). token: Optional Plausible API token. If omitted, uses PLAUSIBLE_API_KEY environment variable.

Inputs: site_id (required), token. Returns: result

get_timeseriesA

Get historical timeseries trendlines (visitors, pageviews) over time for plotting charts.

Args: site_id: Domain name of the site in Plausible (e.g. 'surendranb.com'). date_range: Time period ('day', '7d', '30d', 'month', '6mo', '12mo', or 'YYYY-MM-DD,YYYY-MM-DD'). Default '30d'. interval: Aggregation bucket: 'date' (daily) or 'month' (monthly). Default 'date'. token: Optional Plausible API token. If omitted, uses PLAUSIBLE_API_KEY environment variable.

Inputs: site_id (required), token, interval, date_range. Returns: result

skill_readA

Fetch guidance and analytical playbooks for Plausible Analytics by name.

Args: name: Name of skill to read (e.g. 'plausible-overview', 'analytics-recipes'). Call skills_list() to view all.

Inputs: name (required). Returns: result

skills_listA

List available Plausible Analytics operational skills and playbooks.

Inputs: no named parameters. Returns: result

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A3.8/5.0

    Scored across 8 tools

    Disambiguation5/5

    Each analytics tool targets a clearly different output shape: totals (get_aggregate_stats), segmented rows (get_breakdown), trendlines (get_timeseries), and a live counter (get_realtime_visitors). The meta-tools are equally separable: skills_list vs skill_read differ by enumeration vs fetch, check_for_updates covers package versioning while doctor covers connectivity/auth. No two tools could plausibly be confused for the same task.

    Naming Consistency4/5

    The dominant pattern is verb_noun (get_aggregate_stats, get_breakdown, get_timeseries, get_realtime_visitors, check_for_updates). The two skill tools invert to noun_verb (skills_list, skill_read) and 'doctor' is a bare noun, so there are minor deviations but everything remains readable and predictable.

    Tool Count4/5

    Eight tools is a well-scoped set for an analytics server, and each one earns its place. However, three of the eight (skills_list, skill_read, check_for_updates, doctor) are operational/meta overhead, leaving only four actual analytics queries, which is a bit thin on the core surface.

    Completeness3/5

    The core read path (totals, breakdowns, timeseries, realtime) is covered, but the Plausible API surface is notably partial: no site/property listing, no goal or custom-event conversion metrics, no funnel or comparison queries, and no filter/segment parameters on breakdowns beyond a single dimension. Agents can work around some of this via date_range aliases but will hit dead ends on conversions and multi-dimensional filtering.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      D
      maintenance
      Allows AI models to query and retrieve analytics data from Plausible Analytics through the Plausible API, enabling natural language interactions with website statistics.
      1
      8
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      Enables AI assistants to interact with Umami Analytics for both Cloud and self-hosted instances. It provides tools to retrieve website statistics, visitor metrics, pageview trends, and real-time active user counts.
      5
      1
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      Enables AI assistants to query website statistics from Plausible Analytics, providing access to metrics like real-time visitors, traffic trends, and page performance. It supports both Plausible Cloud and self-hosted instances through the Stats API v2.
      6
      35 npm
      1
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      Enables AI assistants to query privacy-first web analytics from Measure.events, including pageviews, top pages, referrers, and custom event tracking, all via natural language.
      6
      2
      MIT