Yandex MCP Serverのロゴ

Yandex MCP Server

コミュニティ
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,…

公開者SvechaPVL
リポジトリyandex-mcp
言語Python
フォーク
22
スター
58
利用可能なツール
0
通信方式stdio
カテゴリ
ライセンスMIT
リンク
  • ツールをAIワークフローに接続

    Yandex MCP Serverは、対応するAIクライアントやAIエージェントから利用できるMCP機能を提供します。

  • 0個の利用可能なツール

    呼び出し可能なアクションを以下で確認できます。サーバーから提供されている場合は、名前や説明も表示されます。

  • コピーして使える設定

    セットアップ用の設定例を使って、お好みのMCPクライアントにこのサーバーを設定できます。

  • オープンソースの注目度

    リンク先のリポジトリには58件のスターと22件のフォークがあります。

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

インストール

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

Yandex MCP ServerのMCPを複数のAIモデルで活用

TypingMindはワークスペース単位でMCPツールに接続します。そのため、一度Yandex MCP Serverに接続すれば、モデルごとに個別に設定することなく、TypingMind内のさまざまなAIモデルで利用できます。 このMCPは、デバイス上のTypingMind MCPコネクタを通じてローカルで動作します。

ローカルコネクタのセットアップガイド

MCPサーバーが、お使いのコンピューター上のローカルファイル、アプリ、非公開リソースにアクセスする必要がある場合は、この方法を使います。

1

MCP設定を開く

TypingMindで「設定」、「詳細設定」、「MCP」の順に進み、「コネクタを設定」を選択してください。

  1. ブラウザでTypingMindを開いてください。
  2. 設定アイコンをクリックしてください。
  3. 「詳細設定」に移動してください。
  4. 「MCP」セクションを開いてください。
  5. 「コネクタを設定」をクリックし、「このデバイス」を選択してください。
「このデバイス」が選択されたTypingMindのMCPコネクタ設定画面
2

コネクタのコマンドを実行

「このデバイス」を選択し、TypingMindからコマンドをコピーしてターミナルで実行してください。MCPの使用中は、プロセスを実行したままにしてください。

  1. TypingMindに表示されるセットアップコマンドをコピーしてください。
  2. macOSではターミナルを、WindowsではWindows Terminalを開いてください。
  3. コマンドを貼り付けて実行してください。
  4. ターミナルで続行の確認を求められた場合は、パッケージのインストールを承認してください。
  5. MCPツールの使用中は、ターミナルウィンドウを開いたまま、プロセスの実行を継続してください。
3

Yandex MCP Serverをサーバーとして追加

コネクタのステータスが「準備完了」になったら、「サーバーを編集」をクリックし、MCPサーバーの設定を貼り付けてください。

  1. コネクタのステータスが「準備完了」になるまでお待ちください。
  2. 「サーバーを編集」をクリックしてください。
  3. Yandex MCP ServerのMCPサーバー設定を貼り付けてください。
  4. サーバー一覧を保存してください。
  5. コネクタが引き続き使用可能か確認するには、更新してください。
稼働中のサーバーと「サーバーを編集」ボタンが表示されたTypingMindのMCP設定画面
{
  "mcpServers": {
    "yandex-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

複数のモデルで同じ接続を使用

サーバー一覧を保存し、「プラグイン」を開いてYandex MCP ServerのMCPツールを有効にしてください。その後、TypingMindで対応するAIモデルを選択し、チャットでツールを使うか、AIエージェントに割り当ててください。

  1. TypingMindの「プラグイン」ページを開いてください。
  2. Yandex MCP ServerのMCPツールを有効にしてください。
  3. チャットを開始し、使用するAIモデルを選択してください。
  4. MCPツールをチャットで使うか、AIエージェントに割り当ててください。
  5. MCPに再接続することなく、必要に応じて別のAIモデルに切り替えられます。
選択したAIモデルと有効なMCPツールを使用したTypingMindのチャット
Yandex MCP Serverを使ってこのタスクを手伝ってもらえますか?
Yandex MCP Server
はい、読みました。
Yandex MCP Serverで調べた結果をお伝えします。

よくある質問

Yandex MCP Server MCPサーバーは何に使いますか?

Yandex MCP Serverは、対応するAIクライアントを外部ツールやコンテキストに接続するためのMCPサーバーです。TypingMindでは、このMCPサーバーを一度追加するだけで、AIワークスペース内でそのツールを利用できるようになります。

TypingMindでYandex MCP Server MCPを複数のAIモデルと併用できますか?

はい。TypingMindはワークスペース単位でMCPツールに接続するため、モデルごとにMCPサーバーを設定する必要はありません。Claude、ChatGPT、Geminiや、TypingMindで設定したその他のAIモデルでYandex MCP Serverを利用できます。

TypingMindでYandex MCP Server MCPを使うメリットは何ですか?

TypingMindは、複数のAIモデル、プロンプト、プラグイン、AIエージェント、APIキー、MCPツールを1つのワークスペースにまとめられる、LLMチャット向けの優れたフロントエンドです。Yandex MCP Serverを接続すると、TypingMindでチャットのワークフローを整理しながら、お好みのモデルでそのMCPツールを利用できます。

Yandex MCP Server MCPをTypingMindに接続するにはどうすればよいですか?

Yandex MCP ServerはTypingMindのローカルMCPコネクタ経由で動作します。MCPサーバーがコンピューター上のローカルファイル、デスクトップアプリ、コマンドラインツール、プライベートリソースにアクセスする必要がある場合に最適です。

TypingMindでYandex MCP Server MCPのどのようなツールを利用できますか?

Yandex MCP ServerはMCP機能を提供しています。TypingMindのプラグインページで有効にすると、チャットで使用したり、AIエージェントに割り当てたりできます。

Yandex MCP Server MCPを使うには、APIキーをTypingMindと共有する必要がありますか?

いいえ。TypingMindはローカルファーストの設計で、モデルプロバイダー、APIキー、プロンプト、MCP設定をご自身で管理できます。Yandex MCP Serverで認証が必要な場合は、接続の作成時に、そのMCPサーバーに必要なヘッダー、OAuth設定、またはローカル設定を追加してください。

関連するMCPサーバー

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇