yandex-direct-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@yandex-direct-mcp Show campaign performance for last 30 days"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
yandex-direct-mcp
Hardened форк axisrow/yandex-direct-mcp-plugin. Управление Яндекс.Директом из MCP-клиента (Claude Code, Cursor и другие). Только чтение по умолчанию — запись включается явно через YANDEX_DIRECT_ENABLE_WRITES=true. OAuth реализован пакетом direct-cli (бинарь direct); каждый пользователь авторизуется под своим Яндекс-аккаунтом.
Профили и поверхность инструментов
Профиль | Как активируется | Что включено | Инструментов |
analytics (по умолчанию) | — | Отчёты, статистика, прогноз, Wordstat, словари, изменения (только чтение) | ~26 |
campaign-editor |
| Управление кампаниями, группами, объявлениями, ставками (чтение + запись) | ~36 |
Финансы |
| Пополнение счёта, счета, переводы ( | +3 |
full |
| Все 146 инструментов | 146 |
Переменные окружения
Переменная | Назначение |
|
|
|
|
| Явный выбор профиля: |
| Allow-list групп (через запятую): |
| Убрать группы из активной поверхности (не расширяет до full — safe-by-default). |
| Allow-list конкретных инструментов (через запятую). |
| Убрать конкретные инструменты из активной поверхности. |
Важно:
DISABLED_*переменные уточняют активную поверхность, но не расширяют её до полного набора. Если одновременно не указаныENABLED_*, не выставлен явныйTOOL_PROFILEи не установленENABLE_WRITES=true— сервер стартует в профилеanalytics(только чтение).
Приоритет:
YANDEX_DIRECT_ENABLE_WRITESигнорируется, если заданYANDEX_DIRECT_TOOL_PROFILEили любая изYANDEX_DIRECT_ENABLED_GROUPS/YANDEX_DIRECT_ENABLED_TOOLS— явный профиль или allow-list имеют приоритет.
Related MCP server: yandex-marketing-mcp
Установка
Claude Code (рекомендуемый способ — uvx)
claude mcp add yandex-direct \
-- uvx --from git+https://github.com/nikolaymokh-dev/yandex-direct-mcp@v0.1.0 yandex-direct-mcpЧтобы включить запись:
claude mcp add yandex-direct \
--env YANDEX_DIRECT_ENABLE_WRITES=true \
-- uvx --from git+https://github.com/nikolaymokh-dev/yandex-direct-mcp@v0.1.0 yandex-direct-mcp.claude.json / Cursor / другие MCP-клиенты
{
"mcpServers": {
"yandex-direct": {
"command": "uvx",
"args": [
"--from",
"git+https://github.com/nikolaymokh-dev/yandex-direct-mcp@v0.1.0",
"yandex-direct-mcp"
],
"env": {
"YANDEX_DIRECT_ENABLE_WRITES": "true"
}
}
}
}Поле "env" не обязательно — без него сервер запускается в read-only (analytics) режиме.
Запуск standalone (без MCP-клиента, для проверки)
uvx --from git+https://github.com/nikolaymokh-dev/yandex-direct-mcp@v0.1.0 yandex-direct-mcpЗапускает stdio-сервер напрямую (для теста установки; обычно сервер запускает MCP-клиент).
Первый вход (OAuth / PKCE)
После установки и запуска MCP-сервера вызовите инструмент auth_login:
mcp__yandex_direct__auth_login()Сервер напечатает URL. Откройте его в браузере и авторизуйтесь в своём Яндекс-аккаунте. PKCE-поток реализован пакетом direct-cli; токен сохраняется локально в ~/.direct-cli/auth.json (права 0600).
Не используйте
auth_setup(code=...)на общих машинах — код авторизации будет виден вpsи системных логах.
Включение управления кампаниями и финансов
Запись (управление кампаниями, группами, объявлениями, ставками):
# В ~/.claude/settings.json
{
"env": {
"YANDEX_DIRECT_ENABLE_WRITES": "true"
}
}Финансовые инструменты (пополнение, счета, переводы) — отдельное осознанное решение:
{
"env": {
"YANDEX_DIRECT_ENABLE_WRITES": "true",
"YANDEX_DIRECT_ENABLE_FINANCE": "true"
}
}⚠ Финансовые операции работают с реальными деньгами. Включайте только в окружениях с явными правами на финансовые транзакции.
(Опционально) Запуск как Claude Code плагин
Если репозиторий клонирован локально, плагин запускается через hooks/run-server.sh:
// .mcp.json (пример для Claude Code plugin channel)
{
"mcpServers": {
"yandex-direct-mcp": {
"command": "bash",
"args": ["${CLAUDE_PLUGIN_ROOT}/hooks/run-server.sh"]
}
}
}Детали bootstrap и troubleshooting — в hooks/setup.sh и CLAUDE.md.
Документация
Настройка доступа к API → docs/SETUP.md
Модель угроз и безопасность → docs/SECURITY.md
Синхронизация с upstream → docs/SYNC.md
Лицензия
MIT — форк axisrow/yandex-direct-mcp-plugin, см. NOTICE.
Available Tools
26 toolsauth_loginA
Start interactive OAuth login through direct (elicits the authorization code); use auth_setup if you already have a y0_ token. Call tool_help('auth_login') for parameters.
Inputs: login, profile, force.
auth_setupB
Save a ready-made direct OAuth token (y0_...) into a direct auth profile; use auth_login for the interactive browser flow. Call tool_help('auth_setup') for parameters.
Inputs: code (required), login, profile.
auth_statusC
Check the current direct auth profile status (token presence, login, expiry). Call tool_help('auth_status') for parameters.
Inputs: profile.
changes_checkA
Check what changed since a timestamp within specific objects, filtered by exactly one of campaign_ids / ad_group_ids / ad_ids. Use this for targeted checks; use changes_check_campaigns for an account-wide campaign-level scan. Call tool_help('changes_check') for parameters.
Inputs: timestamp (required), field_names, fields, campaign_ids, +2 more.
changes_check_campaignsA
Check account-wide campaign-level changes since a timestamp (which campaigns changed). Use this for a broad scan; use changes_check to drill into specific campaign/ad-group/ad IDs. Call tool_help('changes_check_campaigns') for parameters.
Inputs: timestamp (required).
changes_check_dictionariesB
Check whether Yandex.Direct reference dictionaries (e.g. regions) have changed; takes no parameters. Call tool_help('changes_check_dictionaries') for parameters.
Inputs: no named parameters.
dictionaries_getB
Get reference dictionary data by names (Currencies, GeoRegions, TimeZones, etc.); use dictionaries_list_names to see options. Call tool_help('dictionaries_get') for parameters.
Inputs: names (required).
dictionaries_get_geo_regionsC
Get GeoRegions dictionary entries, optionally filtered by name or region IDs. Call tool_help('dictionaries_get_geo_regions') for parameters.
Inputs: fields (required), name, region_ids, exact_names.
dictionaries_list_namesA
List the dictionary names accepted by dictionaries_get. Call tool_help('dictionaries_list_names') for parameters.
Inputs: no named parameters. Returns: result
keywordsresearch_deduplicateC
Deduplicate a list of keywords. Call tool_help('keywordsresearch_deduplicate') for parameters.
Inputs: keywords (required).
keywordsresearch_has_search_volumeC
Check whether keywords have search volume in given regions. Call tool_help('keywordsresearch_has_search_volume') for parameters.
Inputs: keywords (required), region_ids (required), fields.
leads_getB
List leads (form submissions) for the given Turbo pages; leads are scoped to Turbo pages, not campaigns. Call tool_help('leads_get') for parameters.
Inputs: turbo_page_ids (required), datetime_from, datetime_to, limit, +2 more.
reports_customA
Build an arbitrary Yandex.Direct statistics report: any FieldNames, filters, ordering, date/week/month/goal breakdowns, pagination, and file output. Use reports_custom for arbitrary fields & breakdowns; use reports_get for a quick recent snapshot. Call tool_help('reports_custom') for parameters.
Inputs: field_names (required), date_from, date_to, report_type, +21 more. Returns: result
reports_getA
Quick per-campaign performance snapshot over a short recent window (~last 8 days, default fields). Use reports_get for a fast overview; use reports_custom for arbitrary fields, filters, or date/goal breakdowns. Call tool_help('reports_get') for parameters.
Inputs: date_from, date_to. Returns: result
reports_list_typesA
List supported Yandex.Direct report types with guidance on when to pick each (use before reports_custom if unsure which report_type fits). Call tool_help('reports_list_types') for parameters.
Inputs: no named parameters. Returns: result
tool_helpA
Get the full documentation for another tool: parameter reference, examples and constraints. Call this BEFORE using an unfamiliar tool — the tools themselves carry only a one-line summary. Pass the exact tool name (e.g. 'campaigns_add'); omit the name to list every available tool.
Inputs: name.
v4events_get_events_logC
Get v4 Live events log entries via GetEventsLog for a timestamp range. Call tool_help('v4events_get_events_log') for parameters.
Inputs: timestamp_from (required), timestamp_to (required), currency, limit, +2 more. Returns: result
v4forecast_createC
Create a v4 Live budget forecast via CreateNewForecast (up to 100 phrases). Call tool_help('v4forecast_create') for parameters.
Inputs: phrases (required), geo_ids, currency, dry_run. Returns: result
v4forecast_getC
Get a ready v4 Live budget forecast by ID via GetForecast. Call tool_help('v4forecast_get') for parameters.
Inputs: forecast_id (required). Returns: result
v4forecast_listA
List v4 Live budget forecasts via GetForecastList. Call tool_help('v4forecast_list') for parameters.
Inputs: no named parameters. Returns: result
v4goals_get_retargeting_goalsB
Get retargeting goals for campaigns (v4 Live); use v4goals_get_stat_goals for Metrica stat goals. Call tool_help('v4goals_get_retargeting_goals') for parameters.
Inputs: campaign_ids (required). Returns: result
v4goals_get_stat_goalsB
Get Yandex Metrica stat goals available for campaigns (v4 Live); use v4goals_get_retargeting_goals for retargeting goals. Call tool_help('v4goals_get_stat_goals') for parameters.
Inputs: campaign_ids (required). Returns: result
v4keywords_get_suggestionA
Get related keyword suggestions via v4 Live GetKeywordsSuggestion (up to 20 phrases; spends API points). Call tool_help('v4keywords_get_suggestion') for parameters.
Inputs: keywords (required). Returns: result
v4wordstat_create_reportB
Create a v4 Live Wordstat report via CreateNewWordstatReport (up to 10 phrases). Call tool_help('v4wordstat_create_report') for parameters.
Inputs: phrases (required), geo_ids, dry_run. Returns: result
v4wordstat_get_reportC
Get a ready v4 Live Wordstat report by ID via GetWordstatReport. Call tool_help('v4wordstat_get_report') for parameters.
Inputs: report_id (required), dry_run. Returns: result
v4wordstat_list_reportsC
List v4 Live Wordstat reports via GetWordstatReportList. Call tool_help('v4wordstat_list_reports') for parameters.
Inputs: dry_run. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 26 tools
Each tool has a clearly distinct purpose, grouped by functional area (auth, changes, dictionaries, keywordsresearch, leads, reports, v4*). Within groups, create/get/list patterns are well-separated, and descriptions clarify any potential overlap.
Tool names follow a consistent area_verb pattern (e.g., auth_login, dictionaries_get, v4forecast_create). The only exception is tool_help, a meta tool. All others adhere to snake_case and predictable naming.
26 tools is slightly above the typical 3-15 range, but it is justified by the breadth of features covered (authentication, changes, dictionaries, keyword research, leads, reporting, v4 Live API). The organization keeps it manageable.
The tool set focuses on data retrieval and analysis (reports, dictionaries, changes, forecasts) but lacks core campaign management operations such as creating, updating, or deleting campaigns, ad groups, or bids. This limits its completeness for full Yandex Direct management.
Related MCP Connectors
Google Ads MCP server — manage campaigns, keywords, and metrics.
MCP servers for Yandex APIs: Wordstat, Search, Webmaster, Metrika, Direct. Open source, by Seyka AI.
MCP server for querying and analyzing data from ad platforms, analytics tools, and spreadsheets
Yandex Direct, Metrika & Wordstat MCP for Russian digital marketing.
Related MCP Servers
- AlicenseAqualityCmaintenanceMCP server for Yandex.Direct API v5 enabling management of campaigns, ad groups, ads, keywords, statistics, and account info via 12 tools.2092 npm4MIT
- AlicenseBqualityCmaintenanceMCP server for managing Yandex Direct advertising, Yandex Metrica analytics, Wordstat keyword research, and Yandex Webmaster SEO tools, with self-configuring OAuth; provides 153 tools for complete ad and search workflows from AI assistants.10014 npm3MIT
- AlicenseNot gradedqualityDmaintenanceMCP server for Yandex Direct, Metrika, Wordstat, and Webmaster APIs, providing 132 tools to manage advertising campaigns, analytics, keyword research, and reporting through any MCP-compatible client.58MIT
- AlicenseAqualityCmaintenanceA local MCP server that connects Yandex Direct advertising reports and safe campaign creation to AI agents, enabling natural-language analytics and protected campaign setup.82MIT