Yandex Direct MCP server (npm)
@theyahia/yandex-direct-mcp
A TypeScript MCP server with an npm package: 20 tools for Yandex Direct campaigns, bids and negative keywords, with money always in rubles
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 and changes campaigns, ads and bids in the live ad account
- Can spend real budget when sandbox mode is not enabled
Install
In your terminal, with SkillFoxx CLI
npx skillfoxx add mcp/theyahia-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 -- npx -y @theyahia/yandex-direct-mcpOr add to the file .mcp.json, in the project
{
"mcpServers": {
"yandex-direct": {
"command": "npx",
"args": [
"-y",
"@theyahia/yandex-direct-mcp"
],
"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
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": {
"command": "npx",
"args": [
"-y",
"@theyahia/yandex-direct-mcp"
],
"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
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","type":"stdio","command":"npx","args":["-y","@theyahia/yandex-direct-mcp"],"env":{"YANDEX_DIRECT_TOKEN":"<your YANDEX_DIRECT_TOKEN>"}}'Or add to the file .vscode/mcp.json, in the project
{
"servers": {
"yandex-direct": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@theyahia/yandex-direct-mcp"
],
"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
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 --env 'YANDEX_DIRECT_TOKEN=<your YANDEX_DIRECT_TOKEN>' -- npx -y @theyahia/yandex-direct-mcpOr add to the file ~/.codex/config.toml, for all projects
[mcp_servers.yandex-direct]
command = "npx"
args = ["-y", "@theyahia/yandex-direct-mcp"]
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
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": {
"command": "npx",
"args": [
"-y",
"@theyahia/yandex-direct-mcp"
],
"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
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": {
"command": "npx",
"args": [
"-y",
"@theyahia/yandex-direct-mcp"
],
"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
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": {
"command": "npx",
"args": [
"-y",
"@theyahia/yandex-direct-mcp"
],
"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
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": {
"command": "npx",
"args": [
"-y",
"@theyahia/yandex-direct-mcp"
],
"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
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": {
"type": "local",
"command": [
"npx",
"-y",
"@theyahia/yandex-direct-mcp"
],
"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
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": {
"command": "npx",
"args": [
"-y",
"@theyahia/yandex-direct-mcp"
],
"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
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": {
"command": "npx",
"args": [
"-y",
"@theyahia/yandex-direct-mcp"
],
"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
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 via oauth.yandex.ru and submit an API access request in the Direct interface, then run claude mcp add yandex-direct -e YANDEX_DIRECT_TOKEN=your_token -- npx -y @theyahia/yandex-direct-mcp, adding YANDEX_DIRECT_SANDBOX=1 for testing.
Other ways from the author
claude mcp add yandex-direct -e YANDEX_DIRECT_TOKEN=ваш_токен -- npx -y @theyahia/yandex-direct-mcpThe README's command for connecting in Claude Code.
This is third-party code. Review the repository files before installing.
What it does
The server wraps the Yandex Direct API into 20 MCP tools: listing and creating campaigns, ad groups with region targeting, text ads with headline and body length checks, keywords and bids, negative keywords at the group and campaign level, statistics and account balance. All money values in and out are in rubles; the server converts them to the API's micro-units itself. It supports a sandbox mode via YANDEX_DIRECT_SANDBOX for testing without real spending, and an agency mode with a Client-Login header for acting on a client's behalf. It ships its own SKILL.md for analyzing campaign performance.
Who it is for. For PPC specialists and agencies running Yandex Direct campaigns through an agent who want money in rubles rather than the API's micro-units.
Good fit when
- You want an npm MCP package for Direct with an npx command and no build step
- You need to act on behalf of an agency's clients via an agency token
- You want a ready skill for analyzing a campaign's spend and bids
Not a fit when
- You have no OAuth token and Direct API access: the server will not work without an application submitted in the Direct interface
- You need image uploads or image ads: there are no tools for that
Example request
Show spend and CTR for Yandex Direct campaign 12345 over the last two weeksLimitations
You need an OAuth token from an application registered in Yandex OAuth and a separate application for Direct API access. Agency tokens require the client's login in the YANDEX_DIRECT_LOGIN variable. Tools for creating campaigns, ads, keywords and bids change the live account and spend money immediately; sandbox mode is opt-in and not on by default. The package is young, and its CHANGELOG shows a recent start.
How to disable. Remove the server with claude mcp remove yandex-direct, or delete the yandex-direct block from your MCP client config.
MCP
- Transport
- stdio
- Authentication
- API key
| Environment variables | |
|---|---|
| YANDEX_DIRECT_TOKEN required, secret | Yandex Direct OAuth token |
| YANDEX_DIRECT_SANDBOX | Enables the sandbox with no real spending |
| YANDEX_DIRECT_LOGIN | Client login for agency tokens |
Security check
- Creates and changes campaigns, ads and bids in the live ad account
- Can spend real budget when sandbox mode is not enabled
README in short
The README lists 20 tools across five groups: campaigns, ad groups, ads, keywords and bids, statistics and balance. It covers installation for Claude Desktop and Claude Code via npx, an environment variable table with the token, sandbox flag and client login, the steps to get an OAuth token, and an explicit warning that some tools spend real money. MIT license, published on npm.
FAQ
What currency is used for input and output?
Rubles everywhere; the server converts them to the micro-units the Direct API uses internally.
Can it act on behalf of an agency's client?
Yes, agency mode is enabled with the YANDEX_DIRECT_LOGIN variable set to the client's login, and the server adds a Client-Login header.
Related
Official DataLens (Yandex) skills for Claude Code, Codex and OpenCode: SDK, HTML reports and RLS resolution
A Yandex Metrika MCP server generated from the API spec: 108 methods, 10 tools declared by default, transparent filters and response metadata
An open MCP server and agent skill set for SEO: keyword research, competitors, backlinks and site audits powered by DataForSEO
A Claude Code plugin for SEO audits: technical SEO, E-E-A-T, schema, local and AI search via parallel subagents