Skip to main content
Glama
yandex-direct-mcp

yandex-direct-mcp

by s3rezhkaa

yandex-direct-mcp

Read-only MCP server for Yandex Direct. AI assistants and coding agents can read campaigns, conversion goals, ad creatives, and performance reports without changing live ad settings.

Русская версия (README.ru.md)

Available tools

Tool

Description

get_campaigns

List campaigns with ID, name, status, state, and type (optional campaign_ids filter).

get_goals

List conversion goals for the account via the v4 Live API (GetRetargetingGoals).

get_ads

Load ad creatives (titles, texts, destination URLs, statuses) and resolve AdImageHash to image URLs.

get_campaign_report

Load daily campaign statistics (Impressions, Clicks, Cost, Conversions) with goal_ids support.

get_ad_report

Load daily ad statistics (AD_PERFORMANCE_REPORT).

get_search_queries_report

Load weekly search query statistics (SEARCH_QUERY_PERFORMANCE_REPORT) for search term and negative keyword analysis.

get_placements_report

Load daily ad network placement statistics filtered by minimum_clicks.

Report tools wait for async 201/202 responses using the retryIn header and return parsed JSON rows.

Related MCP server: google-ads-mcp

Getting credentials

  1. Register an app in Yandex OAuth with the direct:api permission and set the Redirect URI to https://oauth.yandex.com/verification_code.

  2. Enable API access in your Yandex Direct account settings (see Yandex Direct API token docs).

  3. Open this URL in your browser (replace <CLIENT_ID> with your app ID), approve access, and copy access_token from the redirect URL:

    https://oauth.yandex.com/authorize?response_type=token&client_id=<CLIENT_ID>
  4. Set YANDEX_DIRECT_TOKEN to that token and YANDEX_CLIENT_LOGIN to the Yandex Direct account login (without @yandex.ru).

Environment variables

  • YANDEX_DIRECT_TOKEN (required): Yandex Direct OAuth token.

  • YANDEX_CLIENT_LOGIN (required): Yandex Direct client login.

  • YANDEX_DIRECT_API_URL (optional): base URL for API v5, defaults to https://api.direct.yandex.com. Set this when pointing to a local mock server (for example http://localhost:8091).

  • YANDEX_DIRECT_GOALS_URL (optional): URL for API v4 Live goals, defaults to https://api.direct.yandex.ru/live/v4/json/.

Installation in coding agents

Requires uv (uvx). Run it directly from GitHub with uvx, or from a local clone using --directory /path/to/yandex-direct-mcp.

Standard JSON config (Cursor, Claude Desktop, Windsurf, Antigravity, VS Code, Gemini CLI)

Add this block to your agent's mcpServers JSON config:

{
  "mcpServers": {
    "yandex-direct": {
      "command": "uvx",
      "args": [
        "--from",
        "git+https://github.com/s3rezhkaa/yandex-direct-mcp",
        "yandex-direct-mcp"
      ],
      "env": {
        "YANDEX_DIRECT_TOKEN": "your-oauth-token",
        "YANDEX_CLIENT_LOGIN": "your-client-login"
      }
    }
  }
}

For a local clone, use "command": "uv" and "args": ["run", "--directory", "/path/to/yandex-direct-mcp", "yandex-direct-mcp"].

Claude Code CLI

claude mcp add yandex-direct \
  -e YANDEX_DIRECT_TOKEN=your-oauth-token \
  -e YANDEX_CLIENT_LOGIN=your-client-login \
  -- uvx --from git+https://github.com/s3rezhkaa/yandex-direct-mcp yandex-direct-mcp

Codex CLI (~/.codex/config.toml)

[mcp_servers.yandex_direct]
command = "uvx"
args = ["--from", "git+https://github.com/s3rezhkaa/yandex-direct-mcp", "yandex-direct-mcp"]

[mcp_servers.yandex_direct.env]
YANDEX_DIRECT_TOKEN = "your-oauth-token"
YANDEX_CLIENT_LOGIN = "your-client-login"

Optional audit skill

A short audit skill is included in skills/yandex-direct-audit/SKILL.md. Copy or symlink skills/yandex-direct-audit into your agent's skills directory (for example ~/.claude/skills/, ~/.codex/skills/, or .agents/skills/ in a workspace) to run a step-by-step account audit.

Local development

uv sync
uv run ruff check .
uv run pytest -v

Available Tools

7 tools
get_ad_reportA

Load daily ad-level statistics (impressions, clicks, cost, conversions).

Args: start_date: Start date in YYYY-MM-DD format. end_date: End date in YYYY-MM-DD format. campaign_ids: Optional list of campaign IDs to filter. goal_ids: Optional list of Yandex Metrica goal IDs for conversion columns.

Inputs: end_date (required), start_date (required), goal_ids, campaign_ids. Returns: result

get_adsA

Load ad creatives: titles, texts, destination URLs, statuses, and image URLs.

Args: campaign_ids: Optional list of campaign IDs to load ads for. ad_ids: Optional list of specific ad IDs. Provide campaign_ids or ad_ids. include_image_urls: Resolve AdImageHash values to original/preview URLs.

Inputs: ad_ids, campaign_ids, include_image_urls. Returns: result

get_campaign_reportA

Load daily Yandex Direct campaign statistics for a date range.

Args: start_date: Start date in YYYY-MM-DD format. end_date: End date in YYYY-MM-DD format. campaign_ids: Optional list of campaign IDs to filter. goal_ids: Optional list of Yandex Metrica goal IDs for conversion columns.

Inputs: end_date (required), start_date (required), goal_ids, campaign_ids. Returns: result

get_campaignsA

List Yandex Direct campaigns with their ID, name, status, state, and type.

Args: campaign_ids: Optional list of campaign IDs to filter. Returns all campaigns if omitted.

Inputs: campaign_ids. Returns: result

get_goalsB

List conversion goals available for the configured Yandex Direct account.

Inputs: no named parameters. Returns: result

get_placements_reportB

Load daily ad network placement statistics for campaigns.

Args: start_date: Start date in YYYY-MM-DD format. end_date: End date in YYYY-MM-DD format. campaign_ids: Optional list of campaign IDs to filter. goal_ids: Optional list of Yandex Metrica goal IDs for conversion columns. minimum_clicks: Minimum clicks required for a placement to be included.

Inputs: end_date (required), start_date (required), goal_ids, campaign_ids, +1 more. Returns: result

get_search_queries_reportA

Load weekly search query statistics to analyze search terms and negative keywords.

Args: start_date: Start date in YYYY-MM-DD format. end_date: End date in YYYY-MM-DD format. campaign_ids: Optional list of campaign IDs to filter. goal_ids: Optional list of Yandex Metrica goal IDs for conversion columns. clicks_only: If true, return only search queries with at least one click.

Inputs: end_date (required), start_date (required), goal_ids, clicks_only, +1 more. Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.6/5.0

    Scored across 7 tools

    Disambiguation4/5

    Each tool targets a distinct resource or report type (goals, campaigns, ads, search queries, placements, campaign stats, ad stats). The only friction is at-a-glance confusion between metadata getters (get_campaigns, get_ads) and their stat counterparts (get_campaign_report, get_ad_report), but the descriptions clearly separate them.

    Naming Consistency5/5

    Every tool follows a clean get_<resource> snake_case pattern, with the report tools consistently suffixed with _report. No mixed conventions or vague verbs.

    Tool Count5/5

    Seven tools is well within the ideal range and each one covers a distinct reporting axis. Nothing feels redundant or pad­ded for the analytics purpose.

    Completeness3/5

    The reporting surface is decent (campaign, ad, placement, search query, goals), but it is entirely read-only: no ad group or keyword tools, and no way to create campaigns/ads, manage bids, or apply negative keywords even though the search-query report suggests that workflow. Agents can analyze but cannot act.

    Maintenance

    ActivityMaintained
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      Enables AI assistants to manage Yandex Direct advertising campaigns, ads, keywords, and reports via natural language using the Yandex Direct API v5.
      2
      1
      MIT
    • F
      license
      A
      quality
      C
      maintenance
      Enables AI clients to read Google Ads account data through reporting tools for campaigns, ad groups, keywords, and raw GAQL queries, with no write or mutate capabilities.
      7
      -
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI assistants to work with Yandex Webmaster, Direct, and Metrika data through natural language, including managing sites, sitemaps, recrawls, ad campaigns with write-safety guards, and pulling traffic, conversion, and ad statistics.
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      Enables AI agents to manage Yandex Direct advertising accounts via the API v5, including reports, bids, campaign management, and semantic analysis through natural language requests.
      4
      MIT