mcpField
Y
Yandex Metrika MCP

Yandex Metrika MCP

Remote
github.com/expremientalData & Analytics1Updated 18w ago
Repository

About Yandex Metrika MCP

Yandex Metrika MCP is a read-only analytics server for querying Yandex Metrika in natural language. It is for users who want site metrics in an MCP client, and offers a hosted connection or self-hosting with their own token.

Key features

  1. 01Query visits, users, and pageviews
  2. 02Group by source, device, geography, and UTM
  3. 03Set date ranges, filters, sorting, and row limits
  4. 04List counters available to the token
  5. 05Read-only access to Metrika data

Use cases

  1. 01Check visits and users for the week
  2. 02Compare traffic sources for a month
  3. 03Review the share of mobile visits

MCP support

As an MCP server, it provides tools to list Yandex Metrika counters and run Reporting API queries. Access is read-only; clients can connect to the hosted HTTP service or run it locally with a configured token.

Configuration

Remote servers need no local install. Pick your client, then copy the config or install in one click.

Endpointhttps://mcp.getaiaiai.ru/yandex-metrika
Copy install command
Claude CodeTerminal
Cursor.cursor/mcp.json
VS Code.vscode/mcp.json
Claude Desktopclaude_desktop_config.json
Windsurf~/.codeium/windsurf/mcp_config.json

Run commands in a terminal; paste JSON into the client’s MCP config and restart. Servers that need sign-in will prompt on first connect.

Tools

Details

From the project README

yandex-metrika-mcp

License: MIT Python 3.10+ FastMCP MCP

Query Yandex Metrika analytics in plain language, right inside Claude. "How many visits this week?", "Top traffic sources for June", "Mobile share today?" — the assistant queries Metrika and answers directly. No dashboards, no SQL, no API keys to manage.

Open-source by aiaiai — we build what we teach.


Задавай вопросы по Яндекс.Метрике обычным языком прямо в Claude. «Сколько визитов за неделю?», «топ источников за июнь», «доля мобильных?» — ассистент сам сходит в Метрику и ответит. Без дашбордов.

Спросил про географию аудитории обычным языком — агент сам построил карту из живой Яндекс.Метрики

Works with

Claude.ai  ·  Claude Code  ·  Claude Desktop  ·  Cursor  ·  any MCP-compatible client

Connect in one minute (hosted)

No installation needed — connect to the hosted service.

Claude.ai (Settings → Connectors → Add):

https://mcp.getaiaiai.ru/yandex-metrika

Click Connect → sign in with Yandex → allow access.

Claude Code CLI:

claude mcp add --transport http yandex-metrika https://mcp.getaiaiai.ru/yandex-metrika/
claude mcp login yandex-metrika

A browser window opens → sign in with Yandex → done. On headless/SSH: add --no-browser to mcp login and paste the redirect URL when prompted.

Claude Desktop / Cursor — add to mcpServers:

{
  "mcpServers": {
    "yandex-metrika": {
      "type": "http",
      "url": "https://mcp.getaiaiai.ru/yandex-metrika/"
    }
  }
}

No app registration, no tokens to manage. Read-only — the service never writes to your Metrika account.

Подключение на русском

Claude.ai (Настройки → Коннекторы → Добавить):

https://mcp.getaiaiai.ru/yandex-metrika

Нажмите Подключить → войдите через Яндекс → разрешите доступ.

Claude Code CLI:

claude mcp add --transport http yandex-metrika https://mcp.getaiaiai.ru/yandex-metrika/
claude mcp login yandex-metrika

Откроется браузер → войти через Яндекс → готово.

Tools

ToolDescription
list_countersList all Yandex Metrika counters available to the token (id, name, site)
queryRun a Reporting API query — visits, users, pageviews, bounce rate, traffic sources, devices, geography, UTMs, and more
query parameters
ParameterDefaultDescription
counter_idrequiredCounter ID from list_counters
metricsrequiredComma-separated metrics, e.g. ym:s:visits,ym:s:users
dimensions—Group-by fields: ym:s:date, ym:s:lastTrafficSource, ym:s:deviceCategory, …
date1 / date27daysAgo / todayDate range: YYYY-MM-DD or relative (today, yesterday, NdaysAgo)
filters—Filter expression, e.g. ym:s:deviceCategory=='mobile'
sort—Sort field; prefix - for descending, e.g. -ym:s:visits
limit100Max rows returned

Common metrics: ym:s:visits, ym:s:users, ym:s:pageviews, ym:s:bounceRate, ym:s:avgVisitDurationSeconds, ym:s:newUsers

Common dimensions: ym:s:date, ym:s:lastTrafficSource, ym:s:startURL, ym:s:deviceCategory, ym:s:regionCountry, ym:s:lastsourceUTMSource


Self-host with your own token

For developers — run the engine locally with full control over your data.

Requires Python 3.10+ and uv.

git clone https://github.com/expremiental/yandex-metrika-mcp.git
cd yandex-metrika-mcp
uv sync

Get a token. Go to oauth.yandex.ru, create an app (platform: "Web services"), enable Yandex Metrika → Read statistics (metrika:read), then get an OAuth token:

export YANDEX_METRIKA_TOKEN="<your-token>"

Connect (Claude Desktop / Cursor — add to mcpServers):

{
  "mcpServers": {
    "yandex-metrika": {
      "command": "uv",
      "args": ["run", "yandex-metrika-mcp"],
      "env": { "YANDEX_METRIKA_TOKEN": "<your-token>" }
    }
  }
}

Run over HTTP:

MCP_TRANSPORT=http PORT=8000 uv run yandex-metrika-mcp
# endpoint: http://localhost:8000/mcp

Embed in your own backend. The engine accepts an injectable async token resolver — wrap it with your own auth:

from yandex_metrika_mcp import build_server

async def my_token_resolver() -> str:
    return "<metrika:read token>"

build_server(token_resolver=my_token_resolver).run(transport="stdio")

Public API: build_server, YandexMetrikaClient, TokenResolver, env_token_resolver, main.

License

MIT · made by aiaiai

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.