Skip to content

MCP Server

Kitbase speaks MCP (Model Context Protocol) in two ways. Connect either one to claude.ai, Claude Code, Cursor, or any MCP-compatible client and ask questions about your traffic, events, users, sessions, AI visibility, and bot traffic in natural language.

Remote serverLocal server (@kitbase/mcp)
RunsHosted at https://api.kitbase.dev/mcp — nothing to installOn your machine via npx -y @kitbase/mcp (stdio)
AuthOAuth sign-in or a private API keyYour kitbase login session, or KITBASE_TOKEN / KITBASE_API_KEY
ScopeExactly one project per credentialEvery organization and project your account can access
Extra toolsFunnels, journeys, retention, frustration signals, realtimeOrg/project discovery, SDK keys, raw bot requests, AI citations & job history
Best forclaude.ai / Claude Desktop connectors, zero setupCLI users, Claude Code, headless and self-hosted setups

No Dashboard Required

Once connected, your AI assistant can answer questions like "How many visitors are on the site right now?" or "Which domains does ChatGPT cite instead of us?" by querying Kitbase directly.

Remote Server

The remote MCP server is built into the Kitbase API — there is nothing to install or run.

https://api.kitbase.dev/mcp

Self-hosted deployments serve the same endpoint at https://<your-host>/api/mcp.

Authentication

The server accepts two kinds of credentials. Both are scoped to exactly one project, so tools never need an organization or project parameter.

MethodBest forHow
OAuthclaude.ai / Claude Desktop connectorsAdd the server URL as a custom connector; a browser window asks you to sign in and pick the org + project to grant access to
Private API keyCursor, headless clientsSend Authorization: Bearer sk_kitbase_... (or X-API-Key) with each request

WARNING

Private API keys (sk_kitbase_) are secret keys — not the public SDK token used in browser SDKs. Generate one in your Kitbase dashboard under Project Settings > API Keys.

Client Setup

claude.ai (web / desktop)

  1. Go to Settings > Connectors > Add custom connector
  2. Enter https://api.kitbase.dev/mcp
  3. Complete the sign-in flow and choose the organization and project to connect

Claude Code

bash
claude mcp add --transport http kitbase https://api.kitbase.dev/mcp \
  --header "Authorization: Bearer sk_kitbase_your_key_here"

Cursor

Add to your Cursor MCP settings (.cursor/mcp.json):

json
{
  "mcpServers": {
    "kitbase": {
      "url": "https://api.kitbase.dev/mcp",
      "headers": {
        "Authorization": "Bearer sk_kitbase_your_key_here"
      }
    }
  }
}

Other MCP Clients

The server speaks the standard MCP Streamable HTTP transport. Any client that supports remote MCP servers works — point it at the URL and supply either credential.

Available Tools

The server exposes 31 read-only tools across ten categories. No tool can modify data.

Unless noted otherwise, every tool accepts the standard date parameters described in Date Filtering: preset, from, to, and timezone.

Web Analytics

ToolDescriptionExtra parameters
get_web_summarySummary KPIs — visitors, pageviews, bounce rate, average durationfilters
get_web_timelineVisitors/pageviews as a time seriesinterval (hour/day/week/month), filters
get_web_breakdownBreak down by dimension (country, browser, os, device, page, referrer, …)dimension (required), page, size, filters
compare_web_periodsCompare a dimension across two arbitrary date rangesdimension, currentFrom/currentTo, previousFrom/previousTo (all required), limit, filters

Custom Events

ToolDescriptionExtra parameters
list_eventsList raw tracked eventsevent, channel, userId, filters, page, size, sort
get_event_statsGrouped event countsgroupBy (default event), channel
get_event_timelineEvent counts over timeinterval, event
get_event_breakdownBreak events down by dimensiondimension (required), limit

Users

ToolDescriptionExtra parameters
list_usersList/search aggregated user analyticstype (all/identified/anonymous), search, filters, page, size
get_user_summaryComprehensive single-user summaryuserId (required)
get_user_activityDaily activity heatmap for one useruserId (required), months (default 4); no date params
get_user_eventsPaginated event timeline for one useruserId (required), page, size; no date params

Sessions

ToolDescriptionExtra parameters
list_sessionsList aggregated sessionssearch, filters, page, size
get_session_detailSingle session details (metadata only)sessionId (required); no date params
get_session_eventsEvents inside one sessionsessionId (required), page, size; no date params

Funnels & Journeys

ToolDescriptionExtra parameters
analyze_funnelAd-hoc funnel: conversion + drop-off per stepsteps (required — ordered list of {type, value, name?, filters?}), analysisMode (session/user)
analyze_journeyMost common multi-step event sequencessteps (count, default 3), limit (default 100)

Frustration Signals

ToolDescriptionExtra parameters
get_frustration_signalsRage clicks and dead clicks, with top pages/elementslimit

Retention

ToolDescriptionExtra parameters
get_retentionCohort retention: visitors grouped by the week/month of their first visit, with the share still active in each following periodinterval (week default, or month)

Cohorts are anchored to each visitor's first visit ever, not the first visit inside the requested window, so long-standing visitors are never counted as new. Offset 0 is the cohort itself (100%). The date range selects which cohorts are returned.

Realtime

ToolDescriptionExtra parameters
get_realtime_visitorsDistinct visitors active right nowwindowMinutes (1–60, default 5); no date params

AI Visibility

How often your brand appears in AI search answers (ChatGPT, Gemini, Perplexity, Claude), which domains those answers cite, and how you stack up against competitors.

Most of these tools accept a provider filter (ALL default, chatgpt, gemini, perplexity, claude) and a jobs parameter — how many of the most recent scan jobs to aggregate when no date window is given (default 10).

ToolDescriptionExtra parameters
list_ai_brandsConfigured brands (yours + competitors)none
list_ai_promptsPrompts tracked against AI search enginesnone
get_ai_visibility_seriesVisibility score over timeprovider, limit (default 30)
get_ai_visibility_domainsDomains AI answers cite, ranked by citation shareprovider, jobs, limit (default 25)
get_ai_competitorsYour brand vs competitors (mentions, sentiment)provider, jobs, limit
get_ai_share_of_voiceYour share of all brand mentions over timeprovider, jobs
get_ai_prompts_breakdownPer-prompt: did the brand appear in each provider's answerjobs

Bot & AI-Crawler Traffic

Which bots and AI crawlers (GPTBot, ClaudeBot, PerplexityBot, Googlebot, …) hit your site, from where, and what they read.

ToolDescriptionExtra parameters
get_bot_timelineBot requests over time, grouped by vendorinterval
get_bot_countriesPer-country bot traffic (requests + distinct bots)page, size (default 8)
get_top_botsTop bots ranked by request countsize (default 10)
get_bot_top_pathsPages most requested by botssize (default 10), vendor (e.g. GPTBot)

Common Parameters

Date Filtering

Most tools accept date filtering via either a preset or an explicit date range:

  • preset — one of last_30_minutes, last_hour, today, yesterday, last_7_days, last_30_days, this_month, this_year
  • from / to — explicit date range in YYYY-MM-DD format (inclusive)
  • timezone — timezone for date calculations, e.g. Africa/Cairo (default: UTC)

If both a preset and explicit dates are provided, the preset takes precedence.

For the AI visibility tools, omitting all date parameters aggregates the last jobs scan jobs instead of a time window.

Pagination

List tools support pagination with page (0-indexed) and size.

Filters

Web analytics and event tools support filters in the format dimension:operator:values:

"country:is:US,UK"
"browser:is:Chrome"
"page:contains:/blog"

Pass multiple filters as an array to combine them.

Example Prompts

QuestionTools Used
"How many visitors are on the site right now?"get_realtime_visitors
"How many visitors did we get last week?"get_web_summary
"Compare this week's traffic to last week by country"compare_web_periods
"What's our weekly retention looking like this quarter?"get_retention
"Show me the signup funnel conversion rate"analyze_funnel
"How visible is our brand in AI search this month?"get_ai_visibility_series
"Which domains does ChatGPT cite instead of us?"get_ai_visibility_domains
"How do we compare to competitors in AI answers?"get_ai_competitors
"Is ChatGPT crawling our docs? Which pages?"get_top_bots + get_bot_top_paths
"Which pages have the most rage clicks this week?"get_frustration_signals
"Show me a summary of user U-123's activity"get_user_summary

Local Server (@kitbase/mcp)

@kitbase/mcp runs the MCP server on your machine over stdio — the standard transport for Claude Code, Claude Desktop, and the MCP Inspector. Instead of being locked to one project, it authenticates as you and can browse every organization and project your account can access.

Setup

Log in once with the Kitbase CLI, then point any MCP client at the stdio binary:

bash
kitbase login
claude mcp add kitbase -- npx -y @kitbase/mcp

For Cursor or Claude Desktop, use a command-based server entry:

json
{
  "mcpServers": {
    "kitbase": {
      "command": "npx",
      "args": ["-y", "@kitbase/mcp"]
    }
  }
}

Authentication

The server resolves a token on the first tool call, in this order (first match wins):

  1. KITBASE_TOKEN — an explicit user JWT (power users / CI)
  2. KITBASE_API_KEY — a private API key (sk_kitbase_*), sent as-is
  3. CLI credentials~/.config/kitbase/credentials.json from kitbase login, refreshed automatically when near expiry

Set KITBASE_API_URL to point the server at a self-hosted backend (default: https://api.kitbase.dev).

Start with discovery

Unlike the remote server, tools here are not pre-scoped to a project. Ask your assistant to call list_orgs_and_projects first — it returns the orgSlug and projectId values every other tool requires.

Available Tools

The server exposes 25 read-only tools across eight categories. No tool can modify data.

Every tool except list_orgs_and_projects requires orgSlug and projectId. Unless noted otherwise, tools also accept the standard date parameters described in Date Parameters: preset, from, to, and timezone.

Discovery

ToolDescriptionExtra parameters
list_orgs_and_projectsList your organizations and each org's projects — call this first to get orgSlug + projectIdorgSlug (optional — limit to one org); no date params

Web Analytics

ToolDescriptionExtra parameters
web_analytics_summarySummary KPIs — visitors, sessions, pageviews, bounce rate, average duration, revenue, each vs the previous periodfilters
web_analytics_timelineTime-bucketed pageviews/sessions/visitors (current vs previous period); set dimension + value to drill into one value's timelineinterval (minute/hour/day, default hour), dimension + value, filters
web_analytics_breakdownTop values for a dimension (country, browser, path, referrer, utm_*, device, …); use page_duration for top pages by average time spentdimension (required), page, size, filters
web_analytics_compareCompare a dimension across two explicit date ranges, biggest movers firstdimension, currentFrom/currentTo, previousFrom/previousTo (all required), limit (default 10), filters
list_tracked_namesDistinct page paths or custom event names seen in the projectkind (paths/event_names, required); no date params

Custom Events

ToolDescriptionExtra parameters
events_statsTotal events, unique users, and a breakdown grouped by event name or usergroup_by (event/user, default event), channel; no preset
events_timelineEvent counts over timeinterval (hour/day/week/month, default day), event; no preset
events_breakdownEvents grouped by a dimension (event name, user, geo, browser, OS, device, UTM)dimension (required), limit (default 20); no preset
events_aggregationsOne row per unique event name: count, unique users, first/last seen, 24-hour sparklinechannel, search, user_id, page, size, sort
list_eventsRaw custom events, paginatedevent, channel, user_id, filters, page, size, sort

AI Visibility

Most of these tools accept a provider filter (ALL default, CHATGPT, GEMINI, PERPLEXITY, CLAUDE) and a jobs parameter — how many of the most recent completed analysis jobs to aggregate when no date window is given.

ToolDescriptionExtra parameters
ai_visibility_seriesPresence-rate time series, one point per completed jobprovider, limit
ai_visibility_share_of_voiceEach tracked brand's share of voice and rank per jobprovider, jobs
ai_visibility_breakdownPresence and citation totals per AI providerjobs
ai_visibility_competitorsAll tracked brands ranked by visibility rateprovider, jobs, limit
ai_visibility_citationsDomains cited by AI answers; pass domain to drill into its cited URLsdomain, provider, jobs, limit, page, size
ai_visibility_cited_pagesExact pages (URLs) cited across all domains, most-cited first; set mentioningBrand: true to only count citations from answers featuring your brandprovider, mentioningBrand, jobs, page, size
ai_visibility_promptsTracked prompts; set includeBreakdown: true for per-prompt presence metricsincludeBreakdown, jobs
ai_visibility_jobsAnalysis job history; pass jobId for one job's detail and live progressjobId, limit; no date params

Bot & AI-Crawler Traffic

ToolDescriptionExtra parameters
bots_analyticsBot/crawler traffic — pick a view: top bots, top scraped paths, per-vendor timeline, or per-country breakdownview (top_bots/top_paths/timeline/countries, required), interval (default day), size (default 10), page
list_bot_requestsRaw bot/crawler request log, paginatedsearch, actorType (verified_bot/spoofed_bot/suspected_bot), page, size

Sessions

ToolDescriptionExtra parameters
list_sessionsAggregated visitor sessions, paginatedsearch, filters, page, size
get_sessionOne session's detail; set includeEvents: true to also return its event streamsessionId (required), includeEvents, page, size; no date params

Users

ToolDescriptionExtra parameters
list_analytics_usersAggregated analytics users, paginatedtype (all/identified/anonymous), search, filters, page, size
get_analytics_userOne user's data — choose sections via include: summary (default), activity heatmap, eventsuserId (required), include, months (default 4), page, size; no date params

SDK Keys

ToolDescriptionExtra parameters
list_sdk_keysThe project's public SDK keys (private API keys and secrets are never returned)page, size, sort; no date params

Date Parameters

Date-scoped tools accept:

  • preset — one of last_30_minutes, last_hour, today, yesterday, last_7_days, last_30_days, this_month, this_year; overrides from/to when set
  • from / to — explicit date range in YYYY-MM-DD format (inclusive)
  • timezone — IANA timezone used to resolve date boundaries, e.g. America/New_York (default: UTC)

Pagination uses page (0-indexed, default 0) and size (1–100, default 20).

Filters take the format "dimension:operator:values" where the operator is is or is_not and values are comma-separated — e.g. ["country:is:US,UK", "browser:is_not:Safari"].

Example Prompts

QuestionTools Used
"Which Kitbase projects do I have access to?"list_orgs_and_projects
"How did traffic on my docs project do this month vs last?"web_analytics_compare
"What are the top pages people spend the most time on?"web_analytics_breakdown (page_duration)
"Which custom events fired most this week?"events_aggregations
"Which domains do AI answers cite, and which URLs on reddit.com?"ai_visibility_citations
"What pages do AI engines cite when they mention my brand?"ai_visibility_cited_pages
"Show me the raw GPTBot requests from today"list_bot_requests
"What SDK keys does this project have?"list_sdk_keys

Requirements

  • A Kitbase account with an active project
  • Remote server with API-key auth: a private API key (sk_kitbase_) from Project Settings > API Keys
  • Local server: Node.js 18+ and either a kitbase login session or a KITBASE_TOKEN / KITBASE_API_KEY environment variable

Next steps

  • CLI — the same operations from your terminal instead of an AI assistant, and where kitbase login lives.
  • API reference — the REST API behind every MCP tool.
  • Analytics dashboard guide — the data these tools query.

Released under the MIT License.