yandex-metrika-mcp

io.github.theYahiaPublished by GitHub account theYahiav2.1.1Updated Oct 24, 2026

MCP server for Yandex Metrika — web analytics, counters, goals, traffic (Russia)

VerifiedSTDIODesktop onlyData & AnalyticsBusiness & Commerce

Overview

AI-generated overview

Lets an assistant read and manage Yandex.Metrica web analytics: counters, goals, reports, logs, and traffic data.

What you can do
Wraps the Yandex.Metrica Management, Reporting, and Logs APIs in 15 tools. It can list, create, update, and delete counters and goals, export raw visit and hit logs, and run flexible reports with custom metrics, dimensions, filters, and sorting. Convenience tools give traffic summaries, traffic-source breakdowns, and top pages, plus period-over-period comparison and drill-down reports.
When to use it
Useful when a site's analytics live in Yandex.Metrica and you want an assistant to pull traffic numbers, compare periods, inspect top pages, or manage counters and goals without opening the web interface.
Requirements
Runs locally over stdio, typically via npx from the npm package @theyahia/yandex-metrika-mcp, so Node.js is needed. An OAuth 2.0 Bearer token from Yandex OAuth is required in the environment variable YANDEX_METRIKA_TOKEN. An optional HTTP mode serves a local endpoint on port 3000. Network access to Yandex APIs is required.
Before you install
The token in YANDEX_METRIKA_TOKEN grants access to the account's Metrika data and should be treated as a secret. Several tools write or destroy data: create_counter, update_counter, delete_counter, create_goal, and delete_goal, and delete_counter is described as irreversible. Analytics data is sent to Yandex as part of normal API use.

Installation

In SourceWeft

  1. Open yandex-metrika-mcp in the dashboard and add it to a workspace.
  2. Enable the server for the chats that should use its tools.

Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.

Other MCP clients

Follow the launch instructions in the repository.

README

@theyahia/yandex-metrika-mcp

MCP server for Yandex.Metrica API — counters, goals, reports, logs, traffic sources, top pages. 15 tools, OAuth Bearer token auth.

[npm] [License: MIT]

Part of the Russian API MCP series by @theYahia.

Getting a Token

  1. Go to oauth.yandex.ru
  2. Create an app (or use an existing one)
  3. Under Platforms, select "Web services"
  4. Under Access, add: Yandex.Metrica -> Read statistics and counter parameters
  5. Get the OAuth token:
    https://oauth.yandex.ru/authorize?response_type=token&client_id=YOUR_CLIENT_ID
  6. Copy the token from the redirect URL (access_token=...)

Installation

Claude Desktop

Add to claude_desktop_config.json:

json
{  "mcpServers": {    "yandex-metrika": {      "command": "npx",      "args": ["-y", "@theyahia/yandex-metrika-mcp"],      "env": {        "YANDEX_METRIKA_TOKEN": "your_token"      }    }  }}

Claude Code

bash
claude mcp add yandex-metrika -e YANDEX_METRIKA_TOKEN=your_token -- npx -y @theyahia/yandex-metrika-mcp

Streamable HTTP (remote / multi-client)

bash
YANDEX_METRIKA_TOKEN=your_token npx @theyahia/yandex-metrika-mcp --http --port=3000

Endpoint: POST http://localhost:3000/mcp Health check: GET http://localhost:3000/health

Smithery

Use smithery.yaml from the repository. Requires YANDEX_METRIKA_TOKEN.

Environment Variables

VariableRequiredDescription
YANDEX_METRIKA_TOKENYesOAuth 2.0 Bearer token from Yandex OAuth

Tools (15)

Management — Counters

ToolDescription
list_countersList all counters. Filter by name/URL with search_string.
get_counterGet full details of a single counter by ID.
create_counterCreate a new counter for a website.
update_counterUpdate counter name or site URL.
delete_counterPermanently delete a counter (irreversible).

Management — Goals

ToolDescription
list_goalsList all goals for a counter.
create_goalCreate a goal (url, number, step, action types).
delete_goalDelete a goal from a counter.

Management — Logs

ToolDescription
export_logsExport raw visit/hit logs via the Logs API.

Reporting API

ToolDescription
get_reportFlexible reporting — any metrics + dimensions + filters + sort.
get_report_comparisonCompare two date periods (A vs B).
get_report_drilldownHierarchical drill-down into report dimensions.

Convenience Wrappers

ToolDescription
get_traffic_summaryQuick overview: visits, pageviews, users, bounce rate, avg duration.
get_traffic_sourcesTraffic sources breakdown by channel.
get_top_pagesTop pages by pageviews with performance metrics.

Demo Prompts

Show me all my Yandex.Metrica counters
Compare last week's traffic to the previous week for counter 12345678
What are the top 10 pages on my site this month, sorted by pageviews?

Development

bash
npm installnpm run buildnpm testnpm run dev           # stdio modenpm run start:http    # HTTP mode on port 3000

API Reference

License

MIT

Source: README.md at commit 2c736e0

Tools

0
SourceWeft has not started this package in its sandbox yet, so its tools are not known.

Version history

1
  1. v2.1.1LatestSep 16, 2026

Score

50% of the applicable checks met

How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.

  • Reached in the last 30 days25 pts

    Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.

  • Auth declared10 pts

    Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.

  • Tools listed15 pts

    Answer tools/list without a credential, or ship a package that starts in a sandbox without one.

  • DescriptionRequired15 pts
  • Logo10 pts
  • Documentation15 pts
  • License10 pts