{
  "markdown": "# @theyahia/yandex-metrika-mcp\n\nMCP server for Yandex.Metrica API — counters, goals, reports, logs, traffic sources, top pages. 15 tools, OAuth Bearer token auth.\n\n[![npm](https://img.shields.io/npm/v/@theyahia/yandex-metrika-mcp)](https://www.npmjs.com/package/@theyahia/yandex-metrika-mcp)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nPart of the [Russian API MCP](https://github.com/theYahia) series by [@theYahia](https://github.com/theYahia).\n\n## Getting a Token\n\n1. Go to [oauth.yandex.ru](https://oauth.yandex.ru/)\n2. Create an app (or use an existing one)\n3. Under **Platforms**, select \"Web services\"\n4. Under **Access**, add: `Yandex.Metrica` -> `Read statistics and counter parameters`\n5. Get the OAuth token:\n   ```\n   https://oauth.yandex.ru/authorize?response_type=token&client_id=YOUR_CLIENT_ID\n   ```\n6. Copy the token from the redirect URL (`access_token=...`)\n\n## Installation\n\n### Claude Desktop\n\nAdd to `claude_desktop_config.json`:\n\n```json\n{\n  \"mcpServers\": {\n    \"yandex-metrika\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@theyahia/yandex-metrika-mcp\"],\n      \"env\": {\n        \"YANDEX_METRIKA_TOKEN\": \"your_token\"\n      }\n    }\n  }\n}\n```\n\n### Claude Code\n\n```bash\nclaude mcp add yandex-metrika -e YANDEX_METRIKA_TOKEN=your_token -- npx -y @theyahia/yandex-metrika-mcp\n```\n\n### Streamable HTTP (remote / multi-client)\n\n```bash\nYANDEX_METRIKA_TOKEN=your_token npx @theyahia/yandex-metrika-mcp --http --port=3000\n```\n\nEndpoint: `POST http://localhost:3000/mcp`\nHealth check: `GET http://localhost:3000/health`\n\n### Smithery\n\nUse `smithery.yaml` from the repository. Requires `YANDEX_METRIKA_TOKEN`.\n\n## Environment Variables\n\n| Variable | Required | Description |\n|----------|----------|-------------|\n| `YANDEX_METRIKA_TOKEN` | Yes | OAuth 2.0 Bearer token from [Yandex OAuth](https://oauth.yandex.ru/) |\n\n## Tools (15)\n\n### Management — Counters\n\n| Tool | Description |\n|------|-------------|\n| `list_counters` | List all counters. Filter by name/URL with `search_string`. |\n| `get_counter` | Get full details of a single counter by ID. |\n| `create_counter` | Create a new counter for a website. |\n| `update_counter` | Update counter name or site URL. |\n| `delete_counter` | Permanently delete a counter (irreversible). |\n\n### Management — Goals\n\n| Tool | Description |\n|------|-------------|\n| `list_goals` | List all goals for a counter. |\n| `create_goal` | Create a goal (url, number, step, action types). |\n| `delete_goal` | Delete a goal from a counter. |\n\n### Management — Logs\n\n| Tool | Description |\n|------|-------------|\n| `export_logs` | Export raw visit/hit logs via the Logs API. |\n\n### Reporting API\n\n| Tool | Description |\n|------|-------------|\n| `get_report` | Flexible reporting — any metrics + dimensions + filters + sort. |\n| `get_report_comparison` | Compare two date periods (A vs B). |\n| `get_report_drilldown` | Hierarchical drill-down into report dimensions. |\n\n### Convenience Wrappers\n\n| Tool | Description |\n|------|-------------|\n| `get_traffic_summary` | Quick overview: visits, pageviews, users, bounce rate, avg duration. |\n| `get_traffic_sources` | Traffic sources breakdown by channel. |\n| `get_top_pages` | Top pages by pageviews with performance metrics. |\n\n## Demo Prompts\n\n```\nShow me all my Yandex.Metrica counters\n```\n\n```\nCompare last week's traffic to the previous week for counter 12345678\n```\n\n```\nWhat are the top 10 pages on my site this month, sorted by pageviews?\n```\n\n## Development\n\n```bash\nnpm install\nnpm run build\nnpm test\nnpm run dev           # stdio mode\nnpm run start:http    # HTTP mode on port 3000\n```\n\n## API Reference\n\n- [Yandex.Metrica Management API](https://yandex.ru/dev/metrika/doc/api2/management/intro.html)\n- [Yandex.Metrica Reporting API](https://yandex.ru/dev/metrika/doc/api2/api_v1/intro.html)\n- [Yandex.Metrica Logs API](https://yandex.ru/dev/metrika/doc/api2/logs/intro.html)\n\n## License\n\nMIT\n",
  "bytes": 3962,
  "sha": "c313ed49beaebc62cc3c99bf14fa3ab5ccd5652e819f2ceae75f6b2999664dca",
  "repo_slug": "theyahia/yandex-metrika-mcp",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_theyahia_yandex_metrika_mcp_33cfcb3e/readme"
}