plausible-mcp
This MCP server lets AI agents query Plausible Analytics data and access analytical playbooks.
Get aggregate visitor, pageview, bounce-rate, and visit-duration totals.
Break down metrics by page, source, country, browser, OS, device, entry/exit page, city, or region.
Retrieve the current count of real-time visitors.
Fetch daily or monthly timeseries trends for charting.
Test Plausible API connectivity and validate API tokens.
List and read built-in analytics skills and methodology playbooks.
Check PyPI for newer versions and upgrade instructions.
Provides tools for interacting with the Plausible Analytics API, enabling retrieval of aggregate stats, segmented breakdowns, realtime visitor counts, and timeseries trend data from Plausible Cloud or self-hosted instances.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@plausible-mcp how many visitors did example.com get in the last 30 days?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
plausible-mcp
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-mcpRun with npx (Node / npm bridge)
export PLAUSIBLE_API_KEY="your_api_key_here"
npx -y plausible-analytics-mcpRelated MCP server: Umami MCP Server
Environment Configuration
Variable | Description | Default |
| Your Plausible Stats/Sites API token | Required (or pass via tool |
| Base URL for self-hosted Plausible |
|
| Set to |
|
Getting an API Key
Log in to Plausible (Cloud or your self-hosted instance).
Go to Settings (user profile menu) -> API Keys.
Click + New Key, name it
mcp-agent, and copy the token.Export as
PLAUSIBLE_API_KEY="your_token".
Available Tools
Tool | Description |
| High-level visitor, pageview, bounce rate, and session duration totals |
| Segment metrics by pages, traffic sources, countries, browsers, OS, devices |
| Current count of active visitors on the site right now |
| Daily or monthly trendline data points for chart generation |
| Test Plausible API connectivity and validate the configured API token |
| List dynamic analytics playbooks and methodology guides |
| Fetch full markdown playbook by name (e.g. |
| 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 toolscheck_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
Scored across 8 tools
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.
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.
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.
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
Related MCP Connectors
Privacy-first product analytics. Your agent sets up tracking and answers questions about traffic.
Query your Betterlytics web analytics from AI agents: traffic, funnels, journeys, errors, uptime.
Privacy-first web analytics. Query pageviews, referrers, trends, and AI insights.
Privacy-first, cookie-free web analytics. Read stats and manage sites from your AI.
Related MCP Servers
- AlicenseBqualityDmaintenanceAllows AI models to query and retrieve analytics data from Plausible Analytics through the Plausible API, enabling natural language interactions with website statistics.18MIT
- AlicenseAqualityDmaintenanceEnables 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.51MIT
- AlicenseAqualityDmaintenanceEnables 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.635 npm1MIT
- AlicenseAqualityCmaintenanceEnables AI assistants to query privacy-first web analytics from Measure.events, including pageviews, top pages, referrers, and custom event tracking, all via natural language.62MIT