plausible-whenever-mcp
Provides tools for reading Plausible Analytics data, including sites, realtime visitors, aggregates, time series, breakdowns, and period comparisons, with natural-language date resolution in the site's timezone.
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-whenever-mcp what were my top pages yesterday?"
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-whenever-mcp
The Plausible Analytics MCP server that finally understands "yesterday".
A local Model Context Protocol server that gives an AI assistant full read access to your Plausible data — and, crucially, resolves natural-language dates (yesterday, last week, last 30 days, 3 days ago…) in your site's own timezone. So prompts like "analyze yesterday's traffic" just work, even with small local LLMs.
Why this exists
The Plausible Stats API has presets like day, 7d and month, but no "yesterday" — and to query a specific past day you must send explicit YYYY-MM-DD dates. LLMs (especially smaller local models) routinely get this wrong because they don't reliably know today's date or your site's timezone. The result: "yesterday" silently returns the wrong range, or the model burns turns guessing date formats (/, .., YYYYMMDD, date vs date_range…) and gives up.
This server moves all of that to the server side. The model says date_range: "yesterday"; the server computes the exact dates in your site's timezone before calling Plausible. There is no tool where the model must know Plausible's native date format — and if it ever passes something unrecognizable, the error message lists exactly what's accepted.
Related MCP server: plausible-mcp
Features
🗓️ Natural-language dates resolved in the site timezone — keywords, synonyms,
N days ago,last N days/weeks/months, single dates, and ranges with,../ortoseparators.🧰 8 tools covering the full read API: sites, realtime, aggregates, time series, breakdowns, period comparison, plus a raw query escape hatch — and all of them resolve friendly dates.
🏠 Self-hosted friendly — works against any Plausible instance via
PLAUSIBLE_BASE_URL, with aPLAUSIBLE_TIMEZONEoverride for instances where the Sites API (timezone auto-detect) is disabled.🤖 Tuned for local LLMs — forgiving inputs, self-explaining errors, and clean tool output (no HTML dumps).
🔒 Read-only — every tool only ever reads your analytics.
Tools
Tool | What it does |
| List sites your API key can access (with timezones). |
| Today + yesterday as concrete dates in a site's timezone. |
| People on the site right now. |
| Aggregate totals for a period (visitors, pageviews, bounce rate…). |
| Traffic over time (hour/day/week/month) for trends and charts. |
| Top pages, sources, countries, devices, browsers, UTM tags… |
| Two periods side by side with absolute + % deltas. |
| Raw Stats API v2 escape hatch for anything else. |
Date expressions accepted everywhere
Keywords (resolved in the site timezone):
today,yesterday,this_week,last_week,this_month,last_month,this_year,last_year,last_7_days,last_30_days,last_90_days,last_12_monthsNatural phrasing & synonyms:
3 days ago,day before yesterday,last 14 days,last 6 months,previous month,the last week,ytd,mtd,all time, …Plausible presets:
day,7d,30d,month,6mo,12mo,year,allA single date:
2024-03-15→ that one dayAn explicit range (any separator):
2024-01-01,2024-01-31,2024-01-01..2024-01-31,2024-01-01/2024-01-31,2024-01-01 to 2024-01-31
Install
Requires Node.js ≥ 18 and a Plausible Stats API key (Plausible dashboard → Settings → API Keys; on self-hosted: <your-instance>/settings/api-keys).
git clone https://github.com/Schneckenhausmann/plausible-whenever-mcp.git
cd plausible-whenever-mcp
npm install
npm run buildConfigure
Set environment variables (see .env.example):
Variable | Required | Description |
| Yes | Your Plausible Stats API key. |
| No | Self-hosted instance URL (default |
| No | Default site domain so you can omit |
| No | IANA timezone (e.g. |
Connect to Claude Desktop
~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"plausible": {
"command": "node",
"args": ["/absolute/path/to/plausible-whenever-mcp/dist/index.js"],
"env": {
"PLAUSIBLE_API_KEY": "your-key",
"PLAUSIBLE_DEFAULT_SITE_ID": "example.com"
}
}
}
}For a self-hosted instance, add PLAUSIBLE_BASE_URL and PLAUSIBLE_TIMEZONE:
{
"mcpServers": {
"plausible": {
"command": "node",
"args": ["/absolute/path/to/plausible-whenever-mcp/dist/index.js"],
"env": {
"PLAUSIBLE_API_KEY": "your-key",
"PLAUSIBLE_BASE_URL": "https://analytics.example.com",
"PLAUSIBLE_DEFAULT_SITE_ID": "example.com",
"PLAUSIBLE_TIMEZONE": "Europe/Berlin"
}
}
}
}Connect to Claude Code
claude mcp add plausible \
--env PLAUSIBLE_API_KEY=your-key \
--env PLAUSIBLE_DEFAULT_SITE_ID=example.com \
-- node /absolute/path/to/plausible-whenever-mcp/dist/index.jsExample prompts that just work
"Look at yesterday's data for example.com and analyze it."
"Top 10 pages last week vs the week before."
"Show the hourly visitor trend for yesterday — we had a spike in the morning."
"Which countries drove the most traffic last month?"
Self-hosted note
On Plausible Community Edition the Sites API (/api/v1/sites) is often disabled, so:
list_siteswill reportsites_api_available: falseand point at your configured default — this is expected and does not affect any stats queries.Timezones can't be auto-detected, so set
PLAUSIBLE_TIMEZONEto keep relative dates correct.
Develop
npm run build # compile TypeScript -> dist/
npm run dev # tsc --watch
npm test # build + run the date-resolver test suite
npm run inspector # open the MCP Inspector against the serverAcknowledgments
Built fresh, but inspired by two excellent MIT-licensed projects — thank you to their authors:
Defilan/plausible-mcp by Defilan — clean stdio tool surface.
getsentry/plausible-mcp by Sergiy Dybskiy — per-tool architecture and the period-comparison idea.
Full third-party license notices are in CREDITS.md.
License
MIT © 2026 Nikias Herzhauser
Available Tools
8 toolscompare_periodsA
Compare aggregate metrics between two periods side by side, with absolute and % deltas. Great for 'yesterday vs the day before', 'this week vs last week', or before/after a deploy. Both periods accept the same friendly keywords as date_range.
Inputs: period_a (required), period_b (required), site_id, metrics, +1 more.
get_breakdownA
Break stats down by one or more dimensions — top pages, traffic sources, countries, devices, browsers, UTM tags, etc. Returns ranked rows. Use for 'top pages yesterday', 'where did traffic come from last week', and similar.
Inputs: dimensions (required), site_id, date_range, metrics, +3 more.
get_current_timeA
Get the current date in a site's timezone (today + yesterday as concrete dates). Useful for grounding before analyzing recent data, or to double-check what 'yesterday' resolves to.
Inputs: site_id.
get_realtime_visitorsA
Get the number of people currently on the site (last 5 minutes, real-time).
Inputs: site_id.
get_statsA
Get aggregate stats (single totals) for a site over a period — visitors, pageviews, bounce rate, visit duration, etc. Use for overview/summary questions like 'how did we do yesterday?'.
Inputs: site_id, date_range, metrics, filters.
get_timeseriesA
Get traffic over time as a series of points (per hour, day, week or month). Use for trends, charts, and 'how did traffic change over the last N days'.
Inputs: site_id, date_range, interval, metrics, +1 more.
list_sitesA
List all Plausible sites your API key can access, with their timezones. Note: the Sites API is often disabled on self-hosted Plausible — if so, this returns a note telling you to use the configured default site instead. It does NOT affect stats queries.
Inputs: no named parameters.
queryA
Run a raw Plausible Stats API v2 query for anything the other tools don't cover (custom property breakdowns, multi-dimension + time series, comparisons, imports, behavioral filters). Friendly date keywords like 'yesterday' and 'last_week' ARE resolved here too (in the site's timezone), so you never need to know the date format.
Inputs: metrics (required), date_range (required), site_id, dimensions, +4 more.
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 tool targets a distinct analytics function: period comparison, dimension breakdown, current time, real-time visitors, aggregate stats, time series, site listing, and a raw query fallback. No overlapping purposes.
Most tools follow a clear 'verb_noun' pattern (get_stats, list_sites, compare_periods), but 'query' deviates by being a bare verb. This minor inconsistency is easily understood.
8 tools is well-scoped for a Plausible analytics client. It covers all common analytics queries without unnecessary bloat or gaps.
The tool set covers essential stats queries and includes a raw query tool for edge cases. Minor gaps like site management or event details exist but are outside the server's stated purpose.
Maintenance
Related MCP Connectors
MCP server for querying and analyzing data from ad platforms, analytics tools, and spreadsheets
Hosted MCP server for GA4, Google Ads and Search Console. Google OAuth, nothing to install.
Read-only Google Analytics 4 MCP server for AI assistants.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceMCP server for Umami Analytics that provides read-only tools to query website stats, events, sessions, reports, and more, enabling natural language analytics queries.24 npm3MIT
- AlicenseAqualityBmaintenanceMCP server for Plausible Analytics that enables querying traffic, conversions, and comparing time periods from any AI tool supporting MCP.442 npm50MIT
- AlicenseAqualityDmaintenanceA read-only MCP server for Umami analytics, enabling natural language queries of website stats, traffic trends, events, sessions, and analytics reports.1310 npm1Elastic 2.0
- AlicenseBqualityFmaintenanceMCP server for Plausible Analytics, enabling querying of traffic, conversions, sources, and device breakdowns from any MCP-compatible AI assistant.1263 npmMIT