yandex-metrika-mcp
Click on "Install 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: Plausible 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.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full behavioral burden. It discloses that the operation lists only counters accessible to the token, returns each counter's id/name/site, and requires only read scope. This goes beyond the tool name and schema, though it omits details like pagination or error behavior, which are less critical for a list-all endpoint.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is two concise sentences. The first sentence states the core purpose; the second explains the output fields and their downstream use. There is no wasted wording or redundancy, and the essential information is front-loaded.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The tool is simple (no parameters, no nested objects) and an output schema exists, so the description does not need to describe return structure. It covers what the tool does, what it returns, how to use the result, and the required scope. Nothing essential is missing for correct invocation.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The tool has zero parameters, so schema coverage is trivially 100%. The description adds relevant context about the output fields (id, name, site) and their purpose, which helps the agent interpret the result. With no parameters to document, a baseline of 4 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a specific verb ('List'), a clear resource ('Yandex Metrika counters'), and scopes it to those 'available to the token.' It also implicitly distinguishes itself from the sibling 'query' by positioning the output as a way to pick a counter_id for query.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides clear context: use this tool to obtain counter ids/names/sites, then feed a selected counter_id into 'query.' It does not explicitly state 'when not to use' or name alternatives, but given the single sibling and the dependency hint, the intended usage is apparent.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
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).
| Name | Required | Description | Default |
|---|---|---|---|
| sort | No | ||
| date1 | No | 7daysAgo | |
| date2 | No | today | |
| limit | No | ||
| filters | No | ||
| metrics | Yes | ||
| counter_id | Yes | ||
| dimensions | No |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It explicitly states the return shape: 'Returns the raw Reporting API response (query meta, totals and data rows).' It also clarifies that Metrika field names are passed through directly, which sets expectations for raw passthrough behavior. It does not mention permissions, rate limits, or side effects, but for a query operation the return-value disclosure is substantive.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is well-structured and front-loaded: purpose first, then grouped parameter guidance, then return behavior. Each section is minimal and useful, with practical examples but no filler. The organization makes it easy for an agent to scan and extract the needed details.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given an output schema exists and 8 parameters are involved, the description covers the critical semantics well and even documents return shape. The only gaps are counter_id and limit, which are relatively self-evident from names and schema types. The description is sufficient for an agent to construct a correct query in most cases, though a note on pagination or limit behavior would fully close the gap.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description must compensate, and it largely does. It explains metrics, dimensions, date1/date2, filters, and sort with concrete examples and formats. However, it does not explain counter_id or limit, leaving those to inference from names and types. Overall, the description provides strong semantic value for most parameters.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description opens with a specific verb+resource: 'Run a Reporting API query against a Metrika counter (aggregated stats).' This clearly distinguishes it from the sibling list_counters, which is about enumerating counters rather than executing queries. The purpose is unambiguous and action-oriented.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides extensive how-to guidance: which metrics and dimensions to pass, date formats, filter syntax, and sort prefix. It makes the intended use case clear (aggregated stats queries), though it does not explicitly say when not to use it or mention list_counters as an alternative. Context is clear; exclusions are absent.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
2 tool updates
v0.1.0- First observed
list_counters - First observed
query
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
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Ask business questions in plain English. Get instant answers from your database, no SQL needed.
Ask data questions in natural language. Get SQL, insights, and charts from your databases.
Ask questions in plain language, get answers from your business database. No SQL required.
Query your SEO data in plain language: rankings, audits, backlinks, competitors and AI visibility.
Related MCP Servers
- AlicenseCqualityDmaintenanceMCP server for Yandex Metrika analytics, enabling AI assistants to access traffic, content, demographics, conversion, e-commerce, and drill-down reports.312MIT
- AlicenseBqualityDmaintenanceEnables natural language interaction with Plausible Analytics data to query traffic, visitors, engagement, and more using conversational questions.41MIT
- AlicenseAqualityAmaintenanceMCP 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.81131MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI assistants to retrieve comprehensive analytics data from Yandex Metrika accounts, including traffic, content, e-commerce, and user demographics.1MIT