Yandex MCP Server
An MCP server for Yandex Direct, Metrika, Wordstat and Webmaster: campaigns, ads, bids, reports and keyword research from chat
Install
git clone https://github.com/SvechaPVL/yandex-mcp.git
cd yandex-mcp
python -m venv .venv
source .venv/bin/activate
pip install -e .Requires Python 3.10 or newer.
This is third-party code. Review the repository files before installing.
What it does
The server connects the agent to the Direct API v5, Metrika, Wordstat and Webmaster v4. In Direct the agent creates and edits campaigns, ad groups, ads, keywords, bids, bid modifiers, retargeting, feeds and extensions, and pulls statistics. In Metrika it manages counters, goals, segments, filters and access grants, builds reports and uploads offline conversions and expenses. Wordstat gives query frequency, trends and regional split, and Webmaster shows sites, quality index and search queries.
Who it is for. For marketers and PPC specialists running Yandex Direct and Metrika accounts.
Good fit when
- You need campaign stats and conversions for a period quickly
- You need to pause campaigns or change bids in bulk
- You need query frequency and trends from Wordstat
Not a fit when
- You have no Direct API access: the request must be approved in the account
- The agent cannot be trusted with live account changes without review
Example request
Show spend and conversions for the Lead goal across all active campaigns last weekLimitations
Requires a Yandex OAuth token with direct:api, metrika:read and metrika:write, plus a Yandex Cloud service account API key for Wordstat. Deleting campaigns, ads and counters is irreversible and there is no read-only mode, though the Direct sandbox is available for testing. Install from a repository clone only.
How to disable. Remove the yandex block from your MCP client config and revoke the OAuth token at oauth.yandex.ru.
MCP
- Transport
- stdio
- Authentication
- API key
| Environment variables | |
|---|---|
| YANDEX_TOKEN required, secret | Yandex OAuth token for Direct and Metrika |
| YANDEX_DIRECT_TOKEN secret | Separate token for Direct |
| YANDEX_METRIKA_TOKEN secret | Separate token for Metrika |
| YANDEX_CLIENT_LOGIN | Client login for agency accounts |
| YANDEX_USE_SANDBOX | true enables the Direct sandbox |
| YANDEX_WORDSTAT_API_KEY secret | Yandex Cloud service account API key for Wordstat |
| YANDEX_CLOUD_FOLDER_ID | Yandex Cloud folder ID for Search API |
Security check
- Changes bids, budgets and strategies, which spends ad money
- Can permanently delete campaigns, ads and counters
- Holds OAuth tokens with write access
README in short
The README is in English with a Russian version. It lists capabilities per API and gives full tool tables with descriptions. The quick start is cloning, installing the package, getting a token at oauth.yandex.ru and adding the server to the client config. Environment variables, running via MCP Inspector, package layout and security tips are covered separately. MIT license.
FAQ
Does it support agency accounts?
Yes, the client login is set with YANDEX_CLIENT_LOGIN.
Why does Wordstat not work with the OAuth token?
The old OAuth Wordstat API is decommissioned, so the server uses Search API v2 with a Yandex Cloud service account key.
Related
A Claude Code plugin for SEO audits: technical SEO, E-E-A-T, schema, local and AI search via parallel subagents
A CLI and agent skill for website SEO audits: technical SEO, Core Web Vitals, structured data, security and AI search readiness
A marketplace of 22 Claude Code plugins: Yandex Direct, Metrika, Webmaster, Wordstat, SEO crawling, publishing and research
Five MCP servers for Wordstat, Search, Webmaster, Metrica and Direct, plus a Claude Code plugin with keyword and competitor skills