ya-metrics-mcp
A read-only Yandex Metrika MCP server with 31 tools for traffic, content, demographics, geography, conversions and e-commerce, metrika:read only
Medium risk
We rate an entry medium when the tool runs code, makes network calls or reads project files. Check what exactly it does before installing.
Why this level
- Reads commercially sensitive traffic, conversion and sales data
- The OAuth token grants access to every counter on the account within the metrika:read scope
Install
In your terminal, with SkillFoxx CLI
npx skillfoxx add mcp/ya-metrics-mcpDetects the agents on your machine, checks the risk and pins the version.
Other ways to install
Run in a terminal
claude mcp add --transport stdio --env 'YANDEX_API_KEY=<your YANDEX_API_KEY>' ya-metrics -- uvx ya-metrics-mcpOr add to the file .mcp.json, in the project
{
"mcpServers": {
"ya-metrics": {
"command": "uvx",
"args": [
"ya-metrics-mcp"
],
"env": {
"YANDEX_API_KEY": "<your YANDEX_API_KEY>"
}
}
}
}If the file already exists, add the server inside the mcpServers key.
Keys and settings
YANDEX_API_KEYsecret, required
Replace the values in angle brackets with your own. Keys never go into install links and are not stored by us.
The button opens the agent and offers to add the server. If nothing happens, copy the config below.
Add to the file ~/.cursor/mcp.json, for all projects
{
"mcpServers": {
"ya-metrics": {
"command": "uvx",
"args": [
"ya-metrics-mcp"
],
"env": {
"YANDEX_API_KEY": "<your YANDEX_API_KEY>"
}
}
}
}If the file already exists, add the server inside the mcpServers key. For a single project, put the same block into .cursor/mcp.json.
Keys and settings
YANDEX_API_KEYsecret, required
Replace the values in angle brackets with your own. Keys never go into install links and are not stored by us.
The button opens the agent and offers to add the server. If nothing happens, copy the config below.
Run in a terminal
code --add-mcp '{"name":"ya-metrics","type":"stdio","command":"uvx","args":["ya-metrics-mcp"],"env":{"YANDEX_API_KEY":"<your YANDEX_API_KEY>"}}'Or add to the file .vscode/mcp.json, in the project
{
"servers": {
"ya-metrics": {
"type": "stdio",
"command": "uvx",
"args": [
"ya-metrics-mcp"
],
"env": {
"YANDEX_API_KEY": "<your YANDEX_API_KEY>"
}
}
}
}If the file already exists, add the server inside the servers key.
Keys and settings
YANDEX_API_KEYsecret, required
Replace the values in angle brackets with your own. Keys never go into install links and are not stored by us.
Run in a terminal
codex mcp add ya-metrics --env 'YANDEX_API_KEY=<your YANDEX_API_KEY>' -- uvx ya-metrics-mcpOr add to the file ~/.codex/config.toml, for all projects
[mcp_servers.ya-metrics]
command = "uvx"
args = ["ya-metrics-mcp"]
env = { YANDEX_API_KEY = "<your YANDEX_API_KEY>" }If the file already exists, append the block to the end.
Keys and settings
YANDEX_API_KEYsecret, required
Replace the values in angle brackets with your own. Keys never go into install links and are not stored by us.
Run in a terminal
gemini mcp add -s user -e 'YANDEX_API_KEY=<your YANDEX_API_KEY>' ya-metrics uvx ya-metrics-mcpOr add to the file ~/.gemini/settings.json, for all projects
{
"mcpServers": {
"ya-metrics": {
"command": "uvx",
"args": [
"ya-metrics-mcp"
],
"env": {
"YANDEX_API_KEY": "<your YANDEX_API_KEY>"
}
}
}
}If the file already exists, add the server inside the mcpServers key.
Keys and settings
YANDEX_API_KEYsecret, required
Replace the values in angle brackets with your own. Keys never go into install links and are not stored by us.
Add to the file ~/.config/devin/mcp_config.json, for all projects
{
"mcpServers": {
"ya-metrics": {
"command": "uvx",
"args": [
"ya-metrics-mcp"
],
"env": {
"YANDEX_API_KEY": "<your YANDEX_API_KEY>"
}
}
}
}If the file already exists, add the server inside the mcpServers key. Legacy Cascade keeps the MCP config in ~/.codeium/windsurf/mcp_config.json.
Keys and settings
YANDEX_API_KEYsecret, required
Replace the values in angle brackets with your own. Keys never go into install links and are not stored by us.
Formerly Windsurf.
Add to the file cline_mcp_settings.json, for all projects
{
"mcpServers": {
"ya-metrics": {
"command": "uvx",
"args": [
"ya-metrics-mcp"
],
"env": {
"YANDEX_API_KEY": "<your YANDEX_API_KEY>"
}
}
}
}If the file already exists, add the server inside the mcpServers key. Open the settings file in Cline: MCP Servers tab, Configure MCP Servers.
Keys and settings
YANDEX_API_KEYsecret, required
Replace the values in angle brackets with your own. Keys never go into install links and are not stored by us.
Add to the file .roo/mcp.json, in the project
{
"mcpServers": {
"ya-metrics": {
"command": "uvx",
"args": [
"ya-metrics-mcp"
],
"env": {
"YANDEX_API_KEY": "<your YANDEX_API_KEY>"
}
}
}
}If the file already exists, add the server inside the mcpServers key.
Keys and settings
YANDEX_API_KEYsecret, required
Replace the values in angle brackets with your own. Keys never go into install links and are not stored by us.
A fork of Roo Code, same .roo folders.
Add to the file opencode.json, in the project
{
"mcp": {
"ya-metrics": {
"type": "local",
"command": [
"uvx",
"ya-metrics-mcp"
],
"environment": {
"YANDEX_API_KEY": "<your YANDEX_API_KEY>"
}
}
}
}If the file already exists, add the server inside the mcp key.
Keys and settings
YANDEX_API_KEYsecret, required
Replace the values in angle brackets with your own. Keys never go into install links and are not stored by us.
Add to the file ~/.config/zed/settings.json, for all projects
{
"context_servers": {
"ya-metrics": {
"command": "uvx",
"args": [
"ya-metrics-mcp"
],
"env": {
"YANDEX_API_KEY": "<your YANDEX_API_KEY>"
}
}
}
}If the file already exists, add the server inside the context_servers key.
Keys and settings
YANDEX_API_KEYsecret, required
Replace the values in angle brackets with your own. Keys never go into install links and are not stored by us.
Add to the file .codeassistant/mcp.json, in the project
{
"mcpServers": {
"ya-metrics": {
"command": "uvx",
"args": [
"ya-metrics-mcp"
],
"env": {
"YANDEX_API_KEY": "<your YANDEX_API_KEY>"
}
}
}
}If the file already exists, add the server inside the mcpServers key.
Keys and settings
YANDEX_API_KEYsecret, required
Replace the values in angle brackets with your own. Keys never go into install links and are not stored by us.
Register an application at oauth.yandex.ru with the metrika:read scope, get a token, then add the server to your MCP client config running uvx ya-metrics-mcp with the YANDEX_API_KEY variable.
Other ways from the author
{
"mcpServers": {
"ya-metrics": {
"command": "uvx",
"args": ["ya-metrics-mcp"],
"env": {
"YANDEX_API_KEY": "your_oauth_token"
}
}
}
}Config for Claude Desktop and Cursor from the README.
This is third-party code. Review the repository files before installing.
What it does
The server provides 31 tools across seven Yandex Metrika analytics areas. Account and counters: listing counters and goals, counter metadata. Traffic and sources: visits, a sources overview, search phrases, source types, search engine data, new users by source. Content analytics for Zen and Turbo publisher integration: sources, categories, authors, topics, articles. Demographics and devices: age, gender, device, browser and OS, page-depth. Geography: traffic by city and country. Performance and conversion: bounce rate and duration by entry page, goal conversion rates, SEO performance, conversion by source and landing page. Advanced and drill-down reports: e-commerce purchases, time series, Direct A/B experiment bounce rates, a browser report, hierarchical drill-down and segment comparison. Every tool is read-only and needs only the metrika:read scope, and many accept a limit parameter so large exports do not overflow the agent's context.
Who it is for. For marketers and analysts who want broad read-only Yandex Metrika analytics with zero risk of changing anything in the counter.
Good fit when
- You want to compare traffic sources, devices or user segments over a period
- You want goal and landing-page conversion without opening the Metrika interface
- You have a Zen or Turbo integration and need content analytics on articles and authors
Not a fit when
- You need to create or change goals, filters, segments or counters: the server only reads data
- You do not have a Zen or Turbo integration: without it, the content-analytics tools return nothing
Example request
Compare mobile vs desktop users this month for counter 12345678Limitations
It needs an OAuth token with only the metrika:read scope, but counter management is not available through the server at all. Content analytics only works with a Yandex Zen or Turbo integration on the counter, and the e-commerce report needs purchase tracking enabled. The package is distributed via uvx or run from source; the README does not mention a separate pip release.
How to disable. Remove the server from your MCP client config and revoke the OAuth token at oauth.yandex.ru.
MCP
- Transport
- stdio
- Authentication
- API key
| Environment variables | |
|---|---|
| YANDEX_API_KEY required, secret | Yandex OAuth token with the metrika:read scope |
| YANDEX_TIMEOUT | Request timeout in seconds, defaults to 30 |
| YANDEX_RETRIES | Number of retries on 5xx errors, defaults to 3 |
Security check
- Reads commercially sensitive traffic, conversion and sales data
- The OAuth token grants access to every counter on the account within the metrika:read scope
README in short
The English README, with a Russian version as a separate file, describes the server as exposing 31 tools across seven analytics domains. It covers getting an OAuth token with only the metrika:read scope, and configuration for Claude Desktop and Cursor via uvx or running from source with uv run. Tools are grouped into tables: account and counters, traffic and sources, content analytics flagged as requiring a Zen or Turbo integration, demographics and devices, geography, performance and conversion, advanced and drill-down reports. It separately covers the limit parameter for controlling response size and an environment variable table for timeouts and retries.
FAQ
Can the server change anything in Metrika?
No, all 31 tools only read data; the metrika:read scope alone is enough, no write access is needed.
Why does content analytics return no data?
These tools require a Yandex Zen or Turbo integration on the counter; without it, article sources, categories and authors are unavailable.
Related
Official DataLens (Yandex) skills for Claude Code, Codex and OpenCode: SDK, HTML reports and RLS resolution
A Yandex Metrika MCP server generated from the API spec: 108 methods, 10 tools declared by default, transparent filters and response metadata
An open MCP server and agent skill set for SEO: keyword research, competitors, backlinks and site audits powered by DataForSEO
A Claude Code plugin for SEO audits: technical SEO, E-E-A-T, schema, local and AI search via parallel subagents