Yandex Metrika — Claude Code MCP server: features and setup
This MCP server for Claude Code reads Yandex Metrika reports and compares date ranges. Ask about traffic, sources, landing pages, or goals.
MIT ★ 130 updated 2026-11-16
claude mcp add --env YM_MCP_CLIENT_ID=<YM_MCP_CLIENT_ID> --env YANDEX_METRIKA_TOKEN=<YANDEX_METRIKA_TOKEN> --transport stdio yandex-metrika -- npx -y @dev-crabs/yandex-metrika-mcpWhat Yandex Metrika does
The server reads Yandex Metrika data and returns reports with date ranges, the counter’s time zone, filters, and sampling status. It can compare two periods, group trends by day, week, or month, and retrieve counter and goal details.
Full CSV or JSON exports run as background jobs. A job can resume after a restart. The server provides 13 tools and 3 prompts, and it only reads data; it cannot change a counter.
Node.js 22.13 or later is required. Connect to Yandex Metrika through a browser after installation; no API key or custom OAuth app is needed. Requested report data goes to the AI client and its model provider, but tokens do not.
What it helps with
- compare visits and goal completions across two periods
- find landing pages with the most leads
- track visits by week
- export every traffic source to CSV
Example prompts for the agent
- Compare visits and goal 3001 completions across the last two complete weeks.
- Which landing pages brought the most leads last month?
- Export every traffic source to CSV for Excel.
How to install Yandex Metrika
Platform CLI
claude mcp add --env YM_MCP_CLIENT_ID=<YM_MCP_CLIENT_ID> --env YANDEX_METRIKA_TOKEN=<YANDEX_METRIKA_TOKEN> --transport stdio yandex-metrika -- npx -y @dev-crabs/yandex-metrika-mcpReplace <…> with your own values
Platform CLI
codex mcp add yandex-metrika --env YM_MCP_CLIENT_ID=<YM_MCP_CLIENT_ID> --env YANDEX_METRIKA_TOKEN=<YANDEX_METRIKA_TOKEN> -- npx -y @dev-crabs/yandex-metrika-mcpReplace <…> with your own values
Config file
{
"mcpServers": {
"yandex-metrika": {
"command": "npx",
"args": [
"-y",
"@dev-crabs/yandex-metrika-mcp"
],
"env": {
"YM_MCP_CLIENT_ID": "<YM_MCP_CLIENT_ID>",
"YANDEX_METRIKA_TOKEN": "<YANDEX_METRIKA_TOKEN>"
}
}
}
}Replace <…> with your own values
Config file
{
"servers": {
"yandex-metrika": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@dev-crabs/yandex-metrika-mcp"
],
"env": {
"YM_MCP_CLIENT_ID": "<YM_MCP_CLIENT_ID>",
"YANDEX_METRIKA_TOKEN": "<YANDEX_METRIKA_TOKEN>"
}
}
}
}Replace <…> with your own values
Platform CLI
gemini mcp add -e YM_MCP_CLIENT_ID=<YM_MCP_CLIENT_ID> -e YANDEX_METRIKA_TOKEN=<YANDEX_METRIKA_TOKEN> yandex-metrika npx -y @dev-crabs/yandex-metrika-mcpReplace <…> with your own values
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about Yandex Metrika
How do I install Yandex Metrika in Claude Code?
Run claude mcp add yandex-metrika-mcp -e YANDEX_METRIKA_TOKEN=<YANDEX_METRIKA_TOKEN> -- npx -y @dev-crabs/yandex-metrika-mcp. Node.js 22.13 or later is required.
What does Yandex Metrika do?
The MCP server retrieves Yandex Metrika reports, compares date ranges, and exports data as CSV or JSON. Its access is read-only.
What does Yandex Metrika need to run?
It requires Node.js 22.13 or later. Counter access uses browser sign-in; a custom API key and OAuth app are not needed.