Yandex Metrica MCP logo

Yandex Metrica MCP

Query Yandex Metrica reports, comparisons, trends, metadata, and raw logs through read-only MCP tools.

Install Yandex Metrica MCP

Pick your client, then add it in one click or paste the config.

STDIONode.js
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "yandex-metrica-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "yandex-metrica-mcp"
      ],
      "env": {
        "YANDEX_METRIKA_COUNTER_ID": "YOUR_VALUE_HERE"
      }
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

Values are written into the snippet above so you can paste it as is. They never leave your browser.

Automated check passed— started and listed 12 tools correctly (27d ago).

Overview

The yandex-metrica-mcp MCP server connects AI agents to Yandex Metrica for read-only analytics queries. It exposes tools for reports, period comparisons, dimension drilldowns, time series, counter metadata, configuration details, and Logs API exports. Authentication uses Yandex OAuth with PKCE, either through an interactive browser flow or a supplied token. Reach for it when an agent needs to investigate traffic, conversions, sources, visitors, or raw session and hit data without opening a dashboard.

Use cases

  • Analyze traffic sources and landing pages
  • Compare conversion performance across periods
  • Inspect counter goals and available metrics
  • Drill into visitor devices and operating systems
  • Export raw visits or hits for offline analysis

Key features

  • Read-only Yandex Metrica reporting
  • Period comparisons and time-series trends
  • Dimension-tree drilldowns
  • Counter and metric metadata discovery
  • Asynchronous Logs API exports
  • OAuth PKCE authentication

Tools12

What Yandex Metrica MCP lets your agent do. Expand a tool for its parameters.

Verified live~4.4k tokens of context

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked Today

Recent health check succeeded.

19/23 checks healthy over the last 90d

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 6d ago via OSV.dev · yandex-metrica-mcp (npm)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars15Stargazers on the source repository.
npm downloads1.1kPackage downloads in the last 30 days.
Last commit3d agoMost recent push to the default branch.
Availability100%Our rolling endpoint + install checks that succeeded.
Install checkPassedOur sandbox started it and listed its tools.
Tools exposed12Callable tools this server registers over MCP.
Directory activity3 viewsConfig copies, upvotes, and views on AllMCPs.

How Yandex Metrica MCP works

What yandex-metrica-mcp does

The yandex-metrica-mcp MCP server gives an MCP-compatible client access to Yandex Metrica web analytics through read-only operations. It can retrieve traffic, sources, landing pages, conversions, geography, devices, and trend data, while keeping the query interface flexible enough for different dimensions and metrics.

The server also exposes account and counter discovery. Agents can list available counters, inspect common metric and dimension names, and read selected counter configuration such as goals, segments, filters, operations, and access grants. Goal metadata is useful when a later report needs a goal-specific conversion metric.

For raw-data workflows, the Logs API tools handle visit or hit exports. These exports are asynchronous: the client creates a request, checks its status, downloads the result, and can then clean up the request. Downloads return a bounded inline sample by default or write the complete export to a file.

How it works

An MCP client starts the package through stdio, commonly with npx -y yandex-metrica-mcp. The client supplies a default counter ID through configuration, and an agent invokes the available tools with report parameters such as metrics, dimensions, periods, and filters.

The main reporting operations cover a single report, a comparison between two periods, hierarchical drilldowns, and time-series results. The server returns absolute and percentage differences for comparisons and supports repeated drilldowns by passing a parent identifier. Metadata tools help an agent discover valid names before making a query.

The yandex-metrica-mcp MCP server applies context controls intended to keep responses manageable. Field selection is enabled by default, row limits are conservative, and sampling or quota information is returned to the model. It communicates with Yandex and is read-only; planned write tools and Streamable HTTP transport are not part of the documented v0.1 feature set.

Setup and configuration

Node.js 18 or newer is required. Add the server to the MCP client configuration with the yandex-metrica-mcp package and set YANDEX_METRIKA_COUNTER_ID when a default counter should be used. The package is published for Node, while the repository's local development workflow uses Bun.

The recommended login flow is npx yandex-metrica-mcp auth. It opens Yandex's consent page and normally receives the authorization code through a loopback redirect. If the loopback port is unavailable, the command can use a pasted code instead; YANDEX_OAUTH_LOOPBACK_PORT changes the port. The OAuth flow uses authorization-code PKCE, and the cached token is stored with mode 0600 under ~/.config/yandex-metrica-mcp/token.json.

A client can also invoke the login tool, which is useful when the user has no terminal. For CI or other non-interactive environments, provide a Yandex token with the metrika:read scope through YANDEX_METRIKA_TOKEN. An optional YANDEX_OAUTH_CLIENT_ID selects a user-owned OAuth application, and adding YANDEX_OAUTH_CLIENT_SECRET enables automatic token refresh for that application.

Tools and capabilities

The documented tools include:

  • run_report for flexible queries against Yandex Metrica's Reporting API.
  • run_comparison for comparing two periods with absolute and percentage deltas.
  • run_drilldown for navigating a dimension tree.
  • run_timeseries for splitting metrics by time intervals.
  • get_metadata for counters and catalogs of metrics, dimensions, and Logs API fields.
  • describe_counter for selected counter settings, including goals and access grants.
  • logs_request, logs_status, logs_download, and logs_clean for asynchronous visit or hit exports.
  • login and submit_code for authentication from an MCP client.

Typical uses include comparing organic conversions across weeks, identifying visitor operating systems and their versions, examining traffic sources, checking available counters, and exporting raw sessions for offline analysis.

Limitations and notes

The project describes itself as early development, version 0.1, and work in progress. It requires credentials with the metrika:read scope and access to the counters being queried. Authentication tokens expire after roughly one year and may require another login.

The server is read-only by design. Logs exports consume Yandex quota during their lifecycle, so completed exports should be cleaned up when they are no longer needed. Full raw exports are written to a file rather than placed wholesale into the model context. Streamable HTTP and write operations are listed as future work, not current capabilities.

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Yandex Metrica MCP

yandex-metrica-mcp is an MCP server that connects AI clients to Yandex Metrica. Its main tools run reports, compare periods, drill into dimensions, build time series, inspect counter metadata, describe counter settings, and export raw visit or hit logs. Operations are read-only and require Yandex credentials with the metrika:read scope.

Install it by configuring your MCP client to run `npx -y yandex-metrica-mcp`, then set `YANDEX_METRIKA_COUNTER_ID` if you want a default counter. The package requires Node.js 18 or newer. Claude Desktop can also install the released `.mcpb` extension.

Authenticate by running `npx yandex-metrica-mcp auth` and approving access in the browser. The server uses a built-in public OAuth client with authorization-code PKCE and caches the token locally. For non-interactive use, provide a Yandex token with the `metrika:read` scope in `YANDEX_METRIKA_TOKEN`.

Configure Cursor to start the package with `npx -y yandex-metrica-mcp`, provide a default counter if needed, and authenticate through the browser or with a token.

Yes, it can export raw session or hit rows through the Logs API tools. Use `logs_request`, poll with `logs_status`, download with `logs_download`, and call `logs_clean` afterward. Inline downloads are bounded; full exports can be streamed to a file.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewYandex Metrica MCP AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/yandex-metrica-mcp?style=directory)](https://allmcps.com/mcp/yandex-metrica-mcp)
HTML Embed
<a href="https://allmcps.com/mcp/yandex-metrica-mcp"><img src="https://allmcps.com/api/badge/yandex-metrica-mcp?style=directory" alt="Yandex Metrica MCP on AllMCPs" /></a>