Plausible Analytics MCP

io.github.surendranb由 GitHub 帳號 surendranb 發布v0.1.3更新於 Nov 3, 2026

Plausible Analytics MCP: privacy-first website stats, real-time visitors, breakdowns, and trends.

概覽

AI 產生的概覽

針對 Plausible Analytics 的唯讀 MCP 伺服器,讓助理取得網站流量彙總、細分資料、趨勢與即時訪客數。

可以做什麼
  • 取得訪客數、瀏覽量、跳出率與造訪時長等網站彙總指標
  • 依頁面、來源、國家、瀏覽器、作業系統或裝置細分指標
  • 取得可繪圖的歷史時間序列資料,以及目前的即時訪客數
  • 測試 API 連線並驗證已設定的權杖
  • 列出並讀取內建的分析方法與操作手冊,檢查套件更新
適用情境
適合讓助理回答 Plausible 雲端或自架網站的流量問題、快速產生報告或趨勢摘要,或查看目前線上訪客,而不必開啟儀表板。
執行需求
以 stdio 方式在本機執行,通常透過 uvx(Python)或 npx 橋接啟動。需在 PLAUSIBLE_API_KEY 提供 Plausible Stats/Sites API 權杖,或透過工具參數傳入。自架執行個體可選用 PLAUSIBLE_BASE_URL,預設連線 Plausible 雲端。需要能連上 Plausible 執行個體的網路。
安裝前請注意
此 API 權杖可存取你的分析資料,應放在環境變數而非共用設定中。README 提到預設開啟匿名遙測,可用 DO_NOT_TRACK=1 關閉。工具本身為唯讀,但網站 ID 與權杖會傳送到所設定的 Plausible 端點。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Plausible Analytics MCP,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

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)

bash
export PLAUSIBLE_API_KEY="your_api_key_here"uvx plausible-mcp

Run with npx (Node / npm bridge)

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

Environment Configuration

VariableDescriptionDefault
PLAUSIBLE_API_KEYYour Plausible Stats/Sites API tokenRequired (or pass via tool token arg)
PLAUSIBLE_BASE_URLBase URL for self-hosted Plausiblehttps://plausible.io
DO_NOT_TRACKSet to 1 to disable anonymous telemetry0

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

ToolDescription
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.

MCP Client Setup

Claude Desktop (claude_desktop_config.json)

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

Or using the npm bridge:

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

License

MIT License. See LICENSE for details.

來源:README.md,提交 b20381a

工具

8

get_aggregate_stats

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.

輸入參數tokenmetricssite_id必填date_range

get_breakdown

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.

輸入參數limittokensite_id必填date_rangeproperty_name

get_realtime_visitors

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.

輸入參數tokensite_id必填

get_timeseries

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.

輸入參數tokensite_id必填intervaldate_range

doctor

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.

輸入參數token

skills_list

List available Plausible Analytics operational skills and playbooks.

無需輸入參數。

skill_read

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.

輸入參數name必填

check_for_updates

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

無需輸入參數。

版本歷史

1
  1. v0.1.3最新Oct 29, 2026

評分

已滿足適用檢查項的 90%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分
  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分