Yandex Webmaster MCP

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

MCP server for Yandex Webmaster API — site analytics, indexing, search queries

概览

AI 生成的概览

面向 Yandex Webmaster API 的本地 MCP 服务器,让助手查看站点健康状况、索引、搜索查询、链接、站点地图和重抓取状态。

可以做什么
读取账户与站点数据:当前用户、带 host_id 的站点列表、站点详情、站点摘要与 SQI 历史、诊断信息、热门查询与查询历史、索引与搜索出现历史及示例 URL、带排除原因的搜索事件、被排除页面、外链与失效内链及其历史、站点地图、重要 URL,以及重抓取配额、队列和任务。为站点添加站点地图文件。将 URL 加入重抓取队列,消耗每日配额。向 Webmaster 添加站点并发起所有权验证。从 Webmaster 移除站点,需显式确认。
适用场景
适合管理被 Yandex 收录的站点时使用:让助手审计索引与搜索表现、排查被移除或排除的页面、检查失效链接和站点地图,或在对话中提交重抓取请求。
运行要求
以本地 Node.js 进程从源码运行(克隆仓库并用 bun 安装依赖)。需要 Yandex OAuth 令牌,放在 YANDEX_WEBMASTER_TOKEN 中;交互式授权流程还需 YANDEX_CLIENT_ID 和 YANDEX_CLIENT_SECRET。需要访问 Yandex Webmaster API 的网络连接。
安装前请注意
YANDEX_WEBMASTER_TOKEN 中的令牌可访问你的 Webmaster 账户;授权流程还会处理 YANDEX_CLIENT_ID 和 YANDEX_CLIENT_SECRET。多个工具会更改账户状态:add-host、start-verification、add-sitemap 和 add-recrawl-url(消耗每日重抓取配额)。delete-host 不可逆,会清除验证、历史与设置,仅在传入字面量 confirm: true 时执行。无作用域的 npm 包名属于无关发布者。

安装

在 SourceWeft 中

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

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

其他 MCP 客户端

参照 仓库 中的启动说明。

README

yandex-webmaster-mcp

MCP server for Yandex Webmaster API v4. Monitor site health, indexing status, search queries, backlinks, sitemaps, and more.

Installation

This package is published as @stufently/yandex-webmaster-mcp; the unscoped name yandex-webmaster-mcp belongs to an unrelated publisher (see the note in the root README). Nothing is on the scope yet, so run it from source:

bash
git clone https://github.com/stufently/yandex-mcp.gitcd yandex-mcp && bun installnode packages/yandex-webmaster-mcp/src/index.mjs

Configuration

Add to your MCP client config:

json
{  "mcpServers": {    "yandex-webmaster": {      "command": "node",      "args": ["/path/to/yandex-mcp/packages/yandex-webmaster-mcp/src/index.mjs"],      "env": {        "YANDEX_WEBMASTER_TOKEN": "your-oauth-token"      }    }  }}

Environment Variables

VariableRequiredDescription
YANDEX_WEBMASTER_TOKENYesOAuth token for Webmaster API
YANDEX_CLIENT_IDFor auth flowYandex OAuth app client ID
YANDEX_CLIENT_SECRETFor auth flowYandex OAuth app client secret

Authentication

To obtain an OAuth token interactively:

bash
node packages/yandex-webmaster-mcp/src/index.mjs auth

This opens a browser for Yandex OAuth authorization and returns a token. Set the token as YANDEX_WEBMASTER_TOKEN.

Note: The Webmaster API uses Authorization: OAuth {token} (not Bearer).

Agent playbook

SKILL.md next to this file is the task-level guide for agents: the new-site flow, the regular-audit order, the recrawl rules, how the three different time-series shapes are read, and — importantly — what API v4 does not have (IndexNow, robots.txt, site region, favicon, mobile status, Metrika binding), so nothing gets invented.

Tool Reference (33 tools)

Core (3)

ToolDescriptionParameters
get-userGet current Webmaster user info and user_id--
list-hostsList all hosts (sites) with their host_id — the identifier every other tool needs--
get-hostGet details for a specific hosthost_id

Statistics (2)

ToolDescriptionParameters
get-summaryGet site summary: SQI, page counts, problemshost_id
get-sqi-historyGet SQI (Site Quality Index) historyhost_id, date_from?, date_to?

Diagnostics (1)

ToolDescriptionParameters
get-diagnosticsGet site diagnostics and problemshost_id

Search Queries (2)

ToolDescriptionParameters
get-popular-queriesGet popular search queries for a sitehost_id, order_by (TOTAL_SHOWS/TOTAL_CLICKS), device_type?, date_from?, date_to?, limit? (1-500, default: 100), offset?
get-query-historyGet search query totals historyhost_id, device_type?, date_from?, date_to?

Indexing (4)

ToolDescriptionParameters
get-indexing-historyGet indexing history over timehost_id, date_from?, date_to?
get-indexing-samplesGet sample indexed URLshost_id, limit? (1-100), offset?
get-insearch-historyGet in-search (appearing in results) historyhost_id, date_from?, date_to?
get-insearch-samplesGet sample URLs appearing in searchhost_id, limit? (1-100), offset?

Search Events (3)

ToolDescriptionParameters
get-search-events-historyGet search URL events historyhost_id, date_from?, date_to?
get-search-events-samplesGet sample URLs for search events, with per-URL exclusion reasons (excluded_url_status): an exclusion_reasons tally of the fetched page plus an excluded_pages list of URL → reasonhost_id, event_type? (APPEARED_IN_SEARCH/REMOVED_FROM_SEARCH — client-side filter, the API has none), limit? (1-100, default: 10), offset?
get-excluded-pagesPages dropped from search inside a time window, with excluded_url_status for each one. Built from REMOVED_FROM_SEARCH events, deduplicated per URL (latest event wins), so a page that came back is reported under returned_to_search instead. Walks the mixed event stream page by page until limit excluded pages are collected, then reports next_offset (first unread event) / exhausted so the walk can continue. Also returns summary_excluded_pages_count for cross-checkinghost_id, limit? (1-100 excluded pages, default: 20), offset?, max_requests? (1-50 page fetches, retries not counted, default: 10), returned_urls? (pass the previous returned_to_search when continuing a walk)

There is no dedicated "excluded pages" resource in API v4: get-summary carries only the aggregate excluded_pages_count, and the reason a given URL was dropped lives on REMOVED_FROM_SEARCH records of /search-urls/events/samples. Since the API has no server-side event filter, count still counts events of both types and limit/offset page the mixed stream. get-search-events-samples reports what one such page contains; get-excluded-pages does the walking, so its limit counts excluded pages rather than events. Per-URL detail beyond the status code: bad_http_status for HTTP_ERROR, and target_url for the redirect target, canonical address or duplicate.

These are events in time, not a snapshot of the index. The same URL appears as REMOVED_FROM_SEARCH and later as APPEARED_IN_SEARCH — it dropped out and came back, and right now it is in search. get-excluded-pages therefore deduplicates by URL and keeps the latest event: a URL whose latest event is an appearance goes to returned_to_search, not to pages. Two consequences worth stating out loud:

  • an exclusion older than the scanned window is invisible, no matter how current it is;
  • deduplication spans one call. Continuing from next_offset starts with an empty state, so a page whose return fell into the previous window would be reported as excluded again — pass the previous returned_to_search in returned_urls to keep the walk honest;
  • excluded_pages_count from get-summary and the length of pages are different kinds of number and are not expected to match. The tool returns the aggregate as summary_excluded_pages_count and says so in its text, instead of leaving the reader to discover a 25x gap on their own.

The per-URL status field is named excluded_url_status everywhere — in the tool descriptions, in excluded_pages from get-search-events-samples and in pages from get-excluded-pages. It is the name from the Yandex reference (ApiExcludedUrlStatus), so it can be grepped against the docs.

Links (4)

ToolDescriptionParameters
get-external-linksGet external links pointing to the sitehost_id, limit? (1-100), offset?
get-external-links-historyGet external links count historyhost_id, date_from?, date_to?
get-broken-internal-linksList broken internal links: destination URL, the source page linking to it, and when Yandex last checked the link. Records carry days_since_last_check, never_rechecked and stale (last check older than 90 days)host_id, limit? (1-100), offset?
get-broken-internal-links-historyGet broken internal links count historyhost_id, date_from?, date_to?

A broken-link record is a snapshot of the last time Yandex checked that link, and that moment can be months old: when source_last_access_date equals discovery_date, nothing has been re-verified since the problem was found, so the link may have been fixed long ago. Each record therefore carries days_since_last_check, never_rechecked and stale (last check older than 90 days — never_rechecked on its own does not set it), and the text block puts the warning above the list. A live check of 258 links reported broken across these sites (2026-09-02) found 10 real 404s; about 80% were 301 redirects. The API is not lying — the old one-line output just made the count read like an outage.

⚠️ In the Yandex reference the name and the description of source_last_access_date disagree: the name says source, the description says "the date the robot last visited the link's destination page". The wording here stays neutral ("last checked") because the conclusion about the record's age holds under either reading, while a conclusion about a specific page does not.

Sitemaps (4)

ToolDescriptionParameters
get-sitemapsList all sitemaps for a hosthost_id, limit? (1-100)
get-sitemapGet details for a specific sitemaphost_id, sitemap_id
get-user-sitemapsList user-added sitemapshost_id, limit? (1-100)
add-sitemapWrite. Add a user sitemap file; returns sitemap_id. Additive — the file is removable in the Webmaster panelhost_id, url

add-sitemap needs the host verified (404 HOST_NOT_VERIFIED otherwise). Adding a file that is already there answers 409 SITEMAP_ALREADY_ADDED; like every other non-2xx here it surfaces as an error, and its payload names the existing sitemap_id — read it as "already present" rather than retrying. Removing a sitemap (DELETE /user-added-sitemaps/{id}) exists in the API but is deliberately not wrapped here.

Important URLs (2)

ToolDescriptionParameters
get-important-urlsGet important URLs for a sitehost_id, limit? (1-100), offset?
get-important-url-historyGet history for a specific important URLhost_id, url, date_from?, date_to?

Recrawl (4)

ToolDescriptionParameters
get-recrawl-quotaGet recrawl quota (daily limit and remainder)host_id
add-recrawl-urlWrite. Enqueue a URL for re-crawl; consumes daily quotahost_id, url
get-recrawl-queueList submitted recrawl tasks and their statehost_id, limit? (default: 10), offset?
get-recrawl-taskGet the state of one recrawl taskhost_id, task_id

Host Management (4)

These change your Webmaster account, not just read from it.

ToolDescriptionParameters
add-hostWrite. Add a site to Webmaster (needs verification afterwards). Additive — undone by delete-hosthost_url (with protocol)
verify-hostGet verification state and applicable verification methodshost_id
start-verificationWrite. Start the ownership check (POST …/verification, no body). The verification_uin must already be on the site; the check is asynchronous — poll verify-host. Additivehost_id, verification_type (HTML_FILE / META_TAG / DNS)
delete-hostWrite. Remove a site from Webmaster. Irreversible — see Deleting a host. Needs confirm: truehost_id, confirm
Deleting a host

delete-host is the only irreversible tool here, and it refuses to run unless the call carries confirm: true:

json
{ "host_id": "https:example.com:443", "confirm": true }

Called without it, the tool returns an error result and sends nothing to the Webmaster API:

Refused: `delete-host` requires explicit confirmation.
Removing host https:example.com:443 from Yandex Webmaster is irreversible — the site'sverification, its accumulated indexing and search-query history, and its sitemap andimportant-URL settings go with it. Adding the same site back creates a fresh host that must beverified again and starts with no history.
Nothing was sent to the Webmaster API — no host was touched.
To go ahead, call `delete-host` again with host_id https:example.com:443 and `confirm: true`.To check which site this host ID stands for first, call `get-host-info` or `list-hosts`.

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.

The other three writes are deliberately left unguarded: add-host is additive and undone by delete-host, add-recrawl-url only queues a URL for re-crawl against a daily quota that replenishes, and add-sitemap adds a file that stays removable and takes no history with it. A confirmation on every write would train callers to pass confirm: true by reflex, which is exactly what would defeat it on the one call that matters.

Common Parameters

  • host_id -- Host identifier, URL-encoded (e.g., https:example.com:443). Get it from list-hosts.
  • date_from, date_to -- Dates in YYYY-MM-DD format. Strictly validated (no silent date overflow).
  • limit, offset -- Pagination controls.
  • device_type -- One of: ALL, DESKTOP, MOBILE, TABLET, MOBILE_AND_TABLET.

Caching

The user_id is fetched once on the first API call and cached for the session. It is automatically invalidated on 401/403 errors.

License

MIT

来源:packages/yandex-webmaster-mcp/README.md,提交 bdd6c64

工具

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

版本历史

2
  1. v2.2.1最新Oct 16, 2026
  2. v2.2.0Oct 15, 2026

评分

已满足适用检查项的 50%

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

  • 近 30 天内可连通25 分

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

  • 已声明认证方式10 分

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

  • 已列出工具15 分

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

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