Skip to main content
ClaudeWave
BoxLab-Ltd avatar
BoxLab-Ltd

yandex-metrica-mcp

Ver en GitHub
MCP ServersRegistry oficial1 estrellas0 forksTypeScriptMITActualizado today
Install in Claude Code / Claude Desktop
Method: Manual
Claude Code CLI
git clone https://github.com/BoxLab-Ltd/yandex-metrica-mcp
claude_desktop_config.json (Claude Desktop)
{
  "mcpServers": {
    "yandex-metrica-mcp": {
      "command": "node",
      "args": ["/path/to/yandex-metrica-mcp/dist/index.js"]
    }
  }
}
1. Run the command above in your terminal (Claude Code), or paste the JSON config into claude_desktop_config.json (Claude Desktop).
2. Replace any <placeholder> values with your API keys or paths.
3. Restart Claude. The MCP server and its tools appear automatically.
💡 Clone https://github.com/BoxLab-Ltd/yandex-metrica-mcp and follow its README for install instructions.
Casos de uso

Resumen de MCP Servers

# yandex-metrica-mcp

[![CI](https://github.com/BoxLab-Ltd/yandex-metrica-mcp/actions/workflows/ci.yml/badge.svg)](https://github.com/BoxLab-Ltd/yandex-metrica-mcp/actions/workflows/ci.yml)
[![npm](https://img.shields.io/npm/v/yandex-metrica-mcp.svg)](https://www.npmjs.com/package/yandex-metrica-mcp)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](./LICENSE)

A [Model Context Protocol](https://modelcontextprotocol.io) (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.

## 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 available counters, goals, and common
  dimensions/metrics so the model queries with real field names.
- Built-in context control: field selection on by default, low default row
  limits, and sampling/quota surfaced back to the model.

Planned for later: Logs API (raw row-level export → local SQL), 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:

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

It opens a Yandex consent page; after you approve, Yandex shows a code that you
paste back into the terminal. 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`.

**Alternative: static token.** 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.

## Usage

Add the server to your MCP client (e.g. Claude Desktop) configuration:

```json
{
    "mcpServers": {
        "yandex-metrica": {
            "command": "npx",
            "args": ["-y", "yandex-metrica-mcp"],
            "env": {
                "YANDEX_METRIKA_TOKEN": "your-oauth-token",
                "YANDEX_METRIKA_COUNTER_ID": "12345678"
            }
        }
    }
}
```

See [`.env.example`](./.env.example) for all configuration options. The published
package runs on Node (so `npx`/MCP clients work out of the box); local
development uses [Bun](https://bun.sh).

## 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 and goals can I query?” → `get_metadata`.

## Development

This project is Bun-first:

```bash
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](./LICENSE) © boxlab

Lo que la gente pregunta sobre yandex-metrica-mcp

¿Qué es BoxLab-Ltd/yandex-metrica-mcp?

+

BoxLab-Ltd/yandex-metrica-mcp es mcp servers para el ecosistema de Claude AI con 1 estrellas en GitHub.

¿Cómo se instala yandex-metrica-mcp?

+

Puedes instalar yandex-metrica-mcp clonando el repositorio (https://github.com/BoxLab-Ltd/yandex-metrica-mcp) o siguiendo las instrucciones del README en GitHub. ClaudeWave también te ofrece bloques de instalación rápida en esta misma página.

¿Es seguro usar BoxLab-Ltd/yandex-metrica-mcp?

+

BoxLab-Ltd/yandex-metrica-mcp aún no ha sido auditado por nuestro agente de seguridad. Revisa el repositorio original en GitHub antes de usarlo en producción.

¿Quién mantiene BoxLab-Ltd/yandex-metrica-mcp?

+

BoxLab-Ltd/yandex-metrica-mcp es mantenido por BoxLab-Ltd. La última actividad registrada en GitHub es de today, con 0 issues abiertos.

¿Hay alternativas a yandex-metrica-mcp?

+

Sí. En ClaudeWave puedes explorar mcp servers similares en /categories/mcp, ordenados por popularidad o actividad reciente.

Despliega yandex-metrica-mcp en tu cloud

Lleva este repo a producción en minutos. Cada plataforma genera su propio entorno con variables de entorno editables.

¿Mantienes este repo? Añade un badge a tu README

Pega el badge en tu README de GitHub para mostrar que está auditado por ClaudeWave. Cada badge enlaza de vuelta a esta página y muestra el Trust Score actual.

Featured on ClaudeWave: BoxLab-Ltd/yandex-metrica-mcp
[![Featured on ClaudeWave](https://claudewave.com/api/badge/boxlab-ltd-yandex-metrica-mcp)](https://claudewave.com/repo/boxlab-ltd-yandex-metrica-mcp)
<a href="https://claudewave.com/repo/boxlab-ltd-yandex-metrica-mcp"><img src="https://claudewave.com/api/badge/boxlab-ltd-yandex-metrica-mcp" alt="Featured on ClaudeWave: BoxLab-Ltd/yandex-metrica-mcp" width="320" height="64" /></a>

Más MCP Servers

Alternativas a yandex-metrica-mcp