Logotipo de Yandex MCP Server

Yandex MCP Server

Comunidad
SvechaPVL

MCP (Model Context Protocol) server for Yandex Direct, Yandex Metrika, Yandex Wordstat, and Yandex Webmaster APIs. Provides 132 tools for managing advertising campaigns, analytics, keyword research,…

EditorSvechaPVL
Repositorioyandex-mcp
IdiomaPython
Forks
22
Estrellas
58
Herramientas disponibles
0
Tipo de transportestdio
Categorías
LicenciaMIT
Enlaces
  • Conecta herramientas a flujos de trabajo con IA

    Yandex MCP Server ofrece funciones MCP que pueden usar los clientes y agentes de IA compatibles.

  • 0 herramientas disponibles

    Explora a continuación las acciones que se pueden invocar, con sus nombres y descripciones cuando el servidor los proporcione.

  • Configuración lista para copiar

    Usa los ejemplos de instalación para configurar este servidor en tu cliente MCP preferido.

  • Indicadores de interés en el código abierto

    58 estrellas y 22 forks en el repositorio enlazado.

Yandex MCP Server

🇷🇺 Русская версия

Python 3.10+ License: MIT MCP

MCP (Model Context Protocol) server for Yandex Direct, Yandex Metrika, Yandex Wordstat, and Yandex Webmaster APIs. Provides 132 tools for managing advertising campaigns, analytics, keyword research, organic search, and reporting through any MCP-compatible client.

Manage Yandex advertising and analytics through AI

Features

Yandex Direct API v5 (80 tools)

  • Campaigns — create, update, pause, resume, archive, delete
  • Ad Groups — create, update with targeting settings
  • Ads — text, image, dynamic, shopping ads with moderation
  • Keywords — manage keywords and bids
  • Statistics — detailed performance reports with async retry
  • Bid Modifiers — mobile, desktop, demographics, regional adjustments
  • Retargeting — retargeting lists and audience targets
  • Smart Ad Targets — feed-based targeting filters
  • Sitelinks, VCards, Callouts — ad extensions
  • Images — upload, manage, and delete ad images
  • Feeds — product feed management
  • Videos & Creatives — video ad creation
  • Dictionaries — regions, interests, categories
  • Negative Keywords — shared negative keyword sets

Yandex Wordstat API (5 tools)

  • Top Requests — popular search queries and associations
  • Dynamics — query frequency trends over time
  • Regions — regional distribution of search queries
  • Regions Tree — hierarchical region structure
  • User Info — API quota and usage limits

Yandex Webmaster API v4 (4 tools)

  • User ID — resolve the token owner's Webmaster UserID
  • Hosts — list verified sites and their IDs
  • Host Summary — SQI, searchable and excluded page counts
  • Popular Queries — organic search queries with shows, clicks, and positions

Yandex Metrika API (43 tools)

  • Counters — create, configure, delete tracking counters
  • Goals — conversion goal management
  • Reports — analytics with custom metrics, time series, comparisons, drill-down
  • Segments — audience segmentation
  • Filters — traffic filtering rules
  • Grants — access permission management
  • Offline Data — upload conversions, calls, expenses, user parameters
  • Labels & Annotations — organize counters and mark chart events
  • Delegates — account delegation

Quick Start

1. Install

bash
git clone https://github.com/SvechaPVL/yandex-mcp.git
cd yandex-mcp
python -m venv .venv
source .venv/bin/activate  # Windows: .venv\Scripts\activate
pip install -e .

2. Set up your Yandex API token

Create a .env file:

env
YANDEX_TOKEN=your_oauth_token_here

Get a token from Yandex OAuth with permissions for Direct and Metrika APIs (direct:api, metrika:read, metrika:write).

3. Configure your MCP client

Add to your MCP client settings:

json
{
  "mcpServers": {
    "yandex": {
      "command": "python",
      "args": ["-m", "yandex_mcp"],
      "cwd": "/path/to/yandex-mcp",
      "env": {
        "YANDEX_TOKEN": "your_token"
      }
    }
  }
}

4. Done!

> Show all my campaigns in Direct
> Pause campaign 12345
> What are the site stats for the last week?

Environment Variables

VariableRequiredDescription
YANDEX_TOKENYesYandex OAuth token (used for both Direct and Metrika)
YANDEX_DIRECT_TOKENNoSeparate token for Direct API
YANDEX_METRIKA_TOKENNoSeparate token for Metrika API
YANDEX_CLIENT_LOGINNoClient login for agency accounts
YANDEX_USE_SANDBOXNoSet to true for sandbox API
YANDEX_WORDSTAT_API_KEYFor WordstatYandex Cloud service-account API key (Search API v2); the old OAuth Wordstat API is decommissioned
YANDEX_CLOUD_FOLDER_IDNoYandex Cloud folder ID for Search API v2 requests (optional)

Tools (132)

Yandex Direct (80 tools)

Campaigns (8)

ToolDescription
direct_get_campaignsGet campaigns with status, strategy, and budget info
direct_create_campaignCreate a new campaign (search, network, or both)
direct_update_campaignUpdate campaign settings (strategy, budget, schedule, regions, attribution model)
direct_suspend_campaignsPause campaigns
direct_resume_campaignsResume paused campaigns
direct_archive_campaignsArchive campaigns
direct_unarchive_campaignsRestore archived campaigns
direct_delete_campaignsDelete campaigns permanently

Ad Groups (3)

ToolDescription
direct_get_adgroupsGet ad groups with targeting settings
direct_create_adgroupCreate a new ad group in a campaign
direct_update_adgroupUpdate ad group settings and targeting

Ads (12)

ToolDescription
direct_get_adsGet ads with content and moderation status
direct_create_text_adCreate a text ad with title, text, and URL
direct_create_image_adCreate an image ad (banner)
direct_create_dynamic_adCreate a dynamic text ad from feed data
direct_create_shopping_adCreate a shopping ad (unified campaign format)
direct_update_adUpdate ad content (triggers re-moderation)
direct_moderate_adsSubmit ads for moderation
direct_suspend_adsPause ads
direct_resume_adsResume paused ads
direct_archive_adsArchive ads
direct_unarchive_adsRestore archived ads
direct_delete_adsDelete ads permanently

Keywords (6)

ToolDescription
direct_get_keywordsGet keywords with bids and status
direct_add_keywordsAdd keywords to an ad group
direct_set_keyword_bidsSet search and network bids
direct_suspend_keywordsPause keywords
direct_resume_keywordsResume paused keywords
direct_delete_keywordsDelete keywords permanently

Statistics (1)

ToolDescription
direct_get_statisticsGet performance reports (impressions, clicks, cost, CTR)

Bid Modifiers (5)

ToolDescription
direct_get_bid_modifiersGet bid modifiers (mobile, desktop, demographics, regional)
direct_add_bid_modifierAdd a bid modifier to campaign or ad group
direct_set_bid_modifierSet bid modifier value (0-1300%)
direct_delete_bid_modifiersDelete bid modifiers
direct_toggle_bid_modifiersEnable or disable bid modifiers

Retargeting & Audience Targets (9)

ToolDescription
direct_get_retargeting_listsGet retargeting lists based on Metrika goals
direct_add_retargeting_listCreate a retargeting list with goal rules
direct_update_retargeting_listUpdate retargeting list rules
direct_delete_retargeting_listsDelete retargeting lists
direct_get_audience_targetsGet audience targets linking lists to ad groups
direct_add_audience_targetAdd an audience target to an ad group
direct_suspend_audience_targetsPause audience targets
direct_resume_audience_targetsResume audience targets
direct_delete_audience_targetsDelete audience targets

Smart Ad Targets (5)

ToolDescription
direct_get_smart_ad_targetsGet smart ad target filters and conditions
direct_add_smart_ad_targetAdd a targeting filter to a smart ad group
direct_suspend_smart_ad_targetsPause smart ad targets
direct_resume_smart_ad_targetsResume smart ad targets
direct_delete_smart_ad_targetsDelete smart ad targets

Sitelinks (3)

ToolDescription
direct_get_sitelinksGet sitelink sets
direct_add_sitelinksCreate a sitelink set (up to 8 links)
direct_delete_sitelinksDelete sitelink sets

VCards (3)

ToolDescription
direct_get_vcardsGet business card info (address, phone, hours)
direct_add_vcardCreate a business card for ads
direct_delete_vcardsDelete business cards

Negative Keyword Sets (4)

ToolDescription
direct_get_negative_keyword_shared_setsGet shared negative keyword sets
direct_add_negative_keyword_shared_setCreate a shared negative keyword set
direct_update_negative_keyword_shared_setUpdate a negative keyword set
direct_delete_negative_keyword_shared_setsDelete negative keyword sets

Ad Extensions (3)

ToolDescription
direct_get_adextensionsGet ad extensions (callouts, etc.)
direct_add_calloutsAdd callout extensions
direct_link_callouts_to_adLink callouts to an ad

Videos & Creatives (4)

ToolDescription
direct_upload_videoUpload a video for ad extensions
direct_get_advideosGet uploaded ad videos
direct_create_video_creativeCreate a video creative from uploaded video
direct_get_creativesGet video creatives

Feeds (4)

ToolDescription
direct_get_feedsGet product feeds
direct_add_feedAdd a product feed (URL or file)
direct_update_feedUpdate feed settings
direct_delete_feedsDelete feeds

Images (3)

ToolDescription
direct_upload_imageUpload a base64-encoded image (JPEG, GIF, PNG)
direct_get_imagesGet image metadata, hashes, and association status
direct_delete_imagesDelete unassociated images by hash

Dictionaries & Regions (3)

ToolDescription
direct_get_dictionariesGet Direct dictionaries (ad categories, interests)
direct_get_regionsGet geographic region tree
direct_get_interestsGet interest categories for targeting

Client & Changes (4)

ToolDescription
direct_get_client_infoGet account info and settings
direct_check_campaign_changesCheck for changes in specific campaigns
direct_check_all_changesCheck for any changes in the account
direct_get_recent_changes_timestampGet timestamp of most recent changes

Yandex Metrika (43 tools)

Counters (5)

ToolDescription
metrika_get_countersList all Metrika counters
metrika_get_counterGet detailed counter info (code status, webvisor, goals)
metrika_create_counterCreate a new counter with tracking code
metrika_update_counterUpdate counter name, site, or favorite status
metrika_delete_counterDelete a counter and all its data

Goals (4)

ToolDescription
metrika_get_goalsGet conversion goals for a counter
metrika_create_goalCreate a goal (URL, event, composite, etc.)
metrika_update_goalUpdate goal conditions
metrika_delete_goalDelete a goal

Reports (4)

ToolDescription
metrika_get_reportGet analytics report with custom metrics and dimensions
metrika_get_report_by_timeGet time-series report (daily, weekly, monthly)
metrika_get_comparison_reportCompare two date ranges
metrika_get_drilldown_reportGet hierarchical drill-down report

Segments (4)

ToolDescription
metrika_get_segmentsGet audience segments
metrika_create_segmentCreate a segment with filter expression
metrika_update_segmentUpdate segment definition
metrika_delete_segmentDelete a segment

Filters (4)

ToolDescription
metrika_get_filtersGet data filters for a counter
metrika_create_filterCreate a filter (include/exclude traffic)
metrika_update_filterUpdate filter conditions
metrika_delete_filterDelete a filter

Grants (4)

ToolDescription
metrika_get_grantsGet access permissions for a counter
metrika_add_grantGrant access to another user
metrika_update_grantUpdate grant permissions
metrika_delete_grantRevoke access

Offline Data (5)

ToolDescription
metrika_upload_offline_conversionsUpload offline conversion data
metrika_get_offline_conversions_statusCheck upload processing status
metrika_upload_callsUpload call tracking data
metrika_upload_expensesUpload advertising expense data
metrika_upload_user_parametersUpload custom user parameters

Labels (6)

ToolDescription
metrika_get_labelsGet labels for organizing counters
metrika_create_labelCreate a label
metrika_update_labelRename a label
metrika_delete_labelDelete a label
metrika_link_counter_to_labelLink a counter to a label
metrika_unlink_counter_from_labelUnlink a counter from a label

Annotations (4)

ToolDescription
metrika_get_annotationsGet chart annotations for a counter
metrika_create_annotationCreate an annotation (mark events on charts)
metrika_update_annotationUpdate annotation text
metrika_delete_annotationDelete an annotation

Delegates (3)

ToolDescription
metrika_get_delegatesGet list of account delegates
metrika_add_delegateAdd a delegate with counter access
metrika_delete_delegateRemove a delegate

Yandex Wordstat (5 tools)

ToolDescription
wordstat_top_requestsGet popular search queries and associations for phrases
wordstat_dynamicsGet query frequency dynamics over time (daily/weekly/monthly)
wordstat_regionsGet regional distribution of search queries
wordstat_regions_treeGet full hierarchical regions tree with IDs
wordstat_user_infoDeprecated: v1 quota endpoint removed; returns pointer to Yandex Cloud console

Yandex Webmaster (4 tools)

ToolDescription
webmaster_get_user_idResolve the token owner's Webmaster UserID
webmaster_get_hostsList verified sites and their host IDs
webmaster_get_host_summaryGet SQI, searchable and excluded page counts
webmaster_get_popular_queriesGet organic search queries with shows, clicks, positions

Usage Examples

Campaign management

Show all active campaigns
Pause campaign "Summer sale"
Set weekly budget of campaign 123 to 50000 rubles

Keywords

Show keywords in ad group 456
Add keywords "buy iphone" and "iphone price" to group 456
Set bid 50 rubles on keyword 789

Analytics

Show site stats for the last week
How many conversions on goal "Lead" for the last month?
Show traffic sources for counter 97538360

Ad creation

Create a text ad in group 456:
- Title: Buy iPhone 15
- Text: Best prices! Free delivery
- URL: https://example.com/iphone

Keyword research

Show top requests for "buy car from china"
Query dynamics for "electric car" over the last year
Regional distribution for "auto from japan"

Alternative Run Methods

Direct execution

bash
python -m yandex_mcp
# or
python main.py

MCP Inspector

bash
npx @modelcontextprotocol/inspector python -m yandex_mcp

Cursor IDE

Add to Cursor MCP settings in the same format as above.

Project Structure

yandex_mcp/
├── __init__.py          # MCP server init and tool registration
├── client.py            # Async HTTP client for Direct, Metrika, Wordstat & Webmaster APIs
├── config.py            # Configuration and environment variables
├── utils.py             # Error handling utilities
├── models/              # Pydantic input models
│   ├── common.py
│   ├── direct.py
│   ├── direct_extended.py
│   ├── metrika.py
│   ├── metrika_extended.py
│   ├── wordstat.py
│   └── webmaster.py
├── formatters/          # Markdown output formatters
│   ├── direct.py
│   ├── metrika.py
│   ├── wordstat.py
│   └── webmaster.py
└── tools/               # MCP tool definitions
    ├── direct/          # 80 Yandex Direct tools
    │   ├── _helpers.py  # Shared manage-operation factory
    │   ├── campaigns.py
    │   ├── adgroups.py
    │   ├── ads.py
    │   ├── keywords.py
    │   ├── stats.py
    │   ├── images.py
    │   └── ...
    ├── metrika/         # 43 Yandex Metrika tools
    │   ├── counters.py
    │   ├── goals.py
    │   ├── reports.py
    │   └── ...
    ├── wordstat.py      # 5 Yandex Wordstat tools
    └── webmaster.py     # 4 Yandex Webmaster tools

Development

bash
# Install dev dependencies
pip install -e ".[dev]"

# Lint
ruff check .

# Type check
mypy yandex_mcp

# Test
pytest

Security

  • Store tokens in environment variables, not in code
  • Use minimum required permissions
  • Use sandbox for testing (YANDEX_USE_SANDBOX=true)
  • Never commit .env files

Links

License

MIT

Instalación

TypingMind
{
  "mcpServers": {
    "yandex-mcp": {
      "command": "yandex-mcp",
      "args": [],
      "env": {
        "YANDEX_TOKEN": "<YANDEX_TOKEN>"
      }
    }
  }
}

Usa el MCP de Yandex MCP Server con varios modelos de IA

TypingMind conecta las herramientas MCP a nivel del espacio de trabajo, por lo que, una vez conectado Yandex MCP Server, puedes usarlo con distintos modelos de IA en TypingMind sin tener que configurarlo por separado para cada modelo. Esta integración MCP se ejecuta localmente en tu dispositivo a través del conector MCP de TypingMind.

Guía de configuración para usar el conector local

Usa esta opción si el servidor MCP necesita acceder a archivos locales, aplicaciones o recursos privados de tu ordenador.

1

Abre los ajustes de MCP

En TypingMind, ve a Ajustes, luego a Ajustes avanzados y a Model Context Protocol, y elige Configurar conector.

  1. Abre TypingMind en tu navegador.
  2. Haz clic en el icono de Ajustes.
  3. Ve a Ajustes avanzados.
  4. Abre la sección Model Context Protocol.
  5. Haz clic en Configurar conector y elige Este dispositivo.
Pantalla de configuración del conector MCP de TypingMind con «Este dispositivo» seleccionado
2

Ejecuta el comando del conector

Elige Este dispositivo, copia el comando de TypingMind y ejecútalo en Terminal. Mantén el proceso en ejecución mientras uses MCP.

  1. Copia el comando de configuración que muestra TypingMind.
  2. Abre Terminal en macOS o Windows Terminal en Windows.
  3. Pega y ejecuta el comando.
  4. Acepta la instalación del paquete si Terminal te pide confirmación para continuar.
  5. Mantén el proceso en ejecución en la ventana de Terminal mientras uses las herramientas MCP.
3

Añade Yandex MCP Server como servidor

Cuando el estado del conector sea «Listo», haz clic en «Edita servidores» y pega la configuración del servidor MCP.

  1. Espera hasta que el estado del conector indique «Listo».
  2. Haz clic en Edita servidores.
  3. Pega la configuración del servidor MCP de Yandex MCP Server.
  4. Guarda la lista de servidores.
  5. Actualiza para comprobar que el conector sigue listo.
Ajustes de MCP de TypingMind con un servidor activo y el botón «Edita servidores»
{
  "mcpServers": {
    "yandex-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

Úsala con distintos modelos

Guarda la lista de servidores, abre Plugins, activa las herramientas MCP de Yandex MCP Server y selecciona cualquier modelo de IA compatible en TypingMind para usar las herramientas en el chat o asignárselas a un agente de IA.

  1. Abre la página Plugins en TypingMind.
  2. Activa las herramientas MCP de Yandex MCP Server.
  3. Inicia un chat y elige el modelo de IA que quieras usar.
  4. Usa las herramientas MCP en el chat o asígnalas a un agente de IA.
  5. Cambia a otro modelo de IA cuando lo necesites sin volver a conectar MCP.
Chat de TypingMind que usa herramientas MCP activadas con un modelo de IA seleccionado
¿Puedes usar Yandex MCP Server para ayudarme con esta tarea?
Yandex MCP Server
Claro. Lo he leído.
Esto he encontrado usando Yandex MCP Server.

Preguntas frecuentes

¿Para qué sirve el servidor MCP Yandex MCP Server?

Yandex MCP Server es un servidor MCP que permite a los clientes de IA compatibles conectarse a herramientas y contexto externos. En TypingMind, basta con añadir este servidor MCP una vez para que sus herramientas estén disponibles en tu espacio de trabajo de IA.

¿Puedo usar el servidor MCP Yandex MCP Server con varios modelos de IA en TypingMind?

Sí. TypingMind conecta las herramientas MCP a nivel del espacio de trabajo, por lo que puedes usar Yandex MCP Server con distintos modelos de IA, como Claude, ChatGPT, Gemini u otros que hayas configurado en TypingMind, sin configurar el servidor MCP por separado para cada modelo.

¿Por qué usar el conector MCP de Yandex MCP Server con TypingMind?

TypingMind es una de las mejores interfaces de chat con LLM porque reúne varios modelos de IA, prompts, plugins, agentes de IA, claves de API y herramientas MCP en un solo espacio de trabajo. Con Yandex MCP Server conectado, puedes usar sus herramientas MCP con tus modelos preferidos y mantener organizado tu flujo de trabajo de chat en TypingMind.

¿Cómo conecto el servidor MCP Yandex MCP Server a TypingMind?

Yandex MCP Server funciona a través del conector MCP local de TypingMind. Es la mejor opción cuando el servidor MCP necesita acceder a archivos locales, aplicaciones de escritorio, herramientas de línea de comandos o recursos privados de tu ordenador.

¿Qué herramientas ofrece el servidor MCP Yandex MCP Server en TypingMind?

Yandex MCP Server ofrece funciones MCP que puedes activar desde la página Plugins de TypingMind y usar en el chat o asignar a agentes de IA.

¿Tengo que compartir mis claves de API con TypingMind para usar el servidor MCP Yandex MCP Server?

No. TypingMind prioriza el funcionamiento local y te permite mantener el control de tus proveedores de modelos, claves de API, prompts y configuración MCP. Si Yandex MCP Server requiere autenticación, añade las cabeceras, los ajustes de OAuth o la configuración local necesarios para ese servidor MCP al crear la conexión.

Servidores MCP relacionados

Ver todos

Crea ya tu propio espacio de trabajo IA

Suscríbete a nuestro boletín para recibir avisos sobre nuevas funciones y próximos sorteos 👇