Yandex Metrika MCP Server (ymetrika-mcp)
Yandex Metrika MCP Server
A FastMCP-based MCP server for Yandex Metrika reports: visits, traffic sources, demographics, goal conversions
- 0 ★ on the repository
- Last commit
Extended access
Why this level
- Runs a Python HTTP server on port 8000 that reads Metrika reports with an OAuth token
- Issue the token with the metrika:read scope
nnstd-cloud-ru-hack-2025/ymetrika-mcp
A similar tool with a larger community: Yandex Metrika MCP, 24 ★ on the repository
Install
- Works in
- Services
Manual install
docker build -t yandex-metrika-mcp . && docker run -p 8000:8000 -e YANDEX_API_KEY=your_api_key_here yandex-metrika-mcpBuild and run the container as shown in the README; the server listens on port 8000.
Access and checks
How we reviewExtended accessThe tool runs code or makes network calls and only reads external data.
- Runs a Python HTTP server on port 8000 that reads Metrika reports with an OAuth token
- Issue the token with the metrika:read scope
This is third-party code. Review the repository files before installing.
What it does
A Python and FastMCP server exposes MCP over streamable HTTP and provides five tools on top of the Metrika Reporting API: counter info, visits for a period, traffic source breakdown, user demographics and goal conversions. A diagnostic ping tool checks the transport. Every call is wrapped in an OpenTelemetry trace, the server exposes Prometheus metrics at /metrics and status at /health. It runs locally via uv or in Docker under a non-root user.
Who it is for. For teams that want an observable Metrika reporting MCP server with tracing and metrics for their own infrastructure.
Good fit when
- You need basic Metrika reports (visits, sources, demographics, goals) over MCP
- Observability matters: OpenTelemetry traces and Prometheus metrics on your own server
- You plan to deploy it in Docker alongside your monitoring stack
Not a fit when
- You need the full Stat API or Logs API surface: only five ready tools are implemented here
- You need Direct or Webmaster support in the same server
Example request
Show visits and traffic sources for counter 12345678 over the last weekMCP
- Transport
- http
- Authentication
- API key
Environment variables
YANDEX_API_KEYrequired, secret- Yandex OAuth token with read access to Metrika
YANDEX_COUNTER_ID- Default Metrika counter ID
PORT- Server port, defaults to 8000
ENVIRONMENT- development or production mode; production enforces YANDEX_API_KEY validation
Limitations
Only five reporting tools plus ping are implemented; other Metrika methods (Logs API, management, import) are not covered. The server only speaks streamable HTTP, no stdio mode. A Yandex OAuth token with Metrika access is required. The README has no npx or uvx one-liner, only clone and uv sync.
How to disable. Stop the server process or container and remove its address from your MCP client settings.
FAQ
Can it run without Docker?
Yes, via uv sync and uv run python src/server.py; the server comes up at http://0.0.0.0:8000.
Does the server change anything in the Metrika account?
No, all five tools only read reports, there is no write access to the account.
Discussion
No questions or reviews yet.
Related
All Yandex Metrica toolsYandex 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
Yandex Metrica MCP
yandex-metrica-mcp
Read-only MCP server for Yandex Metrica: reports, period comparison, goals and raw log export with browser login
An MCP server, CLI and Pydantic models for the Yandex Metrika API: reports, counters, goals, filters, segments, logs and offline conversion uploads
A Yandex Metrika MCP server generated from the API spec: 108 methods, 10 tools declared by default, transparent filters and response metadata
A read-only Yandex Metrika MCP server with 31 tools for traffic, content, demographics, geography, conversions and e-commerce, metrika:read only
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 Server (ymetrika-mcp) (this card) | no | API key | 0 | |
| Yandex Metrika MCP Server (Node.js) | no | API key | 1 | fixed report bugs |
| MCP Yandex Metrica with counter management | no | API key | 1 | manage counters and goals |
| Yandex Metrika MCP with DuckDB | no | API key | 0 | analyzes raw Metrika logs locally in DuckDB |
README in short
The README covers quick start via uv and Docker, the endpoint list (mcp, metrics, health) and detailed parameters for each of the five tools with JSON request and response examples. Separate sections cover environment variables, getting a metrika:read OAuth token, OpenTelemetry tracing, Prometheus metrics and project layout. A roadmap at the end marks the basic tools phase done, with batch reports and multi-counter support planned next.