Skip to main content

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

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.

Metadata

Release files for plausible-mcp 0.1.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for plausible-mcp 0.1.6
File Size Uploaded Provenance Actions
plausible_mcp-0.1.6.tar.gz 20.4 kB Without provenance Details for plausible_mcp-0.1.6.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for plausible-mcp 0.1.6
File Interpreter ABI Platform Actions
plausible_mcp-0.1.6-py3-none-any.whl Python 3 none any Details for plausible_mcp-0.1.6-py3-none-any.whl

Total release size: 36.1 kB

Release files / plausible_mcp-0.1.6.tar.gz

Download URL plausible_mcp-0.1.6.tar.gz
Size 20.4 kB
Tags Source
SHA-256 checksum
How to use checksums
ecf9ab7331a47051176edfc4218f97ca4a1ddf4cbe74e2347f0af3312f054af4
BLAKE2b-256 checksum
How to use checksums
30f4c5e25c81f571e24032bcff8de60e9c2159cb4604c404cd677b9404f07beb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / plausible_mcp-0.1.6-py3-none-any.whl

Download URL plausible_mcp-0.1.6-py3-none-any.whl
Size 15.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fea558c23b0619cec57fb04539fe48e71b1d4d24f873763d1469c8d19faf006f
BLAKE2b-256 checksum
How to use checksums
6674a9ebd456c33ab84fe0a9d2d9b81b2878151e05579baab1813fe9bd32fc65
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for plausible-mcp 0.1.6

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page