Yandex Metrika MCP with device flow and Logs API

yandex-metrika-mcp

A Yandex Metrika MCP server for Claude Desktop with a browserless OAuth device flow and the full Logs API cycle

  • 0 ★ on the repository
  • Last commit
MCP server

Extended access

Why this level

  • Reads detailed stats and raw visits through the Logs API
  • The OAuth app requests metrika:write and metrika:expenses scopes beyond reading
  • Tokens are stored in an unencrypted token.json file on disk
All reasons and checks
Russian stack

perfilev/yandex-metrika-mcp

Install

Manual install

git clone https://github.com/perfilev/yandex-metrika-mcp.git
cd yandex-metrika-mcp
npm install
npm run build

Build the server before logging in and connecting.

Access and checks

How we review

Extended accessThe tool runs code or makes network calls and only reads external data.

  • Reads detailed stats and raw visits through the Logs API
  • The OAuth app requests metrika:write and metrika:expenses scopes beyond reading
  • Tokens are stored in an unencrypted token.json file on disk

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

What it does

The server gives the model access to Metrika's Reporting, Management, Logs API and real-time reports. The generic get_report tool takes any dimensions, metrics, filters and sort, while presets cover common scenarios: traffic and UTM, audience by geography and device, content, and conversions with funnels. It lists counters, goals and segments, offers real-time bytime and drilldown reports, and the full Logs API cycle from evaluating a request through downloading and clearing the log. Auth runs via npm run login: the script opens a Yandex OAuth device flow with no redirect URI and saves tokens to token.json, refreshing them automatically.

Who it is for. For marketers and analysts who need both a flexible custom report and raw Logs API data in one server.

Good fit when

  • You need a custom report with any combination of dimensions and metrics via get_report
  • You need raw visits from the Logs API with specific fields like ClientID or goals
  • You do not want to configure an OAuth redirect URI: auth runs through a terminal device flow

Not a fit when

  • A few ready-made reports without fine-tuning are enough: a server with named tools is simpler
  • You have no Node.js environment to build the server before first run

Example request

Build a funnel for goal id=123 in April and show the top 20 landing pages with the worst bounce rate

MCP

Transport
stdio
Authentication
OAuth

Environment variables

YANDEX_CLIENT_ID required
Client ID of the Yandex ID OAuth app
YANDEX_CLIENT_SECRET required, secret
Client secret of the OAuth app
TOKEN_PATH required
Path to the token.json file with saved tokens

Limitations

Requires a Yandex ID OAuth app with metrika:read, metrika:write, metrika:user_params, metrika:expenses scopes. Tokens are stored in a local token.json file next to the server. No license file.

How to disable. Remove the yandex-metrika block from claude_desktop_config.json and delete the token.json file with saved tokens.

FAQ

Do I need to configure an OAuth redirect URI?

No, npm run login uses a device flow: it requests a device code from Yandex, shows a confirmation code and saves the tokens itself.

What happens when the token expires?

The server automatically refreshes the access token using the saved refresh token, with no need to log in again.

Discussion

No questions or reviews yet.

Yandex Metrica MCP

yandex-metrica-mcp

Russian stack

Read-only MCP server for Yandex Metrica: reports, period comparison, goals and raw log export with browser login

MCP serverExtended access15Repository stars

Yandex Metrika MCP

Yandex Metrika MCP Server

Russian stack

MCP server for Yandex Metrika reports: traffic, sources, search phrases, goals, geography, devices and content analytics

MCP serverExtended access24Repository stars

MCP Yandex Metrica with counter management

@theyahia/yandex-metrika-mcp

Russian stack

Yandex Metrica MCP server with 15 tools: reports and traffic plus creating, editing, and deleting counters and goals

MCP serverBroad access1Repository stars
Russian stack

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

MCP serverBroad access2Repository stars
Russian stack

A Metrika MCP server for Claude Code with Stat, Logs, Management and Compare APIs plus local SQL analysis of raw logs via DuckDB

MCP serverBroad access

Comparison with similar tools

Cards that share the main search query, and how they differ.

ToolOfficialAuthenticationRepository starsMain difference
Yandex Metrika MCP with device flow and Logs API (this card)noOAuth0
Yandex Metrika MCP: a compact reporting servernoOAuth0compact reports server
Yandex Metrika MCP: 25 analytics toolsnoOAuth025 ready reports

README in short

The README describes capabilities by block: the generic get_report, presets, counters, real-time, Logs API, gives install via clone and build, steps to create an OAuth app and get a token via npm run login, the Claude Desktop config, and Russian-language example prompts.

README badge

Report a problem