KosmoKrator

analytics

Plausible Analytics MCP Integration for Vercel AI SDK

Connect Plausible Analytics to Vercel AI SDK through the local KosmoKrator MCP gateway with scoped tools, credentials, and write policy.

8 functions 4 read 4 write API key auth

Connect Plausible Analytics to Vercel AI SDK

Use KosmoKrator as a local integration gateway for Vercel AI SDK agents and scripts.

Create an MCP client that starts or connects to the KosmoKrator gateway for the selected integration. The gateway is local, scoped to this integration, and starts with --write=deny so Vercel AI SDK can inspect read-capable tools without receiving write access by default.

Plausible Analytics MCP Config for Vercel AI SDK

Prefer CLI JSON calls when a workflow only needs one deterministic integration operation.

{
  "mcpServers": {
    "kosmokrator-plausible": {
      "type": "stdio",
      "command": "kosmo",
      "args": [
        "mcp:serve",
        "--integration=plausible",
        "--write=deny"
      ]
    }
  }
}

Run the Gateway Manually

kosmokrator mcp:serve --integration=plausible --write=deny

Why Use KosmoKrator Here

Scoped tools

Expose only Plausible Analytics instead of a broad multi-service tool list.

Local credentials

Reuse credentials already configured for the KosmoKrator CLI and Lua runtime.

Write policy

Start read-only, then opt into ask or allow for trusted workspaces.

Plausible Analytics Tools Visible to Vercel AI SDK

Vercel AI SDK sees stable MCP tool names generated from the Plausible Analytics integration catalog.

MCP toolSource functionTypeDescription
integration__plausible__plausible_query_stats plausible.plausible_query_stats Read Query website analytics from Plausible. Supports aggregate stats, timeseries, and breakdowns by dimension. Use dimensions to group results (e.g., by country, source, page). Omit dimensions for simple aggregate totals.
integration__plausible__plausible_realtime_visitors plausible.plausible_realtime_visitors Read Get the current number of realtime visitors on a website (visitors in the last 5 minutes).
integration__plausible__plausible_list_sites plausible.plausible_list_sites Read List websites tracked in Plausible Analytics. Returns site domains you can query for analytics data.
integration__plausible__plausible_create_site plausible.plausible_create_site Write Register a new website for tracking in Plausible Analytics.
integration__plausible__plausible_delete_site plausible.plausible_delete_site Write Remove a website from Plausible Analytics tracking. This deletes all associated data.
integration__plausible__plausible_list_goals plausible.plausible_list_goals Read List all goals (conversion tracking) configured for a website in Plausible.
integration__plausible__plausible_create_goal plausible.plausible_create_goal Write Create a conversion goal for a website in Plausible. Goals can track pageviews to specific pages or custom events.
integration__plausible__plausible_delete_goal plausible.plausible_delete_goal Write Delete a conversion goal from a website in Plausible.

Related Plausible Analytics Pages