# Yandex Metrika MCP

> Yandex Metrika MCP is an open-source MCP server for analytics and data. MCP server for Yandex Metrika counters, traffic reports and custom stat queries. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI
- **Repository:** https://github.com/stufently/yandex-mcp/tree/HEAD/packages/yandex-metrika-mcp
- **MCP Registry name:** io.github.stufently/yandex-metrika-mcp
- **Categories:** [analytics and data](https://ai-powered.com/categories/analytics-and-data)
- **Listing updated:** 2026-11-18

## About

Twelve tools split into five management tools, six ready-made reports and one free-form report. The ready-made ones return traffic summaries, sources, geography, devices, popular pages and search phrases for a counter, defaulting to the last 30 days. `get-report` passes arbitrary metrics, dimensions, filters and sorting straight to the Metrika Stat API.

Two tools write: `create-counter` and `delete-counter` need the `metrika:write` OAuth scope and fail with a 403 naming the missing scope otherwise. The default auth helper requests both read and write scopes; you can ask for read only with `YANDEX_METRIKA_SCOPE`. `delete-counter` is irreversible, so it also needs `confirm: true`, and without it nothing is sent to the API.

The server limits itself to 3 parallel requests and 200 report attempts per five-minute window, retrying 420, 429 and 5xx responses up to three times. Large reports may be sampled, and responses then say so. The package is not on the npm scope yet, so run it from source.

## Features

- **Ready-made reports:** Traffic summary, sources, geography, devices, popular pages and search phrases.
- **Custom reports:** `get-report` accepts any metrics, dimensions, filters and sort.
- **Counter management:** List, inspect and create counters and read their goals.
- **Guarded deletion:** `delete-counter` needs `confirm: true` and the write scope.
- **Built-in rate limiting:** 3 parallel requests and 200 report attempts per five minutes, with retries.
- **OAuth helper:** An `auth` command opens Yandex OAuth and returns a token.

## Good for

- Summarize a site's visits, users and bounce rate for a date range
- See which pages and search phrases drive traffic
- Break traffic down by country, device or browser
- Create a Metrika counter for a new site
- Run a custom Stat API query with filters

## Install

### Claude Code (Terminal)

```sh
claude mcp add yandex-metrika-mcp --env YANDEX_METRIKA_TOKEN='<YANDEX_METRIKA_TOKEN>' -- npx -y @stufently/yandex-metrika-mcp
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "yandex-metrika-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@stufently/yandex-metrika-mcp"
      ],
      "env": {
        "YANDEX_METRIKA_TOKEN": "<YANDEX_METRIKA_TOKEN>"
      }
    }
  }
}
```

### Cursor (~/.cursor/mcp.json)

```json
{
  "mcpServers": {
    "yandex-metrika-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@stufently/yandex-metrika-mcp"
      ],
      "env": {
        "YANDEX_METRIKA_TOKEN": "<YANDEX_METRIKA_TOKEN>"
      }
    }
  }
}
```

### VS Code (.vscode/mcp.json)

```json
{
  "servers": {
    "yandex-metrika-mcp": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@stufently/yandex-metrika-mcp"
      ],
      "env": {
        "YANDEX_METRIKA_TOKEN": "<YANDEX_METRIKA_TOKEN>"
      }
    }
  }
}
```

### Windsurf (~/.codeium/windsurf/mcp_config.json)

```json
{
  "mcpServers": {
    "yandex-metrika-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@stufently/yandex-metrika-mcp"
      ],
      "env": {
        "YANDEX_METRIKA_TOKEN": "<YANDEX_METRIKA_TOKEN>"
      }
    }
  }
}
```

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "yandex-metrika-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@stufently/yandex-metrika-mcp"
      ],
      "env": {
        "YANDEX_METRIKA_TOKEN": "<YANDEX_METRIKA_TOKEN>"
      }
    }
  }
}
```

## Tools

- `get-counters`: Lists all Metrika counters
- `get-counter`: Gets details for one counter
- `get-goals`: Gets goals for a counter
- `create-counter`: Creates a new counter; needs metrika:write
- `delete-counter`: Deletes a counter irreversibly; needs confirm and metrika:write
- `get-traffic-summary`: Visits, users, pageviews, bounce rate and average duration
- `get-traffic-sources`: Traffic breakdown by source
- `get-geography`: Traffic breakdown by country and city
- `get-devices`: Traffic breakdown by device, browser or OS
- `get-popular-pages`: Most visited pages
- `get-search-phrases`: Top search phrases driving traffic
- `get-report`: Custom report with chosen metrics and dimensions

## FAQ

### Which scopes does it need?

`metrika:read` covers the ten read tools; `create-counter` and `delete-counter` also need `metrika:write`.

### Can it delete a counter by accident?

`delete-counter` refuses unless called with a literal `confirm: true`.

### What is the default date range?

The last 30 days when no dates are given.

### Is data sampled?

The Stat API may sample large datasets, and responses include a note when it does.

### How do I get a token?

Run the `auth` command, which opens Yandex OAuth, then set `YANDEX_METRIKA_TOKEN`.

### Is Yandex Metrika MCP free?

Yes. Yandex Metrika MCP is open source, so you can use and self-host it for free.

### How do I add Yandex Metrika MCP to Claude Code?

Run this command in your terminal: claude mcp add yandex-metrika-mcp --env YANDEX_METRIKA_TOKEN='<YANDEX_METRIKA_TOKEN>' -- npx -y @stufently/yandex-metrika-mcp

### What are the best alternatives to Yandex Metrika MCP?

The closest alternatives to Yandex Metrika MCP are Agent-Native Analytics, Google Ads + Meta Ads + SEO/GEO MCP, dashboard-icons, Tapetide - Indian Stock Market MCP and World Monitor.

## Where this comes from

- Description: written from the project's README.
- Install steps: from the official MCP Registry entry.

## Alternatives

- [Agent-Native Analytics](https://ai-powered.com/mcp/agent-native-analytics): Agent-Native Analytics is an open-source MCP server for analytics and data.
- [Google Ads + Meta Ads + SEO/GEO MCP](https://ai-powered.com/mcp/google-ads-meta-ads-seo-geo-mcp): Google Ads + Meta Ads + SEO/GEO MCP is a freemium MCP server for marketing and seo.
- [dashboard-icons](https://ai-powered.com/mcp/dashboard-icons): dashboard-icons is an open-source MCP server for analytics and data.
- [Tapetide - Indian Stock Market MCP](https://ai-powered.com/mcp/tapetide-indian-stock-market-mcp): Tapetide - Indian Stock Market MCP is a freemium MCP server for finance and payments.
- [World Monitor](https://ai-powered.com/mcp/world-monitor): World Monitor is a freemium MCP server for analytics and data.
- [DataArcus for Power BI](https://ai-powered.com/mcp/dataarcus-for-power-bi): DataArcus for Power BI is a free MCP server for analytics and data.
- [CompanyData](https://ai-powered.com/mcp/companydata): CompanyData is a paid MCP server for analytics and data.
- [Pypi Stats](https://ai-powered.com/mcp/pypi-stats): Pypi Stats is a freemium MCP server for analytics and data.

---
Source: https://ai-powered.com/mcp/yandex-metrika-mcp-2
