Yandex Metrika MCP
MCP server for Yandex.Metrica API providing 15 tools for managing counters, goals, reports, logs, traffic sources, and top pages with OAuth Bearer token authentication.
README
@theyahia/yandex-metrika-mcp
MCP server for Yandex.Metrica API — counters, goals, reports, logs, traffic sources, top pages. 15 tools, OAuth Bearer token auth.
Part of the Russian API MCP series by @theYahia.
Getting a Token
- Go to oauth.yandex.ru
- Create an app (or use an existing one)
- Under Platforms, select "Web services"
- Under Access, add:
Yandex.Metrica->Read statistics and counter parameters - Get the OAuth token:
https://oauth.yandex.ru/authorize?response_type=token&client_id=YOUR_CLIENT_ID - Copy the token from the redirect URL (
access_token=...)
Installation
Claude Desktop
Add to claude_desktop_config.json:
{
"mcpServers": {
"yandex-metrika": {
"command": "npx",
"args": ["-y", "@theyahia/yandex-metrika-mcp"],
"env": {
"YANDEX_METRIKA_TOKEN": "your_token"
}
}
}
}
Claude Code
claude mcp add yandex-metrika -e YANDEX_METRIKA_TOKEN=your_token -- npx -y @theyahia/yandex-metrika-mcp
Streamable HTTP (remote / multi-client)
YANDEX_METRIKA_TOKEN=your_token npx @theyahia/yandex-metrika-mcp --http --port=3000
Endpoint: POST http://localhost:3000/mcp
Health check: GET http://localhost:3000/health
Smithery
Use smithery.yaml from the repository. Requires YANDEX_METRIKA_TOKEN.
Environment Variables
| Variable | Required | Description |
|---|---|---|
YANDEX_METRIKA_TOKEN |
Yes | OAuth 2.0 Bearer token from Yandex OAuth |
Tools (15)
Management — Counters
| Tool | Description |
|---|---|
list_counters |
List all counters. Filter by name/URL with search_string. |
get_counter |
Get full details of a single counter by ID. |
create_counter |
Create a new counter for a website. |
update_counter |
Update counter name or site URL. |
delete_counter |
Permanently delete a counter (irreversible). |
Management — Goals
| Tool | Description |
|---|---|
list_goals |
List all goals for a counter. |
create_goal |
Create a goal (url, number, step, action types). |
delete_goal |
Delete a goal from a counter. |
Management — Logs
| Tool | Description |
|---|---|
export_logs |
Export raw visit/hit logs via the Logs API. |
Reporting API
| Tool | Description |
|---|---|
get_report |
Flexible reporting — any metrics + dimensions + filters + sort. |
get_report_comparison |
Compare two date periods (A vs B). |
get_report_drilldown |
Hierarchical drill-down into report dimensions. |
Convenience Wrappers
| Tool | Description |
|---|---|
get_traffic_summary |
Quick overview: visits, pageviews, users, bounce rate, avg duration. |
get_traffic_sources |
Traffic sources breakdown by channel. |
get_top_pages |
Top pages by pageviews with performance metrics. |
Demo Prompts
Show me all my Yandex.Metrica counters
Compare last week's traffic to the previous week for counter 12345678
What are the top 10 pages on my site this month, sorted by pageviews?
Development
npm install
npm run build
npm test
npm run dev # stdio mode
npm run start:http # HTTP mode on port 3000
API Reference
License
MIT
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.