yandex-metrika-mcp

v2.1.1
io.github.theYahia/yandex-metrika-mcp Checked 1 day ago Published 7 months ago

MCP server for Yandex Metrika — web analytics, counters, goals, traffic (Russia)

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

list_counters

List all Yandex.Metrica counters available to the authenticated user. Returns counter ID, name, site URL, and status. Supports search filtering.

ParameterTypeDescription
fieldstringFields to return, comma-separated (e.g. 'name,site,status')
per_pagenumberResults per page (default 100, max 10000)
search_stringstringFilter counters by name or site URL substring

get_counter

Get full details of a single Yandex.Metrica counter by ID, including configuration, code snippet status, and goals count.

ParameterTypeDescription
counter_id *numberCounter ID to retrieve details for

create_counter

Create a new Yandex.Metrica counter for a website. Returns the new counter ID and tracking code. You need to install the tracking code on the site afterwards.

ParameterTypeDescription
name *stringCounter display name
site *stringWebsite domain (e.g. 'example.com')
mirrorsarrayMirror domains to track alongside the main site

update_counter

Update an existing Yandex.Metrica counter — change its name or site URL.

ParameterTypeDescription
counter_id *numberCounter ID to update
namestringNew counter display name
sitestringNew website domain

delete_counter

Permanently delete a Yandex.Metrica counter. This action is irreversible — all historical data for this counter will be lost.

ParameterTypeDescription
counter_id *numberCounter ID to delete. This action is irreversible.

list_goals

List all goals configured for a Yandex.Metrica counter. Goals track conversions like page visits, button clicks, or multi-step funnels.

ParameterTypeDescription
counter_id *numberCounter ID to list goals for

create_goal

Create a new conversion goal for a counter. Supports types: 'url' (page visit), 'number' (page count threshold), 'step' (multi-step funnel), 'action' (JavaScript event).

ParameterTypeDescription
counter_id *numberCounter ID to create the goal in
name *stringGoal display name
type *stringGoal type: 'url' (page visit), 'number' (page count), 'step' (multi-step funnel), 'action' (JS event)
conditionsarrayConditions array. Required for url, step, action goal types.

delete_goal

Delete a conversion goal from a counter. Historical goal data in reports is preserved.

ParameterTypeDescription
counter_id *numberCounter ID the goal belongs to
goal_id *numberGoal ID to delete

export_logs

Export raw visit or hit logs via the Logs API. Creates a log request and evaluates feasibility. Use source='visits' for session data, source='hits' for pageview data.

ParameterTypeDescription
counter_id *numberID счётчика Яндекс.Метрики
date1 *stringДата начала в формате YYYY-MM-DD
date2 *stringДата окончания в формате YYYY-MM-DD
fieldsstringПоля через запятую. По умолчанию для visits: ym:s:date,ym:s:clientID,ym:s:lastTrafficSource,ym:s:visitDuration
sourcestringТип данных: visits (визиты) или hits (просмотры)

get_report

Flexible Yandex.Metrica reporting endpoint. Query any combination of metrics (ym:s:visits, ym:s:pageviews, ym:s:bounceRate, ym:s:avgVisitDurationSeconds, ym:s:users, ym:s:newUsers, etc.) with dimensions (ym:s:trafficSource, ym:s:searchEngine, ym:s:country, ym:s:browser, ym:s:deviceCategory, ym:s:date, etc.) over a date range. Supports filters and sorting.

ParameterTypeDescription
counter_id *numberYandex.Metrica counter ID
date1 *stringStart date YYYY-MM-DD
date2 *stringEnd date YYYY-MM-DD
metrics *arrayMetrics array, e.g. ['ym:s:visits', 'ym:s:pageviews', 'ym:s:bounceRate', 'ym:s:avgVisitDurationSeconds']
dimensionsarrayDimensions array, e.g. ['ym:s:trafficSource', 'ym:s:browser', 'ym:s:country', 'ym:s:deviceCategory']
filtersstringFilter expression, e.g. ym:s:trafficSource=='organic'
limitnumberMax rows to return (default 100)
sortstringSort field, prefix with '-' for descending, e.g. '-ym:s:visits'

get_report_comparison

Compare metrics between two date periods (A vs B). Useful for week-over-week, month-over-month, or campaign before/after analysis.

ParameterTypeDescription
counter_id *numberYandex.Metrica counter ID
date1_a *stringPeriod A start date YYYY-MM-DD
date1_b *stringPeriod B start date YYYY-MM-DD
date2_a *stringPeriod A end date YYYY-MM-DD
date2_b *stringPeriod B end date YYYY-MM-DD
metrics *arrayMetrics to compare
dimensionsarrayDimensions to group by

get_report_drilldown

Drill down into report data hierarchically. Start at top level, then pass parent_id to explore sub-dimensions (e.g., country -> city, traffic source -> campaign).

ParameterTypeDescription
counter_id *numberYandex.Metrica counter ID
date1 *stringStart date YYYY-MM-DD
date2 *stringEnd date YYYY-MM-DD
dimensions *arrayDimensions for drill-down hierarchy
metrics *arrayMetrics to retrieve
parent_idstringParent row ID to drill into. Omit for top-level.

get_traffic_summary

Quick traffic overview for a counter over a date range. Returns visits, pageviews, unique users, bounce rate, and average visit duration in one call.

ParameterTypeDescription
counter_id *numberYandex.Metrica counter ID
date1 *stringStart date YYYY-MM-DD
date2 *stringEnd date YYYY-MM-DD

get_traffic_sources

Traffic sources breakdown — visits and users by source channel (organic search, direct, social, referral, ad). Quick way to see where traffic comes from.

ParameterTypeDescription
counter_id *numberYandex.Metrica counter ID
date1 *stringStart date YYYY-MM-DD
date2 *stringEnd date YYYY-MM-DD

get_top_pages

Top pages by pageviews for a counter. Returns URL, visits, pageviews, bounce rate, and avg duration for each page. Useful for content performance analysis.

ParameterTypeDescription
counter_id *numberYandex.Metrica counter ID
date1 *stringStart date YYYY-MM-DD
date2 *stringEnd date YYYY-MM-DD
limitnumberNumber of pages to return (default 20)