Skip the install. Get this working in under 2 minutes.
Start a free trial on cloud.anythingmcp.com, add the Yandex Metrica in one click, then point your AI client (Claude, ChatGPT, Copilot or Cursor) at the generated MCP endpoint. No Docker, no git clone, zero engineering experience required.
Summary
Let your AI analyse Yandex Metrica web analytics: counters, goals, filters and segments, table, time-series, drill-down and comparison reports on visits, sources, pages and conversions, and raw visits and hits through the Logs API.
Try asking
Example prompts for Yandex Metrica
Click any prompt to copy it. Paste into Claude, ChatGPT, Cursor, Gemini, Copilot or OpenClaw to run it against this connector.
Claude is AI and can make mistakes. Please double-check responses.
💡 No install? Use cloud.anythingmcp.com directly. Sign in, click Connectors → Yandex Metrica, paste your credentials, mint an MCP API key and you're done. No Docker, no
git clone, no local server.
Yandex Metrica + Gemini
Let your AI analyse Yandex Metrica web analytics: counters, goals, filters and segments, table, time-series, drill-down and comparison reports on visits, sources, pages and conversions, and raw visits and hits through the Logs API.
Prerequisites
See the full setup instructions baked into the connector (visible in the in-app store when you select the connector). The required environment variables for this connector are:
YANDEX_METRICA_TOKEN
Step 1 — Get credentials
Setting up takes about 5 minutes. You need a Yandex account that owns the Metrica counters or has access to them, and an app of your own registered at oauth.yandex.com.
- Create an app at oauth.yandex.com of the kind For API access or debugging and give it the access metrika:read (Metrica statistics, counter settings, list of counters). Note its ClientID.
- Signed in with the Yandex account that owns or can see the counters, open
https://oauth.yandex.com/authorize?response_type=token&client_id=<ClientID>with your ClientID and copy the token (it starts withy0_) intoYANDEX_METRICA_TOKEN, without OAuth or Bearer in front. - Install the connector and run
yandex_metrica_list_counters: it checks the token and lists the counter ids the other tools need.
Cloud and self-hosted work the same way: you paste the token, and the connector sends it as Authorization: OAuth ... on every call. There is no redirect URL to set in AnythingMCP.
The token lasts about a year: it is extended while it is used. Read access is enough for everything here: metrika:read covers the reports, the counter settings and the Logs API requests.
Counters and goals first: the counter id goes into ids in reports and into counterId everywhere else. yandex_metrica_list_goals gives the goal ids that goal metrics embed, such as ym:s:goal123reaches and ym:s:goal123conversionRate.
Metrics, dates and filters: metrics and dimensions start with ym:s: for sessions (visits) and ym:pv: for pageviews, for example ym:s:visits, ym:s:bounceRate or ym:s:lastTrafficSource. Dates take YYYY-MM-DD, today, yesterday or 30daysAgo. Filters use ==, !=, =@ (contains) and =~ (regex), combined with AND and OR; the saved segments from yandex_metrica_list_segments can be reused as filters. Rows page with limit (default 100, at most 100,000) and offset, which starts at 1.
Sampled figures: report answers carry sampled and sample_share. When sampled is true the figures are estimates: ask for full accuracy (accuracy full) on small date ranges, or use the Logs API.
Logs API: raw, unsampled visits and hits are prepared on Yandex's side. The AI checks with yandex_metrica_evaluate_log_request whether the request can be built, creates it, waits until its status is processed and downloads each part as tab-separated text, the first line holding the field names. Date ranges cannot include today, and prepared logs count against the counter's log storage quota.
Limits: 5,000 requests a day per user, 200 report requests per 5 minutes per user, 3 parallel requests per user and 30 requests per second per IP address (10 for the Logs API). Above that Yandex answers 429: wait and try again.
Common errors: 401 means the token is wrong, expired or revoked: get a new one with your app's ClientID as in step 2. 403 means the token works, but its account has no access to that counter or the app lacks metrika:read. 400 means an invalid metric, dimension or filter, and the message names it.
What it reads: counters with site, mirrors, status, time zone, code status, owner and your permission, and the labels (folders) they are sorted into; goals with type, conditions, steps and price; data filters, URL operations, saved segments and who has access to a counter; table, time-series, drill-down and comparison reports on visits, users, bounce rate, traffic sources, pages, countries, devices and goal conversions; and raw, unsampled visits and hits from the Logs API.
Switched off at install: yandex_metrica_clean_log_request. It deletes the prepared files of a processed Logs API request to free the counter's log storage quota, and the files cannot be downloaded afterwards. Switch it on on the connector page only if you need it; the AI asks you to confirm every change first. yandex_metrica_create_log_request and yandex_metrica_cancel_log_request are switched on: they only start or stop the preparation of a raw-data export on Yandex's side and change no counter, goal or setting.
Not covered: creating or editing counters, goals, filters and access, and uploading offline conversions, calls, expenses, user parameters or CRM data.
Step 2 — Install the adapter
curl -fsSL https://raw.githubusercontent.com/HelpCode-ai/anythingmcp/main/docker-compose.quickstart.yml -o docker-compose.yml
printf 'JWT_SECRET=%s\nENCRYPTION_KEY=%s\n' "$(openssl rand -hex 32)" "$(openssl rand -hex 32)" > .env
docker compose up -d
Step 3 — Add the connector in Gemini
Your server URL: in AnythingMCP, open MCP Servers → the server this connector is on, and copy its URL (
https://cloud.anythingmcp.com/mcp/…). Use it wherever this guide showsYOUR_SERVER_ID.
Gemini CLI reads MCP servers from ~/.gemini/settings.json (on Windows %USERPROFILE%\.gemini\settings.json). Add:
{
"mcpServers": {
"anythingmcp": {
"httpUrl": "https://cloud.anythingmcp.com/mcp/YOUR_SERVER_ID",
"headers": { "X-API-Key": "YOUR_MCP_API_KEY" }
}
}
}
- Create an MCP API key in AnythingMCP under MCP Servers → your server → API keys, and paste it in place of
YOUR_MCP_API_KEY. - Save the file and restart
gemini. - Run
/mcpinside Gemini CLI (orgemini mcp listin your shell) —anythingmcpshould show as connected. - Start prompting — Gemini CLI can now call the
Yandex Metricatools.
Available tools
| Tool | What it does |
|---|---|
yandex_metrica_list_counters | List the Metrica counters (tags) the token can read: id, name, site, status, owner_login, permission (own, view, edit), time zone, creation… |
yandex_metrica_get_counter | Get one counter's settings: name, site and mirrors, status, time zone, code status, webvisor and e-commerce options, owner and, with field… |
yandex_metrica_list_goals | List the goals of a counter: id, name, type (url, action, number, step, phone, email, form, messenger ...), conditions, is_retargeting and… |
yandex_metrica_get_goal | Get one goal of a counter by id: name, type, conditions, steps of a composite goal and price |
yandex_metrica_list_filters | List the data filters of a counter (include or exclude traffic by IP, URL, title, referrer ...): id, attr, type, value, action, status |
yandex_metrica_list_operations | List the URL operations of a counter (cut query parameters or fragments, merge to lowercase, replace domain): id, action, attr, value… |
yandex_metrica_list_segments | List the saved segments of a counter: segment_id, name, expression (a filter you can pass as filters in reports), status, segment_source… |
yandex_metrica_list_grants | List who has access to a counter: user_login, perm (view or edit), created_at and comment |
yandex_metrica_list_labels | List the user's counter labels (folders): id and name |
yandex_metrica_get_report | Build a table report from the Reporting API: metrics grouped by dimensions over a date range, with filters, sorting and paging |
yandex_metrica_get_report_by_time | Build a time series: the metrics per day, week, month, hour or other interval for the top rows of the dimensions |
yandex_metrica_get_drilldown | Build a tree report: the first dimension's values with their metrics, then expand one row into the next dimension with parent_id |
yandex_metrica_compare_segments | Compare two segments or periods side by side: the same metrics and dimensions for segment A (date1_a, date2_a, filters_a) and segment B… |
yandex_metrica_evaluate_log_request | Check whether a Logs API request for raw visits or hits can be created: possible (true or false) and max_possible_day_quantity |
yandex_metrica_create_log_request | Create a Logs API request that prepares raw, unsampled visits or hits for a date range on Yandex's side |
yandex_metrica_list_log_requests | List the Logs API requests of a counter: request_id, source, fields, attribution, status (created, processed, canceled, processing_failed… |
yandex_metrica_get_log_request | Get one Logs API request: status and, once processed, the parts (part_number and size) to download |
yandex_metrica_download_log_part | Download one part of a processed Logs API request as tab-separated text, the first line holding the field names |
yandex_metrica_cancel_log_request | Cancel a Logs API request that is still being prepared (status created) |
yandex_metrica_clean_log_request | Delete the prepared files of a processed Logs API request to free the counter's log storage quota |
Example prompts
- "Which traffic sources brought the most visits last month, and what were their bounce rates?"
- "How did the conversion rate of my order goal change week by week over the last three months?"
- "Compare visits and goal reaches by traffic source between October and September."
- "Which pages had the most pageviews yesterday, and on which devices?"
- "Get last week's raw, unsampled visits through the Logs API and count them by region."
FAQ
Where does Gemini CLI look for MCP servers? In ~/.gemini/settings.json for your user, or in .gemini/settings.json inside a project. gemini mcp list shows each server and whether it connects.
Next steps
Was this guide helpful?