MCP server

Query RevKlik from Codex, Cursor, or Claude: one MCP endpoint, 14 read-only tools, the same API tokens as the REST API.

RevKlik ships a Model Context Protocol (MCP) server, so coding agents such as Codex, Cursor, or Claude can read your analytics directly. It serves the same data as the REST API (both run on one shared query layer), which turns questions like “which referrers brought paying visitors last week?” into a prompt instead of a dashboard session.

Endpoint

https://app.revklik.com/api/mcp
  • Transport: Streamable HTTP, stateless. Every POST is a complete JSON-RPC 2.0 request carrying its own Authorization header; there are no sessions, so the server-to-client stream probe answers 405.
  • Protocol versions: 2025-06-18 (latest), 2025-03-26, and 2024-11-05. The server echoes your client’s version when it is supported.
  • Rate limits: one bucket per token, shared with the REST API.

Authentication

Use the same API tokens as the REST API. Create them under Share → API tokens (see share and access):

TokenStarts withGood for
Accountrvt_Multi-site work; list_sites requires an account token
Siterv_One site; site_id arguments are optional and default to that site

Scopes decide what a token may call: analytics:read covers the analytics tools, analytics:export covers export_events, and sites:read covers list_sites. The events:write scope is for the server events API, not for MCP tools.

Connect a client

Codex CLI:

codex mcp add revklik --transport http https://app.revklik.com/api/mcp \
  -s user -H "Authorization: Bearer rvt_YOUR_TOKEN"

Claude Code:

claude mcp add --transport http revklik https://app.revklik.com/api/mcp \
  --header "Authorization: Bearer rvt_YOUR_TOKEN"

Cursor (.cursor/mcp.json):

{
	"mcpServers": {
		"revklik": {
			"url": "https://app.revklik.com/api/mcp",
			"headers": { "Authorization": "Bearer rvt_YOUR_TOKEN" }
		}
	}
}

Any other MCP client works the same way: point it at the URL above and send the token as a Bearer Authorization header.

Tools

Fourteen read-only tools, mirroring the REST API one to one (gsc_queries is backed by the GSC endpoint /api/gsc/queries, which predates v1):

ToolReturnsScope
whoamiToken identity: user, plan, token type, scopes, bound site
list_sitesSites the token can access (owned + team)sites:read
analytics_overviewPageviews, visitors, sessions, bounce rate, revenue, conversionsanalytics:read
analytics_timeseriesPageviews and visitors per day (hourly for ranges up to 48h)analytics:read
top_pagesTop pages by pageviewsanalytics:read
top_referrersTraffic sources with visitor share, direct includedanalytics:read
geo_breakdownVisitors by country, region, and cityanalytics:read
device_breakdownVisitors by device type, OS, and browseranalytics:read
revenue_breakdownRevenue by source, by country, and over timeanalytics:read
portfolio_revenueGross vs net revenue across all your sites, by product and railanalytics:read
campaignsUTM campaigns with conversions, revenue, and conversion rateanalytics:read
visitor_journeysRecent sessions with step-by-step journeys and known profilesanalytics:read
gsc_queriesGoogle Search Console queries: clicks, impressions, CTR, positionanalytics:read
export_eventsRaw rows (events, visitors, or sessions) as JSON or CSVanalytics:export

Shared arguments:

  • range: 24h, 7d (default), 30d, or 90d. A custom "YYYY-MM-DD,YYYY-MM-DD" range works on the REST API but is not part of the MCP tool schema, so MCP clients cannot send one.
  • site_id: optional with a site token (rv_), required with an account token (rvt_). Get ids from list_sites.
  • limit where offered: up to 100 rows. export_events accepts type (events/visitors/sessions), event_type (pageview/custom/conversion/payment/subscription), format (json/csv), and up to 1,000 rows.

Prompts to try

  • “Compare top referrers this month against last month.”
  • “Which UTM campaign produced the most revenue in the last 90 days?”
  • “Export last week’s conversion events as CSV.”

Errors

  • 401: missing or invalid token.
  • 400: unsupported MCP-Protocol-Version header.
  • -32602: invalid tool arguments.
  • -32601: unknown method.
  • Other tool failures (for example a missing scope) come back as results with isError: true plus an error and a hint explaining what to fix.