yandex-metrika-mcp

io.github.theYahia由 GitHub 账号 theYahia 发布v2.1.1更新于 Oct 24, 2026

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

已验证STDIO仅桌面数据与分析商业与电商

概览

AI 生成的概览

让助手读取和管理 Yandex.Metrica 网站分析数据:计数器、目标、报告、日志和流量。

可以做什么
把 Yandex.Metrica 的管理、报告和日志 API 封装为 15 个工具。可以列出、创建、更新和删除计数器与目标,导出原始访问和点击日志,并用自定义指标、维度、过滤和排序运行灵活报告。便捷工具提供流量概览、流量来源细分和热门页面,还支持两个时间段的对比和层级下钻报告。
适用场景
当网站分析数据存放在 Yandex.Metrica,且希望助手在不打开网页界面的情况下获取流量数据、对比时间段、查看热门页面或管理计数器与目标时适用。
运行要求
通过 stdio 在本地运行,通常用 npx 启动 npm 包 @theyahia/yandex-metrika-mcp,因此需要 Node.js。必须提供来自 Yandex OAuth 的 OAuth 2.0 Bearer 令牌,放在环境变量 YANDEX_METRIKA_TOKEN 中。可选 HTTP 模式会在本地 3000 端口提供端点。需要访问 Yandex API 的网络连接。
安装前请注意
YANDEX_METRIKA_TOKEN 中的令牌可访问该账户的 Metrika 数据,应作为机密保管。多个工具会写入或删除数据:create_counter、update_counter、delete_counter、create_goal 和 delete_goal,其中 delete_counter 被说明为不可恢复。正常调用 API 时分析数据会发送给 Yandex。

安装

在 SourceWeft 中

  1. 打开 控制台中的 yandex-metrika-mcp,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

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

来源:README.md,提交 2c736e0

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v2.1.1最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分