Skip to docs navigation
On this page
Interactive Client Setup

Pick your client to see its setup. Claude can connect by signing in. The others need an API token first (step 1 below), put where the snippet says.

Choose Your Client

In Claude (web, desktop or mobile), open Settings, then Connectors, and add a custom connector named SourceTrack with this URL. Select Connect and sign in. No token is needed; custom connectors need a paid Claude plan.

Text
https://api.srctk.com/api/mcp

Add this to claude_desktop_config.json and restart Claude Desktop. You need Node.js 20 or later:

JSON
{
  "mcpServers": {
    "sourcetrack": {
      "command": "npx",
      "args": ["-y", "@sourcetrack/mcp"],
      "env": {
        "SOURCETRACK_API_KEY": "st_live_your_api_token_here"
      }
    }
  }
}

Add this to ~/.cursor/mcp.json, or .cursor/mcp.json in a project. You need Node.js 20 or later:

JSON
{
  "mcpServers": {
    "sourcetrack": {
      "command": "npx",
      "args": ["-y", "@sourcetrack/mcp"],
      "env": {
        "SOURCETRACK_API_KEY": "st_live_your_api_token_here"
      }
    }
  }
}

Run this in your terminal. It connects to the hosted SourceTrack server, so there is nothing to install:

Shell
claude mcp add --transport http sourcetrack https://api.srctk.com/api/mcp --header "Authorization: Bearer st_live_your_api_token_here"

Connect an AI Assistant (MCP)

Ask your AI assistant whether tracking works, and how many leads each campaign brought, without leaving the chat. It can only read, and only one site: the one you choose when you sign in, or the one your token belongs to.

Agent guidance

  • In Claude (web, desktop or mobile), add the hosted endpoint as a custom connector and sign in: no token. Other clients connect with the hosted endpoint and an API token (nothing to install), or run the local npm package @sourcetrack/mcp.
  • Send the API token in the Authorization: Bearer header of the MCP client configuration. Never paste it into a chat message, a prompt, a code file or browser code.
  • The only value that belongs in browser code is the public site key in the tracking snippet.
  • Every tool is read-only. No tool returns revenue, order value, cost, ad spend, ROAS, CPL or CAC.

Connect Claude by signing in (no token)

In Claude on the web, desktop or mobile, add SourceTrack as a connector and sign in. There is no token to copy. Custom connectors need a paid Claude plan.

  1. In Claude, open Settings, then Connectors, and add a custom connector named SourceTrack with this URL:
Text
https://api.srctk.com/api/mcp
  1. Select Connect. SourceTrack asks you to sign in.
  2. Choose the one site Claude may read, tick the permissions, and select Allow. The site's plan must include API access.

Signed in, Claude can check whether tracking works, count leads and campaigns, show conversions by channel, and read visitors, page views and saved funnels. Look-ups of a single contact or journey need an API token instead (below). See or revoke every signed-in connection at Settings, Advanced, MCP connections (https://app.sourcetrack.ai/settings?tab=advanced).

1. Issue a token

Create an API token in the app at Settings, Advanced, API tokens (https://app.sourcetrack.ai/settings?tab=advanced#api-tokens). Tick only the scopes you need:

  • read:diagnostics: whether your setup works.
  • read:volume: your leads, contacts, deals and campaign counts.
  • read:attribution: conversion counts by channel and common conversion paths.
  • read:stats: visitors, page views and saved funnels.

Keep the token in your client's settings. Never paste it into a chat message or a shared file.

2. Connect Claude Code

Run this in your terminal. It connects to the hosted SourceTrack server, so there is nothing to install.

Shell
claude mcp add --transport http sourcetrack https://api.srctk.com/api/mcp --header "Authorization: Bearer st_live_your_api_token_here"

For a project .mcp.json file, or another client that takes a server URL with headers, use:

JSON
{
  "mcpServers": {
    "sourcetrack": {
      "type": "http",
      "url": "https://api.srctk.com/api/mcp",
      "headers": {
        "Authorization": "Bearer st_live_your_api_token_here"
      }
    }
  }
}

3. Or connect Claude Desktop or Cursor

These clients run the @sourcetrack/mcp package on your computer. You need Node.js 20 or later.

Add this to claude_desktop_config.json and restart Claude Desktop. For Cursor, add it to ~/.cursor/mcp.json, or .cursor/mcp.json in a project.

JSON
{
  "mcpServers": {
    "sourcetrack": {
      "command": "npx",
      "args": ["-y", "@sourcetrack/mcp"],
      "env": {
        "SOURCETRACK_API_KEY": "st_live_your_api_token_here"
      }
    }
  }
}

You can run the same package in Claude Code:

Shell
claude mcp add sourcetrack --scope user -e SOURCETRACK_API_KEY=st_live_your_api_token_here -- npx -y @sourcetrack/mcp

Or add it as JSON:

Shell
claude mcp add-json sourcetrack --scope user '{"type":"stdio","command":"npx","args":["-y","@sourcetrack/mcp"],"env":{"SOURCETRACK_API_KEY":"st_live_your_api_token_here"}}'

The package can lag behind the hosted server, so a newer tool may be missing. Use the hosted server where your client supports it.

If it does not connect

  • The CLI answers unknown option '-y': the -- before npx was turned into an em dash when you copied it. Retype it as two plain hyphens.
  • claude mcp list shows CONNECTION_CLOSED: you may be inside a folder whose package.json is named @sourcetrack/mcp. Run it from any other folder.

What your assistant can read

These descriptions are the exact text your AI client is given.

detect_platform

API token, scope read:diagnostics.

Detect the CMS or platform (Shopify, WordPress, Webflow, GTM) of the site this API key belongs to. Scans only that site's registered domain — no other domain can be passed.

get_install_snippet

No credential.

Get the tracking script snippet and step-by-step install instructions for a target platform

verify_installation

Signed-in session.

Verify if tracking script events are active on a site. Note: Live backend status API requires an authenticated user session Bearer token (auth_token or SOURCETRACK_AUTH_TOKEN env var)

get_workspace_context

API token, scope read:diagnostics.

Identify the site this API key reads: site_id, domain, timezone, attribution window, onboarding state. Configuration only, no metrics — call this first so later answers can name which site and timezone they refer to.

get_site_health

API token, scope read:diagnostics.

Is the tracker plumbed in? Reports script_detected, last_seen_at, hours since last seen, onboarding state and plan.

get_data_quality

API token, scope read:diagnostics.

Latest result per data-quality check (status, value, threshold, message). Returns has_data:false when no check has run for this site yet — never an all-clear it cannot substantiate.

debug_data_flow

API token, scope read:diagnostics.

Attribution COVERAGE over a window: how many recorded conversions carry a usable source, and what share arrived UTM/click-id tagged. Pipeline completeness only — it does not say which channel deserves credit and returns no revenue.

verify_events

API token, scope read:diagnostics.

Are events arriving? Returns the most recent event timestamp and minutes since. If the data cannot be read this fails explicitly rather than reporting zero events — a SourceTrack read failure must never be read as broken customer tracking.

list_active_destinations

API token, scope read:diagnostics.

Which conversion destinations (Meta, Google Ads, GA4, TikTok and the other Conversion API platforms) are set up for this site, and how their newest sends went: configured, last delivery time and status, whether the newest send failed, and the latest skip reason. The same status the dashboard's Conversion API health card shows. Pipeline state only: returns no conversion values, no revenue, no payloads and no credential, pixel id or account id. Counts are over the newest 100 sends, stated in "sample", not all time. If the status cannot be read this fails explicitly rather than reporting nothing configured.

get_uncounted_forms

API token, scope read:diagnostics.

Form submits the tracker saw over a window (7 or 30 days) that never became a conversion, grouped by the form's own id, name or action and the page, with the submit and visitor counts and the fixed list of ways to make such a form count. Only forms where marking WOULD make them count are listed; login, search, checkout and app-page forms are not. A site that sends its own conversions answers status not_applicable. Every answer carries "limits" saying what this cannot see, so an empty list is never "everything is tracked". Setup state only: returns no revenue, no cost, no visitor id, no event id and no form field value, takes no site or attribution-model argument, and writes nothing. If the read fails this fails explicitly rather than reporting no uncounted forms.

get_leads_volume

API token, scope read:volume.

Lead COUNTS over a window, plus a breakdown by one dimension (source, medium or campaign). Volume only: returns no revenue, no cost and no cost-derived metric, and takes no attribution-model argument — dimension values are always the FIRST touch, echoed back as "touch":"first" on every row. The breakdown is a complete partition: untagged traffic is reported as its own "(untagged)" bucket rather than omitted. distinct_leads (unique converting visitors) and breakdown.total (conversion events) are different units and are not expected to match.

get_campaign_volume

API token, scope read:volume.

Per-campaign VOLUME over a window: distinct visitors and lead-type conversions per campaign. Volume only: there is no revenue, cost, ROAS or CPL column, and no attribution-model argument — campaign values are always the FIRST touch, echoed back as "touch":"first" on every row. Untagged traffic is included as the "(untagged)" campaign so the totals are a complete partition. This tool ranks campaigns by volume and says nothing about which campaign caused or deserves credit for anything.

get_conversions_by_channel

API token, scope read:attribution.

Conversion COUNTS over a window, split by acquisition channel. Counts only: returns no revenue, no value in any unit, no cost and no cost-derived metric. By default the channel is the FIRST touch, echoed back as "touch":"first" on every row, refunds are not counted, and the breakdown is a complete partition: conversions with no recorded channel are reported as "(untagged)" rather than omitted, so rows sum to the stated total. An optional model argument (one of the dashboard's attribution model names) returns the dashboard's own Channel x Conversions figures for that model instead: the answer states the model it used, a multi-touch model gives credited conversions that can be fractional, and a model the site cannot serve is refused with the dashboard's reason, never answered with another model's numbers. Very recent conversions may not appear yet. This tool reports counts and credit as computed and says nothing about which channel caused a conversion.

get_traffic_overview

API token, scope read:stats.

Traffic overview over a window: distinct visitors, pageviews, the site-wide conversion COUNT and conversion rate. Aggregates only: returns no revenue, no cost and no cost-derived metric and no per-visitor row, and takes no attribution-model argument — conversions are a site-wide count, never credited to a source. The window is the last N days (default 30, at most 90) or an explicit from/to (at most 366 days). A figure that cannot be measured is omitted with a reason in "omitted", never 0. If the data cannot be read this fails explicitly rather than reporting zero traffic.

get_traffic_timeseries

API token, scope read:stats.

Visitors, pageviews, conversion count and conversion rate per day, week (starting Monday) or month over a window. Aggregates only: returns no revenue, no cost and no cost-derived metric and no per-visitor row, and takes no attribution-model argument. The first and last bucket can be partial. A point's visitors and pageviews are null before the site's first counted pageview and after its last (no reading) and a measured 0 in between; conversion_rate is null for a bucket with no visitors. If the data cannot be read this fails explicitly rather than returning an empty or zero series.

get_traffic_breakdown

API token, scope read:stats.

Visitors and pageviews per value of one dimension (page, source, ai_source, country, region, device, channel, campaign, utm_campaign, utm_medium, utm_source, browser or os) over a window, ranked by visitors, with limit and offset paging. Traffic only: returns no revenue, no cost and no cost-derived metric, no conversions credited to any value, no per-visitor row, and takes no attribution-model argument. One visitor can appear under several values, so rows can sum to more than total.visitors; a missing value is the explicit "Unknown" row, never dropped by the read. Over a signed-in connection (Claude, ChatGPT), a country, region, device, browser or os row with fewer than 5 visitors is left out so a small count cannot point at one person, and small_counts says how many were left out. truncated:true means the read returned a slice, so values past the last row are not listed. If the data cannot be read this fails explicitly rather than returning an empty list.

list_saved_funnels

API token, scope read:stats.

List the site's saved funnels: id, name and ordered steps. A step is a page (its URL path is, contains or starts with a value) or a goal (a conversion type). Configuration only: returns no counts, no revenue and no cost. Pass an id to get_funnel_results for the numbers. An empty list means the site has none saved; funnels that cannot be read fail explicitly and are never reported as an empty list. Saved funnels need a plan that includes them (PLAN_GATED otherwise).

get_funnel_results

API token, scope read:stats.

Per-step results of one saved funnel over a window (the last N days, default 30, at most 90): the visitors who reached each step in order, each step's share of the previous step and of step 1, drop-off, and the median seconds from the previous step. The unit is distinct visitors over the whole window, not sessions. Counts only: returns no revenue per step, no cost, no visitor ids and no step drill-down, and takes no attribution-model argument. truncated:true means not every visitor could be counted, so every count is a floor. A rate with no denominator is null, never 0. If the data cannot be read this fails explicitly rather than returning a zero funnel.

push_offline_conversion

API token, scope write:capi_push.

Validate and simulate pushing an offline conversion to ad platform Conversion APIs (Meta, Google, TikTok, Microsoft). Groundwork tool, dry-run only: returns simulated validation and payload structure without executing live external writes.

sync_lead_to_crm

API token, scope write:crm_sync.

Validate and preview syncing a lead record to a CRM. Groundwork tool, dry-run only: evaluates lead properties and returns a hypothetical payload preview. It does not check or use any CRM connection (the HubSpot sync exists only in the dashboard, behind flags) and makes no live external write.

tag_campaign

API token, scope write:campaign_tags.

Validate and preview applying organizational tags or flags to a campaign or lead. Groundwork tool, dry-run only: verifies entity format and returns tag payload preview without persisting changes.

find_contacts

API token, scope read:volume.

Search and list tracked contacts (leads and persons) by email or query with first touch attribution details. Volume only: returns no revenue, no cost and no cost-derived metric, and takes no attribution-model argument — channel values are always the first touch, echoed back as "touch":"first" on every row.

get_journey

API token, scope read:volume.

Retrieve the chronological touchpoint journey (events with their pages, sources and campaigns, and conversions) for a specific contact or visitor. Takes the contact_ref returned by find_contacts or list_deals, or the visitor distinct id, not the masked "id" returned by find_contacts or the "contact_id" returned by list_deals. Volume only: returns no revenue, no cost and no cost-derived metric, and takes no attribution-model argument.

list_deals

API token, scope read:volume.

List the site's CRM deals, newest first, with paging and an optional stage filter: stage, the channel and source of the visitor's latest conversion (always the FIRST touch, echoed back as "touch":"first" on every row), created and updated dates. Volume only: returns no revenue, no deal amount, no cost and no cost-derived metric (even for a key that also holds read:revenue; the response says so in "omitted"), and takes no attribution-model argument. Contact ids are masked, deal names are masked as personal names, and email addresses are never returned; each deal's contact_ref is an opaque reference to pass to get_journey for that contact's journey. A value that is not recorded is null, never 0 or a placeholder.

get_pipeline_stages

API token, scope read:volume.

Lead qualification COUNTS per pipeline stage (lead, MQL, SQL, opportunity, closed won, closed lost) for the whole site, all time. The unit is lead qualification records, not visitors. A stage name that matches none of these is counted as lead. Counts only: returns no revenue, no deal value, no cost and no cost-derived metric, and takes no attribution-model argument. A site with no qualified lead answers has_data:false with every count null, never six zeros.

explain_metrics

API token, scope read:diagnostics.

Explain attribution metrics, dimensions, models, and calculation rules used in SourceTrack analytics. Configuration only: returns no revenue, no cost and no live numbers.

get_paths

API token, scope read:attribution.

Retrieve top multi-touch conversion journey paths and the touchpoint patterns leading to conversion. Counts only: returns no revenue, no cost and no cost-derived metric, and takes no attribution-model argument.

What it will not do

  • It cannot change your data, billing or settings. The three tools with a write scope only check a request and send nothing.
  • No tool returns revenue, order value, cost, ad spend, ROAS, CPL or CAC.
  • Lead and campaign figures are counts, credited to the first touch.

One token, one site. The site comes from the token. No tool takes a site argument, so a token cannot read another site.

  • Google Ads
  • Meta
  • LinkedIn
  • Microsoft Ads
  • TikTok
  • Stripe
  • Shopify
  • HubSpot
  • GA4
  • Search Console
  • WooCommerce
  • Webflow
  • WordPress
  • Typeform
  • Calendly
  • Intercom
  • Zapier
Works with