yandex-metrika-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@yandex-metrika-mcphow many visits from Russia yesterday?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
yandex-metrika-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
Related MCP server: Yandex Metrica MCP
Connect in one minute (hosted)
No installation needed — connect to the hosted service.
Claude.ai (Settings → Connectors → Add):
https://mcp.getaiaiai.ru/yandex-metrikaClick 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-metrikaA 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
Tool | Description |
| List all Yandex Metrika counters available to the token (id, name, site) |
| Run a Reporting API query — visits, users, pageviews, bounce rate, traffic sources, devices, geography, UTMs, and more |
query parameters
Parameter | Default | Description |
| required | Counter ID from |
| required | Comma-separated metrics, e.g. |
| — | Group-by fields: |
|
| Date range: |
| — | Filter expression, e.g. |
| — | Sort field; prefix |
|
| Max 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
Requires Python 3.10+ and uv.
git clone https://github.com/expremiental/yandex-metrika-mcp.git
cd yandex-metrika-mcp
uv syncGet 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/mcpEmbed 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
Available Tools
2 toolslist_countersList CountersAInspect
List Yandex Metrika counters available to the token.
Returns each counter's id, name and site so you can pick a counter_id
for query. Read scope is enough.
Inputs: no named parameters. Returns: result
queryQueryAInspect
Run a Reporting API query against a Metrika counter (aggregated stats).
Pass Metrika field names directly. Common ones:
Metrics (comma-separated): ym:s:visits, ym:s:users, ym:s:pageviews, ym:s:bounceRate, ym:s:avgVisitDurationSeconds, ym:s:newUsers
Dimensions (comma-separated, optional — groups the result): ym:s:date, ym:s:lastTrafficSource, ym:s:startURL, ym:s:deviceCategory, ym:s:regionCountry, ym:s:UTMSource
date1 / date2: YYYY-MM-DD or relative (today, yesterday, NdaysAgo). filters: Metrika filter expression, e.g. "ym:s:deviceCategory=='mobile'". sort: field to sort by; prefix with '-' for descending, e.g. "-ym:s:visits".
Returns the raw Reporting API response (query meta, totals and data rows).
Inputs: metrics (required), counter_id (required), sort, date1, +4 more. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
TDQS
Scored across 2 tools
The two tools have clearly non-overlapping purposes: one discovers available counters, the other runs queries against a specific counter. An agent can easily choose the right tool.
list_counters follows a verb_noun pattern while query is a bare verb, which is a minor inconsistency. However, both are concise and readable, and the query description clarifies its role.
With only two tools, the server is minimal but not unreasonable for a read-only analytics API wrapper. It is serviceable yet feels slightly thin compared to more complete analytics integrations.
The pair covers the core workflow: list counters to obtain an ID, then query reporting data from that counter. Missing capabilities like retrieving counter metadata or metadata schemas are minor gaps for this read-only domain.
Maintenance
Related MCP Connectors
Ask your website analytics in plain language and set up funnels, features and dashboards.
Analyze Yandex Metrica traffic and conversions in ChatGPT with read-only access.
Ask business questions in plain English. Get instant answers from your database, no SQL needed.
Ask questions in plain language, get answers from your business database. No SQL required.
Related MCP Servers
- AlicenseBqualityDmaintenanceEnables natural language interaction with Plausible Analytics data to query traffic, visitors, engagement, and more using conversational questions.41MIT
- AlicenseAqualityBmaintenanceMCP server for Yandex Metrica analytics: query web analytics metrics, goals, conversions, and raw API data using natural language from AI clients like Claude and Cursor.8708 npm4MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to retrieve comprehensive analytics data from Yandex Metrika accounts, including traffic, content, e-commerce, and user demographics.113 npm1MIT
- AlicenseNot gradedqualityBmaintenanceEnables natural language querying of Google Analytics 4, including reports, realtime data, custom dimensions, and property management.479 npm1MIT