Yandex Metrica MCP
Yandex Metrica MCP
Yandex Metrica MCP는 AI 애플리케이션을 웹사이트 웹 분석에 연결합니다. 방문자가 어디에서 오는지, 전환율이 어떻게 변하는지, 이탈률이 어디에서 증가하는지 자연어로 물어보세요 — 어시스턴트가 카운터에서 데이터를 가져와 결과를 설명합니다. 연결은 대화 중에 바로 시작됩니다: 토큰을 미리 만들거나 구성을 편집할 필요가 없습니다.
8가지 도구. Metrica의 카운터, 목표 및 보고서, 액세스 연결 및 해제, 그리고 API에 대한 범용 요청 하나.
보고서 및 전환. 선택한 기간의 방문, 사용자, 조회수, 이탈, 방문 시간, 소스, 기기 및 목표.
채팅에서 연결. Yandex가 로그인 페이지를 엽니다. 일회용 코드는 10분 동안 유효하며, 서버는 연결 직후 카운터에 대한 액세스를 확인합니다.
일반 요청은 읽기 전용. 전용 도구는 Metrica의 카운터, 목표 또는 데이터를 변경하지 않습니다.
조용한 잘림 없음. 보고서에 합계 값과 샘플링 표시가 표시됩니다. 결과가 많을 때 서버는 한도에 도달했는지 표시합니다.
첫 메시지로 시도해 보세요:
지난주 내 사이트의 방문, 사용자 및 이탈 수는 얼마였나요?
1분 만에 작동 확인
사용자: Yandex Metrica를 연결하세요.
어시스턴트: Yandex 로그인 링크를 제공합니다. 필요한 카운터에 액세스 권한이 있는 계정으로 열고, 액세스를 확인한 후 표시된 코드를 보내주세요.
사용자: Yandex 페이지의 코드를 보냅니다.
어시스턴트: Metrica를 연결하고, 카운터가 보이는지 확인한 후 결과를 알려줍니다. 애플리케이션을 다시 시작할 필요가 없습니다.
사용자: 지난 30일 동안 트래픽 소스와 '주문 완료' 목표의 전환율을 보여주세요.
어시스턴트: 목표를 찾고, 소스별 보고서를 작성하여 방문, 목표 달성 및 전환율을 보여줍니다. Metrica가 샘플링을 적용한 경우 숫자가 근사치임을 표시합니다.
Related MCP server: ya-metrics-mcp
목차
빠른 시작
Node.js 20 이상이 필요합니다. 서버는 npx를 통해 실행되므로 패키지를 별도로 설치할 필요가 없습니다.
AI 애플리케이션에 서버를 추가하세요 — 아래에 Codex용 예시가 열려 있고, 나머지 애플리케이션은 접이식 지침에 모아져 있습니다.
"Yandex Metrica를 연결하세요"라고 작성하세요. 어시스턴트가 Yandex 로그인을 안내하고 카운터가 보이는지 즉시 확인합니다.
첫 질문을 하세요. 예: "지난달 가장 많은 방문을 가져온 소스는 무엇인가요?"
애플리케이션 인터페이스를 통해:
Settings → Plugins → MCP servers를 엽니다.
Add server를 클릭합니다.
실행 명령
npx -y mcp-yandex-metrica@latest를 추가합니다.
명령줄을 통해:
codex mcp add yandex-metrica -- npx -y mcp-yandex-metrica@latest연결을 확인하세요:
codex mcp list그런 다음 Codex 채팅에서 "Yandex Metrica를 연결하세요"라고 요청하세요.
claude mcp add --transport stdio --scope user yandex-metrica -- npx -y mcp-yandex-metrica@latest다음 명령으로 서버를 확인하세요:
claude mcp list그런 다음 Metrica 연결 요청으로 대화를 시작하세요.
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 로그인을 진행하세요.
명령 팔레트를 열고 MCP: Open User Configuration을 실행하세요. mcp.json에 추가하세요:
{
"servers": {
"yandex-metrica": {
"type": "stdio",
"command": "npx",
"args": ["-y", "mcp-yandex-metrica@latest"]
}
}
}MCP: List Servers 명령으로 실행을 확인한 다음, 채팅을 열고 Metrica 연결을 요청하세요.
무엇을 맡길 수 있나요
사이트 상황 이해하기
"지난주 방문, 사용자 및 조회수는 얼마였나요?"
"6월의 일별 방문 추이를 보여주세요."
"어떤 기기에서 이탈률이 더 높나요?"
트래픽 소스 찾기 및 품질 평가
"한 달간 트래픽 소스를 방문 수 기준으로 정렬하여 보여주세요."
"유기 검색과 광고를 사용자 및 이탈 기준으로 비교하세요."
"이번 주에 가장 많은 전환을 가져온 소스는 무엇인가요?"
전환 분석
"카운터에 설정된 목표는 무엇인가요?"
"30일 동안 '주문 완료' 목표의 전환율은 얼마인가요?"
"목표 달성을 가장 많이 가져온 소스를 보여주세요."
액세스 및 데이터 정확성 확인
"어떤 카운터에 액세스할 수 있나요?"
"Metrica 연결 상태를 보여주세요."
"이 보고서의 데이터는 정확한가요, 아니면 Metrica가 샘플링을 사용했나요?"
작동 방식
서버는 세 가지 익숙한 엔티티로 작동합니다:
엔티티 | 알 수 있는 것 |
카운터 | 사이트 이름, 식별자 및 계정에 대한 액세스 가능 여부. |
목표 | 카운터에 설정된 전환 및 해당 식별자. |
보고서 | 기간별 지표 및 차원: 예: 일별, 소스별 또는 기기별 방문. |
일반적으로 어시스턴트는 먼저 액세스 가능한 카운터를 찾고, 필요한 경우 목표를 찾은 다음에만 보고서를 작성합니다. Metrica 응답에는 모든 행의 합계, 결과 크기 및 샘플링 표시가 있습니다.
데이터를 변경할 수 있는 것
작업 | 결과 |
카운터, 목표 목록 및 보고서 | Metrica 데이터 읽기 전용. |
연결 | 액세스 토큰을 컴퓨터에 로컬로 저장하고 카운터를 읽어 확인합니다. Metrica에서는 아무것도 변경하지 않습니다. |
연결 해제 | 컴퓨터에 저장된 토큰만 삭제합니다. Yandex ID의 애플리케이션 액세스는 유지되며, 별도로 취소할 수 있습니다. |
임의 API 요청 |
|
서버는 임의 쓰기를 잠재적으로 파괴적인 작업으로 표시합니다. AI 애플리케이션이 확인을 요청하는 방식은 애플리케이션에 따라 다릅니다. 이러한 요청 전에 경로, 메서드 및 데이터를 확인하세요.
연결 및 설정
일반적인 사용에는 토큰이 미리 필요하지 않습니다:
채팅에서 Yandex Metrica 연결을 요청하세요.
필요한 카운터에 액세스 권한이 있는 계정으로 Yandex OAuth 링크를 여세요.
액세스를 확인하고 코드를 어시스턴트에게 보내세요. 코드는 10분 동안 유효하며 실행 중인 서버 내에서만 토큰으로 교환됩니다.
서버는 PKCE를 사용합니다: 채팅의 코드 자체만으로는 토큰으로 교환할 수 없습니다. 얻은 토큰은 ~/.config/mcp-yandex-metrica/credentials.json에 소유자 전용 권한으로 로컬에 저장됩니다. refresh 토큰이 저장되어 있으면 액세스가 자동으로 갱신됩니다.
CI 및 비표준 설치의 경우 환경 변수를 통한 설정이 가능합니다:
변수 | 용도 |
|
|
|
|
| Ask Ads 애플리케이션 대신 자체 OAuth 애플리케이션의 Client ID. |
| API 응답의 레이블 언어. 기본값은 |
| 요청 타임아웃. 기본값 60,000ms. |
| 일시적 오류 시 재시도 횟수. 기본값 3. |
| API 기본 주소. 기본값 |
자체 OAuth 애플리케이션을 사용하는 경우, 해당 애플리케이션에서 "통계 가져오기, 자신 및 신뢰할 수 있는 카운터의 매개변수 읽기" (metrika:read) 권한을 요청하세요.
데이터 및 텔레메트리
기본적으로 서버는 익명의 기술 텔레메트리를 전송합니다: 무작위 설치 식별자, 이벤트 또는 도구 이름, 서버 버전, Node.js 버전, OS 및 연결된 AI 클라이언트 정보. 토큰, 카운터 데이터, 도구 인수, 사용자 메시지 및 환경 변수 값은 포함되지 않습니다.
Ask Ads MCP 서버의 텔레메트리를 비활성화하려면 환경 변수를 설정하세요:
ASKADS_TELEMETRY=0제한 사항
Metrica 샘플링. 긴 기간이나 복잡한 보고서에서 API가 근사 데이터를 반환할 수 있습니다.
sampled및sample_share필드를 확인하세요. 더 정확한 계산을 위해 기간을 좁히거나accuracy: "full"을 사용하세요.보고서 크기. 단일 요청은 최대 10,000행을 반환합니다. 자동 페이지네이션은 최대 100페이지, 100,000행 또는 약 1MB 데이터에서 중지되며 불완전한 응답을
_truncated필드로 표시합니다.요청 재시도. 단일 요청 타임아웃은 60초입니다. 서버는 일시적 오류 시 최대 3회 재시도합니다:
GET— 네트워크 오류,429및5xx시;POST및DELETE— 변경 작업을 반복하지 않도록429에서만. 지연은Retry-After를 고려하며 30초를 초과하지 않습니다.실제 데이터. Metrica에는 샌드박스가 없습니다. 전용 도구는 데이터를 읽지만, 임의 요청을 통한
POST및DELETE는 실제 객체를 변경합니다.백그라운드 모니터링 없음. 서버는 AI 애플리케이션이 호출할 때 작동하며 자체적으로 지표를 추적하지 않습니다. 애플리케이션이 예약 작업을 지원하는 경우 주기적인 보고서 요청을 설정할 수 있습니다.
기술 문서
MCP 기능 카탈로그 — 각 도구의 사용자 작업별 페이지.
모든 도구 — 각 도구의 매개변수, 응답 및 경계.
개발 문서 — 프로젝트 구조 및 데모 작업.
지원
Available Tools
8 toolsauth_statusСтатус подключения к МетрикеARead-onlyIdempotent
Показывает, подключена ли Яндекс Метрика: есть ли токен, откуда он взят (переменная окружения YANDEX_METRIKA_TOKEN или сохранённый вход), когда истекает и где лежит файл с сохранёнными данными. Ничего не отправляет в сеть и не показывает сам токен. Вызовите это, если инструменты Метрики отвечают, что подключение не настроено.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
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.
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.
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.
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.
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.
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Завершить подключение МетрикиAIdempotent
Второй шаг подключения: обменивает код подтверждения из start_login на токен доступа, сохраняет его в файл только для владельца (0600) и сразу проверяет живым запросом к Метрике. После успеха остальные инструменты работают немедленно — перезапускать клиент не нужно. Код одноразовый и живёт 10 минут: если он не принят, вызовите start_login заново и попросите свежий.
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | Код подтверждения, который Яндекс показал пользователю после входа. |
TDQS
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.
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.
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.
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.
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.
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СтатистикаARead-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.
| Name | Required | Description | Default |
|---|---|---|---|
| sort | No | Поле сортировки; префикс '-' — по убыванию, например -ym:s:visits. | |
| date1 | No | Дата начала: YYYY-MM-DD или относительная (today, yesterday, NdaysAgo). По умолчанию 7daysAgo. | |
| date2 | No | Дата конца: YYYY-MM-DD или относительная (today, yesterday, NdaysAgo). По умолчанию yesterday. | |
| limit | No | Максимум строк на странице (игнорируется, если задан autoPaginate). | |
| offset | No | Смещение по строкам для постраничной выдачи, отсчёт с 1. | |
| filters | No | Выражение фильтра Метрики, например ym:s:deviceCategory=='mobile'. | |
| metrics | No | Метрики, например ym:s:visits, ym:s:users, ym:s:bounceRate, ym:s:goal<id>reaches. По умолчанию — типовой набор. | |
| accuracy | No | Точность сэмплирования: 'full' — точный расчёт (медленнее) или доля 0..1. По умолчанию — авторежим API. | |
| maxPages | No | Лимит страниц для autoPaginate. По умолчанию 100. | |
| counterId | No | Идентификатор счётчика. По умолчанию YANDEX_METRIKA_COUNTER_ID. | |
| dimensions | No | Измерения для группировки, например ym:s:date, ym:s:lastTrafficSource, ym:s:deviceCategory. Без них — итог за период. | |
| autoPaginate | No | Забирает все строки, листая страницами максимального для API размера (склеивает data, сохраняет totals). Игнорирует `limit`; ограничен maxPages и лимитами по строкам/байтам (при их достижении выставляет _truncated). |
TDQS
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.
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.
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.
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.
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.
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Список счётчиков МетрикиARead-onlyIdempotent
Возвращает счётчики Яндекс Метрики, доступные токену (Management API). У каждого счётчика есть id, name и site2 (домен сайта) — id используется в get_statistics и list_goals. Фильтр по подстроке имени или сайта задаётся параметром search.
| Name | Required | Description | Default |
|---|---|---|---|
| offset | No | Смещение для постраничной выдачи, отсчёт с 1. | |
| search | No | Подстрока для фильтра счётчиков по имени или сайту, без учёта регистра. | |
| perPage | No | Максимум счётчиков в ответе. По умолчанию 100. |
TDQS
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.
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.
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.
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.
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.
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Список целей счётчикаARead-onlyIdempotent
Возвращает цели (конверсии), настроенные на счётчике Метрики (Management API). Идентификаторы целей нужны, чтобы запросить метрики конверсий (ym:s:goalreaches / ym:s:goalconversionRate) в get_statistics. Если counterId не передан, берётся YANDEX_METRIKA_COUNTER_ID.
| Name | Required | Description | Default |
|---|---|---|---|
| counterId | No | Идентификатор счётчика. По умолчанию YANDEX_METRIKA_COUNTER_ID. |
TDQS
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.
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.
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.
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.
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.
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Отключить МетрикуADestructive
Удаляет сохранённый токен Метрики с диска. Токен, заданный переменной окружения YANDEX_METRIKA_TOKEN, не трогает — его нужно убирать из конфигурации клиента вручную. Доступ, выданный приложению, остаётся активным на стороне Яндекса: отозвать его можно в Яндекс ID.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
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.
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.
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.
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.
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.
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 Яндекс МетрикиADestructive
Универсальный запрос: обращается напрямую к любому пути API Яндекс Метрики — например "management/v1/counters", "management/v1/counter/{id}/goals", "stat/v1/data". Нужен для эндпоинтов, у которых нет отдельного инструмента. query уходит в строку запроса, body отправляется как JSON для POST. GET выполняется свободно; POST и DELETE — это запись, им нужен confirmWrite=true.
| Name | Required | Description | Default |
|---|---|---|---|
| body | No | Тело запроса в JSON для POST. | |
| path | Yes | Путь API, например "stat/v1/data" или "management/v1/counter/12345/goals". | |
| query | No | Параметры строки запроса (ids, metrics, dimensions, date1, date2, ...). | |
| method | No | HTTP-метод. По умолчанию GET. | |
| confirmWrite | No | Должен быть true для записи (POST или DELETE). |
TDQS
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.
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.
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.
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.
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.
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Начать подключение МетрикиARead-onlyIdempotent
Первый шаг подключения Яндекс Метрики без правки конфигурации и без перезапуска клиента. Возвращает ссылку на страницу Яндекс OAuth. Покажите ссылку пользователю целиком и попросите: открыть её в браузере под аккаунтом, у которого есть доступ к нужным счётчикам, подтвердить доступ и прислать показанный код подтверждения. Полученный код передайте в finish_login. Код действует 10 минут. Сам по себе код бесполезен для постороннего: обменять его может только этот сервер.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
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.
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.
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.
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.
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.
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.
8 tool updates
v1.4.1- Added
auth_status - Added
finish_login - Changed
get_statistics12 fields changed- changed
Input schema / properties / accuracy / descriptionPrevious value: -"Sampling accuracy: 'full' for exact (slower), or a 0..1 share. Default the API's auto."New value: +"Точность сэмплирования: 'full' — точный расчёт (медленнее) или доля 0..1. По умолчанию — авторежим API." - changed
Input schema / properties / autoPaginate / descriptionPrevious 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)." - changed
Input schema / properties / counterId / descriptionPrevious value: -"Counter id. Defaults to YANDEX_METRIKA_COUNTER_ID."New value: +"Идентификатор счётчика. По умолчанию YANDEX_METRIKA_COUNTER_ID." - changed
Input schema / properties / date1 / descriptionPrevious value: -"Start date YYYY-MM-DD or relative (today, yesterday, NdaysAgo). Default 7daysAgo."New value: +"Дата начала: YYYY-MM-DD или относительная (today, yesterday, NdaysAgo). По умолчанию 7daysAgo." - changed
Input schema / properties / date2 / descriptionPrevious value: -"End date YYYY-MM-DD or relative (today, yesterday, NdaysAgo). Default yesterday."New value: +"Дата конца: YYYY-MM-DD или относительная (today, yesterday, NdaysAgo). По умолчанию yesterday." - changed
Input schema / properties / dimensions / descriptionPrevious 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. Без них — итог за период." - changed
Input schema / properties / filters / descriptionPrevious value: -"Metrica filter expression, e.g. ym:s:deviceCategory=='mobile'."New value: +"Выражение фильтра Метрики, например ym:s:deviceCategory=='mobile'." - changed
Input schema / properties / limit / descriptionPrevious value: -"Max rows per page (ignored when autoPaginate is set)."New value: +"Максимум строк на странице (игнорируется, если задан autoPaginate)." - changed
Input schema / properties / maxPages / descriptionPrevious value: -"Page cap for autoPaginate. Default 100."New value: +"Лимит страниц для autoPaginate. По умолчанию 100." - changed
Input schema / properties / metrics / descriptionPrevious 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. По умолчанию — типовой набор." - changed
Input schema / properties / offset / descriptionPrevious value: -"1-based row offset for pagination."New value: +"Смещение по строкам для постраничной выдачи, отсчёт с 1." - changed
Input schema / properties / sort / descriptionPrevious value: -"Sort field; prefix with '-' for descending, e.g. -ym:s:visits."New value: +"Поле сортировки; префикс '-' — по убыванию, например -ym:s:visits."
- Changed
list_counters3 fields changed- changed
Input schema / properties / offset / descriptionPrevious value: -"1-based offset for pagination."New value: +"Смещение для постраничной выдачи, отсчёт с 1." - changed
Input schema / properties / perPage / descriptionPrevious value: -"Max counters to return. Default 100."New value: +"Максимум счётчиков в ответе. По умолчанию 100." - changed
Input schema / properties / search / descriptionPrevious value: -"Case-insensitive substring to filter counters by name or site."New value: +"Подстрока для фильтра счётчиков по имени или сайту, без учёта регистра."
- Changed
list_goals1 field changed- changed
Input schema / properties / counterId / descriptionPrevious value: -"Counter id. Defaults to YANDEX_METRIKA_COUNTER_ID."New value: +"Идентификатор счётчика. По умолчанию YANDEX_METRIKA_COUNTER_ID."
- Added
logout - Changed
raw_request5 fields changed- changed
Input schema / properties / body / descriptionPrevious value: -"JSON body for POST requests."New value: +"Тело запроса в JSON для POST." - changed
Input schema / properties / confirmWrite / descriptionPrevious value: -"Must be true for a write (POST or DELETE)."New value: +"Должен быть true для записи (POST или DELETE)." - changed
Input schema / properties / method / descriptionPrevious value: -"HTTP method. Default GET."New value: +"HTTP-метод. По умолчанию GET." - changed
Input schema / properties / path / descriptionPrevious 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\"." - changed
Input schema / properties / query / descriptionPrevious value: -"Query string parameters (ids, metrics, dimensions, date1, date2, ...)."New value: +"Параметры строки запроса (ids, metrics, dimensions, date1, date2, ...)."
- Added
start_login
1 tool update
v1.0.2- Changed
get_statistics11 fields changed- added
Input schema / properties / accuracy / anyOfAdded value: +[ + { + "type": "string" + }, + { + "maximum": 1, + "minimum": 0, + "type": "number" + } +] - changed
Input schema / properties / accuracy / descriptionPrevious 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." - removed
Input schema / properties / accuracy / typeRemoved value: -"string" - changed
Input schema / properties / autoPaginate / descriptionPrevious 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)." - removed
Input schema / properties / date2 / $refRemoved value: -"#/properties/date1" - changed
Input schema / properties / date2 / descriptionPrevious value: -"End date YYYY-MM-DD or relative. Default yesterday."New value: +"End date YYYY-MM-DD or relative (today, yesterday, NdaysAgo). Default yesterday." - added
Input schema / properties / date2 / patternAdded value: +"^(\\d{4}-\\d{2}-\\d{2}|today|yesterday|\\d+daysAgo)$" - added
Input schema / properties / date2 / typeAdded value: +"string" - changed
Input schema / properties / limit / descriptionPrevious value: -"Max rows per page."New value: +"Max rows per page (ignored when autoPaginate is set)." - changed
Input schema / properties / limit / maximumPrevious value: -100000New value: +10000 - added
Input schema / properties / maxPagesAdded value: +{ + "description": "Page cap for autoPaginate. Default 100.", + "maximum": 1000, + "minimum": 1, + "type": "integer" +}
4 tool updates
v1.0.0- First observed
get_statistics - First observed
list_counters - First observed
list_goals - First observed
raw_request
TDQS
Scored across 8 tools
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.
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.
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.
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
Related MCP Connectors
Read-only Yandex Metrika MCP. Query visits, sources, geo, devices and more in plain language.
MCP for Yandex Direct: manage ad campaigns & analytics from Claude or ChatGPT
MCP server for querying and analyzing data from ad platforms, analytics tools, and spreadsheets
Clamp Analytics MCP server: traffic, revenue, funnels, cohorts, errors, and search, for AI agents.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceA 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-
- AlicenseCqualityDmaintenanceMCP server for Yandex Metrika analytics, enabling AI assistants to access traffic, content, demographics, conversion, e-commerce, and drill-down reports.312MIT
- AlicenseNot gradedqualityDmaintenanceRead-only MCP server for Yandex Metrika analytics, enabling report retrieval via MCP clients like Claude Code or Cursor without modifying any data.17 npmMIT
- AlicenseAqualityAmaintenanceMCP 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.12154 npm14MIT