Yandex Direct MCP with launch policies
yamcp (Yandex Direct MCP Server)
A Yandex Direct MCP server for agencies: reports, campaign audits and safe campaign creation under fixed business policies
High risk
We rate an entry high when the tool writes to external systems, handles money, production databases or secrets, or runs arbitrary commands. The CLI installs it only with your consent.
Why this level
- Creates new ad campaigns with a real client budget
- The agency OAuth token grants access to real Yandex Direct data and actions
Install
Manual install
claude mcp add --scope user --transport stdio --env "YD_TOKEN=$YD_TOKEN" --env "YD_MODE=report" yandex-direct -- /absolute/path/to/yamcp/.venv/bin/python -m yadirect_mcpRequires installing into a Python 3.11 venv first.
This is third-party code. Review the repository files before installing.
What it does
The server runs in two modes via the YD_MODE variable. Report mode returns offline Yandex Direct reports with async waiting and context-saving: the full dump is saved to a TSV file, and only a row preview goes back to the model. Campaign_setup mode lets it assemble and write a new campaign under one of several named policies: B2B services, local business or e-commerce, separately for new and already-running accounts. A policy fixes the budget, UTM scheme, measurement profile and which strategy is chosen depending on available history. Before writing, the MCP client requests consent via elicitation for a specific SHA-256 plan, and after writing the server checks actual budgets and settings of created campaigns against that plan.
Who it is for. For agencies and contractors running several client Yandex Direct accounts who want to launch campaigns under one fixed set of rules.
Good fit when
- You need regular offline client reports without blowing up model context
- You need to launch new campaigns under one agreed budget and tracking policy
- You need an audit of existing campaigns against a business profile
Not a fit when
- You need a Unified Performance, display or mobile campaign: the server does not create those
- You need to edit or delete existing objects: the server only reads them
- You need remote HTTP access: the server only runs over local stdio
Example request
Build a Search plus network campaign plan for a new local business with a 30,000 ruble monthly budget and show the plan before writing itLimitations
Does not edit or delete existing campaigns, groups, ads or keywords: bid adjustments and retargeting conditions are read but not set. Does not create Unified Performance, display or mobile campaigns. No direct Yandex Metrica access: a separate token with metrika:read is needed. Not an official Yandex product. The sandbox has been disabled since July 2026, so testing is only possible on a dedicated draft campaign.
How to disable. Run claude mcp remove yandex-direct in Claude Code or remove the server from your MCP client config.
MCP
- Transport
- stdio
- Authentication
- API key
| Environment variables | |
|---|---|
| YD_TOKEN required, secret | OAuth token with Yandex Direct API access |
| YD_MODE | Server mode: report or campaign_setup, defaults to report |
| YD_ALLOWED_LOGINS | Comma-separated list of allowed client logins |
| YD_OUT_DIR | Directory for full TSV reports |
Security check
- Creates new ad campaigns with a real client budget
- The agency OAuth token grants access to real Yandex Direct data and actions
README in short
The README carefully logs the history of campaign-launch policy changes by date, an environment-variable table, Windows and Linux install steps, and connections to Claude Code, OpenAI Codex, Hermes Agent and ZCode. It separately covers technical decisions: stable report names, Reports API waiting, model context savings via row previews, and a full list of limitations and common-error diagnostics.
FAQ
Can the server launch a campaign on its own?
No, writing a campaign requires consent via elicitation on the MCP client side, and it only starts serving after manual activation in the Direct interface following moderation.
Do I need a separate Metrica token?
Yes, the Direct token does not grant Metrica API access; you need a separate token with metrika:read, though goal conversions are still available via direct_report with the goals parameter.
Related
A skill that strips AI writing tells from text using Wikipedia's list, without adding invented facts
Marketing Skills for AI agents
Marketing Skills for AI Agents
About fifty skills for CRO, copywriting, SEO, analytics, ads and launches, built for coding agents
SendPulse MCP server
SendPulse MCP
SendPulse's official remote MCP server: statistics, campaigns and user data through an agent chat
Yandex Direct MCP generated from a machine-readable schema
yandex-direct-mcp
An MCP server and CLI covering all 113 Yandex Direct API v5 methods generated from WSDL, exposing 9 read tools by default and writes only on demand