Yandex Metrika MCP with device flow and Logs API
yandex-metrika-mcp
A Yandex Metrika MCP server for Claude Desktop with a browserless OAuth device flow and the full Logs API cycle
- 0 ★ on the repository
- Last commit
Extended access
Why this level
- Reads detailed stats and raw visits through the Logs API
- The OAuth app requests metrika:write and metrika:expenses scopes beyond reading
- Tokens are stored in an unencrypted token.json file on disk
Install
- Works in
- Services
Manual install
git clone https://github.com/perfilev/yandex-metrika-mcp.git
cd yandex-metrika-mcp
npm install
npm run buildBuild the server before logging in and connecting.
Access and checks
How we reviewExtended accessThe tool runs code or makes network calls and only reads external data.
- Reads detailed stats and raw visits through the Logs API
- The OAuth app requests metrika:write and metrika:expenses scopes beyond reading
- Tokens are stored in an unencrypted token.json file on disk
This is third-party code. Review the repository files before installing.
What it does
The server gives the model access to Metrika's Reporting, Management, Logs API and real-time reports. The generic get_report tool takes any dimensions, metrics, filters and sort, while presets cover common scenarios: traffic and UTM, audience by geography and device, content, and conversions with funnels. It lists counters, goals and segments, offers real-time bytime and drilldown reports, and the full Logs API cycle from evaluating a request through downloading and clearing the log. Auth runs via npm run login: the script opens a Yandex OAuth device flow with no redirect URI and saves tokens to token.json, refreshing them automatically.
Who it is for. For marketers and analysts who need both a flexible custom report and raw Logs API data in one server.
Good fit when
- You need a custom report with any combination of dimensions and metrics via get_report
- You need raw visits from the Logs API with specific fields like ClientID or goals
- You do not want to configure an OAuth redirect URI: auth runs through a terminal device flow
Not a fit when
- A few ready-made reports without fine-tuning are enough: a server with named tools is simpler
- You have no Node.js environment to build the server before first run
Example request
Build a funnel for goal id=123 in April and show the top 20 landing pages with the worst bounce rateMCP
- Transport
- stdio
- Authentication
- OAuth
Environment variables
YANDEX_CLIENT_IDrequired- Client ID of the Yandex ID OAuth app
YANDEX_CLIENT_SECRETrequired, secret- Client secret of the OAuth app
TOKEN_PATHrequired- Path to the token.json file with saved tokens
Limitations
Requires a Yandex ID OAuth app with metrika:read, metrika:write, metrika:user_params, metrika:expenses scopes. Tokens are stored in a local token.json file next to the server. No license file.
How to disable. Remove the yandex-metrika block from claude_desktop_config.json and delete the token.json file with saved tokens.
FAQ
Do I need to configure an OAuth redirect URI?
No, npm run login uses a device flow: it requests a device code from Yandex, shows a confirmation code and saves the tokens itself.
What happens when the token expires?
The server automatically refreshes the access token using the saved refresh token, with no need to log in again.
Discussion
No questions or reviews yet.
Related
All Yandex Metrica toolsYandex Metrica MCP: reports and goals in Claude, Cursor and Codex
mcp-yandex-metrica
A Metrica MCP server run with npx and Yandex OAuth sign-in inside the chat: counters, goals, visit and conversion reports, read-only by default
Yandex Metrica MCP
yandex-metrica-mcp
Read-only MCP server for Yandex Metrica: reports, period comparison, goals and raw log export with browser login
Yandex Metrika MCP
Yandex Metrika MCP Server
MCP server for Yandex Metrika reports: traffic, sources, search phrases, goals, geography, devices and content analytics
MCP Yandex Metrica with counter management
@theyahia/yandex-metrika-mcp
Yandex Metrica MCP server with 15 tools: reports and traffic plus creating, editing, and deleting counters and goals
An MCP server, CLI and Pydantic models for the Yandex Metrika API: reports, counters, goals, filters, segments, logs and offline conversion uploads
Yandex Metrika MCP with DuckDB
Yandex.Metrika MCP
A Metrika MCP server for Claude Code with Stat, Logs, Management and Compare APIs plus local SQL analysis of raw logs via DuckDB
Comparison with similar tools
Cards that share the main search query, and how they differ.
| Tool | Official | Authentication | Repository stars | Main difference |
|---|---|---|---|---|
| Yandex Metrika MCP with device flow and Logs API (this card) | no | OAuth | 0 | |
| Yandex Metrika MCP: a compact reporting server | no | OAuth | 0 | compact reports server |
| Yandex Metrika MCP: 25 analytics tools | no | OAuth | 0 | 25 ready reports |
README in short
The README describes capabilities by block: the generic get_report, presets, counters, real-time, Logs API, gives install via clone and build, steps to create an OAuth app and get a token via npm run login, the Claude Desktop config, and Russian-language example prompts.