yandex-mcp
Provides tools for querying Yandex Wordstat search statistics (popular queries, dynamics, regional distribution) via the Yandex Cloud Search API v2.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@yandex-mcpShow all my campaigns in Direct"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Yandex MCP Server
π·πΊ Π ΡΡΡΠΊΠ°Ρ Π²Π΅ΡΡΠΈΡ
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
Related MCP server: ya-metrics-mcp
Quick Start
1. Install
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:
YANDEX_TOKEN=your_oauth_token_hereGet 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:
{
"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
Variable | Required | Description |
| Yes | Yandex OAuth token (used for both Direct and Metrika) |
| No | Separate token for Direct API |
| No | Separate token for Metrika API |
| No | Client login for agency accounts |
| No | Set to |
| For Wordstat | Yandex Cloud service-account API key (Search API v2); the old OAuth Wordstat API is decommissioned |
| No | Yandex Cloud folder ID for Search API v2 requests (optional) |
Tools (132)
Yandex Direct (80 tools)
Campaigns (8)
Tool | Description |
| Get campaigns with status, strategy, and budget info |
| Create a new campaign (search, network, or both) |
| Update campaign settings (strategy, budget, schedule, regions, attribution model) |
| Pause campaigns |
| Resume paused campaigns |
| Archive campaigns |
| Restore archived campaigns |
| Delete campaigns permanently |
Ad Groups (3)
Tool | Description |
| Get ad groups with targeting settings |
| Create a new ad group in a campaign |
| Update ad group settings and targeting |
Ads (12)
Tool | Description |
| Get ads with content and moderation status |
| Create a text ad with title, text, and URL |
| Create an image ad (banner) |
| Create a dynamic text ad from feed data |
| Create a shopping ad (unified campaign format) |
| Update ad content (triggers re-moderation) |
| Submit ads for moderation |
| Pause ads |
| Resume paused ads |
| Archive ads |
| Restore archived ads |
| Delete ads permanently |
Keywords (6)
Tool | Description |
| Get keywords with bids and status |
| Add keywords to an ad group |
| Set search and network bids |
| Pause keywords |
| Resume paused keywords |
| Delete keywords permanently |
Statistics (1)
Tool | Description |
| Get performance reports (impressions, clicks, cost, CTR) |
Bid Modifiers (5)
Tool | Description |
| Get bid modifiers (mobile, desktop, demographics, regional) |
| Add a bid modifier to campaign or ad group |
| Set bid modifier value (0-1300%) |
| Delete bid modifiers |
| Enable or disable bid modifiers |
Retargeting & Audience Targets (9)
Tool | Description |
| Get retargeting lists based on Metrika goals |
| Create a retargeting list with goal rules |
| Update retargeting list rules |
| Delete retargeting lists |
| Get audience targets linking lists to ad groups |
| Add an audience target to an ad group |
| Pause audience targets |
| Resume audience targets |
| Delete audience targets |
Smart Ad Targets (5)
Tool | Description |
| Get smart ad target filters and conditions |
| Add a targeting filter to a smart ad group |
| Pause smart ad targets |
| Resume smart ad targets |
| Delete smart ad targets |
Sitelinks (3)
Tool | Description |
| Get sitelink sets |
| Create a sitelink set (up to 8 links) |
| Delete sitelink sets |
VCards (3)
Tool | Description |
| Get business card info (address, phone, hours) |
| Create a business card for ads |
| Delete business cards |
Negative Keyword Sets (4)
Tool | Description |
| Get shared negative keyword sets |
| Create a shared negative keyword set |
| Update a negative keyword set |
| Delete negative keyword sets |
Ad Extensions (3)
Tool | Description |
| Get ad extensions (callouts, etc.) |
| Add callout extensions |
| Link callouts to an ad |
Videos & Creatives (4)
Tool | Description |
| Upload a video for ad extensions |
| Get uploaded ad videos |
| Create a video creative from uploaded video |
| Get video creatives |
Feeds (4)
Tool | Description |
| Get product feeds |
| Add a product feed (URL or file) |
| Update feed settings |
| Delete feeds |
Images (3)
Tool | Description |
| Upload a base64-encoded image (JPEG, GIF, PNG) |
| Get image metadata, hashes, and association status |
| Delete unassociated images by hash |
Dictionaries & Regions (3)
Tool | Description |
| Get Direct dictionaries (ad categories, interests) |
| Get geographic region tree |
| Get interest categories for targeting |
Client & Changes (4)
Tool | Description |
| Get account info and settings |
| Check for changes in specific campaigns |
| Check for any changes in the account |
| Get timestamp of most recent changes |
Yandex Metrika (43 tools)
Counters (5)
Tool | Description |
| List all Metrika counters |
| Get detailed counter info (code status, webvisor, goals) |
| Create a new counter with tracking code |
| Update counter name, site, or favorite status |
| Delete a counter and all its data |
Goals (4)
Tool | Description |
| Get conversion goals for a counter |
| Create a goal (URL, event, composite, etc.) |
| Update goal conditions |
| Delete a goal |
Reports (4)
Tool | Description |
| Get analytics report with custom metrics and dimensions |
| Get time-series report (daily, weekly, monthly) |
| Compare two date ranges |
| Get hierarchical drill-down report |
Segments (4)
Tool | Description |
| Get audience segments |
| Create a segment with filter expression |
| Update segment definition |
| Delete a segment |
Filters (4)
Tool | Description |
| Get data filters for a counter |
| Create a filter (include/exclude traffic) |
| Update filter conditions |
| Delete a filter |
Grants (4)
Tool | Description |
| Get access permissions for a counter |
| Grant access to another user |
| Update grant permissions |
| Revoke access |
Offline Data (5)
Tool | Description |
| Upload offline conversion data |
| Check upload processing status |
| Upload call tracking data |
| Upload advertising expense data |
| Upload custom user parameters |
Labels (6)
Tool | Description |
| Get labels for organizing counters |
| Create a label |
| Rename a label |
| Delete a label |
| Link a counter to a label |
| Unlink a counter from a label |
Annotations (4)
Tool | Description |
| Get chart annotations for a counter |
| Create an annotation (mark events on charts) |
| Update annotation text |
| Delete an annotation |
Delegates (3)
Tool | Description |
| Get list of account delegates |
| Add a delegate with counter access |
| Remove a delegate |
Yandex Wordstat (5 tools)
Tool | Description |
| Get popular search queries and associations for phrases |
| Get query frequency dynamics over time (daily/weekly/monthly) |
| Get regional distribution of search queries |
| Get full hierarchical regions tree with IDs |
| Deprecated: v1 quota endpoint removed; returns pointer to Yandex Cloud console |
Yandex Webmaster (4 tools)
Tool | Description |
| Resolve the token owner's Webmaster UserID |
| List verified sites and their host IDs |
| Get SQI, searchable and excluded page counts |
| Get 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 rublesKeywords
Show keywords in ad group 456
Add keywords "buy iphone" and "iphone price" to group 456
Set bid 50 rubles on keyword 789Analytics
Show site stats for the last week
How many conversions on goal "Lead" for the last month?
Show traffic sources for counter 97538360Ad creation
Create a text ad in group 456:
- Title: Buy iPhone 15
- Text: Best prices! Free delivery
- URL: https://example.com/iphoneKeyword 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
python -m yandex_mcp
# or
python main.pyMCP Inspector
npx @modelcontextprotocol/inspector python -m yandex_mcpCursor 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 toolsDevelopment
# Install dev dependencies
pip install -e ".[dev]"
# Lint
ruff check .
# Type check
mypy yandex_mcp
# Test
pytestSecurity
Store tokens in environment variables, not in code
Use minimum required permissions
Use sandbox for testing (
YANDEX_USE_SANDBOX=true)Never commit
.envfiles
Links
License
MIT
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/SvechaPVL/yandex-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server