MCP

Pagebee runs one remote MCP server. Connect it to Claude Code, Cursor, Codex or any client that can send a header, and your agent can answer questions about your numbers or set up a new property end to end.

text
https://api.pagebee.ai/mcp

Streamable HTTP, stateless. Authenticate with an API key in the Authorization header.

1. Make a key

In workspace settings, API keys and MCP, create a key:

  • Read keys can query your numbers and change nothing.
  • Dev keys can also create sites, keys, goals, channels and hostname rules.

You can limit a key to some sites and apps. The key starts with pb_ak_ and is shown once.

2. Connect your client

Claude Code

bash
claude mcp add --transport http pagebee https://api.pagebee.ai/mcp \
  --header "Authorization: Bearer pb_ak_your_key"

Cursor

~/.cursor/mcp.json
{
  "mcpServers": {
    "pagebee": {
      "url": "https://api.pagebee.ai/mcp",
      "headers": { "Authorization": "Bearer pb_ak_your_key" }
    }
  }
}

Codex

~/.codex/config.toml
[mcp_servers.pagebee]
url = "https://api.pagebee.ai/mcp"
bearer_token_env_var = "PAGEBEE_API_KEY"

One-click connection from Claude.ai needs OAuth, which is on the way. Until then, use a key.

3. Ask

To set up the project you're in:

text
Add Pagebee analytics to this project. Create a property for it, install the snippet, make preview deploys count as preview, add a goal for sign-ups, then verify the install and tell me what you saw.

To read your numbers: "How did the 2.0 launch do?", "Why did sign-ups drop on Tuesday?", "Which pages bring the most installs?"

Intelligence tools (read keys)

ToolWhat it does
list_sitesEvery site and app the key can see
get_schemaMetrics, dimensions, event names, goals, funnels and environments for a site
query_metricsAny metric, filtered and broken down, for any range
get_topTop pages, referrers, channels, countries, devices, campaigns or events
get_timeseriesMetrics by hour, day, week or month
get_funnelStep counts for a saved or ad hoc funnel
compare_periodsA range against the previous period or last year
get_realtimeVisitors in the last 5 and 30 minutes
explain_changeThe sources, pages, countries or versions behind a change

Dev tools (dev keys, adds to read)

ToolWhat it does
create_siteAdd a website, iOS, Mac, Android or server property
update_site_settingsDomains, timezone, currency, excluded paths and hostname rules
get_install_snippetThe script tag, Swift or Kotlin setup, or a server example
verify_installCheck the snippet is live and production events arrived
list_recent_eventsThe latest raw events, without visitor identifiers
upsert_goalCreate or update a goal
delete_goalRemove a goal; asks for confirmation
create_api_keyIngest keys, or read-only API keys
create_channelA feed channel with an emoji and push setting
send_test_eventOne test event, end to end, not counted

Safety

Read tools are marked read-only to the client and delete_goal is marked destructive. Every dev call is written to the workspace audit log with the key that made it. Revoking a key takes effect within a minute. Each key can make 120 calls a minute.