AI agentsLet Cursor, Claude Code, Codex, or another MCP-compatible agent inspect and manage Kobbe.

Kobbe exposes a scoped API for local AI agents. Use it when you want Cursor, Claude Code, Codex, or another MCP-compatible tool to inspect analytics, check setup health, or manage sites.

Agent access uses the same @kobbe/cli package as the CLI, but runs it in MCP server mode.

MCP setup

Kobbe works with any MCP-compatible client: point it at kobbe mcp and it can query your analytics. Client examples for Cursor, VS Code, Claude, and Codex are below.

Create a token

Agent access is included on every plan, including the trial. If a trial or subscription lapses, API requests return plan_required until billing is active again.

Log in with the CLI:

kobbe login --token kbpat_YOUR_TOKEN

Or provide the token through the KOBBE_TOKEN environment variable.

MCP mode

Run Kobbe in MCP server mode directly, or use one of the client examples below:

kobbe mcp

Available tools

MCP tools include:

Tool What it does
list_sites List sites the token can access.
get_live Visitors online right now, for every site at once.
get_overview Read headline traffic KPIs for one site.
get_revenue Read revenue totals and attribution health for one site.
get_top_pages Inspect top pages for a site and time range.
get_sources Inspect referrers, channels, and source breakdowns.
get_timeseries Visitors, visits, views, bounce rate, and session time over time.
get_breakdown Visitors by country, region, city, browser, OS, device, or channel.
get_custom_events Custom event counts, with an optional property breakdown per event.
get_goals Conversion goals with completions and unique visitors.
create_goal Add a conversion goal (preset or custom event).
delete_goal Delete a conversion goal.
get_funnels Funnels with per-step visitors, conversion, and drop-off.
create_funnel Create a funnel with 2-5 pageview or event steps.
delete_funnel Delete a funnel.
get_campaigns UTM campaign traffic with visitors and views.
get_setup_health Check whether tracking and optional features are configured correctly.
get_next_actions Ask Kobbe for suggested follow-up work.
create_site Create a new site when the token has write access.
update_site Update site details when the token has write access.
rotate_site_token Rotate a site tracker token.
delete_site Delete a site with dangerous write access and confirmation.
reset_site_stats Reset analytics data with dangerous write access and confirmation.

Token scopes

API tokens are workspace-scoped and can be revoked any time from profile menu → Agent access.

Scopes:

Scope Allows
sites:read List and inspect sites.
analytics:read Read overview, time-series, pages, sources, breakdowns, custom events, goals, funnels, campaigns, setup health, and next actions.
revenue:read Read revenue totals and attribution health.
sites:write Create or update sites, goals, and funnels.
tokens:write Rotate tracker tokens.
danger:write Delete sites or reset analytics data.

Safety notes

Kobbe API tokens are management credentials. Treat them like passwords.

  • Store tokens in your local environment or the kobbe login config, not in source control.
  • Revoke tokens when an agent, machine, or project no longer needs access.
  • Use the smallest scope set that works.
  • Destructive actions still require typed confirmation, even when the token has danger:write.
  • Site tracker tokens are separate from API tokens. A tracker token can send analytics events, but it cannot manage a workspace.

Good prompts

  • “What changed on my site today?”
  • “Which page should I improve next?”
  • “Compare traffic over the last 30 days and tell me which week grew fastest.”
  • “Where do my visitors come from, by country and by channel?”
  • “How is my signup funnel converting, and where do people drop off?”
  • “Create a funnel from /pricing to the Signup event.”
  • “List my sites and tell me which one needs setup.”
  • “Rotate the tracker token for this test site.”

For destructive actions, include the exact confirmation only after you have reviewed the agent’s proposed action.

MCP client examples

Pick the client you use. The examples assume you already ran kobbe login or set KOBBE_TOKEN.

{
  "mcpServers": {
    "kobbe": {
      "command": "npx",
      "args": ["-y", "@kobbe/cli@latest", "mcp"],
      "env": {
        "KOBBE_TOKEN": "kbpat_YOUR_TOKEN"
      }
    }
  }
}