Prototype · Preview: every server in the official registry, synced every 30 minutes. Sign in with Google to write reviews.Prototype · updated every 30 min
PopNx MCPMCP servers for people who use AI · explained in plain words Sign in

Yandex Metrica MCP

by askadsversion 1.5.6i★ 7iRuns on your computerRepository ↗
Registry nameio.github.askads/mcp-yandex-metrica

How to install

What it does

MCP server for Yandex Metrica API: list counters, goals and pull web-analytics statistics.

  • Connects Runs on your computer
  • Account or key No key needed
  • Category Marketing & social media

Use together with

Skills that teach the AI this kind of work; they work alongside this one

scroll-world

A skill that turn any brand into a scrollable 3D world landing page

by oso95★ 11,0651 skills

Skill · How-to guide

social-auto-upload

自动化上传视频到社交媒体:抖音、小红书、视频号、tiktok、youtube、bilibili

by dreammis★ 16,698 (whole repo)4 skills

Skill · How-to guide

native-subtitle-quote-image

保留视频内嵌字幕,精确取帧并生成 3:4 社交长图的 Agent Skill

by chengyi-ai★ 2,8911 skills

Skill · How-to guide

Why it ranks here

Lists are ordered by a usage score (out of 100) built from these parts

Popularity17/80GitHub stars or weekly downloads: the larger counts 60, the smaller 20
Freshness12/12Full marks for a release or code change within 30 days
Still answering0/8The cloud endpoint answered at the last check
Usage score29/100

Quality: Passed 3/3 basic checks (shown, not used for ordering) · Momentum: No data yet (Used only on the Trending tab)

Install

Pick the AI app you use, then copy the settings.

Let your AI install it with one sentence

Please install Yandex Metrica MCP. Follow https://mcp.popnx.com/i/askads-mcp-yandex-metrica.md, show me the commands and wait for my OK before running them.

Paste it into an AI that can work on your computer (such as Claude Code or Cursor). It reads our steps, shows you the commands and waits for your OK. No key, no sign-up. · See the full text your AI reads

Passed 3/3 checks · Runs on your computer · ✓ Commands checked Nov 14, 2026

First: which AI do you use?

Pick your app and the steps appear below.

Works with Claude, with some setup first

Install Node.js on your computer first (one time) · Only the Claude desktop app (Windows or Mac), not the web or phone

Let AI install it

Copy this message into a Claude chat. The AI checks your computer, tells you which file it will change, and waits for your OK every time.

Please install the MCP server Yandex Metrica MCP for Claude on this computer, in this order: 1) Check Node.js with node -v. If it is missing, tell me to install it from https://nodejs.org/en/download; do not install it yourself. 2) Use only this config (already checked by PopNx MCP): { "mcpServers": { "yandex-metrica": { "command": "npx", "args": [ "-y", "mcp-yandex-metrica" ] } } } 3) Tell me the full path of the file you will change, or the command you will run, and wait for my OK. 4) No key is needed. 5) Do what we agreed, then check that the Yandex Metrica MCP tools really show up.

This message has no key in it. If a key is needed, the AI will ask you to paste it yourself into the file or the app’s field.

  1. Install Node.js (if you don’t have it)

    Already installed? Check first · Open Terminal, type this command and press Enter

    node -v
    • A version number such as v26.13.1 = installed, skip this step
    • "command not found" (on Windows: "is not recognized") = not installed yet, or installed but Terminal needs to be closed and reopened
    How to open Terminal

    Mac: press ⌘ + Space, type Terminal, press Enter

    Windows: open Start, type Windows PowerShell, then Open

    Not installed: Open the official download page, pick the LTS version and the click-through installer: .pkg on Mac · .msi on Windows. Double-click and follow it to the end. No curl command needed

    Open the Node.js download page ↗

    When it’s done, close Terminal, open it again and run the same command. You should see a version number: node -v

    Install once; it works for everything that needs Node.js

  2. Open the Claude desktop app’s settings file

    SettingsDeveloperEdit Config

  3. Paste these settings and save the file

    {
      "mcpServers": {
        "yandex-metrica": {
          "command": "npx",
          "args": [
            "-y",
            "mcp-yandex-metrica"
          ]
        }
      }
    }
  4. Quit Claude and open it again

  5. Try it

    Use Yandex Metrica MCP and tell me what you can do for me, then show me one thing

    ✓ If Claude says it is using Yandex Metrica MCP or shows a Yandex Metrica MCP tool in the answer, you are connected

7 optional setting(s) (works without them)

The command above works without these. Add them only if you want to change something, following the maker’s description.

  • YANDEX_METRIKA_TOKEN Yandex Metrica OAuth token (scope metrika:read) — read access to analytics data. Treat it as a secret. Optional: without it the server starts anyway and connects through the in-chat login (start_logi…
  • YANDEX_METRIKA_OAUTH_CLIENT_ID ClientID of your own Yandex OAuth app for the in-chat login. Defaults to the Ask Ads app scoped to metrika:read.
  • YANDEX_METRIKA_COUNTER_ID Default Metrica counter id, used when a tool call omits counterId.
  • YANDEX_METRIKA_LANG Language for API responses (ru, en, ...). · default ru
  • YANDEX_METRIKA_API_BASE API root host. Override only for a proxy or a non-default endpoint. · default https://api-metrika.yandex.net
  • YANDEX_METRIKA_TIMEOUT_MS Per-request timeout in milliseconds. · default 60000
  • YANDEX_METRIKA_MAX_RETRIES Max retries for transient errors (429 rate limit, 5xx on reads). · default 3

Descriptions are as written by the maker.

Menu names checked against Anthropic’s help page on Nov 11, 2026 · your screen may differ slightly by app version

ChatGPT cannot connect Yandex Metrica MCP yet

Yandex Metrica MCP runs on your computer, but ChatGPT can only connect servers that run on the web

What you can do instead

A · Use an app that can connect Yandex Metrica MCP

  • Install Node.js on your computer first (one time) · Only the Claude desktop app (Windows or Mac), not the web or phone
  • Install Node.js on your computer first (one time)
  • Install Node.js on your computer first (one time)
  • Install Node.js on your computer first (one time)

B · Others in Marketing & social media that work with ChatGPT

Picked from the most used in the same category, only ones that connect by address with no key

Works with Claude Code, with some setup first

Install Node.js on your computer first (one time)

Let AI install it

Copy this message into a Claude Code chat. The AI checks your computer, tells you which file it will change, and waits for your OK every time.

Please install the MCP server Yandex Metrica MCP for Claude Code on this computer, in this order: 1) Check Node.js with node -v. If it is missing, tell me to install it from https://nodejs.org/en/download; do not install it yourself. 2) Use only this config (already checked by PopNx MCP): claude mcp add --scope user yandex-metrica -- npx -y mcp-yandex-metrica 3) Tell me the full path of the file you will change, or the command you will run, and wait for my OK. 4) No key is needed. 5) Do what we agreed, then check that the Yandex Metrica MCP tools really show up.

This message has no key in it. If a key is needed, the AI will ask you to paste it yourself into the file or the app’s field.

  1. Install Node.js (if you don’t have it)

    Already installed? Check first · Open Terminal, type this command and press Enter

    node -v
    • A version number such as v26.13.1 = installed, skip this step
    • "command not found" (on Windows: "is not recognized") = not installed yet, or installed but Terminal needs to be closed and reopened
    How to open Terminal

    Mac: press ⌘ + Space, type Terminal, press Enter

    Windows: open Start, type Windows PowerShell, then Open

    Not installed: Open the official download page, pick the LTS version and the click-through installer: .pkg on Mac · .msi on Windows. Double-click and follow it to the end. No curl command needed

    Open the Node.js download page ↗

    When it’s done, close Terminal, open it again and run the same command. You should see a version number: node -v

    Install once; it works for everything that needs Node.js

  2. Open Terminal

    Mac: press Command+Space and type Terminal · Windows: open PowerShell

  3. Paste this command and press Enter

    claude mcp add --scope user yandex-metrica -- npx -y mcp-yandex-metrica
  4. Type /mcp in Claude Code

    You should see Yandex Metrica MCP listed as connected

  5. Try it

    Use Yandex Metrica MCP and tell me what you can do for me, then show me one thing

    ✓ If Claude Code says it is using Yandex Metrica MCP or shows a Yandex Metrica MCP tool in the answer, you are connected

7 optional setting(s) (works without them)

The command above works without these. Add them only if you want to change something, following the maker’s description.

  • YANDEX_METRIKA_TOKEN Yandex Metrica OAuth token (scope metrika:read) — read access to analytics data. Treat it as a secret. Optional: without it the server starts anyway and connects through the in-chat login (start_logi…
  • YANDEX_METRIKA_OAUTH_CLIENT_ID ClientID of your own Yandex OAuth app for the in-chat login. Defaults to the Ask Ads app scoped to metrika:read.
  • YANDEX_METRIKA_COUNTER_ID Default Metrica counter id, used when a tool call omits counterId.
  • YANDEX_METRIKA_LANG Language for API responses (ru, en, ...). · default ru
  • YANDEX_METRIKA_API_BASE API root host. Override only for a proxy or a non-default endpoint. · default https://api-metrika.yandex.net
  • YANDEX_METRIKA_TIMEOUT_MS Per-request timeout in milliseconds. · default 60000
  • YANDEX_METRIKA_MAX_RETRIES Max retries for transient errors (429 rate limit, 5xx on reads). · default 3

Descriptions are as written by the maker.

Menu names checked against Anthropic’s help page on Nov 11, 2026 · your screen may differ slightly by app version

Works with Cursor, with some setup first

Install Node.js on your computer first (one time)

Let AI install it

Copy this message into a Cursor chat. The AI checks your computer, tells you which file it will change, and waits for your OK every time.

Please install the MCP server Yandex Metrica MCP for Cursor on this computer, in this order: 1) Check Node.js with node -v. If it is missing, tell me to install it from https://nodejs.org/en/download; do not install it yourself. 2) Use only this config (already checked by PopNx MCP): { "mcpServers": { "yandex-metrica": { "command": "npx", "args": [ "-y", "mcp-yandex-metrica" ] } } } 3) Tell me the full path of the file you will change, or the command you will run, and wait for my OK. 4) No key is needed. 5) Do what we agreed, then check that the Yandex Metrica MCP tools really show up.

This message has no key in it. If a key is needed, the AI will ask you to paste it yourself into the file or the app’s field.

  1. Install Node.js (if you don’t have it)

    Already installed? Check first · Open Terminal, type this command and press Enter

    node -v
    • A version number such as v26.13.1 = installed, skip this step
    • "command not found" (on Windows: "is not recognized") = not installed yet, or installed but Terminal needs to be closed and reopened
    How to open Terminal

    Mac: press ⌘ + Space, type Terminal, press Enter

    Windows: open Start, type Windows PowerShell, then Open

    Not installed: Open the official download page, pick the LTS version and the click-through installer: .pkg on Mac · .msi on Windows. Double-click and follow it to the end. No curl command needed

    Open the Node.js download page ↗

    When it’s done, close Terminal, open it again and run the same command. You should see a version number: node -v

    Install once; it works for everything that needs Node.js

  2. Click this button to open Cursor

    Open in Cursor

    Cursor asks you to confirm; click Install

  3. Open the AI chat in Cursor in Agent mode

  4. Try it

    Use Yandex Metrica MCP and tell me what you can do for me, then show me one thing

    ✓ If Cursor says it is using Yandex Metrica MCP or shows a Yandex Metrica MCP tool in the answer, you are connected

7 optional setting(s) (works without them)

The command above works without these. Add them only if you want to change something, following the maker’s description.

  • YANDEX_METRIKA_TOKEN Yandex Metrica OAuth token (scope metrika:read) — read access to analytics data. Treat it as a secret. Optional: without it the server starts anyway and connects through the in-chat login (start_logi…
  • YANDEX_METRIKA_OAUTH_CLIENT_ID ClientID of your own Yandex OAuth app for the in-chat login. Defaults to the Ask Ads app scoped to metrika:read.
  • YANDEX_METRIKA_COUNTER_ID Default Metrica counter id, used when a tool call omits counterId.
  • YANDEX_METRIKA_LANG Language for API responses (ru, en, ...). · default ru
  • YANDEX_METRIKA_API_BASE API root host. Override only for a proxy or a non-default endpoint. · default https://api-metrika.yandex.net
  • YANDEX_METRIKA_TIMEOUT_MS Per-request timeout in milliseconds. · default 60000
  • YANDEX_METRIKA_MAX_RETRIES Max retries for transient errors (429 rate limit, 5xx on reads). · default 3

Descriptions are as written by the maker.

Menu names checked against Cursor’s help page on Nov 11, 2026 · your screen may differ slightly by app version

Works with VS Code, with some setup first

Install Node.js on your computer first (one time)

Let AI install it

Copy this message into a VS Code chat. The AI checks your computer, tells you which file it will change, and waits for your OK every time.

Please install the MCP server Yandex Metrica MCP for VS Code on this computer, in this order: 1) Check Node.js with node -v. If it is missing, tell me to install it from https://nodejs.org/en/download; do not install it yourself. 2) Use only this config (already checked by PopNx MCP): { "servers": { "yandex-metrica": { "type": "stdio", "command": "npx", "args": [ "-y", "mcp-yandex-metrica" ] } } } 3) Tell me the full path of the file you will change, or the command you will run, and wait for my OK. 4) No key is needed. 5) Do what we agreed, then check that the Yandex Metrica MCP tools really show up.

This message has no key in it. If a key is needed, the AI will ask you to paste it yourself into the file or the app’s field.

  1. Install Node.js (if you don’t have it)

    Already installed? Check first · Open Terminal, type this command and press Enter

    node -v
    • A version number such as v26.13.1 = installed, skip this step
    • "command not found" (on Windows: "is not recognized") = not installed yet, or installed but Terminal needs to be closed and reopened
    How to open Terminal

    Mac: press ⌘ + Space, type Terminal, press Enter

    Windows: open Start, type Windows PowerShell, then Open

    Not installed: Open the official download page, pick the LTS version and the click-through installer: .pkg on Mac · .msi on Windows. Double-click and follow it to the end. No curl command needed

    Open the Node.js download page ↗

    When it’s done, close Terminal, open it again and run the same command. You should see a version number: node -v

    Install once; it works for everything that needs Node.js

  2. Click this button to open VS Code

    Open in VS Code

    VS Code asks you to confirm; click Install

  3. Open the AI chat in VS Code in Agent mode

  4. Try it

    Use Yandex Metrica MCP and tell me what you can do for me, then show me one thing

    ✓ If VS Code says it is using Yandex Metrica MCP or shows a Yandex Metrica MCP tool in the answer, you are connected

7 optional setting(s) (works without them)

The command above works without these. Add them only if you want to change something, following the maker’s description.

  • YANDEX_METRIKA_TOKEN Yandex Metrica OAuth token (scope metrika:read) — read access to analytics data. Treat it as a secret. Optional: without it the server starts anyway and connects through the in-chat login (start_logi…
  • YANDEX_METRIKA_OAUTH_CLIENT_ID ClientID of your own Yandex OAuth app for the in-chat login. Defaults to the Ask Ads app scoped to metrika:read.
  • YANDEX_METRIKA_COUNTER_ID Default Metrica counter id, used when a tool call omits counterId.
  • YANDEX_METRIKA_LANG Language for API responses (ru, en, ...). · default ru
  • YANDEX_METRIKA_API_BASE API root host. Override only for a proxy or a non-default endpoint. · default https://api-metrika.yandex.net
  • YANDEX_METRIKA_TIMEOUT_MS Per-request timeout in milliseconds. · default 60000
  • YANDEX_METRIKA_MAX_RETRIES Max retries for transient errors (429 rate limit, 5xx on reads). · default 3

Descriptions are as written by the maker.

Menu names checked against VS Code’s help page on Nov 11, 2026 · your screen may differ slightly by app version

Other apps that use MCP, such as Windsurf, Zed or Gemini CLI, each add servers differently. See how in the app list.

See every app that uses MCP →

JSON settings are under “For developers” below

Stuck? Ask people who use Yandex Metrica MCP💬 Discussion →
For developers: Terminal commands and JSON settings

Installed on your computer

Claude Code

claude mcp add --scope user yandex-metrica -- npx -y mcp-yandex-metrica

Claude Desktop (claude_desktop_config.json)

{
  "mcpServers": {
    "yandex-metrica": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-yandex-metrica"
      ]
    }
  }
}

Cursor (~/.cursor/mcp.json)

{
  "mcpServers": {
    "yandex-metrica": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-yandex-metrica"
      ]
    }
  }
}

VS Code (mcp.json)

{
  "servers": {
    "yandex-metrica": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "mcp-yandex-metrica"
      ]
    }
  }
}

Values you fill in

  • YANDEX_METRIKA_TOKEN secret env
    Yandex Metrica OAuth token (scope metrika:read) — read access to analytics data. Treat it as a secret. Optional: without it the server starts anyway and connects through the in-chat login (start_logi…
  • YANDEX_METRIKA_OAUTH_CLIENT_ID env
    ClientID of your own Yandex OAuth app for the in-chat login. Defaults to the Ask Ads app scoped to metrika:read.
  • YANDEX_METRIKA_COUNTER_ID env
    Default Metrica counter id, used when a tool call omits counterId.
  • YANDEX_METRIKA_LANG env
    Language for API responses (ru, en, ...).
  • YANDEX_METRIKA_API_BASE env
    API root host. Override only for a proxy or a non-default endpoint.
  • YANDEX_METRIKA_TIMEOUT_MS env
    Per-request timeout in milliseconds.
  • YANDEX_METRIKA_MAX_RETRIES env
    Max retries for transient errors (429 rate limit, 5xx on reads).

Descriptions are as written by the maker.

These settings are generated from the maker’s registry entry. If the README says otherwise, follow the README.

At a glance

Downloads per weeki
410/wk
Connection
Runs on your computer
Latest versioni
1.5.6
Published to registryi
Nov 14, 2026
Code last changedi
Nov 14, 2026
Maker
askads
Packages
npm: mcp-yandex-metrica
Website
github.com
Registry status
Active

Which apps can use it

Based on how this server connects and on each app’s own docs, checked Nov 10, 2026.

Run on your computer in

ClaudeGooseLM StudioMsty StudioCherry StudioCursorVS Code + GitHub CopilotVisual StudioWindsurf (Devin Desktop)ZedKiroClineContinueJetBrains AI AssistantClaude CodeCodex CLIGemini CLIOpenCodenodecodeWarpLibreChatRaycast

All apps, with pros and cons →

Related guides

What it can do

Runs on your computer; the tool list appears in your AI app after you install it.

Basic checksi

We check information anyone can see; we have not read the code. Checks that do not apply are left out of the count. · Checked Nov 20, 2026

  • ✓ Pass

    Maker matches the repo

    The registry name was verified with the GitHub account askads, which owns the repo

  • ✓ Pass

    Still maintained

    Code last changed 6 days ago

  • ✓ Pass

    Has a licence

    Uses MIT

  • – Not applicable

    Endpoint responds

    This one runs on your computer; there is no internet endpoint

  • – Not applicable

    Sign-in with OAuth

    Runs on your computer and uses local settings instead

  • … Not checked yet

    No hidden instructions in tool descriptions

    Runs on your computer; we can only read tool lists from internet endpoints

Published vulnerabilities (OSV.dev)

No entries on OSV.dev for mcp-yandex-metrica@1.5.6

Checks only this package version, not every dependency · checked Nov 15, 2026

What we check → · JSON

Makers: ask for a re-check or report wrong info
For makers: add a badge to your README

If you made this, paste this code into your README. The badge links back to this page.

[![Featured on PopNx MCP](https://mcp.popnx.com/badge/askads-mcp-yandex-metrica.svg)](https://mcp.popnx.com/en/servers/askads-mcp-yandex-metrica)

Discussion

Ask, share a tip or report that it does not work. Sorted by what people marked helpful.

No posts yet. Be the first to ask or share.

Posts here are written by users, not the PopNx team.

Sign in to post

User reviews

No reviews yet

Sign in to write a review

Compared with others in Marketing & social mediai

  • More stars than 96% of the other 4243 servers in this category
  • Published to the registry more recently than 84% of the other 4243 servers in this category
  • Basic checks equal to or better than 99% of the other 4243 servers in this category

Compared with every active server in this category in the registry. Stars count only when the publisher owns the repo.

Common questions

Is Yandex Metrica MCP safe?

It passed 3 of 3 applicable basic checks. We have not read the code. Before adding a key or token, see what access the server asks for and use a key with only the permissions you need.

What keys or codes does it need?

The registry does not list a required key, though some servers ask you to sign in on first use.

Does it run on my computer or in the cloud?

It runs on your computer. Your AI app starts it when needed, and data does not pass through the maker’s servers (unless it calls an online service itself).

Is it still maintained?

The GitHub repo last changed 6 days ago, and the latest version (1.5.6) reached the registry 6 days ago.

Which apps can use it?

Apps that support MCP, such as Claude Desktop, Claude Code, Cursor and VS Code. You also need Node.js on your computer.

What can I use instead?

In the same category: Relaticle, ChatbotX, X (Twitter) MCP Server by Xquik, Betterlytics, BibiGPT YouTube Video Summarizer

Similar alternatives

Same category, other makers, commands already checked. Official ones first, then by stars.

Reading a card:↓ Downloads per weeki★ GitHub starsiThree pillars: reviews · checks · usageiUpdated = latest version published to the registryi

ChatbotX

Omnichannel customer messaging, CRM contacts, flows, sequences, broadcasts, and AI automation.

by ChatbotXIOGrowing★ 1.1K Stars for the whole repoUpdated 14 days ago

Runs in the cloud✓ service owner · chatbotx.io

Betterlytics

Query your Betterlytics web analytics from AI agents: traffic, funnels, journeys, errors, uptime.

by betterlyticsGrowing★ 196Updated 4 months ago

Runs in the cloud✓ service owner · betterlytics.io
Compared with similar ones
This one
Yandex Metrica MCP
RelaticleChatbotXX (Twitter) MCP Server by XquikBetterlyticsBibiGPT YouTube Video Summarizer
Runs whereInstalls on your computerRuns in the cloud, nothing to installRuns in the cloud, nothing to installRuns in the cloud, nothing to installRuns in the cloud, nothing to installRuns in the cloud, nothing to install
Needs a keyNoNoNoNoYesNo
Add with + in ClaudeNoNoNoNoNoNo
Basic checks3/34/44/44/44/44/4
LicenseMITAGPL-3.0NOASSERTIONMITAGPL-3.0MIT
PriceNo cost listed in the registryNo cost listed in the registryNo cost listed in the registryNo cost listed in the registryNo cost listed in the registryNo cost listed in the registry

README from the maker

Open the README

Copied from the maker’s repo as written. PopNx MCP has not reviewed or endorsed it. HTML, images and scripts are removed. Links lead off this site.

Яндекс Метрика MCP

Яндекс Метрика MCP подключает AI-приложение к веб-аналитике сайта. Спросите на естественном языке, откуда приходят посетители, как меняется конверсия или где растёт доля отказов — ассистент возьмёт данные из вашего счётчика и объяснит результат. Подключение начинается прямо в диалоге: не нужно заранее создавать токен или редактировать конфигурацию.

  • Восемь инструментов. Счётчики, цели и отчёты Метрики, подключение и отключение доступа, а также один универсальный запрос к API.
  • Отчёты и конверсии. Визиты, пользователи, просмотры, отказы, длительность визита, источники, устройства и цели за выбранный период.
  • Подключение в чате. Яндекс откроет страницу входа; одноразовый код действует 10 минут, а сервер проверит доступ к счётчикам сразу после подключения.
  • Обычные запросы — только чтение. Специализированные инструменты не меняют счётчики, цели или данные Метрики.
  • Без молчаливого обрезания. В отчёте видны итоговые значения и признак выборки; при большой выдаче сервер отмечает, если упёрся в лимит.

Попробуйте первым сообщением:

Сколько визитов, пользователей и отказов было у моего сайта за последнюю неделю?

Подключить сервер · Посмотреть сценарии · Открыть техническую документацию


Увидеть работу за минуту

Вы: Подключи Яндекс Метрику.

Ассистент: Даёт ссылку на вход в Яндекс. Откройте её под аккаунтом, у которого есть доступ к нужным счётчикам, подтвердите доступ и пришлите показанный код.

Вы: Отправляет код из страницы Яндекса.

Ассистент: Подключает Метрику, проверяет, видны ли счётчики, и сообщает результат. Перезапускать приложение не нужно.

Вы: За последние 30 дней покажи источники трафика и конверсию по цели «Оформление заказа».

Ассистент: Находит цель, строит отчёт по источникам и показывает визиты, достижения цели и конверсию. Если Метрика применила выборку, отмечает, что цифры приблизительные.

Содержание

  • Быстрый старт
  • Что можно поручить
  • Как это работает
  • Что может изменить данные
  • Подключение и настройка
  • Данные и телеметрия
  • Ограничения
  • Техническая документация
  • Поддержка

Быстрый старт

Нужен Node.js 20 или новее. Сервер запускается через npx, поэтому отдельно устанавливать пакет не требуется.

  1. Добавьте сервер в AI-приложение — ниже открыт пример для Codex, остальные приложения собраны в сворачиваемые инструкции.
  2. Напишите: «Подключи Яндекс Метрику». Ассистент проведёт через вход в Яндекс и сразу проверит, что ему видны ваши счётчики.
  3. Задайте первый вопрос, например: «Какие источники дали больше всего визитов за прошлый месяц?»

Codex

Через интерфейс приложения:

  1. Откройте Settings → Plugins → MCP servers.
  2. Нажмите Add server.
  3. Добавьте команду запуска npx -y mcp-yandex-metrica@latest.

Через командную строку:

codex mcp add yandex-metrica -- npx -y mcp-yandex-metrica@latest

Проверьте подключение:

codex mcp list

Затем в чате Codex попросите: «Подключи Яндекс Метрику».

Официальная инструкция Codex

Claude Code

claude mcp add --transport stdio --scope user yandex-metrica -- npx -y mcp-yandex-metrica@latest

Проверьте сервер командой:

claude mcp list

Затем начните диалог с просьбы подключить Метрику.

Документация Claude Code

Claude Desktop

Откройте Settings → Developer → Edit Config и добавьте сервер в claude_desktop_config.json:

{

"mcpServers": { "yandex-metrica": { "command": "npx", "args": ["-y", "mcp-yandex-metrica@latest"] } } }

После сохранения откройте новый диалог и попросите подключить Метрику.

Cursor

Для всех проектов создайте ~/.cursor/mcp.json; только для текущего проекта — .cursor/mcp.json:

{

"mcpServers": { "yandex-metrica": { "command": "npx", "args": ["-y", "mcp-yandex-metrica@latest"] } } }

В чате Cursor сервер появится среди доступных инструментов. Попросите подключить Метрику и пройдите вход через Яндекс.

Документация Cursor

VS Code

Откройте палитру команд и выполните MCP: Open User Configuration. Добавьте в mcp.json:

{

"servers": { "yandex-metrica": { "type": "stdio", "command": "npx", "args": ["-y", "mcp-yandex-metrica@latest"] } } }

Проверьте запуск командой MCP: List Servers, затем откройте чат и попросите подключить Метрику.

Документация VS Code

Что можно поручить

Понять, что происходит с сайтом
  • «Сколько было визитов, пользователей и просмотров за последнюю неделю?»
  • «Покажи динамику посещаемости по дням за июнь».
  • «На каких устройствах доля отказов выше?»
Найти источник трафика и оценить его качество
  • «Покажи источники трафика за месяц и отсортируй по визитам».
  • «Сравни органический поиск и рекламу по пользователям и отказам».
  • «Какие источники дали больше всего переходов на этой неделе?»
Разобраться с конверсиями
  • «Какие цели настроены в счётчике?»
  • «Какая конверсия по цели „Оформление заказа“ за 30 дней?»
  • «Покажи источники, которые принесли больше всего достижений цели».
Проверить доступ и точность данных
  • «Какие счётчики мне доступны?»
  • «Покажи статус подключения к Метрике».
  • «Данные в этом отчёте точные или Метрика использовала выборку?»

Как это работает

Сервер работает с тремя привычными сущностями:

СущностьЧто можно узнать
СчётчикНазвание сайта, его идентификатор и доступность для вашего аккаунта.
ЦельНастроенные на счётчике конверсии и их идентификаторы.
ОтчётМетрики и срезы за период: например, визиты по дням, источникам или устройствам.

Обычно ассистент сначала находит доступный счётчик, затем — при необходимости — цель, и только после этого строит отчёт. В ответе Метрики есть итог по всем строкам, размер выдачи и признак выборки.

Что может изменить данные

ДействиеЧто происходит
Список счётчиков, целей и отчётыТолько чтение данных Метрики.
ПодключениеСохраняет токен доступа локально на вашем компьютере и проверяет его чтением счётчиков. В Метрике ничего не меняет.
ОтключениеУдаляет только сохранённый на компьютере токен. Доступ приложения в Яндекс ID остаётся; его можно отозвать там отдельно.
Произвольный запрос к APIGET читает данные. POST и DELETE могут менять реальные объекты Метрики и выполняются только с confirmWrite=true.

Сервер помечает произвольную запись как потенциально разрушительное действие. Как именно AI-приложение запрашивает подтверждение, зависит от самого приложения; перед таким запросом проверьте путь, метод и данные.

Подключение и настройка

Для обычного использования токен заранее не нужен:

  1. В чате попросите подключить Яндекс Метрику.
  2. Откройте ссылку на Яндекс OAuth под аккаунтом с доступом к нужным счётчикам.
  3. Подтвердите доступ и пришлите код ассистенту. Он действует 10 минут и меняется на токен только внутри работающего сервера.

Сервер использует PKCE: код из чата сам по себе нельзя обменять на токен. Полученный токен хранится локально в ~/.config/mcp-yandex-metrica/credentials.json с правами только для владельца. При сохранённом refresh-токене доступ продлевается автоматически.

Для CI и нестандартных установок доступна настройка через переменные окружения:

ПеременнаяНазначение
YANDEX_METRIKA_TOKENГотовый OAuth-токен с правом metrika:read; имеет приоритет над подключением из чата.
YANDEX_METRIKA_COUNTER_IDСчётчик по умолчанию для запросов без counterId.
YANDEX_METRIKA_OAUTH_CLIENT_IDClient ID собственного OAuth-приложения вместо приложения Ask Ads.
YANDEX_METRIKA_LANGЯзык подписей в ответах API; по умолчанию ru.
YANDEX_METRIKA_TIMEOUT_MSТаймаут запроса; по умолчанию 60 000 мс.
YANDEX_METRIKA_MAX_RETRIESЧисло повторов при временных ошибках; по умолчанию 3.
YANDEX_METRIKA_API_BASEБазовый адрес API; по умолчанию https://api-metrika.yandex.net.

Если используете собственное OAuth-приложение, запросите в нём право «Получение статистики, чтение параметров своих и доверенных счётчиков» (metrika:read).

Данные и телеметрия

По умолчанию сервер отправляет анонимную техническую телеметрию: случайный идентификатор установки, имя события или инструмента, версию сервера, версию Node.js, ОС и сведения о подключившемся AI-клиенте. При вызове инструмента сервер также отправляет его исход, а при ошибке - фрагмент её текста: код и сообщение, в которых e-mail, адреса, токены, числа от 4 цифр и текст в кавычках заменены на «#». Если в тексте ошибки есть значение из запроса, оно тоже может попасть во фрагмент. В телеметрию не попадают токен, данные счётчиков, аргументы инструментов, ваши сообщения и значения переменных окружения.

Чтобы отключить телеметрию для MCP-серверов Ask Ads, задайте переменную окружения:

ASKADS_TELEMETRY=0

Ограничения

  • Выборка Метрики. На больших периодах или сложных отчётах API может вернуть приблизительные данные. Смотрите поля sampled и sample_share; для более точного расчёта сузьте период или используйте accuracy: "full". Если Метрика отклоняет запрос как слишком сложный (400 «Query is too complicated»), сократите период или запросите его частями по месяцу — снижение accuracy не помогает.
  • Размер отчёта. Один запрос возвращает до 10 000 строк. Автоматическая пагинация останавливается не более чем на 100 страницах, 100 000 строках или примерно 1 МБ данных и помечает неполный ответ полем _truncated.
  • Повторы запросов. Таймаут одного запроса — 60 секунд. Сервер делает до трёх повторов при временной ошибке: GET — при сетевой ошибке, 429 и 5xx; POST и DELETE — только при 429, чтобы не повторить изменяющее действие. Задержка учитывает Retry-After и не превышает 30 секунд.
  • Боевые данные. У Метрики нет песочницы. Специализированные инструменты читают данные, но POST и DELETE через произвольный запрос меняют реальные объекты.
  • Нет фонового наблюдения. Сервер работает, когда его вызывает AI-приложение, и сам не следит за показателями. Если приложение поддерживает запланированные задания, можно настроить в нём периодический запрос отчёта.

Техническая документация

Поддержка

Нашли ошиб

Only the beginning is shown; read the rest in the repo