Logo Yandex MCP Server

Yandex MCP Server

Cộng đồng
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,…

Nhà phát hànhSvechaPVL
Kho mãyandex-mcp
Ngôn ngữPython
Bản fork
22
Sao
58
Công cụ có sẵn
0
Phương thức truyền tảistdio
Danh mục
Giấy phépMIT
Liên kết
  • Kết nối công cụ với quy trình làm việc AI

    Yandex MCP Server cung cấp các khả năng MCP mà ứng dụng khách và tác nhân AI tương thích có thể sử dụng.

  • 0 công cụ có sẵn

    Xem các thao tác có thể gọi bên dưới, kèm tên và mô tả nếu máy chủ cung cấp.

  • Cấu hình sẵn để sao chép

    Dùng các đoạn cấu hình cài đặt mẫu để thiết lập máy chủ này trong ứng dụng khách MCP bạn muốn dùng.

  • Chỉ số quan tâm đến mã nguồn mở

    58 sao và 22 bản fork từ kho mã được liên kết.

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

Cài đặt

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

Dùng MCP Yandex MCP Server với nhiều mô hình AI

TypingMind kết nối các công cụ MCP ở cấp không gian làm việc, nên sau khi kết nối Yandex MCP Server, bạn có thể dùng với nhiều mô hình AI khác nhau trong TypingMind thay vì phải thiết lập riêng cho từng mô hình. MCP này chạy cục bộ thông qua trình kết nối MCP của TypingMind trên thiết bị của bạn.

Hướng dẫn thiết lập để dùng trình kết nối cục bộ

Dùng cách này khi máy chủ MCP cần truy cập các tệp, ứng dụng hoặc tài nguyên riêng tư trên máy tính của bạn.

1

Mở cài đặt MCP

Trong TypingMind, vào Cài đặt, Cài đặt nâng cao, rồi đến Giao thức ngữ cảnh mô hình và chọn Cài trình kết nối.

  1. Mở TypingMind trong trình duyệt của bạn.
  2. Nhấp vào biểu tượng Cài đặt.
  3. Vào Cài đặt nâng cao.
  4. Mở mục Giao thức ngữ cảnh mô hình.
  5. Nhấp vào Cài trình kết nối rồi chọn Thiết bị này.
Màn hình thiết lập trình kết nối MCP của TypingMind với tùy chọn Thiết bị này được chọn
2

Chạy lệnh trình kết nối

Chọn Thiết bị này, sao chép lệnh từ TypingMind và chạy trong Terminal. Giữ tiến trình chạy trong khi bạn dùng MCP.

  1. Sao chép lệnh thiết lập hiển thị trong TypingMind.
  2. Mở Terminal trên macOS hoặc Windows Terminal trên Windows.
  3. Dán và chạy lệnh.
  4. Xác nhận cài đặt gói nếu Terminal hỏi bạn có muốn tiếp tục không.
  5. Giữ tiến trình trong cửa sổ Terminal chạy trong khi dùng các công cụ MCP.
3

Thêm Yandex MCP Server làm máy chủ

Khi trạng thái trình kết nối là Sẵn sàng, nhấp vào Sửa máy chủ và dán cấu hình máy chủ MCP.

  1. Đợi đến khi trạng thái trình kết nối hiển thị Sẵn sàng.
  2. Nhấp vào Sửa máy chủ.
  3. Dán cấu hình máy chủ MCP của Yandex MCP Server.
  4. Lưu danh sách máy chủ.
  5. Làm mới nếu bạn muốn xác nhận trình kết nối vẫn sẵn sàng.
Cài đặt MCP của TypingMind hiển thị máy chủ đang hoạt động và nút Sửa máy chủ
{
  "mcpServers": {
    "yandex-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

Dùng kết nối với nhiều mô hình

Lưu danh sách máy chủ, mở Plugin, bật các công cụ MCP của Yandex MCP Server, sau đó chọn bất kỳ mô hình AI nào được hỗ trợ trong TypingMind và dùng các công cụ trong cuộc trò chuyện hoặc gán chúng cho một tác nhân AI.

  1. Mở trang Plugin trong TypingMind.
  2. Bật các công cụ MCP của Yandex MCP Server.
  3. Bắt đầu cuộc trò chuyện và chọn mô hình AI bạn muốn dùng.
  4. Dùng các công cụ MCP trong cuộc trò chuyện hoặc gán chúng cho một tác nhân AI.
  5. Chuyển sang mô hình AI khác bất cứ khi nào cần mà không phải kết nối lại MCP.
Cuộc trò chuyện TypingMind dùng các công cụ MCP đã bật với một mô hình AI được chọn
Bạn có thể dùng Yandex MCP Server giúp tôi làm việc này không?
Yandex MCP Server
Được. Tôi đã đọc.
Đây là kết quả tôi tìm được bằng Yandex MCP Server.

Câu hỏi thường gặp

Máy chủ MCP Yandex MCP Server dùng để làm gì?

Yandex MCP Server là máy chủ MCP cho phép các ứng dụng AI tương thích kết nối với công cụ và ngữ cảnh bên ngoài. Trong TypingMind, bạn chỉ cần thêm máy chủ MCP này một lần để các công cụ của nó có sẵn trong không gian làm việc AI của bạn.

Bạn có thể dùng MCP Yandex MCP Server với nhiều mô hình AI trong TypingMind không?

Có. TypingMind kết nối các công cụ MCP ở cấp không gian làm việc, nên bạn có thể dùng Yandex MCP Server với nhiều mô hình AI như Claude, ChatGPT, Gemini hoặc các mô hình khác đã cấu hình trong TypingMind mà không cần thiết lập máy chủ MCP riêng cho từng mô hình.

Vì sao nên dùng MCP Yandex MCP Server với TypingMind?

TypingMind là một trong những giao diện trò chuyện với LLM tốt nhất vì tập hợp nhiều mô hình AI, prompt, plugin, tác nhân AI, khóa API và công cụ MCP vào một không gian làm việc. Khi kết nối Yandex MCP Server, bạn có thể dùng các công cụ MCP của dịch vụ này với những mô hình ưa thích, đồng thời giữ quy trình trò chuyện gọn gàng trong TypingMind.

Làm cách nào để kết nối MCP Yandex MCP Server với TypingMind?

Yandex MCP Server hoạt động thông qua trình kết nối MCP cục bộ của TypingMind. Đây là lựa chọn phù hợp nhất khi máy chủ MCP cần truy cập tệp cục bộ, ứng dụng máy tính, công cụ dòng lệnh hoặc tài nguyên riêng trên máy tính của bạn.

MCP Yandex MCP Server cung cấp những công cụ nào trong TypingMind?

Yandex MCP Server cung cấp các chức năng MCP mà bạn có thể bật từ trang Plugin của TypingMind để dùng trong trò chuyện hoặc gán cho tác nhân AI.

Bạn có cần chia sẻ khóa API với TypingMind để dùng MCP Yandex MCP Server không?

Không. TypingMind ưu tiên xử lý cục bộ và cho phép bạn kiểm soát nhà cung cấp mô hình, khóa API, prompt và cấu hình MCP. Nếu Yandex MCP Server yêu cầu xác thực, hãy thêm các header, cài đặt OAuth hoặc cấu hình cục bộ cần thiết cho máy chủ MCP đó khi tạo kết nối.

Máy chủ MCP liên quan

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇