Skip to content
MCP server

Yandex Metrica MCP

Query Yandex Metrica traffic, conversions and raw logs from AI, read-only by default

Runs locallyStatus and history
Install
Pricing
Open source
Platforms
CLI, self-hosted
Runs
Locally
Version
1.0.1
Listing updated
today

Similar MCP servers

About Yandex Metrica MCP

Yandex Metrica MCP is an open-source MCP server for analytics and data. It runs locally on your machine and is started by your AI client.

A community-built server, since the README says Yandex offers no official Metrica one. It runs through npx on Node.js 18 or later and wraps the Reporting API so an assistant can ask about traffic sources, landing pages, goals, geography, devices and trends. It is built to keep model context small: field selection is on by default, row limits are low, and sampling and quota information is passed back.

Login is interactive. Running the auth command opens the Yandex consent page and returns the code over a local loopback redirect using PKCE, so no client secret is stored; the token is cached for about a year. A static token also works for CI. Raw session or hit exports go through an asynchronous request, poll, download and clean cycle, returning a bounded sample or streaming the full export to a file.

Write tools stay off unless YANDEX_METRIKA_ENABLE_WRITE is set to 1. They add chart annotations and ad-expense CSV upload, and each change is confirmed by the user first. An optional local HTTP mode listens on 127.0.0.1 only. The server also hands clients short analysis rules, such as excluding robots and comparing complete periods.

Install

Run in a terminal

claude mcp add yandex-metrica-mcp --env YANDEX_METRIKA_TOKEN='<YANDEX_METRIKA_TOKEN>' -- npx -y yandex-metrica-mcp

Add to claude_desktop_config.json

{
  "mcpServers": {
    "yandex-metrica-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "yandex-metrica-mcp"
      ],
      "env": {
        "YANDEX_METRIKA_TOKEN": "<YANDEX_METRIKA_TOKEN>"
      }
    }
  }
}

Add to ~/.cursor/mcp.json

{
  "mcpServers": {
    "yandex-metrica-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "yandex-metrica-mcp"
      ],
      "env": {
        "YANDEX_METRIKA_TOKEN": "<YANDEX_METRIKA_TOKEN>"
      }
    }
  }
}

Add to .vscode/mcp.json

{
  "servers": {
    "yandex-metrica-mcp": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "yandex-metrica-mcp"
      ],
      "env": {
        "YANDEX_METRIKA_TOKEN": "<YANDEX_METRIKA_TOKEN>"
      }
    }
  }
}

Add to ~/.codeium/windsurf/mcp_config.json

{
  "mcpServers": {
    "yandex-metrica-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "yandex-metrica-mcp"
      ],
      "env": {
        "YANDEX_METRIKA_TOKEN": "<YANDEX_METRIKA_TOKEN>"
      }
    }
  }
}

Add to your client's MCP settings (most use this shape)

{
  "mcpServers": {
    "yandex-metrica-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "yandex-metrica-mcp"
      ],
      "env": {
        "YANDEX_METRIKA_TOKEN": "<YANDEX_METRIKA_TOKEN>"
      }
    }
  }
}

Using several servers? Build one config file with the MCP config generator.

Configuration

  • YANDEX_METRIKA_TOKENYandex Metrica OAuth token (metrika:read). Optional if you run the `auth` login.
  • YANDEX_METRIKA_COUNTER_IDDefault counter id, so tools may omit counterId.
  • YANDEX_METRIKA_ENABLE_WRITESet to 1 to add the write tools (chart annotations, expense upload). Sign-in then also asks for metrika:write; every change is confirmed.
  • YANDEX_METRIKA_LOGS_DIRDirectory for Logs API file exports (logs_download in file mode). Defaults to a folder under the OS temp directory.

Tools this server provides (14)

Taken from the project documentation; the running server may differ.

run_report
Flexible wrapper over the Metrica Reporting API.
run_comparison
Compares two periods with absolute and percentage deltas.
run_drilldown
Drills down through a dimension tree.
run_timeseries
Returns metrics as a time series for trends.
get_metadata
Lists counters on the account and a catalog of dimensions, metrics and Logs API fields.
describe_counter
Reads a counter's goals, segments, filters, operations, access grants and annotations.
logs_request
Starts a raw Logs API export of visits or hits.
logs_status
Checks the status of a Logs API export.
logs_download
Downloads an export as a bounded inline sample or a file.
logs_clean
Cleans up a finished Logs API export.
login
Signs in to Yandex Metrica from the MCP client.
submit_code
Completes sign-in with a pasted authorization code.
manage_annotation
Creates, updates or deletes a chart annotation (write mode only).
upload_expenses
Imports ad costs from a CSV file, with a dry-run option (write mode only).

What it does

Flexible reports
Run reports, period comparisons, drilldowns and time series against Metrica counters.
Raw log export
Request, poll, download and clean session or hit exports without flooding context.
Counter inspection
Read goals, segments, filters and annotations for a counter.
Opt-in write tools
Manage chart annotations and upload ad expenses, each confirmed before sending.
PKCE sign-in
Browser login with no client secret stored on the machine.
Local HTTP mode
Serve several clients from one local instance bound to loopback.

Good for

  • Ask which traffic sources grew over the last 7 days
  • Compare conversions between two periods
  • Export un-sampled visit logs to a file for analysis
  • Pin a release or campaign date as a chart annotation
  • Import ad costs from another network to see ROI

Pricing

Open source

Yandex Metrica MCP FAQ

Is it an official Yandex product?

No. The README says there is no official Yandex Metrica MCP server and this is an independent open option.

Can it change my data?

Only if you set YANDEX_METRIKA_ENABLE_WRITE=1, and each change is confirmed first.

How do I sign in?

Run npx yandex-metrica-mcp auth and approve access in the browser, or supply a static OAuth token.

What does it need?

Node.js 18 or later and Yandex credentials with the metrika:read scope.

Is Yandex Metrica MCP free?

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

How do I add Yandex Metrica MCP to Claude Code?

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

What are the best alternatives to Yandex Metrica MCP?

The closest alternatives to Yandex Metrica 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.

How AIPoweredBot checks servers