Skip to main content
Glama
askads

Yandex Metrica MCP

Yandex Metrica MCP

npm CI Glama License: MIT

Yandex Metrica MCP 将 AI 应用连接到网站的网络分析。用自然语言提问,访客来自哪里、转化率如何变化、或者跳出率在哪里增长——助手会从您的计数器获取数据并解释结果。连接直接在对话中开始:无需提前创建令牌或编辑配置。

  • 八个工具。 Metrica 的计数器、目标和报告,连接和断开访问,以及一个通用的 API 请求。

  • 报告和转化。 所选期间的访问量、用户数、浏览量、跳出率、访问时长、来源、设备和目标。

  • 聊天中连接。 Yandex 会打开登录页面;一次性代码有效期为 10 分钟,服务器会在连接后立即检查对计数器的访问权限。

  • 常规请求——只读。 专用工具不会修改计数器、目标或 Metrica 数据。

  • 不静默截断。 报告中显示汇总值和抽样标志;当数据量较大时,服务器会标记是否达到限制。

用第一条消息试试:

我的网站上周有多少访问量、用户数和跳出数?

连接服务器 · 查看场景 · 打开技术文档


一分钟了解工作原理

您: 连接 Yandex Metrica。

助手: 提供 Yandex 登录链接。请使用有权访问所需计数器的账户打开它,确认访问权限并发送显示的代码。

您: 发送 Yandex 页面中的代码。

助手: 连接 Metrica,检查计数器是否可见,并报告结果。无需重启应用。

您: 显示最近 30 天的流量来源和「提交订单」目标的转化率。

助手: 找到目标,按来源生成报告,并显示访问量、目标达成数和转化率。如果 Metrica 应用了抽样,会标记数字为近似值。

Related MCP server: ya-metrics-mcp

目录

快速开始

需要 Node.js 20 或更高版本。服务器通过 npx 启动,因此无需单独安装包。

  1. 将服务器添加到 AI 应用——下面是 Codex 的示例,其他应用收集在可折叠说明中。

  2. 输入:「连接 Yandex Metrica」。助手会引导您完成 Yandex 登录,并立即检查它是否能看到您的计数器。

  3. 提出第一个问题,例如:「上个月哪些来源带来的访问量最多?」

通过应用界面:

  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 聊天中请求:「连接 Yandex Metrica」。

Codex 官方说明

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

用命令检查服务器:

claude mcp list

然后以连接 Metrica 的请求开始对话。

Claude Code 文档

打开 Settings → Developer → Edit Config 并将服务器添加到 claude_desktop_config.json:

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

保存后打开新对话并请求连接 Metrica。

为所有项目创建 ~/.cursor/mcp.json;仅当前项目则创建 .cursor/mcp.json:

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

在 Cursor 聊天中,服务器会出现在可用工具中。请求连接 Metrica 并完成 Yandex 登录。

Cursor 文档

打开命令面板并执行 MCP: Open User Configuration。在 mcp.json 中添加:

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

用 MCP: List Servers 命令检查启动,然后打开聊天并请求连接 Metrica。

VS Code 文档

可以委托什么

了解网站情况

  • 「上周有多少访问量、用户数和浏览量?」

  • 「显示六月按天计算的访问量趋势」。

  • 「哪些设备的跳出率更高?」

找到流量来源并评估其质量

  • 「显示一个月的流量来源并按访问量排序」。

  • 「按用户数和跳出率比较自然搜索和广告」。

  • 「本周哪些来源带来的点击最多?」

分析转化

  • 「计数器中配置了哪些目标?」

  • 「「提交订单」目标 30 天的转化率是多少?」

  • 「显示带来最多目标达成的来源」。

检查访问权限和数据准确性

  • 「我可以访问哪些计数器?」

  • 「显示 Metrica 的连接状态」。

  • 「这份报告中的数据是准确的还是 Metrica 使用了抽样?」

工作原理

服务器处理三个常见的实体:

实体

可以了解什么

计数器

网站名称、其标识符以及您的账户是否有访问权限。

目标

计数器上配置的转化及其标识符。

报告

期间内的指标和维度:例如,按天、按来源或按设备的访问量。

通常助手先找到可访问的计数器,然后——如有必要——找到目标,最后才生成报告。Metrica 的响应中包含所有行的汇总、输出大小和抽样标志。

什么可能修改数据

操作

会发生什么

计数器、目标和报告列表

仅读取 Metrica 数据。

连接

将访问令牌本地保存在您的计算机上,并通过读取计数器来验证。不会修改 Metrica 中的任何内容。

断开连接

仅删除保存在计算机上的令牌。应用在 Yandex ID 中的访问权限仍然保留;可以在那里单独撤销。

任意 API 请求

GET 读取数据。POST 和 DELETE 可能修改 Metrica 中的真实对象,并且仅在 confirmWrite=true 时执行。

服务器将任意写入标记为潜在破坏性操作。AI 应用如何请求确认取决于应用本身;在此类请求之前请检查路径、方法和数据。

连接和配置

常规使用无需提前准备令牌:

  1. 在聊天中请求连接 Yandex Metrica。

  2. 使用有权访问所需计数器的账户打开 Yandex OAuth 链接。

  3. 确认访问权限并将代码发送给助手。代码有效期为 10 分钟,并且仅在运行中的服务器内部兑换为令牌。

服务器使用 PKCE:聊天中的代码本身无法兑换为令牌。获取的令牌本地存储在 ~/.config/mcp-yandex-metrica/credentials.json 中,权限仅限所有者。在保存了 refresh-token 的情况下,访问权限会自动续期。

对于 CI 和非标准安装,可以通过环境变量进行配置:

变量

用途

YANDEX_METRIKA_TOKEN

具有 metrika:read 权限的现成 OAuth 令牌;优先于聊天中的连接。

YANDEX_METRIKA_COUNTER_ID

未指定 counterId 时请求使用的默认计数器。

YANDEX_METRIKA_OAUTH_CLIENT_ID

自有 OAuth 应用的 Client ID,替代 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 客户端信息。其中不包含令牌、计数器数据、工具参数、您的消息和环境变量值。

要为 Ask Ads MCP 服务器禁用遥测,请设置环境变量:

ASKADS_TELEMETRY=0

限制

  • Metrica 抽样。 在较长的期间或复杂报告上,API 可能返回近似数据。请查看 sampled 和 sample_share 字段;要获得更精确的计算,请缩小期间或使用 accuracy: "full"。

  • 报告大小。 单个请求最多返回 10 000 行。自动分页最多停止在 100 页、100 000 行或约 1 MB 数据,并用 _truncated 字段标记不完整的响应。

  • 请求重试。 单个请求的超时为 60 秒。服务器在临时错误时最多重试三次:GET——在网络错误、429 和 5xx 时;POST 和 DELETE——仅在 429 时,以避免重复执行修改操作。延迟考虑 Retry-After 且不超过 30 秒。

  • 生产数据。 Metrica 没有沙箱。专用工具读取数据,但通过任意请求的 POST 和 DELETE 会修改真实对象。

  • 无后台监控。 服务器在 AI 应用调用时运行,本身不监控指标。如果应用支持计划任务,可以在其中配置定期报告请求。

技术文档

支持

发现错误或缺少场景?创建 issue 或通过 Telegram 联系我们。

Available Tools

8 tools
auth_statusСтатус подключения к МетрикеA
Read-onlyIdempotent

Показывает, подключена ли Яндекс Метрика: есть ли токен, откуда он взят (переменная окружения YANDEX_METRIKA_TOKEN или сохранённый вход), когда истекает и где лежит файл с сохранёнными данными. Ничего не отправляет в сеть и не показывает сам токен. Вызовите это, если инструменты Метрики отвечают, что подключение не настроено.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A5/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description transparently discloses that the tool does not send anything over the network and does not expose the token itself, effectively communicating its read-only and privacy-preserving nature. This aligns with the annotations and gives additional context beyond basic metadata.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise—two sentences—and efficiently covers the tool's purpose, the information it provides, its side effects, and when to use it. There is no unnecessary verbosity; every sentence contributes to understanding the tool.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the lack of an output schema, the description sufficiently outlines what the tool reports (connection status, token source, expiry, file location) and when to invoke it. It also mentions the tool's non-destructive and non-network nature, providing enough context for a user to decide whether to call it.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has zero parameters, so no parameter descriptions are needed. The description does not need to explain parameters, and the schema reflects this. The description is complete in this regard.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: to show whether Yandex Metrika is connected, including token presence, source, expiry, and file location. It also provides a condition for when to call it (if Metrika tools report connection not configured). This is specific and unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly says when to use the tool: 'Вызовите это, если инструменты Метрики отвечают, что подключение не настроено.' It also mentions that it does not send anything to the network and does not reveal the token, providing clear behavior expectations for users.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

finish_loginЗавершить подключение МетрикиA
Idempotent

Второй шаг подключения: обменивает код подтверждения из start_login на токен доступа, сохраняет его в файл только для владельца (0600) и сразу проверяет живым запросом к Метрике. После успеха остальные инструменты работают немедленно — перезапускать клиент не нужно. Код одноразовый и живёт 10 минут: если он не принят, вызовите start_login заново и попросите свежий.

ParametersJSON Schema
NameRequiredDescriptionDefault
codeYesКод подтверждения, который Яндекс показал пользователю после входа.

TDQS

A4/5.0
Behavior1/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The annotations declare idempotentHint=true, but the description states the code is one-time and that a rejected code requires calling start_login again for a fresh one. Repeated calls with the same arguments are therefore not idempotent, so the description contradicts the annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three dense sentences cover the workflow, file permissions, live verification, postcondition, and recovery path. The main action is front-loaded and every sentence adds value.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description covers the prerequisite, success condition, file permission, and failure recovery, which is strong for a one-parameter tool. However, the misleading idempotentHint leaves retry semantics ambiguous despite the one-time-code warning.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the schema already documents the code parameter. The description adds important meaning beyond the schema: the code comes from start_login, is valid for 10 minutes, and is single-use.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly identifies the tool as the second step of connecting Metrika, specifying that it exchanges the confirmation code from start_login for an access token, saves it, and verifies it with a live request. This distinguishes it from siblings by naming its role and the exact operation it performs.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly says this is the second step after start_login, explains that other tools become usable immediately after success, and tells the agent to call start_login again for a fresh code if the current code is rejected. This is clear when-to-use and recovery guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_statisticsСтатистикаA
Read-onlyIdempotent

Запрашивает Reporting API Яндекс Метрики (stat/v1/data) по счётчику. ПО УМОЛЧАНИЮ возвращает одну строку, агрегированную за период (без измерений), с visits/users/pageviews/bounceRate/avgVisitDurationSeconds. dimensions разбивает результат на строки (ym:s:date — динамика по дням, ym:s:lastTrafficSource — источники трафика, ym:s:deviceCategory — устройства), metrics задаёт нужные метрики — для конверсий это ym:s:goalreaches / ym:s:goalconversionRate (идентификаторы целей даёт list_goals). В ответе есть totals (итог по ВСЕМ строкам — для вопросов «сколько всего» суммировать не нужно), total_rows и sampled/sample_share (sampled=true означает, что данные приблизительные; для точных цифр нужно сузить период или передать accuracy=full). Если counterId не передан, берётся YANDEX_METRIKA_COUNTER_ID.

ParametersJSON Schema
NameRequiredDescriptionDefault
sortNoПоле сортировки; префикс '-' — по убыванию, например -ym:s:visits.
date1NoДата начала: YYYY-MM-DD или относительная (today, yesterday, NdaysAgo). По умолчанию 7daysAgo.
date2NoДата конца: YYYY-MM-DD или относительная (today, yesterday, NdaysAgo). По умолчанию yesterday.
limitNoМаксимум строк на странице (игнорируется, если задан autoPaginate).
offsetNoСмещение по строкам для постраничной выдачи, отсчёт с 1.
filtersNoВыражение фильтра Метрики, например ym:s:deviceCategory=='mobile'.
metricsNoМетрики, например ym:s:visits, ym:s:users, ym:s:bounceRate, ym:s:goal<id>reaches. По умолчанию — типовой набор.
accuracyNoТочность сэмплирования: 'full' — точный расчёт (медленнее) или доля 0..1. По умолчанию — авторежим API.
maxPagesNoЛимит страниц для autoPaginate. По умолчанию 100.
counterIdNoИдентификатор счётчика. По умолчанию YANDEX_METRIKA_COUNTER_ID.
dimensionsNoИзмерения для группировки, например ym:s:date, ym:s:lastTrafficSource, ym:s:deviceCategory. Без них — итог за период.
autoPaginateNoЗабирает все строки, листая страницами максимального для API размера (склеивает data, сохраняет totals). Игнорирует `limit`; ограничен maxPages и лимитами по строкам/байтам (при их достижении выставляет _truncated).

TDQS

A4.4/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already mark it as read-only, idempotent, and non-destructive. The description adds valuable behavioral context: default returns a single aggregated row, totals field should not be summed, sampling with sample/accuracy behavior, autoPaginate semantics, and default counter/env variable fallback. This goes well beyond the structured annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single dense paragraph, but it is logically organized: purpose, default behavior, dimensions/metrics, response semantics, then default counter. Though long, it avoids waste and includes practical notes (autoPaginate, sampling). Loses a point for lack of bullet points or clear sections.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Covers default values (date range, limit, counter), response structure (totals, pagination), and sampling behavior. Missing explicit error cases or output schema, but annotations and parameter descriptions cover most operational needs. It's solid for an API wrapper.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema covers all parameters with descriptions, but the tool description adds crucial usage context: date formats and relatives, goal ID format (from get_goals), explanation of autoPaginate, and the meaning of `–` prefix for sort. This materially helps an agent set parameters correctly.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Сообщается конкретный глагол + ресурс:

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description mentions that goal IDs come from get_goals, implying a relationship, and states defaults for date range and counter ID allocations. However, it does not explicitly state when to prefer this tool over get_analytics, get_visits, or raw_request, nor does it state when not to use it.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_countersСписок счётчиков МетрикиA
Read-onlyIdempotent

Возвращает счётчики Яндекс Метрики, доступные токену (Management API). У каждого счётчика есть id, name и site2 (домен сайта) — id используется в get_statistics и list_goals. Фильтр по подстроке имени или сайта задаётся параметром search.

ParametersJSON Schema
NameRequiredDescriptionDefault
offsetNoСмещение для постраничной выдачи, отсчёт с 1.
searchNoПодстрока для фильтра счётчиков по имени или сайту, без учёта регистра.
perPageNoМаксимум счётчиков в ответе. По умолчанию 100.

TDQS

A4.2/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description discloses that the tool returns counters with id, name, and site2, and that it supports a search filter. It does not contradict the annotations (read-only, idempotent, non-destructive). It does not mention rate limits or errors, but for a simple read operation this is acceptable. The behavior is transparent enough.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise and front-loaded, stating the main purpose in the first clause. It includes relevant supplementary information (id usage in other tools) without unnecessary verbosity. The structure is clear and free of redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple read operation, the description is complete. It explains what the tool returns (counters with specific fields) and mentions the search filter, which is the main functionality. Pagination is implicit via the schema's offset and perPage parameters. The lack of an output schema is compensated by the description of the returned fields. It is adequate for an agent to use correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description adds little beyond the schema: the search parameter is described in the schema as a substring filter, and the description repeats that. The mention of counter fields (id, name, site2) is about the response, not parameters. Since schema coverage is 100% and descriptions are provided, the baseline is 3, and the description does not elevate it.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool returns Yandex Metrika counters available to the token, and it specifically mentions that the id field is used in related tools (get_statistics and list_goals), which helps differentiate it from those tools. The verb 'Returns' is precise, and the resource is unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage by stating that the id from counters is used in get_statistics and list_goals, suggesting this tool is a prerequisite for those operations. It also explains the search parameter for filtering. However, it does not explicitly state 'when to use this tool vs alternatives' in direct terms, but the context is sufficient.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_goalsСписок целей счётчикаA
Read-onlyIdempotent

Возвращает цели (конверсии), настроенные на счётчике Метрики (Management API). Идентификаторы целей нужны, чтобы запросить метрики конверсий (ym:s:goalreaches / ym:s:goalconversionRate) в get_statistics. Если counterId не передан, берётся YANDEX_METRIKA_COUNTER_ID.

ParametersJSON Schema
NameRequiredDescriptionDefault
counterIdNoИдентификатор счётчика. По умолчанию YANDEX_METRIKA_COUNTER_ID.

TDQS

A4.4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already indicate readOnly, idempotent, and non-destructive behavior. The description adds transparency by mentioning the default counterId (YANDEX_METRIKA_COUNTER_ID) and that it uses the Management API, providing useful context without conflicting with annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise: it states the main purpose, the use case, and the default behavior in three short sentences. The parameter description is also brief and to the point. No unnecessary details or redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description provides enough context for an agent to understand when and why to call this tool: to fetch goal IDs for conversion metrics in get_statistics, with a default counterId. It does not detail the return structure, but given the simple listing nature and lack of output schema, this is acceptable. The mention of Management API adds relevant context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The parameter counterId is described in the schema, and the description reinforces its role and default. The description adds context about why the parameter matters (goal IDs for conversion metrics), but the core parameter semantics are already clear from the schema, so the added value is moderate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Возвращает цели (конверсии), настроенные на счётчике Метрики' (Returns goals configured on the Metrika counter). It also distinguishes itself from siblings by specifying it's for listing goals, not counters or statistics, and explains the relevance to get_statistics.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies when to use this tool: to obtain goal IDs needed for conversion metrics in get_statistics. It also notes the default counterId behavior. However, it does not explicitly contrast with sibling tools like list_counters, though the purpose is clear enough.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

logoutОтключить МетрикуA
Destructive

Удаляет сохранённый токен Метрики с диска. Токен, заданный переменной окружения YANDEX_METRIKA_TOKEN, не трогает — его нужно убирать из конфигурации клиента вручную. Доступ, выданный приложению, остаётся активным на стороне Яндекса: отозвать его можно в Яндекс ID.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A4.6/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The annotations already indicate destructiveHint=true, but the description adds important context: what exactly is deleted, what remains (env token), and that the app's access stays active on Yandex's side. This exceeds what annotations provide alone.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three sentences, each providing distinct value: the primary action, the exception, and the side effect. No fluff or redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a no-parameter destructive action with robust annotations and no output schema, the description fully covers what an agent needs to know: what is affected, what isn't, and the external implication.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

There are zero parameters, so the description doesn't need to explain any. It correctly focuses on the effect of the operation itself.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states that the tool removes the saved Metrika token from disk, and distinguishes it from the environment variable token. It uses precise language and is not a tautology.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explains what the tool does and explicitly mentions what it does NOT do (env var token). It doesn't explicitly compare to siblings like start_login or finish_login, but the context makes it clear this is a logout operation.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

raw_requestПроизвольный запрос к API Яндекс МетрикиA
Destructive

Универсальный запрос: обращается напрямую к любому пути API Яндекс Метрики — например "management/v1/counters", "management/v1/counter/{id}/goals", "stat/v1/data". Нужен для эндпоинтов, у которых нет отдельного инструмента. query уходит в строку запроса, body отправляется как JSON для POST. GET выполняется свободно; POST и DELETE — это запись, им нужен confirmWrite=true.

ParametersJSON Schema
NameRequiredDescriptionDefault
bodyNoТело запроса в JSON для POST.
pathYesПуть API, например "stat/v1/data" или "management/v1/counter/12345/goals".
queryNoПараметры строки запроса (ids, metrics, dimensions, date1, date2, ...).
methodNoHTTP-метод. По умолчанию GET.
confirmWriteNoДолжен быть true для записи (POST или DELETE).

TDQS

A4.4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Given destructiveHint=true and readOnlyHint=false in annotations, the description adds crucial context about write operations requiring confirmWrite=true, which is not in the annotations. It also mentions that POST/DELETE are write operations. However, it doesn't detail what is destroyed or the exact consequences, but the annotations already set the destructive nature, and the description adds a practical guard.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise, front-loaded with the purpose, and each sentence earns its place. It includes examples, usage conditions, and parameter behavior without redundancy. The structure is efficient and easy to scan.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with 5 parameters and nested objects, the description together with the schema provides adequate guidance. It lacks mention of response format, but there is no output schema, and for a generic request tool, response behavior is inherently variable. It covers the essential aspects: when to use, how authentication works implied, and write confirmation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all parameters. The description adds value by explaining the role of 'query' as query string parameters and 'body' as JSON for POST, which aligns with the schema. However, it doesn't add much beyond the schema for paths, method defaults, or confirmWrite requirements beyond what the schema describes.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states it is a universal request tool that directly accesses any path of the Yandex Metrica API, with concrete examples. It also explicitly notes it is for endpoints without a dedicated tool, distinguishing it from siblings like list_counters and get_statistics.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It explicitly says when to use it (for endpoints without a dedicated tool) and implies when not to (when a dedicated tool exists). It also provides conditions for POST/DELETE requiring confirmWrite=true, and notes GET is free. This effectively routes agents to the right tool.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

start_loginНачать подключение МетрикиA
Read-onlyIdempotent

Первый шаг подключения Яндекс Метрики без правки конфигурации и без перезапуска клиента. Возвращает ссылку на страницу Яндекс OAuth. Покажите ссылку пользователю целиком и попросите: открыть её в браузере под аккаунтом, у которого есть доступ к нужным счётчикам, подтвердить доступ и прислать показанный код подтверждения. Полученный код передайте в finish_login. Код действует 10 минут. Сам по себе код бесполезен для постороннего: обменять его может только этот сервер.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A4.6/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The annotations already declare readOnlyHint, openWorldHint, idempotentHint, and destructiveHint false. The description adds meaningful behavioral context beyond those hints: no config editing or client restart is required, the code expires in 10 minutes, and the code can only be exchanged by this server. It does not discuss exact return URL format or error conditions, but the safety profile is already covered by annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Every sentence adds a distinct piece of information: the step's role, the no-config/no-restart property, the returned link, the exact user actions, the handoff to finish_login, the 10-minute validity, and the security property. There is no filler or repetition.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a zero-parameter first step of a two-step flow, the description is nearly complete: it explains what is returned, what the user must do, where the code goes next, and the code lifetime. It does not mention what to do if the user is already authenticated, but that is a minor gap given the sibling auth_status tool and the focused scope.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has zero parameters, so the schema carries no burden; the baseline is 4. The description clarifies that no configuration changes are needed and focuses on the returned OAuth link rather than any inputs, which is sufficient for a parameterless tool.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with 'Первый шаг подключения Яндекс Метрики', naming a specific action (starting Yandex Metrika OAuth connection) and its resource. It also differentiates itself from the sibling finish_login by explicitly stating that the received code must be passed to finish_login, so an agent can distinguish the two halves of the flow.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit user-facing instructions: show the full link, ask the user to open it in a browser under an account with access to the needed counters, confirm access, and send back the confirmation code. It also names the follow-up tool finish_login, making the intended sequence unambiguous.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 8 tool updatesv1.4.1
    • Addedauth_status
    • Addedfinish_login
    • Changedget_statistics12 fields changed
      • changedInput schema / properties / accuracy / description
        Previous value: -"Sampling accuracy: 'full' for exact (slower), or a 0..1 share. Default the API's auto."New value: +"Точность сэмплирования: 'full' — точный расчёт (медленнее) или доля 0..1. По умолчанию — авторежим API."
      • changedInput schema / properties / autoPaginate / description
        Previous value: -"Fetch all rows by following the API-max page size (merges data, carries totals). Ignores `limit`; capped by maxPages and by row/byte limits (flags _truncated when hit)."New value: +"Забирает все строки, листая страницами максимального для API размера (склеивает data, сохраняет totals). Игнорирует `limit`; ограничен maxPages и лимитами по строкам/байтам (при их достижении выставляет _truncated)."
      • changedInput schema / properties / counterId / description
        Previous value: -"Counter id. Defaults to YANDEX_METRIKA_COUNTER_ID."New value: +"Идентификатор счётчика. По умолчанию YANDEX_METRIKA_COUNTER_ID."
      • changedInput schema / properties / date1 / description
        Previous value: -"Start date YYYY-MM-DD or relative (today, yesterday, NdaysAgo). Default 7daysAgo."New value: +"Дата начала: YYYY-MM-DD или относительная (today, yesterday, NdaysAgo). По умолчанию 7daysAgo."
      • changedInput schema / properties / date2 / description
        Previous value: -"End date YYYY-MM-DD or relative (today, yesterday, NdaysAgo). Default yesterday."New value: +"Дата конца: YYYY-MM-DD или относительная (today, yesterday, NdaysAgo). По умолчанию yesterday."
      • changedInput schema / properties / dimensions / description
        Previous value: -"Group-by dimensions, e.g. ym:s:date, ym:s:lastTrafficSource, ym:s:deviceCategory. Omit for a period total."New value: +"Измерения для группировки, например ym:s:date, ym:s:lastTrafficSource, ym:s:deviceCategory. Без них — итог за период."
      • changedInput schema / properties / filters / description
        Previous value: -"Metrica filter expression, e.g. ym:s:deviceCategory=='mobile'."New value: +"Выражение фильтра Метрики, например ym:s:deviceCategory=='mobile'."
      • changedInput schema / properties / limit / description
        Previous value: -"Max rows per page (ignored when autoPaginate is set)."New value: +"Максимум строк на странице (игнорируется, если задан autoPaginate)."
      • changedInput schema / properties / maxPages / description
        Previous value: -"Page cap for autoPaginate. Default 100."New value: +"Лимит страниц для autoPaginate. По умолчанию 100."
      • changedInput schema / properties / metrics / description
        Previous value: -"Metrics, e.g. ym:s:visits, ym:s:users, ym:s:bounceRate, ym:s:goal<id>reaches. Defaults to a common set."New value: +"Метрики, например ym:s:visits, ym:s:users, ym:s:bounceRate, ym:s:goal<id>reaches. По умолчанию — типовой набор."
      • changedInput schema / properties / offset / description
        Previous value: -"1-based row offset for pagination."New value: +"Смещение по строкам для постраничной выдачи, отсчёт с 1."
      • changedInput schema / properties / sort / description
        Previous value: -"Sort field; prefix with '-' for descending, e.g. -ym:s:visits."New value: +"Поле сортировки; префикс '-' — по убыванию, например -ym:s:visits."
    • Changedlist_counters3 fields changed
      • changedInput schema / properties / offset / description
        Previous value: -"1-based offset for pagination."New value: +"Смещение для постраничной выдачи, отсчёт с 1."
      • changedInput schema / properties / perPage / description
        Previous value: -"Max counters to return. Default 100."New value: +"Максимум счётчиков в ответе. По умолчанию 100."
      • changedInput schema / properties / search / description
        Previous value: -"Case-insensitive substring to filter counters by name or site."New value: +"Подстрока для фильтра счётчиков по имени или сайту, без учёта регистра."
    • Changedlist_goals1 field changed
      • changedInput schema / properties / counterId / description
        Previous value: -"Counter id. Defaults to YANDEX_METRIKA_COUNTER_ID."New value: +"Идентификатор счётчика. По умолчанию YANDEX_METRIKA_COUNTER_ID."
    • Addedlogout
    • Changedraw_request5 fields changed
      • changedInput schema / properties / body / description
        Previous value: -"JSON body for POST requests."New value: +"Тело запроса в JSON для POST."
      • changedInput schema / properties / confirmWrite / description
        Previous value: -"Must be true for a write (POST or DELETE)."New value: +"Должен быть true для записи (POST или DELETE)."
      • changedInput schema / properties / method / description
        Previous value: -"HTTP method. Default GET."New value: +"HTTP-метод. По умолчанию GET."
      • changedInput schema / properties / path / description
        Previous value: -"API path, e.g. \"stat/v1/data\" or \"management/v1/counter/12345/goals\"."New value: +"Путь API, например \"stat/v1/data\" или \"management/v1/counter/12345/goals\"."
      • changedInput schema / properties / query / description
        Previous value: -"Query string parameters (ids, metrics, dimensions, date1, date2, ...)."New value: +"Параметры строки запроса (ids, metrics, dimensions, date1, date2, ...)."
    • Addedstart_login
  2. 1 tool updatev1.0.2
    • Changedget_statistics11 fields changed
      • addedInput schema / properties / accuracy / anyOf
        Added value: +[
        +  {
        +    "type": "string"
        +  },
        +  {
        +    "maximum": 1,
        +    "minimum": 0,
        +    "type": "number"
        +  }
        +]
      • changedInput schema / properties / accuracy / description
        Previous value: -"Sampling accuracy: 'full' for exact (slower), or 0..1. Default the API's auto."New value: +"Sampling accuracy: 'full' for exact (slower), or a 0..1 share. Default the API's auto."
      • removedInput schema / properties / accuracy / type
        Removed value: -"string"
      • changedInput schema / properties / autoPaginate / description
        Previous value: -"Fetch all rows by following limit/offset (merges data, carries totals)."New value: +"Fetch all rows by following the API-max page size (merges data, carries totals). Ignores `limit`; capped by maxPages and by row/byte limits (flags _truncated when hit)."
      • removedInput schema / properties / date2 / $ref
        Removed value: -"#/properties/date1"
      • changedInput schema / properties / date2 / description
        Previous value: -"End date YYYY-MM-DD or relative. Default yesterday."New value: +"End date YYYY-MM-DD or relative (today, yesterday, NdaysAgo). Default yesterday."
      • addedInput schema / properties / date2 / pattern
        Added value: +"^(\\d{4}-\\d{2}-\\d{2}|today|yesterday|\\d+daysAgo)$"
      • addedInput schema / properties / date2 / type
        Added value: +"string"
      • changedInput schema / properties / limit / description
        Previous value: -"Max rows per page."New value: +"Max rows per page (ignored when autoPaginate is set)."
      • changedInput schema / properties / limit / maximum
        Previous value: -100000New value: +10000
      • addedInput schema / properties / maxPages
        Added value: +{
        +  "description": "Page cap for autoPaginate. Default 100.",
        +  "maximum": 1000,
        +  "minimum": 1,
        +  "type": "integer"
        +}
  3. 4 tool updatesv1.0.0
    • First observedget_statistics
    • First observedlist_counters
    • First observedlist_goals
    • First observedraw_request

TDQS

A4.4/5.0

Scored across 8 tools

Disambiguation5/5

Each tool has a clear, distinct role: auth status, login/logout flow, listing counters/goals, fetching statistics, and a generic raw request. No two tools overlap in purpose, and even similar operations (list_goals vs list_counters) are clearly differentiated by resource type.

Naming Consistency4/5

The naming is predominantly verb_noun in lowercase snake_case (list_goals, get_statistics, start_login, finish_login). Minor deviations: 'auth_status' and 'logout' are not strictly verb_noun, but they follow the same case style and are idiomatic for their actions. The overall pattern is consistent.

Tool Count5/5

Eight tools is a well‑scoped set for a Yandex Metrica MCP server. It covers authentication (3 tools), resource listing (3 tools), statistics (1 tool), and a flexible raw API access (1 tool) without being bloated or insufficient.

Completeness5/5

The tool set comprehensively addresses the core Yandex Metrica workflows: authentication, listing counters and goals, retrieving statistics, and raw access to any API endpoint. The inclusion of raw_request fills any gaps for operations not covered by dedicated tools, ensuring no dead ends.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    D
    maintenance
    A Model Context Protocol (MCP) server that provides access to Yandex Metrika analytics data through various tools and functions. This server allows AI assistants and applications to retrieve comprehensive analytics data from Yandex Metrika accounts.
    1
    -
  • A
    license
    Not graded
    quality
    D
    maintenance
    Read-only MCP server for Yandex Metrika analytics, enabling report retrieval via MCP clients like Claude Code or Cursor without modifying any data.
    17 npm
    MIT
  • A
    license
    A
    quality
    A
    maintenance
    MCP server for Yandex Metrica — query your web analytics in plain language from Claude, Cursor, and other AI agents. Secretless one-command login (PKCE), read-only, TypeScript.
    12
    154 npm
    14
    MIT