
Yandex Direct
io.github.dontsovcmcPublished by GitHub account dontsovcmcv0.3.0Updated Oct 24, 2026
MCP server for Yandex Direct API v5 — campaigns, ads, keywords, bids, audiences
Overview
Local MCP server for the Yandex Direct API v5 that lets an assistant search and execute 79 advertising actions on campaigns, ads, keywords, bids and audiences.
- What you can do
- Search available Yandex Direct actions by natural-language description and get their parameter schemas, then execute a chosen action by ID. Manage campaigns, ad groups and ads, including creation, moderation and archiving. Work with keywords, bids and bid adjustments, negative keyword lists and keyword research. Handle audiences and retargeting, feeds, creatives, quick links, images, video and other assets. Read account data, dictionaries and agency clients, track changes, and pull reports in TSV or CSV.
- When to use it
- Useful when you manage Yandex Direct advertising accounts and want an assistant to look up, change or report on campaigns, ads, keywords and audiences from a chat instead of the web interface or scripts.
- Requirements
- Runs locally as a Python package, started with uvx or after pip install; uv or Python is needed. A Yandex Direct OAuth token is required in the YD_TOKEN environment variable. Optional variables set the agency client login, response language and HTTP and report timeouts. Network access to the Yandex Direct API is required.
Installation
In SourceWeft
- Open Yandex Direct in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
mcp-server-yandex-direct
MCP-сервер, CLI-утилита и библиотека Pydantic-моделей для Yandex Direct API v5.
- MCP-сервер — интеграция с Claude Code, Claude Desktop и другими MCP-клиентами
- CLI-утилита — работа с API из терминала, скрипты и автоматизация
- Pydantic-модели — типизированные модели API для использования в своих Python-программах
Все данные остаются на вашем компьютере — токен никуда не передаётся.
Оглавление
- Архитектура
- Доступные действия
- MCP-сервер
- CLI-утилита
- Pydantic-модели
- Переменные окружения
- Разработка
- Лицензия
Архитектура
Сервер использует паттерн search + execute — вместо 79 отдельных инструментов предоставляет 2:
Как это работает
Доступные действия (79)
MCP-сервер
Установка
Шаг 1. Получить OAuth-токен
- Войдите в Яндекс Директ
- Перейдите в Настройки → API
- Создайте OAuth-токен с нужными правами
- Скопируйте токен
Шаг 2. Подключить MCP-сервер
Подключение к Claude Code
Способ 1: через uvx (не требует установки пакета)
Требуется uv — если не установлен:
Способ 2: через pip
Для удаления:
Подключение к Claude Desktop
Добавьте в конфигурационный файл:
Через uvx:
Через pip (после pip install mcp-server-yandex-direct):
Подключение через --mcp-config
Подключает сервер только на время одной сессии Claude, не сохраняя в настройки. Токен хранится в отдельном .env.mcp файле, а не в конфиге Claude.
Из JSON-строки:
Из файла:
Пример ~/mcp-servers.json:
Пример ~/.env.mcp:
Шаг 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)
Переменная окружения YD_TOKEN должна быть установлена:
Или через файл:
Формат файла — KEY=VALUE, по одной переменной на строку, #-комментарии.
Использование (CLI)
Без аргументов запускается MCP-сервер, с командой — CLI. Все команды выводят JSON.
Примеры команд
Пример вывода
Pydantic-модели
Пакет содержит типизированные Pydantic-модели всех объектов API. Модели можно использовать в своих Python-программах для валидации данных и автодополнения в IDE.
Установка (библиотеки)
Использование в своих программах
Все модели используют extra="allow" для forward compatibility — неизвестные поля API не вызывают ошибок.
Полный список моделей: models/
Переменные окружения
Разработка
Лицензия
MIT
Source: README.md at commit e4c3f7e
Tools
0Version history
1- v0.3.0LatestSep 16, 2026
Score
40% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts
Declare a license in the repository or the registry entry.