yandex-metrika-mcp
Read-only MCP server for Yandex Metrika analytics, enabling report retrieval via MCP clients like Claude Code or Cursor without modifying any data.
README
yandex-metrika-mcp
Hardened форк atomkraft/yandex-metrika-mcp. Доступ к аналитике Яндекс.Метрики из MCP-клиента (Claude Code, Cursor и другие). Только чтение — сервер отдаёт исключительно отчёты Stat API, ничего в аккаунте Метрики не меняет. Ставится через npx прямо из git.
Почему read-only и зачем форк
У Метрики есть write-операции (создание счётчиков, загрузка данных), но в этом MCP они не реализованы — только отчётные инструменты. Поэтому, в отличие от yandex-direct-mcp, здесь нет флагов «включить запись»: гейтить нечего, безопасный режим — единственный.
Что добавил форк поверх upstream:
- npx-установка (
bin+ shebang) — не нужно вручную собирать и зватьnode build/index.js. - Фикс бага:
get_visitsтеперь учитываетdate_from/date_to(в upstream даты игнорировались); даты прокинуты во все пресетные отчёты. - Error handling: сбои возвращаются как MCP-результат с
isError: true, а не заворачиваются в обычный текст. - Провенанс (NOTICE), docs/SECURITY.md, запиненное дерево зависимостей, метаданные репо.
Токен
Сервер авторизуется статичным OAuth-токеном в переменной YANDEX_API_KEY. Запрашивай только scope metrika:read (см. docs/SECURITY.md).
- Создай приложение: платформа — веб-сервисы; redirect URI —
https://oauth.yandex.ru/verification_code; доступ — толькоmetrika:read. - Скопируй ClientID приложения.
- Открой ссылку
https://oauth.yandex.ru/authorize?response_type=token&client_id=<ClientID>. - Скопируй токен со страницы — это значение
YANDEX_API_KEY.
Установка
Claude Code (рекомендуемо — npx из git)
claude mcp add yandex-metrika \
--env YANDEX_API_KEY=ВАШ_ТОКЕН \
-- npx -y github:nikolaymokh-dev/yandex-metrika-mcp
Пин на тег (после релиза):
claude mcp add yandex-metrika \
--env YANDEX_API_KEY=ВАШ_ТОКЕН \
-- npx -y github:nikolaymokh-dev/yandex-metrika-mcp#v0.1.0
.mcp.json / .claude.json / Cursor
{
"mcpServers": {
"yandex-metrika": {
"command": "npx",
"args": ["-y", "github:nikolaymokh-dev/yandex-metrika-mcp"],
"env": { "YANDEX_API_KEY": "ВАШ_ТОКЕН" }
}
}
}
Из локальной сборки
git clone https://github.com/nikolaymokh-dev/yandex-metrika-mcp
cd yandex-metrika-mcp && npm ci && npm run build
YANDEX_API_KEY=ВАШ_ТОКЕН node build/index.js
Инструменты (26, все read-only)
Каждый принимает counter_id; большинство — опциональные date_from/date_to (YYYY-MM-DD).
| Группа | Инструменты |
|---|---|
| Аккаунт / визиты | get_account_info, get_visits, get_data_by_time |
| Источники трафика | sources_summary, sources_search_phrases, get_traffic_sources_types, get_search_engines_data, get_new_users_by_source |
| Контент-аналитика | get_content_analytics_sources, ..._categories, ..._authors, ..._topics, ..._articles |
| Аудитория / устройства | get_user_demographics, get_device_analysis, get_browsers_report, get_mobile_vs_desktop |
| Гео | get_regional_data, get_geographical_organic_traffic |
| Поведение / конверсии | get_page_depth_analysis, get_page_performance, get_goals_conversion, get_conversion_rate_by_source_and_landing |
| Поиск / эксперименты | get_organic_search_performance, get_yandex_direct_experiment |
| E-commerce | get_ecommerce_performance |
Полное описание каждого инструмента (на английском) — в README_en.md.
Разработка
npm ci
npm run build # tsc → build/
npm run inspector # MCP Inspector
Лицензия
MIT. Форк atomkraft/yandex-metrika-mcp (© Vadim Bezymiannyi). Изменения © 2026 nikolaymokh-dev. См. NOTICE и LICENSE.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.