
Yandex Metrika MCP
io.github.stufently由 GitHub 帳號 stufently 發布v2.2.1更新於 Oct 24, 2026
MCP server for Yandex Metrika API — web analytics, traffic, audience data
概覽
面向 Yandex Metrika API 的本機 MCP 伺服器,讓助理讀取網站流量、受眾與報表資料,並管理計數器。
- 可以做什麼
- 列出計數器,查看計數器詳細資料與目標
- 建立與刪除計數器(刪除需明確確認)
- 取得流量彙總、來源、地理、裝置與熱門頁面
- 列出帶來流量的熱門搜尋詞
- 以自選指標、維度、篩選與排序執行自訂 Stat API 報表
- 適用情境
- 當你使用 Yandex Metrika,希望助理在對話中彙總網站流量、比較來源或裝置、查看搜尋詞,或臨時產生報表時適用。
- 執行需求
- 需在本機透過 Node.js 從複製的原始碼執行(README 說明該範圍下尚未發布套件)。需要 Yandex Metrika OAuth 權杖,放在 YANDEX_METRIKA_TOKEN 中;互動式授權流程另需 YANDEX_CLIENT_ID 與 YANDEX_CLIENT_SECRET。可選 YANDEX_METRIKA_SCOPE 覆寫申請的權限範圍。需能連線至 Metrika API 的網路。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Yandex Metrika MCP,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
yandex-metrika-mcp
MCP server for Yandex Metrika API. Access web analytics data -- traffic summaries, audience demographics, traffic sources, popular pages, search phrases, and custom reports.
Installation
This package is published as @stufently/yandex-metrika-mcp; the unscoped name yandex-metrika-mcp
belongs to an unrelated publisher (see the note in the root README).
Nothing is on the scope yet, so run it from source:
Configuration
Add to your MCP client config:
Environment Variables
Authentication
To obtain an OAuth token interactively:
This opens a browser for Yandex OAuth authorization and returns a token. Set it as
YANDEX_METRIKA_TOKEN.
Scopes
The helper requests metrika:read metrika:write by default. The write scope is not
optional decoration: create-counter and delete-counter are rejected with HTTP 403 without
it, and the rejection arrives at the moment you try to create a counter, not at setup time.
For a token that can only read, ask for less:
The two write tools then fail with a 403 whose message names the missing scope. Both tools also say so in their own descriptions, so a model can tell the difference between "not allowed" and "broken" before calling them.
A write-capable token no longer means an unguarded delete: delete-counter requires an explicit
confirm: true regardless of scope — see Deleting a counter.
Note: The Metrika API uses Authorization: OAuth {token} (not Bearer).
Tool Reference (12 tools)
Management (5)
Deleting a counter
delete-counter is the only irreversible tool here, and it refuses to run unless the call
carries confirm: true:
Called without it, the tool returns an error result and sends nothing to the Metrika API:
confirm is optional in the JSON schema on purpose: a missing confirmation has to come back as
that explanation, not as a schema validation error a model cannot act on. Only a literal
true counts — "true", 1 and "yes" are refused, because a guess at the protocol is not a
decision to delete anything. The tool is also marked destructiveHint: true in its MCP
annotations, so clients that surface tool risk can show it before the call.
Why the parameter exists: until the default OAuth scope included metrika:write, an accidental
delete-counter was stopped by the 403 a read-only token produced. Fixing that 403 (so setup
works the first time) removed the only real brake, and "Irreversible" in a description is a
hope that the model reads carefully, not a guard.
Reporting (6)
Custom (1)
get-report Parameters
The get-report tool provides full access to the Metrika Stat API:
Default Date Range
When date_from and date_to are not specified, all reporting tools default to the last 30 days.
Data Sampling
The Metrika Stat API may return sampled data for large datasets. When sampling is applied, the response includes a note indicating that figures are approximate.
License
MIT
來源:packages/yandex-metrika-mcp/README.md,提交 bdd6c64
工具
0版本歷史
2- v2.2.1最新Oct 16, 2026
- v2.2.0Oct 15, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分