Connector guide7-minute read20 MCP tools7 languages

Yandex Metrica MCP Server: Traffic and Conversions

Let your AI analyse Yandex Metrica web analytics: counters, goals, filters and segments, table, time-series, drill-down and comparison reports on visits, sources, pages and conversions, and raw visits and hits through the Logs API.

HCBy HelpCode teamUpdated 7 min read Open-source on GitHub

No credit card · 7-day trial · Self-host alternative available

Yandex Metrica

Yandex Metrica

Let your AI analyse Yandex Metrica web analytics: counters, goals, filters and segments, table, time-series, drill-down and comparison reports on visits, sources, pages and conversions, and raw visits and hits through the Logs API.

tools

20

Region

INTL

Category

Analytics

Authentication

API Key

Required env vars

YANDEX_METRICA_TOKEN
Install in one click on Cloud

7-day free trial · No credit card

  • 7-day free trial
    No credit card required
  • GDPR & SOC 2 ready
    EU data residency, audit logs
  • Open-source on GitHub
    Open source · AGPL-3.0
  • Works with ChatGPT, Claude, Gemini
    Any MCP-compatible client

Summary

Let your AI analyse Yandex Metrica web analytics: counters, goals, filters and segments, table, time-series, drill-down and comparison reports on visits, sources, pages and conversions, and raw visits and hits through the Logs API.

Guided setup

Connect Yandex Metrica to Claude, ChatGPT or Copilot in 2 minutes

Start a free trial on AnythingMCP Cloud, connect Yandex Metrica in the guided setup, then add your MCP URL to your AI assistant. No code and no server to run.

No credit card · 7-day trial · Self-host alternative available

Try asking

Example prompts for Yandex Metrica

Click any prompt to copy it. Paste into Claude, ChatGPT, Cursor, Gemini, Copilot or OpenClaw to run it against this connector.

Yandex Metrica · live via MCP
Share
Opus 4.7

Claude is AI and can make mistakes. Please double-check responses.

💡 No install? Use cloud.anythingmcp.com directly. Sign in, click Connectors → Yandex Metrica, paste your credentials, mint an MCP API key and you're done. No Docker, no git clone, no local server.

Yandex Metrica

Let your AI analyse Yandex Metrica web analytics: counters, goals, filters and segments, table, time-series, drill-down and comparison reports on visits, sources, pages and conversions, and raw visits and hits through the Logs API.

Setup

Setting up takes about 5 minutes. You need a Yandex account that owns the Metrica counters or has access to them, and an app of your own registered at oauth.yandex.com.

  1. Create an app at oauth.yandex.com of the kind For API access or debugging and give it the access metrika:read (Metrica statistics, counter settings, list of counters). Note its ClientID.
  2. Signed in with the Yandex account that owns or can see the counters, open https://oauth.yandex.com/authorize?response_type=token&client_id=<ClientID> with your ClientID and copy the token (it starts with y0_) into YANDEX_METRICA_TOKEN, without OAuth or Bearer in front.
  3. Install the connector and run yandex_metrica_list_counters: it checks the token and lists the counter ids the other tools need.

Cloud and self-hosted work the same way: you paste the token, and the connector sends it as Authorization: OAuth ... on every call. There is no redirect URL to set in AnythingMCP.

The token lasts about a year: it is extended while it is used. Read access is enough for everything here: metrika:read covers the reports, the counter settings and the Logs API requests.

Counters and goals first: the counter id goes into ids in reports and into counterId everywhere else. yandex_metrica_list_goals gives the goal ids that goal metrics embed, such as ym:s:goal123reaches and ym:s:goal123conversionRate.

Metrics, dates and filters: metrics and dimensions start with ym:s: for sessions (visits) and ym:pv: for pageviews, for example ym:s:visits, ym:s:bounceRate or ym:s:lastTrafficSource. Dates take YYYY-MM-DD, today, yesterday or 30daysAgo. Filters use ==, !=, =@ (contains) and =~ (regex), combined with AND and OR; the saved segments from yandex_metrica_list_segments can be reused as filters. Rows page with limit (default 100, at most 100,000) and offset, which starts at 1.

Sampled figures: report answers carry sampled and sample_share. When sampled is true the figures are estimates: ask for full accuracy (accuracy full) on small date ranges, or use the Logs API.

Logs API: raw, unsampled visits and hits are prepared on Yandex's side. The AI checks with yandex_metrica_evaluate_log_request whether the request can be built, creates it, waits until its status is processed and downloads each part as tab-separated text, the first line holding the field names. Date ranges cannot include today, and prepared logs count against the counter's log storage quota.

Limits: 5,000 requests a day per user, 200 report requests per 5 minutes per user, 3 parallel requests per user and 30 requests per second per IP address (10 for the Logs API). Above that Yandex answers 429: wait and try again.

Common errors: 401 means the token is wrong, expired or revoked: get a new one with your app's ClientID as in step 2. 403 means the token works, but its account has no access to that counter or the app lacks metrika:read. 400 means an invalid metric, dimension or filter, and the message names it.

What it reads: counters with site, mirrors, status, time zone, code status, owner and your permission, and the labels (folders) they are sorted into; goals with type, conditions, steps and price; data filters, URL operations, saved segments and who has access to a counter; table, time-series, drill-down and comparison reports on visits, users, bounce rate, traffic sources, pages, countries, devices and goal conversions; and raw, unsampled visits and hits from the Logs API.

Switched off at install: yandex_metrica_clean_log_request. It deletes the prepared files of a processed Logs API request to free the counter's log storage quota, and the files cannot be downloaded afterwards. Switch it on on the connector page only if you need it; the AI asks you to confirm every change first. yandex_metrica_create_log_request and yandex_metrica_cancel_log_request are switched on: they only start or stop the preparation of a raw-data export on Yandex's side and change no counter, goal or setting.

Not covered: creating or editing counters, goals, filters and access, and uploading offline conversions, calls, expenses, user parameters or CRM data.

Prerequisites: YANDEX_METRICA_TOKEN

Install the connector locally

curl -fsSL https://raw.githubusercontent.com/HelpCode-ai/anythingmcp/main/docker-compose.quickstart.yml -o docker-compose.yml
printf 'JWT_SECRET=%s\nENCRYPTION_KEY=%s\n' "$(openssl rand -hex 32)" "$(openssl rand -hex 32)" > .env
docker compose up -d

Open http://localhost:3000/connectors/store, pick Yandex Metrica and paste in the env vars listed under Prerequisites.

Available tools

ToolWhat it does
yandex_metrica_list_countersList the Metrica counters (tags) the token can read: id, name, site, status, owner_login, permission (own, view, edit), time zone, creation…
yandex_metrica_get_counterGet one counter's settings: name, site and mirrors, status, time zone, code status, webvisor and e-commerce options, owner and, with field…
yandex_metrica_list_goalsList the goals of a counter: id, name, type (url, action, number, step, phone, email, form, messenger ...), conditions, is_retargeting and…
yandex_metrica_get_goalGet one goal of a counter by id: name, type, conditions, steps of a composite goal and price
yandex_metrica_list_filtersList the data filters of a counter (include or exclude traffic by IP, URL, title, referrer ...): id, attr, type, value, action, status
yandex_metrica_list_operationsList the URL operations of a counter (cut query parameters or fragments, merge to lowercase, replace domain): id, action, attr, value…
yandex_metrica_list_segmentsList the saved segments of a counter: segment_id, name, expression (a filter you can pass as filters in reports), status, segment_source…
yandex_metrica_list_grantsList who has access to a counter: user_login, perm (view or edit), created_at and comment
yandex_metrica_list_labelsList the user's counter labels (folders): id and name
yandex_metrica_get_reportBuild a table report from the Reporting API: metrics grouped by dimensions over a date range, with filters, sorting and paging
yandex_metrica_get_report_by_timeBuild a time series: the metrics per day, week, month, hour or other interval for the top rows of the dimensions
yandex_metrica_get_drilldownBuild a tree report: the first dimension's values with their metrics, then expand one row into the next dimension with parent_id
yandex_metrica_compare_segmentsCompare two segments or periods side by side: the same metrics and dimensions for segment A (date1_a, date2_a, filters_a) and segment B…
yandex_metrica_evaluate_log_requestCheck whether a Logs API request for raw visits or hits can be created: possible (true or false) and max_possible_day_quantity
yandex_metrica_create_log_requestCreate a Logs API request that prepares raw, unsampled visits or hits for a date range on Yandex's side
yandex_metrica_list_log_requestsList the Logs API requests of a counter: request_id, source, fields, attribution, status (created, processed, canceled, processing_failed…
yandex_metrica_get_log_requestGet one Logs API request: status and, once processed, the parts (part_number and size) to download
yandex_metrica_download_log_partDownload one part of a processed Logs API request as tab-separated text, the first line holding the field names
yandex_metrica_cancel_log_requestCancel a Logs API request that is still being prepared (status created)
yandex_metrica_clean_log_requestDelete the prepared files of a processed Logs API request to free the counter's log storage quota

Example prompts

  • "Which traffic sources brought the most visits last month, and what were their bounce rates?"
  • "How did the conversion rate of my order goal change week by week over the last three months?"
  • "Compare visits and goal reaches by traffic source between October and September."
  • "Which pages had the most pageviews yesterday, and on which devices?"
  • "Get last week's raw, unsampled visits through the Logs API and count them by region."

Next steps

Was this guide helpful?

Connect Yandex Metrica to Claude, ChatGPT or Copilot in 2 minutes

Start a free trial on AnythingMCP Cloud, connect Yandex Metrica in the guided setup, then add your MCP URL to your AI assistant. No code and no server to run.

Related guides

Connectors

Connect Yandex Metrica to ChatGPT via MCP

Let your AI analyse Yandex Metrica web analytics: counters, goals, filters and segments, table, time-series, drill-down and comparison reports on visits, sources, pages and conversions, and raw visits and hits through the Logs API.

Connectors

Connect Yandex Metrica to Claude via MCP

Let your AI analyse Yandex Metrica web analytics: counters, goals, filters and segments, table, time-series, drill-down and comparison reports on visits, sources, pages and conversions, and raw visits and hits through the Logs API.

Connectors

Connect Yandex Metrica to Microsoft Copilot via MCP

Let your AI analyse Yandex Metrica web analytics: counters, goals, filters and segments, table, time-series, drill-down and comparison reports on visits, sources, pages and conversions, and raw visits and hits through the Logs API.

Connectors

Connect Yandex Metrica to Cursor via MCP

Let your AI analyse Yandex Metrica web analytics: counters, goals, filters and segments, table, time-series, drill-down and comparison reports on visits, sources, pages and conversions, and raw visits and hits through the Logs API.

Connectors

Connect Yandex Metrica to Gemini CLI via MCP

Let your AI analyse Yandex Metrica web analytics: counters, goals, filters and segments, table, time-series, drill-down and comparison reports on visits, sources, pages and conversions, and raw visits and hits through the Logs API.

Connectors

Connect Yandex Metrica to Meta Muse via MCP

Let your AI analyse Yandex Metrica web analytics: counters, goals, filters and segments, table, time-series, drill-down and comparison reports on visits, sources, pages and conversions, and raw visits and hits through the Logs API.