Skip to content
plugmcp
DirectorySkillsCategoriesBlog
EN/中文
Sign inSign up
Home/Servers/Yandex Metrica

Yandex Metrica

I
by io.github.BoxLab-Ltd

Query Yandex Metrica analytics — reports, trends, metadata and raw log exports — via an AI agent.

Power your agent

Add this server

The publisher's own command. Not a PlugMCP endpoint.

Local command
npx -y [email protected]
Credentials from the publisher
  • YANDEX_METRIKA_TOKEN — Yandex Metrica OAuth token (metrika:read). Optional if you run the `auth` login.
  • YANDEX_METRIKA_COUNTER_ID — Default counter id, so tools may omit counterId.
  • YANDEX_METRIKA_LOGS_DIR — Directory for Logs API file exports (logs_download in file mode). Defaults to a folder under the OS temp directory.
Provider
Claude Code
YANDEX_METRIKA_TOKEN=<secret> YANDEX_METRIKA_COUNTER_ID=<value> YANDEX_METRIKA_LOGS_DIR=<value> claude mcp add io.github.boxlab-ltd-yandex-metrica-mcp -- npx -y [email protected]

Run in a terminal.

Claude Desktop
{
  "mcpServers": {
    "io.github.boxlab-ltd-yandex-metrica-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "[email protected]"
      ],
      "env": {
        "YANDEX_METRIKA_TOKEN": "<secret>",
        "YANDEX_METRIKA_COUNTER_ID": "<value>",
        "YANDEX_METRIKA_LOGS_DIR": "<value>"
      }
    }
  }
}

claude_desktop_config.json

Step-by-step: add this in Claude

Remote URL or a command on your machine? How the two installs differ

Run on PlugMCP

Host a copy with our keys and logs.

A new server you create. It is not this listing's official endpoint. Use the publisher install when you want their URL and their credentials.

Launch

Related MCP

View more
  • Firecrawl🔥 Official Firecrawl MCP Server - Adds powerful web scraping and search to Cursor, Claude and any other LLM clients.
  • N
    NotionToken-auth Notion MCP: pages, databases, blocks, comments, files. Runs headless in CI and agents.
  • Context7Context7 Platform -- Up-to-date code documentation for LLMs and AI code editors

Related skills

View all
  • reaReverse engineer anything with agents, from app behavior down to native binaries.
  • rea-changelog-updatePrepare or rewrite REA release changelogs and GitHub release notes from pinned Git history, with verified contributor thanks and Release Please synchronization.
  • rea-tool-designDesign or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics.

Query Yandex Metrica analytics — reports, trends, metadata and raw log exports — via an AI agent.

yandex-metrica-mcp

Ask your Yandex Metrica analytics in plain language — from Claude, Cursor, or any MCP client.

A Model Context Protocol (MCP) server for Yandex Metrica. It lets an AI agent query your web-analytics data — traffic, sources, landing pages, conversions, geography, devices and trends — through a small set of flexible, read-only tools.

Read-only by design, no secrets stored in the package: interactive login uses a built-in public OAuth client with PKCE, and the server talks only to Yandex.

Status: early development (v0.1, work in progress). General-purpose: SEO is one of many use cases, not the focus.

Demo

Point an AI agent at your counter and ask about your traffic — the server queries Yandex Metrica and hands back real, read-only data, no dashboards. Here the run_report tool answers a “traffic sources, last 7 days” question against a live counter:

yandex-metrica-mcp querying live Yandex Metrica traffic sources, read-only

Quickstart

1. Add the server to your MCP client (e.g. Claude Desktop) — no token required up front; you log in interactively in step 2:

{
    "mcpServers": {
        "yandex-metrica": {
            "command": "npx",
            "args": ["-y", "yandex-metrica-mcp"],
            "env": { "YANDEX_METRIKA_COUNTER_ID": "12345678" }
        }
    }
}

2. Log in once — one command, no app registration, no secret stored:

npx yandex-metrica-mcp auth

Approve access in the browser and you're done — the code is handed back automatically over a local redirect, no copy-paste. The login uses authorization-code + PKCE, so no client secret ever touches your machine; the token is cached (mode 0600) and valid for ~1 year.

3. Ask your agent about traffic, sources, conversions, geography, devices, or trends — see Examples for prompts.

Prefer a static token (CI / non-interactive) or your own OAuth app? See Authentication.

Or install as a Claude Code plugin

The repo doubles as a plugin marketplace, so you can install the server through Claude Code's plugin system instead of the config above:

/plugin marketplace add BoxLab-Ltd/yandex-metrica-mcp
/plugin install yandex-metrica-mcp@boxlab

Then run npx yandex-metrica-mcp auth once to log in.

Or install as a Claude Desktop extension (.mcpb)

For a one-click install with no JSON, download the .mcpb from the latest release and open it with Claude Desktop (or drag it into Settings → Extensions). It asks for an optional default counter id; then sign in from the chat with the login tool (or run npx yandex-metrica-mcp auth).

Why

There is no official Yandex Metrica MCP server, and existing community ones are mostly thin, unmaintained, or dump raw data straight into the model's context. This server aims to be the well-engineered, well-maintained, open option: flexible report tools, strict token/context discipline, read-only by default.

Features (v0.1)

  • run_report — flexible wrapper over the Reporting API (/stat/v1/data).
  • run_comparison — compare two periods with absolute and percentage deltas.
  • run_drilldown — drill down through a dimension tree.
  • run_timeseries — metrics split into a time series (/bytime) for trends.
  • get_metadata — discover the counters on your account and a catalog of common dimensions/metrics (and Logs API fields) so the model queries with real names.
  • describe_counter — read one counter's configuration (goals, segments, filters, operations, access grants) via an include selector. The goals section gives the goal ids needed for conversion metrics in run_report.
  • logs_request / logs_status / logs_download / logs_clean — Logs API: export raw, un-sampled session (visits) or hit (hits) rows. Async lifecycle (request → poll → download → clean); logs_download returns a bounded sample inline by default, or streams the full export to a file — never dumping raw rows into the model's context.
  • login / submit_code — sign in to Yandex Metrica from your MCP client, no terminal needed: login opens the browser and captures the code over a local redirect, or hands back a URL and takes the pasted code via submit_code.
  • Built-in context control: field selection on by default, low default row limits, and sampling/quota surfaced back to the model.

Planned for later: Streamable HTTP transport, write tools (behind an explicit flag).

Requirements

  • Node.js >= 18
  • Yandex Metrica credentials with the metrika:read scope (see Authentication). Whoever the credentials belong to must have access to the counters you query.

Authentication

Recommended: interactive login. No app registration needed — the server ships a built-in public OAuth client. Run once:

yandex-metrica-mcp auth     # or, in dev: bun run auth

It opens the Yandex consent page in your browser; after you approve, the code is returned automatically over a loopback redirect (http://127.0.0.1:53682) — no copy-paste. If that port is taken, it falls back to showing a code you paste in (force that flow with auth --oob, or change the port with YANDEX_OAUTH_LOOPBACK_PORT). The token is cached at ~/.config/yandex-metrica-mcp/token.json (mode 0600) and is valid for ~1 year; re-run auth when it expires. The login uses authorization-code + PKCE, so no client secret is stored anywhere. A cached login takes precedence over YANDEX_METRIKA_TOKEN.

From your MCP client (no terminal). Not signed in yet? The server still starts — ask your agent to run the login tool and it does the same browser flow in-process (or returns a URL and takes the code via submit_code). Handy for GUI clients like Claude Desktop, where there is no terminal to run auth. Get a token for an app with the metrika:read scope at https://oauth.yandex.ru and pass it as YANDEX_METRIKA_TOKEN — handy for CI or non-interactive use.

Own OAuth app (optional). To use your own app instead of the built-in one, set YANDEX_OAUTH_CLIENT_ID; add YANDEX_OAUTH_CLIENT_SECRET to also enable automatic token refresh.

Configuration

The Quickstart covers the happy path. For all options — static token, your own OAuth app, default counter, request tuning, language — see .env.example. The published package runs on Node (so npx/MCP clients work out of the box); local development uses Bun.

Examples

Once connected, an agent can answer questions like:

  • “How many visits and users did counter 12345678 get last week, split by traffic source?” → run_report with metrics: ["ym:s:visits","ym:s:users"], dimensions: ["ym:s:lastsignTrafficSource"].
  • “Compare this week's organic conversions to last week's.” → run_comparison (server returns A, B, and the deltas).
  • “Which operating systems do my visitors use? Let me drill into Windows versions.” → run_drilldown, then again with parentId.
  • “What counters do I have?” → get_metadata.
  • “List this counter's goals, then show how the ‘Purchase’ goal converted last week.” → describe_counter (include: ["goals"]) for the goal id, then run_report with ym:s:goal<id>conversionRate.
  • “Export last month's raw sessions with landing pages and referrers for offline analysis.” → logs_request (source: "visits"), poll logs_status, then logs_download (mode: "file"), then logs_clean to free the quota.

Development

This project is Bun-first:

bun install
bun run dev        # run from source with hot reload
bun run typecheck  # tsc --noEmit
bun run lint       # eslint
bun test           # bun's test runner
bun run build      # emit dist/ with tsc (Node-compatible)

License

MIT © boxlab

How do I install Yandex Metrica?
Copy the stdio config for Cursor, Claude Desktop, Claude Code, or VS Code on this page. It uses the publisher's install, not a PlugMCP proxy.
Does Yandex Metrica need an API key?
The publisher lists these environment variables: YANDEX_METRIKA_TOKEN, YANDEX_METRIKA_COUNTER_ID, YANDEX_METRIKA_LOGS_DIR.
What transport does Yandex Metrica use?
Yandex Metrica runs locally over stdio.
When was Yandex Metrica last checked?
Last checked 2026-10-16. Query Yandex Metrica analytics — reports, trends, metadata and raw log exports — via an AI agent.

No tool list yet. Remote servers get one after the first health check.

plugmcp

Plug any tool into any agent. MCP servers for people who do not write servers. Gateway for volume, n8n for apps.

  • github.com/TODO
  • x.com/TODO
  • linkedin.com/company/TODO

PlugMCP, 2026

Product
  • Browse
  • Install
  • Host your own
  • Voice mode
  • Browser
Directory
  • All MCP servers
  • Agent skills
  • Categories
  • New
  • Voice
  • Submit a server
Developers
  • Docs
  • Blog
  • What is MCP
  • What is WebMCP
  • Status
Company
  • About
  • Contact
  • Terms
  • Privacy
  • DPA