yandex-metrika-mcp
@rezlazy/yandex-metrika-mcp
Yandex Metrika Reports API(/stat/v1/*) 및 Management API(/management/v1/*)용 MCP 서버입니다.
68개 도구를 제공합니다: 보고서 도구 6개와 관리 도구 62개(카운터, 목표, 필터, 권한, 세그먼트, 라벨 등).
요구 사항
Node.js 20+
metrika:read(보고서) 및/또는metrika:write(생성/수정/삭제) 권한이 있는 OAuth 토큰
Related MCP server: Google Analytics MCP Server
OAuth 토큰 발급받기
Yandex OAuth 앱 만들기 — API 액세스 또는 디버깅용을 선택합니다.
metrika:read(보고서) 및 metrika:write(관리 변경) 권한을 추가합니다.
앱의 Client ID를 복사합니다.
브라우저에서 엽니다:
https://oauth.yandex.ru/authorize?response_type=token&client_id=<CLIENT_ID>리디렉션 URL(
access_token=...)에서 토큰을 복사합니다.
Yandex Metrika 인증 문서를 참조하세요.
Cursor 설정
.cursor/mcp.json 또는 Cursor MCP 설정에 추가합니다:
{
"mcpServers": {
"yandex-metrika": {
"command": "npx",
"args": ["-y", "@rezlazy/yandex-metrika-mcp"],
"env": {
"METRIKA_TOKEN": "<your-oauth-token>"
}
}
}
}로컬 개발용(이 저장소의 .cursor/mcp.json):
{
"mcpServers": {
"yandex-metrika": {
"type": "stdio",
"command": "node",
"args": ["${workspaceFolder}/dist/index.js"],
"envFile": "${workspaceFolder}/.env"
}
}
}프로젝트 루트에 .env를 생성합니다:
METRIKA_TOKEN=your_oauth_tokenMCP 서버 실행
서버는 HTTP가 아닌 stdio(표준 입력/출력)를 사용합니다. 웹 서버처럼 직접 시작하는 것이 아니라 MCP 클라이언트(예: Cursor)가 하위 프로세스로 실행합니다.
요구 사항: Node.js 20+, METRIKA_TOKEN, 그리고 빌드된 dist/index.js(로컬 개발용).
Cursor에서(권장)
.cursor/mcp.json또는 Cursor MCP 설정에서 MCP를 구성합니다(위 예시 참조).설정 → MCP → 새로고침을 하거나 Cursor를 다시 시작합니다.
Cursor는 도구가 사용될 때 node dist/index.js(로컬) 또는 npx @rezlazy/yandex-metrika-mcp(npm)를 자동으로 실행합니다. 문제가 발생하면 출력 → MCP 로그를 확인하세요.
GitHub에서(npm 배포 없이)
{
"mcpServers": {
"yandex-metrika": {
"command": "npx",
"args": ["-y", "github:Rezlazy/yandex-metrika-mcp"],
"env": {
"METRIKA_TOKEN": "<your-oauth-token>"
}
}
}
}git 설치의 경우 dist/가 저장소에 존재하거나 설치 시 빌드되어야 합니다(예: prepare 스크립트 사용).
수동 실행(디버깅 전용)
npm run build
export METRIKA_TOKEN=your_oauth_token
node dist/index.js프로세스는 표준 입력에서 JSON-RPC를 조용히 기다립니다 — 이는 정상적인 동작입니다. METRIKA_TOKEN이 없으면 오류와 함께 종료됩니다.
다중 루트 작업 공간(*.code-workspace)
mcp.code-workspace(한 창에 여러 폴더)를 열면 Cursor가 설정 → MCP에서 .cursor/mcp.json의 프로젝트 MCP 서버를 표시하지 않을 수 있습니다. 이는 알려진 Cursor 제한 사항입니다.
해결 방법:
이 저장소를 직접 엽니다: 파일 → 폴더 열기 →
yandex-metrika-mcp(.code-workspace파일이 아님).또는 전역 설정
~/.cursor/mcp.json에 추가합니다(다중 루트에서 작동):
"yandex-metrika": {
"type": "stdio",
"command": "node",
"args": ["/absolute/path/to/yandex-metrika-mcp/dist/index.js"],
"envFile": "/absolute/path/to/yandex-metrika-mcp/.env"
}설정 변경 후: 설정에서 MCP를 새로고침하거나 Cursor를 다시 시작합니다. 로그 확인: 출력 패널 → MCP 로그.
환경 변수
변수 | 필수 | 설명 |
| 예 | OAuth 토큰( |
| 아니요 | API 기본 URL(기본값: |
도구
보고서(stat_*) — 6개 도구
도구 | 설명 |
| 표 보고서 |
| 시계열(차트, 추세) |
| 트리 / 드릴다운 보고서 |
| 두 세그먼트 비교(A vs B) |
| 드릴다운이 포함된 세그먼트 비교 |
| 피벗 테이블 |
관리(mgmt_*) — 62개 도구
Management API를 다룹니다: 카운터, 목표, 필터, 연산, 권한, 액세스 필터, 세그먼트, 차트 주석, 라벨, 계정, 대리인, 클라이언트, 클라우드 내보내기.
일반적인 관리 도구:
도구 | 설명 |
| 사용 가능한 카운터 목록 |
| 카운터 세부 정보 가져오기 |
| 카운터 생성 |
| 카운터 목표 목록 |
| 목표 생성 |
| 액세스 권한 목록 |
| 저장된 세그먼트 목록 |
POST/PUT 메서드의 경우 body 매개변수에 JSON을 전달합니다(API 형식 참조). 카운터 생성 예시:
{
"body": {
"counter": {
"name": "My site",
"site": "example.com"
}
}
}보고서 매개변수
ids — 카운터 ID(쉼표로 구분)
metrics — 예:
ym:s:visits,ym:s:users,ym:s:pageviewsdimensions — 예:
ym:s:trafficSource,ym:s:operatingSystemdate1 / date2 — 기간(
7daysAgo,today또는YYYY-MM-DD)filters — 세그먼테이션 표현식
preset — 보고서 프리셋
format —
json(기본값) 또는csv
전체 메트릭 및 차원 목록: attrandmetr.
예시: 트래픽 소스별 방문 수
도구: stat_data
{
"ids": "44147844",
"metrics": "ym:s:visits,ym:s:users",
"dimensions": "ym:s:trafficSource",
"date1": "30daysAgo",
"date2": "today",
"sort": "-ym:s:visits",
"limit": "10"
}예시: 일별 방문 추세
도구: stat_bytime
{
"ids": "44147844",
"metrics": "ym:s:visits",
"date1": "30daysAgo",
"date2": "today",
"group": "day"
}개발
npm install
npm run typecheck
npm test
npm run buildnpm 배포
배포는 GitHub Release가 게시될 때 GitHub Actions를 통해 자동화됩니다.
일회성 설정:
npmjs.com에서 npm 조직/스코프
@rezlazy를 생성합니다.npm Automation 토큰을 생성합니다.
GitHub 저장소에
NPM_TOKEN시크릿을 추가합니다.태그
v0.1.0으로 릴리스를 생성합니다 — 워크플로가@rezlazy/yandex-metrika-mcp를 배포합니다.
라이선스
MIT
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceA Model Context Protocol (MCP) server that provides access to Yandex Metrika analytics data through various tools and functions. This server allows AI assistants and applications to retrieve comprehensive analytics data from Yandex Metrika accounts.1
- AlicenseNot gradedqualityDmaintenanceEnables interaction with Google Analytics APIs to fetch reports, manage properties, data streams, conversion events, and custom dimensions/metrics through OAuth2 authentication.1606MIT
- AlicenseAqualityAmaintenanceEnables managing Yandex Direct PPC campaigns, ad groups, ads, and keywords, plus pulling performance statistics via the Yandex Direct API v5.445701MIT
- AlicenseNot gradedqualityBmaintenanceEnables interaction with Yandex advertising and analytics APIs (Direct, Metrika, Audience, Webmaster, AdMetrica) through MCP tools, resources, and prompts for campaign management and data retrieval.MIT
Related MCP Connectors
Read-only Yandex Metrika MCP. Query visits, sources, geo, devices and more in plain language.
MCP for Yandex Direct: manage ad campaigns & analytics from Claude or ChatGPT
Read-only NuMetric.work accounting & ERP data: statements, KPIs, reports, invoices, documents.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Rezlazy/yandex-metrika-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server