Skip to content
Scalekit Docs
Talk to an Engineer Dashboard

Connect AI agents to the Agency Analytics MCP server

Vendor MCP
Open markdown

The Agency Analytics MCP connector routes your AI agent's tool calls to Agency Analytics's own MCP server through Scalekit. Each user signs in to Agency Analytics once, and Scalekit stores and refreshes their tokens, so your agent never handles credentials. It comes with 35 tools.

Tools
35
What they doRead · write · destructive
34 · 1 · 034 read1 write0 destructive
Users sign in with
OAuth app
Scalekit's or your own

Setup

  1. Install the SDK

    Terminal window
    npm install @scalekit-sdk/node dotenv
  2. Set your credentials

    Add your Scalekit credentials to your .env file. Find values in app.scalekit.com > Developers > API Credentials.

    .env
    SCALEKIT_ENVIRONMENT_URL=<your-environment-url>
    SCALEKIT_CLIENT_ID=<your-client-id>
    SCALEKIT_CLIENT_SECRET=<your-client-secret>
  3. Create the Agency Analytics MCP connection

    In AgentKit > Connections, create an Agency Analytics MCP connection. The name you give it is the connection_name your code passes. See Configure connections.

    Scalekit credentials are available for Agency Analytics MCP server, so you don't need to register an OAuth app.

  4. Authorize a user and make your first call

    quickstart.mts
    import { ScalekitClient } from '@scalekit-sdk/node'
    import 'dotenv/config'
    import { createInterface } from 'node:readline/promises'
    const scalekit = new ScalekitClient(
    process.env.SCALEKIT_ENVIRONMENT_URL,
    process.env.SCALEKIT_CLIENT_ID,
    process.env.SCALEKIT_CLIENT_SECRET,
    )
    const actions = scalekit.actions
    const connector = 'agencyanalyticsmcp'
    const identifier = 'user_123'
    // Generate an authorization link for the user
    const { link } = await actions.getAuthorizationLink({ connectionName: connector, identifier })
    console.log('Authorize Agency Analytics MCP:', link)
    const rl = createInterface({ input: process.stdin, output: process.stdout })
    await rl.question('Press Enter after authorizing...')
    rl.close()
    // Make your first call
    const result = await actions.executeTool({
    connector,
    identifier,
    toolName: 'agencyanalyticsmcp_browse_client_custom_metrics',
    toolInput: {},
    })
    console.log(result)
    Terminal window
    npx tsx quickstart.mts

    Each user signs in once. See Authorize a user for the full flow and statuses.

Tools

Pass the exact name to execute_tool
Try in PlaygroundRequest a tool
  • agencyanalyticsmcp_browse_client_custom_metricsList the custom metrics available for a single client — both campaign-level and account-level — so you can discover which formula-driven KPIs exist (e.g.Read-only

    BrowseClientCustomMetrics

    List the custom metrics available for a single client — both campaign-level and account-level — so you can discover which formula-driven KPIs exist (e.g. 'Cost per Lead', 'ROAS'). Returns one row per custom metric with its id, name, data_type, change_format, scope, formula, and description. Use the returned ids with read_client_custom_metrics to fetch computed values.

    Inputs

    clientIdinteger
    The client (campaign) ID.
  • agencyanalyticsmcp_browse_client_dashboardsList all dashboards for a client/campaign.Read-only

    BrowseClientDashboards

    List all dashboards for a client/campaign. Returns paginated dashboards (10 per page). If the user does not see what they are looking for, increment page and call again. Requires client_id on every call.

    Inputs

    client_idinteger
    The client (campaign) ID. Required on every call.
    pageinteger
    Page number for pagination (default 1).
  • agencyanalyticsmcp_browse_client_data_sourcesDiscover connected providers and available metric data sources for a campaign.Read-only

    BrowseClientDataSources

    Discover connected providers and available metric data sources for a campaign. Pass message (the user's question) to filter returned data sources to only those relevant to the question. Returns providers (connected slugs) and data_sources (AAQL data source definitions with available fields and pre-hydrated filters).

    Inputs

    clientIdinteger
    The client (campaign) ID.
    messagestring
    The user's original question — used to filter relevant data sources.
  • agencyanalyticsmcp_browse_client_reportsList all reports for a client/campaign.Read-only

    BrowseClientReports

    List all reports for a client/campaign. Use this when no specific report was named and you need to present options or pick the most relevant one. Requires client_id on every call.

    Inputs

    client_idinteger
    The client (campaign) ID. Required on every call.
  • agencyanalyticsmcp_browse_clientsBrowse or enumerate clients.Read-only

    BrowseClients

    Browse or enumerate clients. Two modes: Folder mode (omit groupId) returns all folders with their client counts plus ungrouped clients. Drill-down mode (groupId provided) returns all clients inside the specified folder. Results are paginated via limit and offset.

    Inputs

    groupIdinteger
    Folder ID to drill into. Omit to list all folders and ungrouped clients.
    limitinteger
    Maximum number of items to return (default 50, max 200).default 50
    offsetinteger
    Zero-based pagination offset (default 0).default 0
    searchstring
    Optional text filter applied to client name or URL.
    statusstring
    Optional status filter — e.g. "active" or "inactive". Omit to return all statuses.
  • agencyanalyticsmcp_fetch_webFetch a single public web page or document by URL and return its readable text.Read-only

    FetchWeb

    Fetch a single public web page or document by URL and return its readable text. HTML is reduced to plain text; JSON, plain-text, and XML responses are returned as-is. Output is truncated to maxLength characters (default 30000).

    Inputs

    urlstringrequired
    Absolute http(s) URL to fetch, e.g. 'https://example.com/article'.
    maxLengthinteger
    Maximum characters of extracted text to return. Defaults to 30000; clamped to [1000, 100000].
  • agencyanalyticsmcp_read_client_ad_managerFetch a client's Google Ad Manager (sell-side / publisher ad-serving) analytics, broken down by a dimension.Read-only

    ReadClientAdManager

    Fetch a client's Google Ad Manager (sell-side / publisher ad-serving) analytics, broken down by a dimension. Returns one row per dimension value with the publisher's ad-revenue metrics (revenue, impressions, clicks, CTR, eCPM, fill rate, and more). This is the client-as-PUBLISHER earning ad revenue — NOT the client buying ads (use read_client_ads for spend-side campaign performance). Supported providers (1): google-ad-manager-v1.

    Inputs

    applyMarkupboolean
    Whether to apply the client's agency markup to revenue and eCPM figures.default false
    clientIdinteger
    The client (campaign) ID.
    endDatestring
    End date in YYYY-MM-DD format.
    entityTypestring
    The dimension to break down Ad Manager revenue by.one of advertisercreativeline_itemordercitycountryregioncustom_criteriaplacementbrowserdevicedevice_categorydomainoperating_systemdefault advertiser
    limitinteger
    Maximum rows to return (default 50).default 50
    providerstring
    The Ad Manager provider slug.one of google-ad-manager-v1
    startDatestring
    Start date in YYYY-MM-DD format.
    testModeboolean
    Set to true to return sample data without a live API call.default false
  • agencyanalyticsmcp_read_client_adsFetch ad data broken down by campaign, ad group, or ad for a specific platform.Read-only

    ReadClientAds

    Fetch ad data broken down by campaign, ad group, or ad for a specific platform. Returns one row per entity — NOT a time series. Use ONLY when the user asks for a per-entity breakdown. Supported platforms (21): googleadwords, facebook-ads, linked-in-ads, snapchat-ads, tiktok-ads, adroll, amazon-ads, bing-ads, twitter-ads, spotify-ads, stack-adapt, google-display-video360, pinterest-ads, reddit-ads-v1, simpli-fi, centro, centro-basis, choozle, adform, yelp-ads, ground-truth-v1.

    Inputs

    applyMarkupboolean
    Whether to apply the client's agency markup to cost/spend figures.default false
    clientIdinteger
    The client (campaign) ID.
    endDatestring
    End date in YYYY-MM-DD format.
    entityTypestring
    The entity type to break down by.one of campaignadgroupadvideoreachdomaindefault campaign
    limitinteger
    Maximum rows to return (default 50).default 50
    providerstring
    The ad platform provider slug.one of googleadwordsfacebook-adslinked-in-adssnapchat-adstiktok-adsadrollamazon-adsbing-adstwitter-adsspotify-adsstack-adaptgoogle-display-video360pinterest-adsreddit-ads-v1simpli-ficentrocentro-basischoozleadformyelp-adsground-truth-v1
    startDatestring
    Start date in YYYY-MM-DD format.
    testModeboolean
    Set to true to return sample data without a live API call.default false