# Yandex Metrika

This MCP server for Claude Code reads Yandex Metrika reports and compares date ranges. Ask about traffic, sources, landing pages, or goals.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 130 repo stars
- Author: DevCrabs-Inc
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/DevCrabs-Inc/yandex-metrika-mcp
- Updated: 2026-11-16
- Security check: automated, 2026-11-17 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/mcp/yandex-metrika

## What it does

The server reads Yandex Metrika data and returns reports with date ranges, the counter’s time zone, filters, and sampling status. It can compare two periods, group trends by day, week, or month, and retrieve counter and goal details.

Full CSV or JSON exports run as background jobs. A job can resume after a restart. The server provides 13 tools and 3 prompts, and it only reads data; it cannot change a counter.

Node.js 22.13 or later is required. Connect to Yandex Metrika through a browser after installation; no API key or custom OAuth app is needed. Requested report data goes to the AI client and its model provider, but tokens do not.

## Requirements
- Needs: Node.js (commands run via npx)
- Environment variables: `YM_MCP_CLIENT_ID`, `YANDEX_METRIKA_TOKEN` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add --env YM_MCP_CLIENT_ID=<YM_MCP_CLIENT_ID> --env YANDEX_METRIKA_TOKEN=<YANDEX_METRIKA_TOKEN> --transport stdio yandex-metrika -- npx -y @dev-crabs/yandex-metrika-mcp
```
Replace <…> with your own values

### Codex

**Platform CLI**
```bash
codex mcp add yandex-metrika --env YM_MCP_CLIENT_ID=<YM_MCP_CLIENT_ID> --env YANDEX_METRIKA_TOKEN=<YANDEX_METRIKA_TOKEN> -- npx -y @dev-crabs/yandex-metrika-mcp
```
Replace <…> with your own values

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "yandex-metrika": {
            "command": "npx",
            "args": [
                "-y",
                "@dev-crabs/yandex-metrika-mcp"
            ],
            "env": {
                "YM_MCP_CLIENT_ID": "<YM_MCP_CLIENT_ID>",
                "YANDEX_METRIKA_TOKEN": "<YANDEX_METRIKA_TOKEN>"
            }
        }
    }
}
```
Replace <…> with your own values

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "yandex-metrika": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "@dev-crabs/yandex-metrika-mcp"
            ],
            "env": {
                "YM_MCP_CLIENT_ID": "<YM_MCP_CLIENT_ID>",
                "YANDEX_METRIKA_TOKEN": "<YANDEX_METRIKA_TOKEN>"
            }
        }
    }
}
```
Replace <…> with your own values

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e YM_MCP_CLIENT_ID=<YM_MCP_CLIENT_ID> -e YANDEX_METRIKA_TOKEN=<YANDEX_METRIKA_TOKEN> yandex-metrika npx -y @dev-crabs/yandex-metrika-mcp
```
Replace <…> with your own values

## When to use it
- compare visits and goal completions across two periods
- find landing pages with the most leads
- track visits by week
- export every traffic source to CSV

## Example prompts
- Compare visits and goal 3001 completions across the last two complete weeks.
- Which landing pages brought the most leads last month?
- Export every traffic source to CSV for Excel.

## Similar
- [Yandex Metrika MCP](https://affpapa.org/en/nevibecode/mcp/yandex-metrika-mcp.md) — MCP server · ★ 21 repo stars
- [Yandex Tools MCP](https://affpapa.org/en/nevibecode/mcp/yandex-tools-mcp.md) — MCP server · ★ 71 repo stars
- [Marketplaces MCP (RU) — Wildberries, Ozon, Yandex Market, Avito](https://affpapa.org/en/nevibecode/mcp/marketplaces-mcp-ru-wildberries-ozon-yandex-market-avito.md) — MCP server · ★ 63 repo stars
- [yandex-lavka-mcp](https://affpapa.org/en/nevibecode/mcp/yandex-lavka-mcp.md) — MCP server · ★ 28 repo stars
- [yandex-metrica-mcp](https://affpapa.org/en/nevibecode/mcp/yandex-metrica-mcp.md) — MCP server · ★ 16 repo stars
- [Yandex Wordstat MCP](https://affpapa.org/en/nevibecode/mcp/yandex-wordstat-mcp.md) — MCP server · ★ 21 repo stars

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
