yandex-direct-mcp

yandex-direct-mcp

An MCP server for Yandex Direct advertising API, providing ~80 tools to view and modify campaigns, keywords, budgets, and stats with safe write access.

Category
Visit Server

README

yandex-direct-mcp

Open-source MCP-сервер для Яндекс Директ — ~80 инструментов, чтобы ИИ (Claude, Cursor, Claude Code, Grok, Windsurf…) мог смотреть и (по явному разрешению) менять рекламный кабинет: поиск, РСЯ, ключи, минуса, бюджеты, автотаргетинг, поисковые запросы, max-conv, видео-расширения.

Сделано в проде Arckep (AI-студия).
Статья с установкой: https://arckep.ru/blog/how-to/yandex-direct-mcp-open-source

🤖 Агенту: прочитай AGENTS.md и разверни MCP сам.


Зачем

Кабинет Директа — ручной и медленный. MCP даёт агенту безопасный контур:

  • Read — кампании, группы, ключи, объявления, минуса, exclude-площадки, device/demo, стратегия, funds
  • Stats — cost/clicks/CTR, breakdown по Placement/Device/…, поисковые запросы (SQ)
  • Write (только allow_write=true) — бюджет, suspend/resume, минуса, exclude, гео, ставки, AT, max-conv, тексты объявлений, launch pack
  • Escapedirect_rpc на любой service.method API v5/v501

Один OAuth-токен = весь кабинет. Несколько брендов размечаются в projects.json, чтобы случайно не потрогать чужой продукт.


Быстрый старт

git clone https://github.com/gmen1057/yandex-direct-mcp.git
cd yandex-direct-mcp
npm install
cp .env.example .env
# YANDEX_DIRECT_TOKEN=...
npm run smoke

Claude Desktop

claude_desktop_config.json:

{
  "mcpServers": {
    "yandex-direct": {
      "command": "node",
      "args": ["/полный/путь/yandex-direct-mcp/index.mjs"],
      "env": {
        "YANDEX_DIRECT_TOKEN": "ваш_токен"
      }
    }
  }
}

Остальные клиенты — в AGENTS.md и examples/.


Токен Директа

  1. Зарегистрируйте приложение: https://oauth.yandex.ru/
  2. Права: Яндекс Директ API
  3. Получите токен: документация
  4. Положите в .env как YANDEX_DIRECT_TOKEN=... (права 600)
  5. Для агентского доступа: YANDEX_DIRECT_CLIENT_LOGIN=login_клиента

API: https://api.direct.yandex.com/json/v501 + Reports v5.


projects.json

{
  "projects": {
    "shop": {
      "label": "Интернет-магазин",
      "name_prefixes": ["[shop]"],
      "campaign_ids": [123456789]
    }
  }
}
  • Write требует project=shop (или другой ваш ключ) — не all.
  • Префиксы в Name кампании ([shop] …) помогают авторазметке.

Безопасность write

Правило Смысл
allow_write=true без флага — только dry-run план
project=<ключ> нельзя all на мутациях
dry_run явно посмотреть payload
логи logs/*.jsonl при write

Не включайте write «чтобы проверить». Сначала direct_ping / direct_list_campaigns / direct_report.


Что умеет (кратко)

Класс Примеры tools
Read direct_ping, list_campaigns, get_campaign, list_keywords, list_ads, get_negatives, list_bidmodifiers
Отчёты direct_report, report_breakdown, report_search_queries, report_raw
Бюджет / state set_daily_budget, set_search_weekly_budget, set_network_weekly_budget, suspend/resume/archive/unarchive
Качество set_excluded_sites, set_negatives, set_group_negatives, set_region_excludes, device/demo bidmods
Ключи / AT add/delete/set_keyword_*, get/set_autotargeting, get_keyword_bids
Стратегия set_max_conv, set_strategy, set_priority_goals, get_strategy
Креатив add_ads, update_ad_text, update_ad_href, upload_adimage, sitelinks/callouts, video
Launch direct_launch_pack — кампания → группы → ключи → ads → moderate → pin
Escape direct_rpc

Полный список — при старте MCP (~80 tools).


Gotchas (РФ / Директ)

  • Деньги API в микросах: 1 ₽ = 1 000 000; tools принимают рубли.
  • DailyBudget + WeeklySpendLimit в одном campaigns.update → ошибка 4004 — два шага.
  • Soft Conversions в отчётах ≠ оплаты в CRM.
  • ЕПК / UNIFIED: ≤3 ads в группе; ACCEPTED OFF часто пул, не бан.
  • В заголовках: не , длинное тире , слово VPN — модерация.
  • Ad Id — int64, не терять точность.
  • AT: AutotargetingCategories — plain array; ставки AT через keywordbids.set.

Требования

  • Node.js ≥ 18
  • Сеть до api.direct.yandex.com
  • Units API (дневной лимит кабинета)

Лицензия

MIT — см. LICENSE.

Не аффилирован с Яндексом. «Яндекс» и «Директ» — товарные знаки правообладателей.


Связанное

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured