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
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
- Once DIRECT_ALLOW_WRITES is set, it opens 80 changing and 16 deleting Direct methods
- Deletion and archiving in Direct are irreversible, and real money sits on the other end
Install
In your terminal, with SkillFoxx CLI
npx skillfoxx add mcp/artgas1-yandex-direct-mcpDetects the agents on your machine, checks the risk and pins the version.
Other ways to install
This entry is high risk, so there is no one-click install. Review the code and add the config by hand.
Run in a terminal
claude mcp add --transport stdio --env 'YANDEX_DIRECT_TOKEN=<your YANDEX_DIRECT_TOKEN>' yandex-direct-api-mcp -- npx -y yandex-direct-api-mcp@1.1.1Or add to the file .mcp.json, in the project
{
"mcpServers": {
"yandex-direct-api-mcp": {
"command": "npx",
"args": [
"-y",
"yandex-direct-api-mcp@1.1.1"
],
"env": {
"YANDEX_DIRECT_TOKEN": "<your YANDEX_DIRECT_TOKEN>"
}
}
}
}If the file already exists, add the server inside the mcpServers key.
Keys and settings
YANDEX_DIRECT_TOKENsecret, required- OAuth-токен Яндекса со scope direct:api (https://oauth.yandex.ru/)
YANDEX_DIRECT_LOGINoptional- Логин кабинета для заголовка Client-Login. Нужен агентствам и представителям; для собственного кабинета не задаётся
DIRECT_PROFILEoptional- Набор объявляемых инструментов: core — узкий набор по умолчанию, read — все читающие, all — вся поверхность
DIRECT_TOOLSoptional- Явный список инструментов или служб через запятую. Побеждает DIRECT_PROFILE
DIRECT_ALLOW_WRITESoptional- Разрешить изменяющие методы (add/update/delete). Пока выключено, они не объявляются вовсе. Значения: 1, true, yes
DIRECT_API_VERSIONoptional- Версия пути API. Разные версии отдают разные наборы полей одной и той же кампании
DIRECT_SANDBOXoptional- Отправлять запросы в песочницу Директа вместо боевого кабинета. Значения: 1, true, yes
DIRECT_MAX_OUTPUT_CHARSoptional- Потолок размера ответа инструмента в символах; сверх него ответ усекается с пометкой
Replace the values in angle brackets with your own. Keys never go into install links and are not stored by us.
Add to the file ~/.cursor/mcp.json, for all projects
{
"mcpServers": {
"yandex-direct-api-mcp": {
"command": "npx",
"args": [
"-y",
"yandex-direct-api-mcp@1.1.1"
],
"env": {
"YANDEX_DIRECT_TOKEN": "<your YANDEX_DIRECT_TOKEN>"
}
}
}
}If the file already exists, add the server inside the mcpServers key. For a single project, put the same block into .cursor/mcp.json.
Keys and settings
YANDEX_DIRECT_TOKENsecret, required- OAuth-токен Яндекса со scope direct:api (https://oauth.yandex.ru/)
YANDEX_DIRECT_LOGINoptional- Логин кабинета для заголовка Client-Login. Нужен агентствам и представителям; для собственного кабинета не задаётся
DIRECT_PROFILEoptional- Набор объявляемых инструментов: core — узкий набор по умолчанию, read — все читающие, all — вся поверхность
DIRECT_TOOLSoptional- Явный список инструментов или служб через запятую. Побеждает DIRECT_PROFILE
DIRECT_ALLOW_WRITESoptional- Разрешить изменяющие методы (add/update/delete). Пока выключено, они не объявляются вовсе. Значения: 1, true, yes
DIRECT_API_VERSIONoptional- Версия пути API. Разные версии отдают разные наборы полей одной и той же кампании
DIRECT_SANDBOXoptional- Отправлять запросы в песочницу Директа вместо боевого кабинета. Значения: 1, true, yes
DIRECT_MAX_OUTPUT_CHARSoptional- Потолок размера ответа инструмента в символах; сверх него ответ усекается с пометкой
Replace the values in angle brackets with your own. Keys never go into install links and are not stored by us.
Run in a terminal
code --add-mcp '{"name":"yandex-direct-api-mcp","type":"stdio","command":"npx","args":["-y","yandex-direct-api-mcp@1.1.1"],"env":{"YANDEX_DIRECT_TOKEN":"<your YANDEX_DIRECT_TOKEN>"}}'Or add to the file .vscode/mcp.json, in the project
{
"servers": {
"yandex-direct-api-mcp": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"yandex-direct-api-mcp@1.1.1"
],
"env": {
"YANDEX_DIRECT_TOKEN": "<your YANDEX_DIRECT_TOKEN>"
}
}
}
}If the file already exists, add the server inside the servers key.
Keys and settings
YANDEX_DIRECT_TOKENsecret, required- OAuth-токен Яндекса со scope direct:api (https://oauth.yandex.ru/)
YANDEX_DIRECT_LOGINoptional- Логин кабинета для заголовка Client-Login. Нужен агентствам и представителям; для собственного кабинета не задаётся
DIRECT_PROFILEoptional- Набор объявляемых инструментов: core — узкий набор по умолчанию, read — все читающие, all — вся поверхность
DIRECT_TOOLSoptional- Явный список инструментов или служб через запятую. Побеждает DIRECT_PROFILE
DIRECT_ALLOW_WRITESoptional- Разрешить изменяющие методы (add/update/delete). Пока выключено, они не объявляются вовсе. Значения: 1, true, yes
DIRECT_API_VERSIONoptional- Версия пути API. Разные версии отдают разные наборы полей одной и той же кампании
DIRECT_SANDBOXoptional- Отправлять запросы в песочницу Директа вместо боевого кабинета. Значения: 1, true, yes
DIRECT_MAX_OUTPUT_CHARSoptional- Потолок размера ответа инструмента в символах; сверх него ответ усекается с пометкой
Replace the values in angle brackets with your own. Keys never go into install links and are not stored by us.
Run in a terminal
codex mcp add yandex-direct-api-mcp --env 'YANDEX_DIRECT_TOKEN=<your YANDEX_DIRECT_TOKEN>' -- npx -y yandex-direct-api-mcp@1.1.1Or add to the file ~/.codex/config.toml, for all projects
[mcp_servers.yandex-direct-api-mcp]
command = "npx"
args = ["-y", "yandex-direct-api-mcp@1.1.1"]
env = { YANDEX_DIRECT_TOKEN = "<your YANDEX_DIRECT_TOKEN>" }If the file already exists, append the block to the end.
Keys and settings
YANDEX_DIRECT_TOKENsecret, required- OAuth-токен Яндекса со scope direct:api (https://oauth.yandex.ru/)
YANDEX_DIRECT_LOGINoptional- Логин кабинета для заголовка Client-Login. Нужен агентствам и представителям; для собственного кабинета не задаётся
DIRECT_PROFILEoptional- Набор объявляемых инструментов: core — узкий набор по умолчанию, read — все читающие, all — вся поверхность
DIRECT_TOOLSoptional- Явный список инструментов или служб через запятую. Побеждает DIRECT_PROFILE
DIRECT_ALLOW_WRITESoptional- Разрешить изменяющие методы (add/update/delete). Пока выключено, они не объявляются вовсе. Значения: 1, true, yes
DIRECT_API_VERSIONoptional- Версия пути API. Разные версии отдают разные наборы полей одной и той же кампании
DIRECT_SANDBOXoptional- Отправлять запросы в песочницу Директа вместо боевого кабинета. Значения: 1, true, yes
DIRECT_MAX_OUTPUT_CHARSoptional- Потолок размера ответа инструмента в символах; сверх него ответ усекается с пометкой
Replace the values in angle brackets with your own. Keys never go into install links and are not stored by us.
Add to the file ~/.gemini/settings.json, for all projects
{
"mcpServers": {
"yandex-direct-api-mcp": {
"command": "npx",
"args": [
"-y",
"yandex-direct-api-mcp@1.1.1"
],
"env": {
"YANDEX_DIRECT_TOKEN": "<your YANDEX_DIRECT_TOKEN>"
}
}
}
}If the file already exists, add the server inside the mcpServers key.
Keys and settings
YANDEX_DIRECT_TOKENsecret, required- OAuth-токен Яндекса со scope direct:api (https://oauth.yandex.ru/)
YANDEX_DIRECT_LOGINoptional- Логин кабинета для заголовка Client-Login. Нужен агентствам и представителям; для собственного кабинета не задаётся
DIRECT_PROFILEoptional- Набор объявляемых инструментов: core — узкий набор по умолчанию, read — все читающие, all — вся поверхность
DIRECT_TOOLSoptional- Явный список инструментов или служб через запятую. Побеждает DIRECT_PROFILE
DIRECT_ALLOW_WRITESoptional- Разрешить изменяющие методы (add/update/delete). Пока выключено, они не объявляются вовсе. Значения: 1, true, yes
DIRECT_API_VERSIONoptional- Версия пути API. Разные версии отдают разные наборы полей одной и той же кампании
DIRECT_SANDBOXoptional- Отправлять запросы в песочницу Директа вместо боевого кабинета. Значения: 1, true, yes
DIRECT_MAX_OUTPUT_CHARSoptional- Потолок размера ответа инструмента в символах; сверх него ответ усекается с пометкой
Replace the values in angle brackets with your own. Keys never go into install links and are not stored by us.
Add to the file ~/.config/devin/mcp_config.json, for all projects
{
"mcpServers": {
"yandex-direct-api-mcp": {
"command": "npx",
"args": [
"-y",
"yandex-direct-api-mcp@1.1.1"
],
"env": {
"YANDEX_DIRECT_TOKEN": "<your YANDEX_DIRECT_TOKEN>"
}
}
}
}If the file already exists, add the server inside the mcpServers key. Legacy Cascade keeps the MCP config in ~/.codeium/windsurf/mcp_config.json.
Keys and settings
YANDEX_DIRECT_TOKENsecret, required- OAuth-токен Яндекса со scope direct:api (https://oauth.yandex.ru/)
YANDEX_DIRECT_LOGINoptional- Логин кабинета для заголовка Client-Login. Нужен агентствам и представителям; для собственного кабинета не задаётся
DIRECT_PROFILEoptional- Набор объявляемых инструментов: core — узкий набор по умолчанию, read — все читающие, all — вся поверхность
DIRECT_TOOLSoptional- Явный список инструментов или служб через запятую. Побеждает DIRECT_PROFILE
DIRECT_ALLOW_WRITESoptional- Разрешить изменяющие методы (add/update/delete). Пока выключено, они не объявляются вовсе. Значения: 1, true, yes
DIRECT_API_VERSIONoptional- Версия пути API. Разные версии отдают разные наборы полей одной и той же кампании
DIRECT_SANDBOXoptional- Отправлять запросы в песочницу Директа вместо боевого кабинета. Значения: 1, true, yes
DIRECT_MAX_OUTPUT_CHARSoptional- Потолок размера ответа инструмента в символах; сверх него ответ усекается с пометкой
Replace the values in angle brackets with your own. Keys never go into install links and are not stored by us.
Formerly Windsurf.
Add to the file cline_mcp_settings.json, for all projects
{
"mcpServers": {
"yandex-direct-api-mcp": {
"command": "npx",
"args": [
"-y",
"yandex-direct-api-mcp@1.1.1"
],
"env": {
"YANDEX_DIRECT_TOKEN": "<your YANDEX_DIRECT_TOKEN>"
}
}
}
}If the file already exists, add the server inside the mcpServers key. Open the settings file in Cline: MCP Servers tab, Configure MCP Servers.
Keys and settings
YANDEX_DIRECT_TOKENsecret, required- OAuth-токен Яндекса со scope direct:api (https://oauth.yandex.ru/)
YANDEX_DIRECT_LOGINoptional- Логин кабинета для заголовка Client-Login. Нужен агентствам и представителям; для собственного кабинета не задаётся
DIRECT_PROFILEoptional- Набор объявляемых инструментов: core — узкий набор по умолчанию, read — все читающие, all — вся поверхность
DIRECT_TOOLSoptional- Явный список инструментов или служб через запятую. Побеждает DIRECT_PROFILE
DIRECT_ALLOW_WRITESoptional- Разрешить изменяющие методы (add/update/delete). Пока выключено, они не объявляются вовсе. Значения: 1, true, yes
DIRECT_API_VERSIONoptional- Версия пути API. Разные версии отдают разные наборы полей одной и той же кампании
DIRECT_SANDBOXoptional- Отправлять запросы в песочницу Директа вместо боевого кабинета. Значения: 1, true, yes
DIRECT_MAX_OUTPUT_CHARSoptional- Потолок размера ответа инструмента в символах; сверх него ответ усекается с пометкой
Replace the values in angle brackets with your own. Keys never go into install links and are not stored by us.
Add to the file .roo/mcp.json, in the project
{
"mcpServers": {
"yandex-direct-api-mcp": {
"command": "npx",
"args": [
"-y",
"yandex-direct-api-mcp@1.1.1"
],
"env": {
"YANDEX_DIRECT_TOKEN": "<your YANDEX_DIRECT_TOKEN>"
}
}
}
}If the file already exists, add the server inside the mcpServers key.
Keys and settings
YANDEX_DIRECT_TOKENsecret, required- OAuth-токен Яндекса со scope direct:api (https://oauth.yandex.ru/)
YANDEX_DIRECT_LOGINoptional- Логин кабинета для заголовка Client-Login. Нужен агентствам и представителям; для собственного кабинета не задаётся
DIRECT_PROFILEoptional- Набор объявляемых инструментов: core — узкий набор по умолчанию, read — все читающие, all — вся поверхность
DIRECT_TOOLSoptional- Явный список инструментов или служб через запятую. Побеждает DIRECT_PROFILE
DIRECT_ALLOW_WRITESoptional- Разрешить изменяющие методы (add/update/delete). Пока выключено, они не объявляются вовсе. Значения: 1, true, yes
DIRECT_API_VERSIONoptional- Версия пути API. Разные версии отдают разные наборы полей одной и той же кампании
DIRECT_SANDBOXoptional- Отправлять запросы в песочницу Директа вместо боевого кабинета. Значения: 1, true, yes
DIRECT_MAX_OUTPUT_CHARSoptional- Потолок размера ответа инструмента в символах; сверх него ответ усекается с пометкой
Replace the values in angle brackets with your own. Keys never go into install links and are not stored by us.
A fork of Roo Code, same .roo folders.
Add to the file opencode.json, in the project
{
"mcp": {
"yandex-direct-api-mcp": {
"type": "local",
"command": [
"npx",
"-y",
"yandex-direct-api-mcp@1.1.1"
],
"environment": {
"YANDEX_DIRECT_TOKEN": "<your YANDEX_DIRECT_TOKEN>"
}
}
}
}If the file already exists, add the server inside the mcp key.
Keys and settings
YANDEX_DIRECT_TOKENsecret, required- OAuth-токен Яндекса со scope direct:api (https://oauth.yandex.ru/)
YANDEX_DIRECT_LOGINoptional- Логин кабинета для заголовка Client-Login. Нужен агентствам и представителям; для собственного кабинета не задаётся
DIRECT_PROFILEoptional- Набор объявляемых инструментов: core — узкий набор по умолчанию, read — все читающие, all — вся поверхность
DIRECT_TOOLSoptional- Явный список инструментов или служб через запятую. Побеждает DIRECT_PROFILE
DIRECT_ALLOW_WRITESoptional- Разрешить изменяющие методы (add/update/delete). Пока выключено, они не объявляются вовсе. Значения: 1, true, yes
DIRECT_API_VERSIONoptional- Версия пути API. Разные версии отдают разные наборы полей одной и той же кампании
DIRECT_SANDBOXoptional- Отправлять запросы в песочницу Директа вместо боевого кабинета. Значения: 1, true, yes
DIRECT_MAX_OUTPUT_CHARSoptional- Потолок размера ответа инструмента в символах; сверх него ответ усекается с пометкой
Replace the values in angle brackets with your own. Keys never go into install links and are not stored by us.
Add to the file ~/.config/zed/settings.json, for all projects
{
"context_servers": {
"yandex-direct-api-mcp": {
"command": "npx",
"args": [
"-y",
"yandex-direct-api-mcp@1.1.1"
],
"env": {
"YANDEX_DIRECT_TOKEN": "<your YANDEX_DIRECT_TOKEN>"
}
}
}
}If the file already exists, add the server inside the context_servers key.
Keys and settings
YANDEX_DIRECT_TOKENsecret, required- OAuth-токен Яндекса со scope direct:api (https://oauth.yandex.ru/)
YANDEX_DIRECT_LOGINoptional- Логин кабинета для заголовка Client-Login. Нужен агентствам и представителям; для собственного кабинета не задаётся
DIRECT_PROFILEoptional- Набор объявляемых инструментов: core — узкий набор по умолчанию, read — все читающие, all — вся поверхность
DIRECT_TOOLSoptional- Явный список инструментов или служб через запятую. Побеждает DIRECT_PROFILE
DIRECT_ALLOW_WRITESoptional- Разрешить изменяющие методы (add/update/delete). Пока выключено, они не объявляются вовсе. Значения: 1, true, yes
DIRECT_API_VERSIONoptional- Версия пути API. Разные версии отдают разные наборы полей одной и той же кампании
DIRECT_SANDBOXoptional- Отправлять запросы в песочницу Директа вместо боевого кабинета. Значения: 1, true, yes
DIRECT_MAX_OUTPUT_CHARSoptional- Потолок размера ответа инструмента в символах; сверх него ответ усекается с пометкой
Replace the values in angle brackets with your own. Keys never go into install links and are not stored by us.
Add to the file .codeassistant/mcp.json, in the project
{
"mcpServers": {
"yandex-direct-api-mcp": {
"command": "npx",
"args": [
"-y",
"yandex-direct-api-mcp@1.1.1"
],
"env": {
"YANDEX_DIRECT_TOKEN": "<your YANDEX_DIRECT_TOKEN>"
}
}
}
}If the file already exists, add the server inside the mcpServers key.
Keys and settings
YANDEX_DIRECT_TOKENsecret, required- OAuth-токен Яндекса со scope direct:api (https://oauth.yandex.ru/)
YANDEX_DIRECT_LOGINoptional- Логин кабинета для заголовка Client-Login. Нужен агентствам и представителям; для собственного кабинета не задаётся
DIRECT_PROFILEoptional- Набор объявляемых инструментов: core — узкий набор по умолчанию, read — все читающие, all — вся поверхность
DIRECT_TOOLSoptional- Явный список инструментов или служб через запятую. Побеждает DIRECT_PROFILE
DIRECT_ALLOW_WRITESoptional- Разрешить изменяющие методы (add/update/delete). Пока выключено, они не объявляются вовсе. Значения: 1, true, yes
DIRECT_API_VERSIONoptional- Версия пути API. Разные версии отдают разные наборы полей одной и той же кампании
DIRECT_SANDBOXoptional- Отправлять запросы в песочницу Директа вместо боевого кабинета. Значения: 1, true, yes
DIRECT_MAX_OUTPUT_CHARSoptional- Потолок размера ответа инструмента в символах; сверх него ответ усекается с пометкой
Replace the values in angle brackets with your own. Keys never go into install links and are not stored by us.
Get a Yandex Direct OAuth token with the direct:api scope and add the server via npx: {"mcpServers":{"yandex-direct":{"command":"npx","args":["-y","yandex-direct-api-mcp"],"env":{"YANDEX_DIRECT_TOKEN":"your-token"}}}}. To allow changes, add DIRECT_ALLOW_WRITES=1 to env.
Other ways from the author
npx -y yandex-direct-api-mcpBy default only the 9 core-profile read tools are exposed.
This is third-party code. Review the repository files before installing.
What it does
The server and CLI cover all 113 Direct API v5 methods rather than a subset: the full list of 30 services, 113 methods, 609 types and 240 enums is generated automatically from the WSDL of 29 services and the official docs, not written by hand. To avoid bloating model context on every turn, the default core profile exposes only nine read tools, and the full 117-tool set unlocks via DIRECT_ALLOW_WRITES=1. Of the 113 methods, 80 change data and 16 delete, and the changing tools are not declared to the model at all until writes are explicitly enabled: context is not spent on tools that cannot be called anyway. The server also handles a list of common live-API traps: converting amounts out of micro-units, not truncating 19-digit ids, refusing to treat an HTTP 200 with an error body as success, and not confusing Direct's warnings with rejections.
Who it is for. For developers who need full, accurate Direct API v5 coverage with control over how many tools go into the model's context.
Good fit when
- You need the entire API v5, not just frequent methods like campaigns and ads
- You care about not bloating model context with dozens of unneeded tools
- You need confidence that amounts, ids and response status are parsed with no hidden bugs
Not a fit when
- You need writes to work out of the box with no extra setting: they are off by default
- You only need a few typical operations: the full surface and profiles here are overkill
- You need the reports service configured with no manual step: Direct does not serve its WSDL, so it is described by hand
Example request
Show the full list of Direct API methods and explain which ones are currently hidden and whyLimitations
Data-changing tools are not declared to the model until DIRECT_ALLOW_WRITES=1 is set: if you expect writes right after install, you need to enable it explicitly. Schema-derived enums can lag behind the live API and are used as a hint, not a hard filter. Needs an OAuth token with the direct:api scope; sandbox needs a separate registration and token.
How to disable. Run claude mcp remove yandex-direct in Claude Code or remove the yandex-direct block from your client config.
MCP
- Transport
- stdio
- Authentication
- API key
| Environment variables | |
|---|---|
| YANDEX_DIRECT_TOKEN required, secret | OAuth token with the direct:api scope |
| DIRECT_ALLOW_WRITES | Declares data-changing tools; off by default |
| DIRECT_PROFILE | core, read or all, defaults to core |
| DIRECT_SANDBOX | Switches to sandbox instead of the live account |
Security check
- Once DIRECT_ALLOW_WRITES is set, it opens 80 changing and 16 deleting Direct methods
- Deletion and archiving in Direct are irreversible, and real money sits on the other end
README in short
The README walks through eight silent Direct API traps with examples: micro-unit amounts, id precision loss, an HTTP 200 with an error body, delayed reports, the v501 versus v5 path version, an incomplete campaign list, and a warning that is actually an applied change. It gives a coverage table by profile with byte and approximate token counts, a settings table, the WSDL-and-docs origin of every method, and a separate install option as a skill via npx skills add.
FAQ
Why does it show only 9 tools out of 113 methods by default?
Every declared tool's description sits in the model's context on every turn, so by default the core profile of frequent read methods is declared, not everything the API can do.
How do I enable data-changing methods?
Set DIRECT_ALLOW_WRITES=1; otherwise the changing tools are never declared to the model.
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
Shturman: Direct MCP with a hard red line
Shturman Direct MCP
12 dependency-free Yandex Direct tools: a plan-then-confirm write flow, with campaign resume and delete simply not implemented