Integration

MCP server and agent access

Most analytics tools give an AI agent a REST API and a login page. Revtrail ships an MCP server, a CLI, and two kinds of scoped credential, because an agent that can read your numbers and set up your goals is more useful than one that can describe how you'd do it in the UI.

Start a 14-day trialLast reviewed August 2026
  1. Create a scoped API key

    Owners and admins create durable, site-scoped keys in the dashboard under Sites → the key icon. Raw rtk_… keys are shown once. Each key carries explicit permissions — analytics:read, goals:write, funnels:write — and can expire or be revoked without touching your tracking key.

  2. Point an MCP client at it

    Launch revtrail-mcp with the key in the server's environment, never as a command argument where it lands in shell history and process lists. The server exposes revtrail_overview, revtrail_create_goal, and revtrail_create_funnel.

    MCP client config
    {
      "mcpServers": {
        "revtrail": {
          "command": "revtrail-mcp",
          "env": { "REVTRAIL_API_KEY": "rtk_..." }
        }
      }
    }
  3. Or use the CLI for one-off answers

    The CLI speaks the same API contract as the MCP server, which makes it the fastest way to check that a key works before wiring it into an agent.

    terminal
    export REVTRAIL_API_KEY=rtk_...
    revtrail overview
    revtrail goal create --name Signups --event signup
    revtrail funnel create --name "Signup to paid" --step signup --step payment
  4. For a coding agent, use a temporary agent token instead

    Agent tokens are a different credential: short-lived by default, revocable, and scoped to one site's aggregates and configuration. The dashboard generates a setup prompt you can paste straight into a coding agent, so it can install the snippet, verify events are arriving, and register the right goals without ever holding a durable key.

What an agent can and can't reach

Both credentials are scoped to one site and to aggregates: overview stats, goals, funnels, install status. Neither grants visitor-level data, and neither can touch billing, workspace membership, or other sites in the workspace. An agent token that leaks is a bounded problem with an expiry date on it.

Setting a site up properly is more than pasting a snippet

This is the job worth handing to an agent. Map the product's real conversion path — pageview, signup, payment — instrument each step as an event, register a goal per key conversion, and define one funnel over the ordered path. Without that shape there's nothing for revenue attribution to attach to, and it's exactly the tedious setup work that an agent with API access does well.

The other half: watching AI traffic arrive

Revtrail separates ChatGPT, Claude, and Perplexity crawlers from human traffic and reports which pages they read. As more discovery moves from search results to assistant answers, 'which pages do the assistants actually read' becomes a content decision, and it's not a number you can get from a tool that files all of it under bots.

Questions people actually ask

What's the difference between an API key and an agent token?
API keys are durable, created by owners and admins, with explicit permissions — for scripts and MCP servers you run. Agent tokens are temporary (7 days by default) and revocable, for handing to a coding agent for a setup session.
Can an agent read individual visitors' data?
No. Both credential types are limited to one site's aggregates and configuration. Visitor-level data isn't exposed through either.
Does the MCP server work with clients other than Claude?
Yes — it's a standard stdio MCP server, so any MCP client can launch it with the key in its environment.

Integrations

All integrations