mcp-server-yandex-metrika

An MCP server, CLI and Pydantic models for the Yandex Metrika API: reports, counters, goals, filters, segments, logs and offline conversion uploads

MCP server

High risk

We rate an entry high when the tool writes to external systems, handles money, production databases or secrets, or runs arbitrary commands. The CLI installs it only with your consent.

Why this level

  • Can delete counters, goals, filters, segments and access grants
  • A token with metrika:write scope grants full control over the account's counters
  • Can upload offline conversions and expenses, affecting attribution data
All reasons and checks
Russian stack

dontsovcmc/mcp-server-yandex-metrika

Install

In your terminal, with SkillFoxx CLI

npx skillfoxx add mcp/mcp-server-yandex-metrika

Detects the agents on your machine, checks the risk and pins the version.

Other ways to install

This entry is high risk, so there is no one-click install. Review the code and add the config by hand.

Run in a terminal

claude mcp add --transport stdio --env 'YANDEX_METRIKA_TOKEN=<your YANDEX_METRIKA_TOKEN>' yandex-metrika -- uvx mcp-server-yandex-metrika==0.2.4

Or add to the file .mcp.json, in the project

{
  "mcpServers": {
    "yandex-metrika": {
      "command": "uvx",
      "args": [
        "mcp-server-yandex-metrika==0.2.4"
      ],
      "env": {
        "YANDEX_METRIKA_TOKEN": "<your YANDEX_METRIKA_TOKEN>"
      }
    }
  }
}

If the file already exists, add the server inside the mcpServers key.

Keys and settings

YANDEX_METRIKA_TOKENsecret, required

Replace the values in angle brackets with your own. Keys never go into install links and are not stored by us.

Add to the file ~/.cursor/mcp.json, for all projects

{
  "mcpServers": {
    "yandex-metrika": {
      "command": "uvx",
      "args": [
        "mcp-server-yandex-metrika==0.2.4"
      ],
      "env": {
        "YANDEX_METRIKA_TOKEN": "<your YANDEX_METRIKA_TOKEN>"
      }
    }
  }
}

If the file already exists, add the server inside the mcpServers key. For a single project, put the same block into .cursor/mcp.json.

Keys and settings

YANDEX_METRIKA_TOKENsecret, required

Replace the values in angle brackets with your own. Keys never go into install links and are not stored by us.

Run in a terminal

code --add-mcp '{"name":"yandex-metrika","type":"stdio","command":"uvx","args":["mcp-server-yandex-metrika==0.2.4"],"env":{"YANDEX_METRIKA_TOKEN":"<your YANDEX_METRIKA_TOKEN>"}}'

Or add to the file .vscode/mcp.json, in the project

{
  "servers": {
    "yandex-metrika": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "mcp-server-yandex-metrika==0.2.4"
      ],
      "env": {
        "YANDEX_METRIKA_TOKEN": "<your YANDEX_METRIKA_TOKEN>"
      }
    }
  }
}

If the file already exists, add the server inside the servers key.

Keys and settings

YANDEX_METRIKA_TOKENsecret, required

Replace the values in angle brackets with your own. Keys never go into install links and are not stored by us.

Run in a terminal

codex mcp add yandex-metrika --env 'YANDEX_METRIKA_TOKEN=<your YANDEX_METRIKA_TOKEN>' -- uvx mcp-server-yandex-metrika==0.2.4

Or add to the file ~/.codex/config.toml, for all projects

[mcp_servers.yandex-metrika]
command = "uvx"
args = ["mcp-server-yandex-metrika==0.2.4"]
env = { YANDEX_METRIKA_TOKEN = "<your YANDEX_METRIKA_TOKEN>" }

If the file already exists, append the block to the end.

Keys and settings

YANDEX_METRIKA_TOKENsecret, required

Replace the values in angle brackets with your own. Keys never go into install links and are not stored by us.

Run in a terminal

gemini mcp add -s user -e 'YANDEX_METRIKA_TOKEN=<your YANDEX_METRIKA_TOKEN>' yandex-metrika uvx mcp-server-yandex-metrika==0.2.4

Or add to the file ~/.gemini/settings.json, for all projects

{
  "mcpServers": {
    "yandex-metrika": {
      "command": "uvx",
      "args": [
        "mcp-server-yandex-metrika==0.2.4"
      ],
      "env": {
        "YANDEX_METRIKA_TOKEN": "<your YANDEX_METRIKA_TOKEN>"
      }
    }
  }
}

If the file already exists, add the server inside the mcpServers key.

Keys and settings

YANDEX_METRIKA_TOKENsecret, required

Replace the values in angle brackets with your own. Keys never go into install links and are not stored by us.

Add to the file ~/.config/devin/mcp_config.json, for all projects

{
  "mcpServers": {
    "yandex-metrika": {
      "command": "uvx",
      "args": [
        "mcp-server-yandex-metrika==0.2.4"
      ],
      "env": {
        "YANDEX_METRIKA_TOKEN": "<your YANDEX_METRIKA_TOKEN>"
      }
    }
  }
}

If the file already exists, add the server inside the mcpServers key. Legacy Cascade keeps the MCP config in ~/.codeium/windsurf/mcp_config.json.

Keys and settings

YANDEX_METRIKA_TOKENsecret, required

Replace the values in angle brackets with your own. Keys never go into install links and are not stored by us.

Formerly Windsurf.

Add to the file cline_mcp_settings.json, for all projects

{
  "mcpServers": {
    "yandex-metrika": {
      "command": "uvx",
      "args": [
        "mcp-server-yandex-metrika==0.2.4"
      ],
      "env": {
        "YANDEX_METRIKA_TOKEN": "<your YANDEX_METRIKA_TOKEN>"
      }
    }
  }
}

If the file already exists, add the server inside the mcpServers key. Open the settings file in Cline: MCP Servers tab, Configure MCP Servers.

Keys and settings

YANDEX_METRIKA_TOKENsecret, required

Replace the values in angle brackets with your own. Keys never go into install links and are not stored by us.

Add to the file .roo/mcp.json, in the project

{
  "mcpServers": {
    "yandex-metrika": {
      "command": "uvx",
      "args": [
        "mcp-server-yandex-metrika==0.2.4"
      ],
      "env": {
        "YANDEX_METRIKA_TOKEN": "<your YANDEX_METRIKA_TOKEN>"
      }
    }
  }
}

If the file already exists, add the server inside the mcpServers key.

Keys and settings

YANDEX_METRIKA_TOKENsecret, required

Replace the values in angle brackets with your own. Keys never go into install links and are not stored by us.

A fork of Roo Code, same .roo folders.

Add to the file opencode.json, in the project

{
  "mcp": {
    "yandex-metrika": {
      "type": "local",
      "command": [
        "uvx",
        "mcp-server-yandex-metrika==0.2.4"
      ],
      "environment": {
        "YANDEX_METRIKA_TOKEN": "<your YANDEX_METRIKA_TOKEN>"
      }
    }
  }
}

If the file already exists, add the server inside the mcp key.

Keys and settings

YANDEX_METRIKA_TOKENsecret, required

Replace the values in angle brackets with your own. Keys never go into install links and are not stored by us.

Add to the file ~/.config/zed/settings.json, for all projects

{
  "context_servers": {
    "yandex-metrika": {
      "command": "uvx",
      "args": [
        "mcp-server-yandex-metrika==0.2.4"
      ],
      "env": {
        "YANDEX_METRIKA_TOKEN": "<your YANDEX_METRIKA_TOKEN>"
      }
    }
  }
}

If the file already exists, add the server inside the context_servers key.

Keys and settings

YANDEX_METRIKA_TOKENsecret, required

Replace the values in angle brackets with your own. Keys never go into install links and are not stored by us.

Add to the file .codeassistant/mcp.json, in the project

{
  "mcpServers": {
    "yandex-metrika": {
      "command": "uvx",
      "args": [
        "mcp-server-yandex-metrika==0.2.4"
      ],
      "env": {
        "YANDEX_METRIKA_TOKEN": "<your YANDEX_METRIKA_TOKEN>"
      }
    }
  }
}

If the file already exists, add the server inside the mcpServers key.

Keys and settings

YANDEX_METRIKA_TOKENsecret, required

Replace the values in angle brackets with your own. Keys never go into install links and are not stored by us.

You will need: uv

Checked against the repository on Sep 25, 2026, commit cd20e21.

Text for your agent

Register an application at oauth.yandex.com with metrika:read and metrika:write scopes, get a token, then add the server with claude mcp add yandex-metrika -e YANDEX_METRIKA_TOKEN=token -- uvx mcp-server-yandex-metrika.

Other ways from the author
claude mcp add yandex-metrika \
  -e YANDEX_METRIKA_TOKEN=ваш_токен \
  -- uvx mcp-server-yandex-metrika

Method via uvx, no package installation required.

This is third-party code. Review the repository files before installing.

What it does

The project ships an MCP server, a CLI utility and a library of typed Pydantic models on top of the Yandex Metrika API. Coverage is broad: tabular, time-series, drill-down and comparison reports from the Reporting API, full management of counters, goals, filters, segments, labels, operations and access grants with create, update and delete, account and delegate management, chart annotations, the Logs API for exporting visits and hits, and uploading offline conversions, calls, expenses and user parameters. Every MCP tool has a matching CLI command, and the package runs as an MCP server with no arguments or as a plain CLI with a command. Every request goes straight to the API from the local machine; the token is never sent anywhere but Yandex Metrika.

Who it is for. For analysts and marketers who need full control over Yandex Metrika, including creating goals and filters, not just reading reports.

Good fit when

  • You want to create or change a counter's goals, filters or segments right from a conversation with an agent
  • You need to export raw visit logs or upload offline conversions and calls
  • You want the same data both in a CLI for scripts and in MCP for an agent, without a second tool

Not a fit when

  • You want view-only access with zero risk of accidentally deleting a goal, filter or counter: delete tools are available here
  • You do not need this much breadth, just reports without managing goals and permissions: a narrower server would fit better

Example request

Create a Purchase goal of type url with a contain /thank-you condition for counter 12345678

Limitations

The repository metadata does not explicitly declare a license, though the README states MIT. It needs an OAuth token with metrika:read and metrika:write scopes. API limits: 30 requests per second per IP, 5,000 per day per user, 3 parallel requests, and a separate limit of 200 requests per 5 minutes for the main report endpoint; exceeding it returns HTTP 420.

How to disable. Remove the server with claude mcp remove yandex-metrika and revoke the OAuth token at oauth.yandex.com.

MCP

Transport
stdio
Authentication
API key
Environment variables
Environment variables
YANDEX_METRIKA_TOKEN
required, secret
Yandex Metrika OAuth token with metrika:read and metrika:write scopes
METRIKA_TIMEOUT
HTTP request timeout in seconds, defaults to 30
METRIKA_FILE_TIMEOUT
Log file download timeout in seconds, defaults to 60

Security check

  • Can delete counters, goals, filters, segments and access grants
  • A token with metrika:write scope grants full control over the account's counters
  • Can upload offline conversions and expenses, affecting attribution data

README in short

The Russian README describes three forms of one package: an MCP server, a CLI and a Pydantic model library on top of the Yandex Metrika API. It gives a detailed tool table by category: reports, counters, goals, filters, access, operations, segments, labels, accounts, annotations, access filters, Logs API, data import, each with a matching CLI name. It covers getting an OAuth token, installing via uvx and pip, connecting to Claude Code and Claude Desktop, a temporary --mcp-config connection, CLI command examples, using the Pydantic models in custom scripts, environment variables and API limits. MIT license.

FAQ

Can the server be used without an MCP client?

Yes, the same package works as a plain CLI: with no arguments it starts the MCP server, and with a command like counters or stat-data it runs that request and prints JSON.

Are there typed models for custom scripts?

Yes, the package includes Pydantic models for every API object with extra=allow for forward compatibility, importable into your own Python programs.

Official

Official DataLens (Yandex) skills for Claude Code, Codex and OpenCode: SDK, HTML reports and RLS resolution

SkillMedium riskRussian stackNo VPN needed12Repository stars
Editors’ pick

A Yandex Metrika MCP server generated from the API spec: 108 methods, 10 tools declared by default, transparent filters and response metadata

MCP serverMedium riskRussian stackNo VPN needed2Repository stars
Official

An open MCP server and agent skill set for SEO: keyword research, competitors, backlinks and site audits powered by DataForSEO

MCP serverMedium risk21.5KRepository stars

A Claude Code plugin for SEO audits: technical SEO, E-E-A-T, schema, local and AI search via parallel subagents

PluginHigh risk17.9KRepository stars
Foxx AImcp-server-yandex-metrika

I am Foxx AI and I have already vetted this tool. Ask about install, setup or anything else, and I will keep it simple.