SuperAPIAI Directory

mcp-yandex-audience

github.com · AI marketing

Yandex Audience API: build and manage ad-targeting segments (CRM uploads, lookalike, pixel-based) and access grants.

Open website Alternatives
PricingOpen source开源项目(可免费自部署)

About this tool

Purpose

mcp-yandex-audience is an MCP (Model Context Protocol) server that connects AI applications to Yandex Audience (Яндекс Аудитории). Users can use natural language to have the AI assistant view existing audience segments in their account, prepare segments from a CRM, build look-alike audiences (LAL), or grant access to colleagues, and the assistant performs these operations through the user's own account.

Main capabilities

The server provides 20 tools covering the following areas:

  • View account contents: view segments and their types, statuses, and IDs; find segments that are still processing, have errors, or have insufficient data; view pixels and their 7-, 30-, and 90-day reach, as well as segments created based on pixels; view who has been granted access to a segment.
  • Prepare segments from a CRM: upload a CSV containing email, phone, ext_id, or external_id columns; upload a TSV/TXT containing device IDs, MAC addresses, or SHA256 hashes; check the parameters of an uploaded segment before confirming; save the segment with a specified name and data type, then check processing progress.
  • Build new audiences: create look-alike audiences based on existing segments (from more similar and narrower to broader); build visitor segments based on a pixel for 1 to 90 days; add trigger count and UTM tag conditions to pixel segments.
  • Manage pixels and access permissions: create or rename pixels; grant view or edit permissions for a segment to colleagues or agencies; revoke access permissions when they are no longer needed.
  • raw_request: for operations that do not yet have a dedicated tool, such as reprocessing a segment or restoring a pixel. This is a tool for technical users and may perform writes or deletions; for ordinary tasks, it is recommended to use the dedicated commands described above.

How to use

Requires Node.js 20 or later, as well as a Yandex Audience account. The server is started via npx, with no separate package installation required.

  1. Add the server to the AI application. Using Codex as an example, you can go through the interface Settings → MCP servers → Add server, select STDIO, and the command is npx -y mcp-yandex-audience@latest, then save and restart; it can also be configured via the command line. Other clients (Claude Code, Claude Desktop, Cursor, VS Code) have their own configuration methods.
  2. In the conversation, write "Подключи Яндекс Аудитории" (connect Yandex Audience). The assistant will guide you through Yandex login and check segment access permissions.
  3. Start with a safe query, for example "Покажи мои сегменты в Яндекс Аудиториях: названия, типы и текущие статусы" (show my segments in Yandex Audience: names, types, and current statuses).

Connection flow: after requesting connection in the conversation, Yandex will open a login page; the user must open it under the account that owns the target segments (or is authorized for them), confirm access, and send the displayed code. The code is one-time, valid for 10 minutes, and is exchanged for a token only within the running server. The server uses PKCE, and the code itself cannot be exchanged for a token. The token is stored locally in ~/.config/mcp-yandex-audience/credentials.json, accessible only to the owner, and access permissions are renewed automatically. The server requests two permissions: read and modify Audience segments; it cannot access ad campaigns, ads, or other Yandex services.

For CI and non-standard installations, it can be configured via environment variables, for example using YANDEX_AUDIENCE_TOKEN Provides ready-made tokens. How to obtain: register an application at oauth.yandex.ru/client/new, select the Yandex Audience permissions (create segments and modify parameters of own and trusted segments, read parameters of own and trusted segments), obtain an OAuth token and pass it to the server. Such tokens are stored in plaintext in the AI client configuration and should be treated like passwords; do not add configurations containing real tokens to Git.

Use cases

  • Advertising specialists quickly view and manage audience segments in Yandex Audience via an AI assistant.
  • Create targeted audiences from CRM data (email, phone) or device identifiers (device ID, MAC, SHA256).
  • Build look-alike audiences and visitor audiences based on existing segments or pixels.
  • Manage pixels and grant or revoke segment access to colleagues and agencies.

Limitations

  • The server does not manage ad campaigns, bids, and ads in Yandex Direct; generated segments need to be connected to ad campaigns outside this MCP server.
  • File segment creation is a two-step process: first upload (status is uploaded), then separately confirm the name, data type, and processing parameters, after which Yandex Audience begins processing. Processing is not instantaneous; check the status via the segment list.
  • The server does not combine file upload and confirmation into a single hidden call. On network errors or 5xx responses, it does not automatically retry write operations, because the operation may have already been executed; check the status first via segments, pixels, or access lists.
  • Deleting a segment is irreversible. Pixels can be restored by calling the restore method via raw_request.
  • A single segment cannot be requested separately; the API returns the full list, and the server looks it up by id within it.
  • Minimum 100 records, maximum 1 GB. When confirming a smaller segment, you can pass check_size: false, but that segment cannot be used for Direct until its size grows.
  • API quotas: at most 30 requests per second per IP, 5000 requests per day per login; creating and modifying segments is limited to at most 10 per minute, 100 per hour, 500 per day. Failed requests also consume quota.
  • When temporary limits are encountered, the server retries with a delay the number of times specified by YANDEX_AUDIENCE_MAX_RETRIES ; a 429 response does not mean the object needs to be recreated.
  • No background monitoring. The server runs only when the AI application calls it and does not wait for processing to complete on its own. If the application supports scheduled tasks, periodic status checks via the segment list can be configured.
  • The server runs locally and accesses api-audience.yandex.ru directly. The OAuth token is added only to Audience API requests; raw_request accepts only relative paths, and redirects to other hosts are blocked.
  • By default, anonymous technical telemetry is sent to usage.gistrec.cloud: server startup (including when no token is configured), the names of tools called and reason codes for configuration issues, as well as a random installation ID, package version, AI client name and version, Node.js version, and operating system. OAuth tokens, account data, file contents, tool parameters, and request text are not read or sent. Sending occurs in the background with a 2-second timeout and does not affect server operation. Telemetry can be disabled via an environment variable.
Up/Down to navigate · Enter to open · ESC to closeBrowse all tools