npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

gemini-direct-mcp

v1.0.2

Published

MCP server for Yandex Direct API — search query performance reports

Readme

yandex-direct-mcp

MCP-сервер для получения отчётов по поисковым запросам из Яндекс Директ.

Интегрируется с MCP SuperAssistant (Chrome/Firefox) и любым другим MCP-клиентом.


Возможности

Инструмент get_search_query_report возвращает отчёт «Поисковые запросы» с полями:

| Поле API | Колонка в отчёте | |---|---| | Query | Поисковый запрос | | CampaignName | Название кампании | | CampaignId | № Кампании | | AdGroupName | Название группы | | AdGroupId | № Группы | | CriterionType | Тип условия показа | | Criterion | Ключевая фраза | | MatchType | Тип соответствия | | QueryTarget | Категория запроса | | Cost | Расход, ₽ | | Impressions | Показы | | Clicks | Клики | | Ctr | CTR, % | | Conversions* | Конверсии | | ConversionRate* | CR, % | | CostPerConversion* | CPA, ₽ | | AvgPageviews** | Глубина просмотра | | BounceRate** | Отказы, % | | AvgImpressionPosition | Ср. позиция показа |

* требуют передачи goal_ids
** требуют подключённой Яндекс Метрики


Быстрый старт

1. Установить зависимости и собрать

npm install
npm run build

2. Получить OAuth-токен Яндекс Директ

  1. Создайте приложение на oauth.yandex.ru с правом direct:api
  2. Получите токен и сохраните его в переменной окружения:
# .env (локально)
YANDEX_DIRECT_TOKEN=y0_AgAAAA...

Или передавайте токен напрямую в параметре access_token при каждом вызове инструмента.

3. Подключить к MCP SuperAssistant

Создайте config.json (скопируйте config.example.json) с путём к собранному серверу:

{
  "mcpServers": {
    "yandex-direct": {
      "command": "node",
      "args": ["C:/путь/до/yandex-direct-mcp/dist/index.js"],
      "env": {
        "YANDEX_DIRECT_TOKEN": "y0_AgAAAA..."
      }
    }
  }
}

Запустите прокси-сервер:

npx -y @srbhptl39/mcp-superassistant-proxy@latest --config ./config.json --outputTransport sse

В расширении MCP SuperAssistant введите URL: http://localhost:3006/sse и нажмите Connect.

Альтернатива — запуск через npx (после публикации в npm)

# config.json с командой npx:
{
  "mcpServers": {
    "yandex-direct": {
      "command": "npx",
      "args": ["-y", "yandex-direct-mcp"],
      "env": { "YANDEX_DIRECT_TOKEN": "y0_AgAAAA..." }
    }
  }
}

Параметры инструмента

| Параметр | Тип | Обязателен | Описание | |---|---|---|---| | access_token | string | нет* | OAuth-токен Директа | | client_login | string | нет | Логин клиента (для агентских аккаунтов) | | date_from | string | да | Начало периода YYYY-MM-DD | | date_to | string | да | Конец периода YYYY-MM-DD | | campaign_ids | number[] | нет | Фильтр по ID кампаний | | goal_ids | number[] | нет | ID целей Метрики для Конверсий/CR/CPA | | include_metrica | boolean | нет | Включить поля Метрики (по умолчанию true) |

* если не передан — берётся из YANDEX_DIRECT_TOKEN


Пример запроса к AI

После подключения сервера введите в чат:

Покажи отчёт по поисковым запросам за последние 7 дней (2026-04-20 — 2026-04-27),
кампании 12345678 и 87654321.

Структура проекта

src/
  index.ts          — MCP-сервер (stdio transport)
  yandex-direct.ts  — клиент Яндекс Директ Reports API v5
dist/               — скомпилированный JS (после npm run build)
config.example.json — пример конфига для mcp-superassistant-proxy
.env.example        — пример переменных окружения

Публикация в npm

# Убедитесь, что name в package.json уникален
npm login
npm publish

Лицензия

MIT