Skip to content
MCP server
Registry

yandex-direct MCP Server

MCP server for Yandex Direct API v5 — campaigns, ads, keywords, bids, audiences

yandex-direct scores 39 (Limited), with no SPDX license recorded and written in Python. It installs as a local process. It does not declare tools yet. Filed under Marketing. GitHub shows 1 stars. Install configs are generated for 12 clients. Being listed in the registry is not the same as being vendor-official.

by dontsovcmcNo licensePython1 stars
Trust score
39Limited
Trust score 39 of 100, Limited

Limited trust

39 of 100 from six public signals. Nobody can buy a point.

  • Listed in the official MCP registry.
  • No license recorded.
How we score trust
Scorecard

License, quality and maintenance

How grades work
Trust breakdown

Where the 39 comes from

22 + 5 + 1 + 0 + 4 + 7 = 39. Each factor is capped, so no single signal can carry a listing.

Registry22 / 30

Active in the official MCP registry, plus a known vendor namespace.

Registry: 22 of 30 points.
Maintenance5 / 20

How recently the repository saw a commit or release.

Maintenance: 5 of 20 points.
Popularity1 / 20

GitHub stars and weekly downloads, on a log scale.

Popularity: 1 of 20 points.
License0 / 10

A clear, OSI-style open-source license.

License: 0 of 10 points.
Security4 / 10

Not archived, a secure install path, a pinned version.

Security: 4 of 10 points.
Docs7 / 10

A real summary, a README with depth, listed tools.

Docs: 7 of 10 points.

Install

Pick your client, copy the config, paste it in.

Needs Cursor or VS Code installed on this device. The button opens the app and asks you to confirm before it adds the server.

~/Library/Application Support/Claude/claude_desktop_config.json
{  "mcpServers": {    "dontsovcmc-mcp-server-yandex-direct": {      "command": "uvx",      "args": [        "mcp-server-yandex-direct"      ],      "env": {        "YD_TOKEN": "YOUR_YD_TOKEN",        "YD_CLIENT_LOGIN": "",        "YD_LANG": "",        "YD_TIMEOUT": "",        "YD_FILE_TIMEOUT": ""      }    }  }}

Environment variables

NameRequiredNotes
YD_TOKENSecretRequired—
YD_CLIENT_LOGINOptional—
YD_LANGOptional—
YD_TIMEOUTOptional—
YD_FILE_TIMEOUTOptional—

Tools show up when the registry metadata or the repository README lists them. Public READMEs are read directly. A GitHub token is used only when one is already configured.

About

mcp-server-yandex-direct

Version

MCP-сервер, CLI-утилита и библиотека Pydantic-моделей для Yandex Direct API v5.

  • MCP-сервер — интеграция с Claude Code, Claude Desktop и другими MCP-клиентами
  • CLI-утилита — работа с API из терминала, скрипты и автоматизация
  • Pydantic-модели — типизированные модели API для использования в своих Python-программах

Все данные остаются на вашем компьютере — токен никуда не передаётся.

Оглавление

Архитектура

Сервер использует паттерн search + execute — вместо 79 отдельных инструментов предоставляет 2:

ИнструментОписание
yd_searchПоиск действий по описанию на естественном языке
yd_executeВыполнение действия по ID

Как это работает

LLM: yd_search("остановить кампании")
→ [{"id": "campaigns-suspend", "params_schema": {"SelectionCriteria": {...}, ...}, ...}]

LLM: yd_execute("campaigns-suspend", '{"SelectionCriteria": {"Ids": [12345]}}')
→ {"SuspendResults": [...]}

Доступные действия (79)

ДоменКол-воОписание
campaigns8Кампании: создание, управление, архивация
adgroups4Группы объявлений
ads9Объявления: создание, управление, модерация
keywords6Ключевые слова
bidding7Ставки и корректировки ставок
assets11Быстрые ссылки, изображения, видео, расширения
audience10Аудитории и ретаргетинг
negkeywords4Общие списки минус-слов
feeds4Фиды для динамических объявлений
creatives2Креативы для медийных объявлений
research2Исследование ключевых слов
leads1Лиды из форм лидогенерации
changes3Отслеживание изменений
account6Аккаунт, справочники, клиенты агентства
turbopages1Турбо-страницы
reports1Отчёты (TSV/CSV)

MCP-сервер

Установка

Шаг 1. Получить OAuth-токен

  1. Войдите в Яндекс Директ
  2. Перейдите в Настройки → API
  3. Создайте OAuth-токен с нужными правами
  4. Скопируйте токен

Шаг 2. Подключить MCP-сервер

Подключение к Claude Code

Способ 1: через uvx (не требует установки пакета)

Требуется uv — если не установлен:

curl -LsSf https://astral.sh/uv/install.sh | sh
claude mcp add yandex-direct \
  -e YD_TOKEN=ваш_токен \
  -- uvx mcp-server-yandex-direct

Способ 2: через pip

pip install mcp-server-yandex-direct

claude mcp add yandex-direct \
  -e YD_TOKEN=ваш_токен \
  -- python -m mcp_server_yandex_direct

Для удаления:

claude mcp remove yandex-direct

Подключение к Claude Desktop

Добавьте в конфигурационный файл:

КлиентОСПуть к файлу
Claude Codeвсе~/.claude/settings.json (секция mcpServers)
Claude DesktopmacOS~/Library/Application Support/Claude/claude_desktop_config.json
Claude DesktopWindows%APPDATA%\Claude\claude_desktop_config.json
Claude DesktopLinux~/.config/Claude/claude_desktop_config.json

Через uvx:

{
  "mcpServers": {
    "yandex-direct": {
      "command": "uvx",
      "args": ["mcp-server-yandex-direct"],
      "env": {
        "YD_TOKEN": "ваш_токен"
      }
    }
  }
}

Через pip (после pip install mcp-server-yandex-direct):

{
  "mcpServers": {
    "yandex-direct": {
      "command": "python",
      "args": ["-m", "mcp_server_yandex_direct"],
      "env": {
        "YD_TOKEN": "ваш_токен"
      }
    }
  }
}

Подключение через --mcp-config

Подключает сервер только на время одной сессии Claude, не сохраняя в настройки. Токен хранится в отдельном .env.mcp файле, а не в конфиге Claude.

Из JSON-строки:

claude --mcp-config '{"yandex-direct":{"command":"bash","args":["-c","source ~/.env.mcp && exec uvx mcp-server-yandex-direct"]}}'

Из файла:

claude --mcp-config ~/mcp-servers.json

Пример ~/mcp-servers.json:

{
  "yandex-direct": {
    "command": "bash",
    "args": ["-c", "source ~/.env.mcp && exec uvx mcp-server-yandex-direct"]
  }
}

Пример ~/.env.mcp:

YD_TOKEN=ваш_токен

Шаг 3. Проверить

Попросите Claude: «Покажи список кампаний» — он вызовет yd_search, получит схему campaigns-get, затем yd_execute.

Примеры (MCP)

Claude автоматически использует yd_search для поиска нужного действия, затем yd_execute для его выполнения:

  • «Покажи все активные кампании» → yd_search("кампании") → yd_execute("campaigns-get", ...)
  • «Останови кампании 123, 456» → yd_search("остановить кампании") → yd_execute("campaigns-suspend", ...)
  • «Покажи объявления кампании 789» → yd_search("объявления") → yd_execute("ads-get", ...)
  • «Добавь ключевую фразу» → yd_search("ключевые слова добавить") → yd_execute("keywords-add", ...)
  • «Получи справочник регионов» → yd_search("справочники") → yd_execute("dictionaries-get", ...)
  • «Сделай отчёт по кампаниям за январь» → yd_search("отчёт") → yd_execute("reports-get", ...)

CLI-утилита

Установка (CLI)

pip install mcp-server-yandex-direct

Переменная окружения YD_TOKEN должна быть установлена:

export YD_TOKEN=ваш_токен

Или через файл:

mcp-server-yandex-direct --env /path/to/.env <command>

Формат файла — KEY=VALUE, по одной переменной на строку, #-комментарии.

Использование (CLI)

Без аргументов запускается MCP-сервер, с командой — CLI. Все команды выводят JSON.

# Версия
mcp-server-yandex-direct --version

# Справка
mcp-server-yandex-direct --help
mcp-server-yandex-direct <command> --help

Примеры команд

# Кампании
mcp-server-yandex-direct campaigns-get '{"SelectionCriteria": {}, "FieldNames": ["Id", "Name", "State"]}'
mcp-server-yandex-direct campaigns-suspend 123,456

# Объявления
mcp-server-yandex-direct ads-get '{"SelectionCriteria": {"CampaignIds": [123]}, "FieldNames": ["Id", "Type", "State"]}'
mcp-server-yandex-direct ads-moderate 789,101

# Ключевые фразы
mcp-server-yandex-direct keywords-get '{"SelectionCriteria": {"AdGroupIds": [111]}, "FieldNames": ["Id", "Keyword", "State"]}'

# Справочники
mcp-server-yandex-direct dictionaries-get Currencies,Regions

# Отчёты
mcp-server-yandex-direct reports-get '{"params": {"SelectionCriteria": {"DateFrom": "2026-01-01", "DateTo": "2026-04-28"}, "FieldNames": ["Date", "CampaignId", "Clicks", "Cost"], "ReportName": "My Report", "ReportType": "CAMPAIGN_PERFORMANCE_REPORT", "DateRangeType": "CUSTOM_DATE", "Format": "TSV"}}'

Пример вывода

$ mcp-server-yandex-direct campaigns-get '{"SelectionCriteria": {"States": ["ON"]}, "FieldNames": ["Id", "Name"]}'
{"Campaigns": [{"Id": 12345, "Name": "Летняя распродажа"}]}

Pydantic-модели

Пакет содержит типизированные Pydantic-модели всех объектов API. Модели можно использовать в своих Python-программах для валидации данных и автодополнения в IDE.

Установка (библиотеки)

pip install mcp-server-yandex-direct

Использование в своих программах

from mcp_server_yandex_direct.models.campaigns import CampaignsGetParams, CampaignsSelectionCriteria

# Валидация данных из API
params = CampaignsGetParams(
    SelectionCriteria=CampaignsSelectionCriteria(States=["ON"]),
    FieldNames=["Id", "Name", "State"],
)
print(params.model_dump_json())

# Валидация ответа
from mcp_server_yandex_direct.models.campaigns import CampaignsGetResult

data = {"Campaigns": [{"Id": 12345, "Name": "Тест", "State": "ON"}]}
result = CampaignsGetResult.model_validate(data)
print(result.Campaigns[0].Name)  # type-safe доступ к полям

Все модели используют extra="allow" для forward compatibility — неизвестные поля API не вызывают ошибок.

Полный список моделей: models/


Переменные окружения

ПеременнаяОбязательнаяПо умолчаниюОписание
YD_TOKENда—OAuth-токен Yandex Direct API
YD_CLIENT_LOGINнет—Логин клиента для агентских аккаунтов
YD_LANGнет—Язык ответов: ru, en, uk
YD_TIMEOUTнет30Таймаут HTTP-запросов к API (секунды)
YD_FILE_TIMEOUTнет120Таймаут отчётов Reports API (секунды)

Разработка

pip install -e ".[test]"
ruff check src/ tests/
pytest tests/ -v

Лицензия

MIT

Frequently asked questions

What is yandex-direct MCP Server?

MCP server for Yandex Direct API v5 — campaigns, ads, keywords, bids, audiences

How do I install yandex-direct MCP Server in Claude Desktop, Cursor, or VS Code?

Pick your client in the Install section on this page and copy the generated config into the client's config file. Step-by-step guides: Claude Desktop, Cursor, and VS Code. yandex-direct MCP Server runs locally from the PyPI package mcp-server-yandex-direct with the command uvx mcp-server-yandex-direct.

Does yandex-direct MCP Server support remote (HTTP) connections?

No remote endpoint is listed for yandex-direct MCP Server. It runs locally on your machine over stdio, started by your MCP client.

How is yandex-direct MCP Server's trust score calculated?

yandex-direct MCP Server scores 39 out of 100 (Limited). The score adds six capped public signals: registry status, maintenance, popularity, license, documentation, and security. Nobody can pay for points. Read the methodology for the full formula.

Reviews

No reviews yet

—Be the first to review

5 star0 reviews at 5 stars
4 star0 reviews at 4 stars
3 star0 reviews at 3 stars
2 star0 reviews at 2 stars
1 star0 reviews at 1 stars

No published reviews yet. Used it? Tell the next person how it went.

Add badge to your README

Paste either snippet into the repository README. The image links to this listing.

Listed on MCPpedia

Top 5 MCP servers

Daily or weekly. Confirm by email, unsubscribe any time.

How often

Manage this listing

Claim this server