mcp-yandex-audience: Instructions file for Claude Code

CLAUDE.md

mcp-yandex-audience CLAUDE.md is an instructions file for Claude Code from A1-x-Tech/mcp-yandex-audience. It costs 2,759 tokens per session, scanned A, original, MIT.

A set of project instructions for developing the mcp-yandex-audience server, which connects to Yandex Audience’s advertising-management API.

In plain words
What is it for?
Use it as a reference when developing, testing, building, or adding tools to mcp-yandex-audience.
Why use it?
It documents the server’s commands, architecture, conventions, authentication, and testing expectations so contributors can change it safely.

Instructions file for Claude Code

Written for Claude Code: the file is CLAUDE.md. Also seen: mentions CLAUDE.md.

This is A1-x-Tech/mcp-yandex-audience's own configuration. It tells Claude Code how to work on mcp-yandex-audience itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything mcp-yandex-audience configures →

Reuse

Borrowing it

Nothing to install: this file belongs to A1-x-Tech/mcp-yandex-audience. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/A1-x-Tech/mcp-yandex-audience/main/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/A1-x-Tech/mcp-yandex-audience

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for mcp-yandex-audience CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/a1-x-tech/mcp-yandex-audience/claude-md/github.svg)](https://agentmods.dev/instructions/a1-x-tech/mcp-yandex-audience/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/a1-x-tech/mcp-yandex-audience/claude-md"><img src="https://agentmods.dev/badge/instructions/a1-x-tech/mcp-yandex-audience/claude-md/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for mcp-yandex-audience CLAUDE.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/a1-x-tech/mcp-yandex-audience/claude-md"><img src="https://agentmods.dev/badge/instructions/a1-x-tech/mcp-yandex-audience/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 2,759 This file is loaded in full into every session.
When invoked 2,759 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.02759 $0.02759
Opus 5 $0.01380 $0.01380
Sonnet 5 $0.00552 $0.00552
Haiku 4.5 $0.00276 $0.00276

Measured 10d ago against content hash d89d92e6aa1a, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

mcp-yandex-audience CLAUDE.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 10d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

CLAUDE.md · 152 lines

How it starts

The opening of the file, as written. The whole thing — 152 lines — stays where its author put it; the contents beside it link to each section on GitHub.

CLAUDE.md — mcp-yandex-audience

MCP server for the Yandex Audience API (TypeScript, stdio). Write-capable: tools wrap segment management (file/CRM uploads with two-phase confirm, lookalike, pixel-based), pixels and access grants; raw_request is the escape hatch. The server talks to the Yandex Audience Management API (api-audience.yandex.ru, /v1/management/*); auth is a Yandex OAuth token sent as Authorization: OAuth <token> on every request — either from YANDEX_AUDIENCE_TOKEN or minted by the in-chat login (start_login / finish_login).

Commands

npm run dev        # run from source (tsx watch)
npm test           # unit tests + dist smoke (incl. real stdio MCP handshake), no network
npm run typecheck  # types for src + tests
npm run build      # emit dist/
npm run smoke      # live READ-ONLY call (needs YANDEX_AUDIENCE_TOKEN)

Architecture

  • src/config.ts — env → config. A missing YANDEX_AUDIENCE_TOKEN is NOT an error: the field stays undefined, the server starts and the token is resolved per request by the TokenStore. ConfigError (with a reason code) is reserved for malformed values, caught by loadConfigOrDegraded in index.ts (no such checks exist today). Optional YANDEX_AUDIENCE_API_HOST (default https://api-audience.yandex.ru), YANDEX_AUDIENCE_TIMEOUT_MS, YANDEX_AUDIENCE_MAX_RETRIES.
  • src/oauth.ts — the OAuth flow: PKCE pair (S256), authorize URL with the https://oauth.yandex.ru/verification_code redirect, code exchange and refresh. No client_secret — this is a public client, and a secret inside an npm package would protect nothing. Scope is pinned to audience:read audience:write. The pending verifier lives in one module-level slot (one stdio server = one user); a second start_login replaces it. Own app via YANDEX_AUDIENCE_OAUTH_CLIENT_ID.
  • src/credentials.ts~/.config/mcp-yandex-audience/credentials.json, mode 0600. An unparsable file reads as "not connected", never as an empty token.
  • src/auth.tsTokenStore: resolves the token per request (env wins over stored), refreshes on expiry, and raises AuthRequiredError whose message is the product — it is the only text the user ever sees about a missing token, and it names both fixes (start_login in the chat, or YANDEX_AUDIENCE_TOKEN + restart). It replaced the old CredentialsError.
  • src/client.ts — one typed method per endpoint (listSegments, confirmSegment, createLookalikeSegment, createPixel, addSegmentGrant, …): OAuth header, path/query/body assembly ({segment: …} / {pixel: …} / {grant: …} envelopes, compact() drops undefined), upload() for multipart file uploads (no explicit Content-Type — fetch sets the boundary). The token comes from the TokenStore on EVERY attempt (never cached on the instance); a missing token raises AuthRequiredError while the auth header is built — rethrown before the retry/backoff branch and before fetch. A 401 (or 403 naming invalid_token) on a stored token triggers one silent refresh + replay. request() resolves the path against the base and rejects any path that escapes to a foreign origin (SSRF guard), enforces an AbortController timeout that also covers reading the body, and throws AudienceError(status, body) parsing the API's {errors: [{error_type, message, location}], code, message} format. Retries: 429 for any method; 5xx/network only for GET — repeating a committed write would duplicate it.
  • src/tools/auth.tsauth_status, start_login, finish_login, logout: the in-chat login. finish_login stores the token and proves it with a live listSegments read; logout deletes only the stored file, never the env token. src/tools/segments.tslist_segments, upload_segment_file, upload_segment_csv_file, confirm_segment, rename_segment, delete_segment, create_lookalike_segment, create_pixel_segment. Upload tools accept file_path XOR content (checked in the handler — cross-field rules can't live in a plain-object inputSchema). src/tools/pixels.tslist_pixels, create_pixel, update_pixel, delete_pixel. src/tools/grants.tslist_segment_grants, add_segment_grant, delete_segment_grant. src/tools/raw.tsraw_request (GET/POST/PUT/DELETE, defaults to GET). src/tools/util.tsok/fail, the annotation constants (READ_ONLY/WRITE/WRITE_IDEMPOTENT/DESTRUCTIVE/RAW) and shared zod field factories.
  • src/index.ts — wires every register* into the McpServer. loadConfigOrDegraded starts the server even on a config problem; connected = tokens.hasToken() is resolved once, only to pick the instructions text — without a token they open with the unconfigured prefix (connect via start_login right in the chat, or set YANDEX_AUDIENCE_TOKEN and restart).
  • src/telemetry.ts — anonymous usage pings (ids/names/versions only, never data or arguments; fire-and-forget, must never block or throw; opt-out ASKADS_TELEMETRY=0). server_start means "a usable install started"; an install without a token sends unconfigured_start instead. The reason is a closed vocabulary (missing_token) — never a variable's name or value. startup_failed remains for a config unusable at load time (malformed values; no such checks exist today), also fire-and-forget.

Read the full file on GitHub · 152 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 10d ago First seen · 152 lines · 2,759 tokens per session scan A d89d92e6aa1a

Subscribe to this mod's changes

mcp-yandex-audience CLAUDE.md is an instructions file published in the GitHub repository A1-x-Tech/mcp-yandex-audience (0 stars, last pushed 11d ago), licensed MIT. It adds 2,759 tokens to every session, about $0.0138 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other instructions, from other repositories

next.js AGENTS.md

AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.

vercel/next.js · 7,296 tokens

codex AGENTS.md

AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.

openai/codex · 5,153 tokens

vscode buildNext.instructions.md

Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).

microsoft/vscode · 6,785 tokens

spec-kit AGENTS.md

AGENTS.md instructions for github/spec-kit, covering agents.md, about spec kit and specify, quickstart — add a new integration in 5 steps, integration architecture and integrationmanifest — file tracking.

github/spec-kit · 7,104 tokens

vscode oss-third-party-notices.instructions.md

Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).

microsoft/vscode · 5,001 tokens

langchain AGENTS.md

AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.

langchain-ai/langchain · 4,469 tokens