Yandex MCP Server logo

Yandex MCP Server

Community
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,…

PublisherSvechaPVL
Repositoryyandex-mcp
LanguagePython
Forks
22
Stars
58
Available tools
0
Transport typestdio
Categories
LicenseMIT
Links
  • Connect tools to AI workflows

    Yandex MCP Server exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 0 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    58 stars and 22 forks from the linked 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

Installation

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

Use Yandex MCP Server MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once Yandex MCP Server is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. This MCP runs locally through the TypingMind MCP connector on your device.

Setup guide to use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add Yandex MCP Server as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the Yandex MCP Server MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "yandex-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the Yandex MCP Server MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the Yandex MCP Server MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use Yandex MCP Server to help me with this task?
Yandex MCP Server
Sure. I read it.
Here is what I found using Yandex MCP Server.

Frequently asked questions

What is the Yandex MCP Server MCP server used for?

Yandex MCP Server is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use Yandex MCP Server MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use Yandex MCP Server with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use Yandex MCP Server MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With Yandex MCP Server connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect Yandex MCP Server MCP to TypingMind?

Yandex MCP Server runs through the TypingMind local MCP connector. This is best when the MCP server needs access to local files, desktop apps, command-line tools, or private resources on your computer.

What tools does Yandex MCP Server MCP provide in TypingMind?

Yandex MCP Server exposes MCP capabilities that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use Yandex MCP Server MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If Yandex MCP Server requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇