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 分