Logo vun Yandex MCP Server

Yandex MCP Server

Communautéit
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,…

EditeurSvechaPVL
Repositoryyandex-mcp
SproochPython
Forks
22
Stären
58
Disponibel Tools
0
Transporttypstdio
Kategorien
LizenzMIT
Linken
  • Tools mat KI-Workflows verbannen

    Yandex MCP Server stellt MCP-Funktioune bereit, déi vu kompatibele KI-Clienten a KI-Agente kënne benotzt ginn.

  • 0 disponibel Tools

    Kuckt Iech déi opruffbar Aktiounen hei drënner un, mat Nimm a Beschreiwungen, wa se vum Server geliwwert ginn.

  • Konfiguratioun fir ze kopéieren

    Benotzt d'Installatiounsbeispiller, fir dëse Server an Ärem bevorzugte MCP-Client ze konfiguréieren.

  • Indicateure fir Open Source

    58 Stären an 22 Forks aus dem verlinkte Repository.

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

Installatioun

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

Yandex MCP Server MCP mat verschiddene KI-Modeller benotzen

TypingMind verbënnt MCP-Tools um Niveau vum Aarbechtsberäich. Soubal Yandex MCP Server verbonnen ass, kënnt Dir et mat verschiddene KI-Modeller an TypingMind benotzen, amplaz et fir all Modell separat anzeriichten. Dës MCP-Integratioun leeft lokal iwwer den TypingMind-MCP-Connector op Ärem Apparat.

Ariichtungsuleedung fir de lokale Connector ze benotzen

Benotzt dës Optioun, wann den MCP-Server Zougrëff op lokal Fichieren, Appen oder privat Ressourcen op Ärem Computer brauch.

1

D'MCP-Astellungen opmaachen

Gitt an TypingMind op „Astellungen“, „Erweidert Astellungen“, dann op „Model Context Protocol“ a wielt „Connector ariichten“.

  1. Maacht TypingMind an Ärem Browser op.
  2. Klickt op d'Astellungssymbol.
  3. Gitt op „Erweidert Astellungen“.
  4. Maacht d'Sektioun „Model Context Protocol“ op.
  5. Klickt op „Connector ariichten“ a wielt „Dësen Apparat“.
Ariichtungsbildschierm vum TypingMind-MCP-Connector mat „Dësen Apparat“ ausgewielt
2

De Connector-Befeel ausféieren

Wielt „Dësen Apparat“, kopéiert de Befeel aus TypingMind a féiert en am Terminal aus. Loosst de Prozess lafen, wärend Dir MCP benotzt.

  1. Kopéiert den Ariichtungsbefeel, deen TypingMind uweist.
  2. Maacht Terminal op macOS oder Windows Terminal op Windows op.
  3. Pescht de Befeel an a féiert en aus.
  4. Bestätegt d'Installatioun vum Package, wann den Terminal Iech freet, ob Dir weiderfuere wëllt.
  5. Loosst den Terminal an de Prozess doranner lafen, wärend Dir MCP-Tools benotzt.
3

Yandex MCP Server als Server derbäisetzen

Wann de Connector-Status „Prett“ ass, klickt op „Serveren änneren“ a pescht d'MCP-Serverkonfiguratioun an.

  1. Waart, bis de Connector-Status „Prett“ weist.
  2. Klickt op „Serveren änneren“.
  3. Pescht d'MCP-Serverkonfiguratioun vu Yandex MCP Server an.
  4. Späichert d'Serverlëscht.
  5. Aktualiséiert, wann Dir kontrolléiere wëllt, ob de Connector nach ëmmer prett ass.
MCP-Astellunge vun TypingMind mat aktivem Server an dem Knäppchen „Serveren änneren“
{
  "mcpServers": {
    "yandex-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

D'Verbindung mat verschiddene Modeller benotzen

Späichert d'Serverlëscht, maacht „Plugins“ op an aktivéiert d'MCP-Tools vu Yandex MCP Server. Wielt dann e belibegen ënnerstëtzte KI-Modell an TypingMind a benotzt d'Tools am Chat oder weist se engem KI-Agent zou.

  1. Maacht d'Säit „Plugins“ an TypingMind op.
  2. Aktivéiert d'MCP-Tools vu Yandex MCP Server.
  3. Start e Chat a wielt de KI-Modell, deen Dir benotze wëllt.
  4. Benotzt d'MCP-Tools am Chat oder weist se engem KI-Agent zou.
  5. Wiesselt bei Bedarf op en anere KI-Modell, ouni MCP nei ze verbannen.
TypingMind-Chat mat aktivéierte MCP-Tools an engem ausgewielte KI-Modell
Hëlleft Dir mir bei dëser Aufgab mat Yandex MCP Server?
Yandex MCP Server
Jo. Ech hunn et gelies.
Dat hunn ech mat Yandex MCP Server fonnt.

Heefeg gestallte Froen

Fir wat gëtt de MCP-Server Yandex MCP Server benotzt?

Yandex MCP Server ass e MCP-Server, deen et kompatibele KI-Clienten erlaabt, sech mat externen Tools a Kontext ze verbannen. An TypingMind kënnt Dir dëse MCP-Server eemol derbäisetzen a seng Tools an Ärem KI-Aarbechtsberäich zur Verfügung stellen.

Kann ech Yandex MCP Server MCP mat méi KI-Modeller an TypingMind benotzen?

Jo. TypingMind verbënnt MCP-Tools um Niveau vum Aarbechtsberäich. Sou kënnt Dir Yandex MCP Server mat verschiddene KI-Modeller wéi Claude, ChatGPT, Gemini oder anere Modeller benotzen, déi Dir an TypingMind konfiguréiert hutt, ouni de MCP-Server fir all Modell separat anzeriichten.

Firwat Yandex MCP Server MCP mat TypingMind benotzen?

TypingMind ass eng vun de beschte Benotzeruewerfläche fir LLM-Chat, well et méi KI-Modeller, Prompts, Plugins, KI-Agenten, API-Schlësselen a MCP-Tools an engem Aarbechtsberäich zesummebréngt. Wann Yandex MCP Server verbonnen ass, kënnt Dir seng MCP-Tools mat Äre bevorzugte Modeller benotzen a gläichzäiteg Är Chataarbecht an TypingMind organiséieren.

Wéi verbannen ech Yandex MCP Server MCP mat TypingMind?

Yandex MCP Server leeft iwwer de lokale MCP-Connector vun TypingMind. Dat eegent sech am beschten, wann de MCP-Server Zougrëff op lokal Fichieren, Desktop-Apps, Kommandozeilen-Tools oder privat Ressourcen op Ärem Computer brauch.

Wéi eng Tools stellt Yandex MCP Server MCP an TypingMind zur Verfügung?

Yandex MCP Server stellt MCP-Funktiounen zur Verfügung, déi Dir op der Plugins-Säit vun TypingMind aktivéiere kënnt, fir se am Chat ze benotzen oder KI-Agenten zouzeweisen.

Muss ech meng API-Schlëssele mat TypingMind deelen, fir Yandex MCP Server MCP ze benotzen?

Nee. TypingMind setzt op lokal Veraarbechtung a léisst Iech d'Kontroll iwwer Är Modellubidder, API-Schlësselen, Prompts a MCP-Konfiguratioun. Wann Yandex MCP Server eng Authentifizéierung verlaangt, setzt déi néideg Headeren, OAuth-Astellungen oder lokal Konfiguratioun fir dee MCP-Server derbäi, wann Dir d'Verbindung erstallt.

Änlech MCP-Serveren

All weisen

Elo Ären eegene KI-Workspace ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇