AppMetrica (Yandex) analytics: reports, funnels, segments, dashboards, logs export, push
Runs on your machine from its package; the steps are below.

Not assessed yet.
Odel charges nothing per call. The publisher may charge for its own service.
Runs locally over stdio
This server isn't hosted — your MCP client launches it from a package registry. Use one of the commands below, or drop the config into your client (e.g. Claude Desktop).
Run
npx -y appmetrica-mcp
MCP client config
{
"mcpServers": {
"appmetrica": {
"command": "npx",
"args": [
"-y",
"appmetrica-mcp"
]
}
}
}
MCP server for AppMetrica — Yandex's mobile analytics platform. Gives Claude direct access to your app's analytics: reports, funnels, dashboards, raw event logs, crash data, and push notification campaigns — and can create funnels and segments in AppMetrica itself.
Update 0.3.0 (October 2026). The server now builds analytics in AppMetrica, not only reads it: saved funnels and segments through the Management API, and real workspaces/dashboards through an experimental logged-in Chrome session (
web_*tools, one-timenpx appmetrica-mcp login). Also new: time series (get_report_bytime), a docs-derived catalogue of 197 metrics, all 13 Logs API tables,audit_eventsand theanalytics_setupworkflow prompt. Full list in CHANGELOG.md.
AppMetrica keeps mobile product analytics (users, sessions, events, funnels, retention, revenue, crashes) behind a web UI and several HTTP APIs. This MCP server puts all of it behind one set of tools, so an AI agent such as Claude can answer and act on questions like:
It works with Claude Code, Claude Desktop and any other MCP client, and is listed in the official MCP Registry as io.github.pavellunev/appmetrica-mcp.
bytime), filters, sorting and sampling controlweb_* tools; the public API cannot do this)segment_id; create, update and delete segmentsaudit_events compares registered events with real volumes and reports instrumentation gapsanalytics_setup walks an agent through analysing an app, building funnels/segments/dashboards and listing instrumentation gapsweb_* tools: Google Chrome and a one-time npx appmetrica-mcp login (see Web session)npx appmetrica-mcp auth
The wizard opens a Chrome window on the Yandex consent page (the same Chrome profile the web-session tools use, so after the first time you are already logged in), you click Разрешить, and the wizard takes the confirmation code from the page URL itself — nothing to copy. The token is saved to ~/.config/appmetrica-mcp/credentials.json (mode 0600; Yandex tokens live about a year, after that just run auth again) and the server picks it up automatically — no APPMETRICA_OAUTH_TOKEN needed. At the end the wizard offers to log in to the AppMetrica web session as well (only needed for the web_* workspace tools).
Details:
appmetrica-mcp OAuth app; no client secret is involved.APPMETRICA_BROWSER_PATH / APPMETRICA_BROWSER_CHANNEL). Without it, or over SSH, use npx appmetrica-mcp auth --manual: your default browser opens the same page, Yandex shows the code and you paste it into the terminal.APPMETRICA_OAUTH_CLIENT_ID (Redirect URI https://oauth.yandex.ru/verification_code, AppMetrica read/write access). If that app also registers http://127.0.0.1:8742/callback, --loopback runs a local callback server instead of Chrome (APPMETRICA_OAUTH_PORT changes the port).npx appmetrica-mcp auth" message.Use the Russian OAuth portal (oauth.yandex.ru) — the international version (oauth.yandex.com) does not expose AppMetrica scopes in its UI.
https://oauth.yandex.ru/verification_code.Чтение данных AppMetrica (required) and Запись данных AppMetrica (optional, for write tools). Copy the ClientID.https://oauth.yandex.ru/authorize?response_type=token&client_id=CLIENT_ID, log in, authorize, copy access_token from the redirect URL and pass it as APPMETRICA_OAUTH_TOKEN.Tokens do not expire by default; revoke them anytime at passport.yandex.ru/profile/access. An env token always wins over the saved credentials file.
claude mcp add appmetrica -- npx -y appmetrica-mcp
npx appmetrica-mcp auth # one-time browser login (or pass -e APPMETRICA_OAUTH_TOKEN=... instead)
To enable write operations (push campaigns, creating/updating/deleting funnels and segments):
claude mcp add appmetrica \
-e APPMETRICA_ALLOW_WRITE=true \
-- npx -y appmetrica-mcp
Add to ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"appmetrica": {
"command": "npx",
"args": ["-y", "appmetrica-mcp"],
"env": {
"APPMETRICA_ALLOW_WRITE": "true"
}
}
}
}
git clone https://github.com/pavellunev99/app_metrica_mcp
cd app_metrica_mcp
npm install
npm run build
| Variable | Required | Default | Description |
|---|---|---|---|
APPMETRICA_OAUTH_TOKEN | No | — | Yandex OAuth token; optional when npx appmetrica-mcp auth saved one (env wins) |
APPMETRICA_CREDENTIALS_FILE | No | ~/.config/appmetrica-mcp/credentials.json | Where auth stores the token |
APPMETRICA_OAUTH_CLIENT_ID | No | bundled public app | Your own Yandex OAuth app ClientID for auth |
APPMETRICA_OAUTH_PORT | No | 8742 | Port of the auth --loopback callback server (ignored by the default Chrome flow) |
APPMETRICA_ALLOW_WRITE | No | false | Set to true to enable write tools: push campaign creation, funnel and segment create/update/delete |
APPMETRICA_WORKSPACES_FILE | No | ~/.config/appmetrica-mcp/workspaces.json | JSON file where local workspaces (saved dashboard widget sets) are stored |
APPMETRICA_BROWSER_PROFILE | No | ~/.config/appmetrica-mcp/chrome-profile | Chrome profile directory that holds the Yandex login for the experimental web_* tools |
APPMETRICA_BROWSER_PATH | No | — | Path to a Chrome/Chromium executable (overrides the channel) |
APPMETRICA_BROWSER_CHANNEL | No | chrome | Browser channel for the web session: chrome, chromium, msedge, ... |
APPMETRICA_BROWSER_IDLE_MS | No | 120000 | Idle time after which the headless web session closes Chrome and frees the profile (so login can run) |
| Tool | Description |
|---|---|
list_applications | List all AppMetrica applications in your account |
get_application | Get details for a specific application by ID |
list_events | List client event names of an application (use them as funnel steps) |
list_conversions | List configured conversions (attributed events) |
get_logs_api_status | Check whether the Logs API is enabled for the account |
| Tool | Description |
|---|---|
get_report | Aggregated metrics for a date range, with filters, sort, segment_id, currency, accuracy, include_undefined, lang, offset |
get_report_bytime | The same as a time series (group: day / week / month / hour / all). One namespace prefix per call |
get_drilldown | Drill down into a dimension value for detailed breakdown |
list_metrics | Metric/dimension catalogue (197 metrics, 188 dimensions): compact overview, or search / namespace / kind / limit for entries |
audit_events | Event instrumentation audit for a period: registered vs active vs zero-volume events, optional expected_events, plain-language findings (read-only) |
| Tool | Description |
|---|---|
list_segments | List saved segments (id, name, expression) |
get_segment | Get one segment with all fields |
| Tool | Description |
|---|---|
list_funnels | List saved funnels with decoded steps and options |
get_funnel_report | Per-step devices and conversion for a saved funnel (funnel_id) or ad-hoc steps |
| Tool | Description |
|---|---|
get_dashboard | Run preset widgets (widgets) or a saved workspace (workspace) for a date range |
list_dashboard_presets | List preset widgets with their metrics |
list_workspaces | List locally saved workspaces |
get_workspace | Get a workspace with its widget specs |
save_workspace | Create or update a local workspace (local file only) |
delete_workspace | Delete a local workspace (local file only) |
Unofficial tools that drive the AppMetrica web UI's internal API through a logged-in headless Chrome — see Web session. Every tool needs npx appmetrica-mcp login once; tools marked Write also need APPMETRICA_ALLOW_WRITE=true.
| Tool | Access | Description |
|---|---|---|
web_session_status | Read | Check the web session: logged in, Yandex login, profile directory |
web_list_workspaces | Read | List the app's AppMetrica workspaces (system + custom) |
web_get_workspace | Read | One workspace: groups, headers and widgets with names, metrics, dimensions |
web_list_widget_presets | Read | Web preset widgets (widget_id = preset value), optional category |
web_list_report_namespaces | Read | Report namespaces with their Reporting API prefix; with namespace_id the valid metrics and dimensions |
web_create_workspace | Write | Create a workspace with groups ({header?, widgets?}) in one call |
web_add_widgets | Write | Add a row of widgets to a workspace (position optional) |
web_add_header | Write | Add a section header row |
web_rename_workspace | Write | Rename a workspace |
web_remove_widget | Write | Remove a widget by dashboard_widget_id |
web_delete_workspace | Write | Delete a custom workspace (system <appId>/… dashboards are refused) |
web_push_workspace | Write | Create an AppMetrica workspace from a local one (workspace, optional name) |
| Tool | Description |
|---|---|
export_events | Export raw custom event logs |
export_crashes | Export raw crash logs |
export_installations | Export raw installation logs |
export_logs | Export any Logs API table (13 tables), with field validation; push_tokens needs no dates |
| Tool | Access | Description |
|---|---|---|
list_push_campaigns | Read | List push notification campaigns with optional status filter |
get_push_stats | Read | Get delivery statistics for a campaign |
create_push_campaign | Write | Create a push campaign (requires APPMETRICA_ALLOW_WRITE=true) |
All of these require APPMETRICA_ALLOW_WRITE=true (and an OAuth token with write access); otherwise they return an error and send no request.
| Tool | Description |
|---|---|
create_funnel | Create a saved funnel (name, steps, comment, foreground_only, single_session, events_between_steps) |
update_funnel | Rename / re-comment a funnel, or rebuild its steps and options (the rest of the saved funnel is kept) |
delete_funnel | Delete a saved funnel |
create_segment | Create a segment from events (users who did all of them) |
update_segment | Change a segment's name and/or events |
delete_segment | Delete a segment |
create_push_campaign | Create a push campaign (see Push Notifications) |
web_create_workspace, web_add_widgets, web_add_header, web_rename_workspace, web_remove_widget, web_delete_workspace, web_push_workspace | Experimental web-session tools (see Web session); they use the Chrome login, not the OAuth token |
What can and cannot be created. Funnels and segments are created through the Management API and show up in the AppMetrica web UI. Dashboards and workspaces are not creatable through the public API: the web UI keeps them behind an internal GraphQL endpoint that needs a cookie session and CSRF token, which an OAuth token cannot use. The experimental web_* tools work around this with a logged-in Chrome session (see Web session); otherwise use the local workspaces and presets (see Dashboards & workspaces); the analytics_setup prompt also outputs a "web dashboard blueprint" you can build by hand.
Saved funnels support only what the web funnel editor can show: client-event steps (several events per step = any of them, at most one event parameter key/value per step, applied to every event of the step) and install steps. Other step kinds (crash, purchase, session_start, ...) and several parameters per step are rejected — run those ad hoc with get_funnel_report. Segments are created from events only (users who did all of them): the API derives the segment expression from the web editor's filter JSON, so other condition types (device, geo, version, profile…) have to be created in the web UI. For ad-hoc filtering use the filters parameter of the report tools.
| Prompt | Arguments | Description |
|---|---|---|
analytics_setup | app_id, project_path (optional), goal (optional) | End-to-end workflow: audit the app's events (last 28 days), scan the source code for AppMetrica event calls, design and verify 3-6 funnels (saved with create_funnel when write mode is on, otherwise printed), create segments, build a dashboard (get_dashboard + save_workspace, then web_push_workspace into AppMetrica when the web session is logged in, else a web dashboard blueprint) and finish with an "Instrumentation gaps" section |
get_funnel_report mirrors the web "Funnels" report. It reads the per-step metrics ym:uf:devicesInStep1..N (ym:sf: for single-session funnels) from the Reporting API: the number of devices that completed each step in sequence. Absolute conversion is relative to step 1, relative conversion to the previous step.
list_funnels shows funnels created in the web UI; pass funnel_id and the saved pattern is used as-is (for funnels saved with "events between steps" off the restriction is rebuilt from the editor steps, as the web UI does). Funnel options below are ignored in this mode.steps. A step is a list of client events (any of them), optional event_params (key == value), or another kind: install, session_start, crash, error, purchase, ad_revenue, deeplink, any_event. Use list_events to find event names.foreground_only (default true), single_session (default false), events_between_steps (default true; false joins steps with next and sends funnel_restriction), window_seconds.dimensions (full keys or bare suffixes like date, appVersion, operatingSystemInfo, regionCountry), filters, segment_id, group (day/week/month, adds one bytime request for a series).Ad-hoc example:
{
"app_id": 12345,
"date_from": "2026-09-01",
"date_to": "2026-09-30",
"steps": [
{ "title": "Open", "events": ["app_open"] },
{ "title": "Paywall", "events": ["paywall_shown"] },
{ "title": "Purchase", "kind": "purchase" }
],
"dimensions": ["operatingSystemInfo"]
}
AppMetrica's web workspaces and the "Обзор" dashboards are served by an internal, cookie-authenticated endpoint that the public API (OAuth token) cannot reach. This MCP therefore builds dashboards itself (to manage the real web workspaces use the experimental Web session tools; web_push_workspace copies a local workspace there):
get_dashboard runs named widgets computed from the Reporting API: audience, installs, installs_by_country, engagement, app_versions, events, crashes, errors, anr, revenue, ad_revenue, ad_revenue_by_type, conversions, traffic, push, funnels (every saved funnel) and retention (not available in the public API — returns an unavailable note). Default set: audience, installs, engagement, crashes, events. list_dashboard_presets shows the metrics of each.{name, error} instead of failing the whole dashboard. Keep the quota in mind (30 requests/second, 5000/day). group turns widgets without breakdown into time series, currency (default USD) applies to revenue widgets, segment_id restricts every widget to a saved segment.save_workspace stores a named widget set in a local JSON file (default ~/.config/appmetrica-mcp/workspaces.json, override with APPMETRICA_WORKSPACES_FILE); get_dashboard(workspace=...) runs it. A widget has a name and exactly one of preset, metrics (custom, single namespace; optional dimensions, filters, segment_id, limit) or funnel_id. A workspace may define a default app_id. Workspace tools only touch the local file — they are not gated by APPMETRICA_ALLOW_WRITE and never write to AppMetrica.What it does. The web_* tools list, create, edit and delete the real AppMetrica workspaces (dashboards) and their widgets — the part of the product the public API cannot manage. The web UI talks to an internal GraphQL endpoint (POST https://appmetrica.yandex.ru/api) that accepts only a Yandex cookie session plus a CSRF token embedded in the page; an OAuth token is rejected. The MCP therefore drives that endpoint through a real Google Chrome (playwright-core, persistent profile) and reuses your login.
Login (once).
npx appmetrica-mcp login # opens Chrome; log in to Yandex, the window closes by itself
npx appmetrica-mcp session-status # prints {"logged_in": true, "login": "...", ...}
After that every web_* call reuses the saved profile headlessly (the first call starts Chrome, about 7 seconds; the session is shared by all calls and closed when the server exits). Yandex renews the session on every visit and the CSRF token is refreshed automatically, so a re-login is only needed when Yandex invalidates the session — the tools then answer with a "not logged in" error that tells you to run npx appmetrica-mcp login. A Chrome profile can be opened by one Chrome at a time, so the headless session closes Chrome after 2 minutes without web_* calls (APPMETRICA_BROWSER_IDLE_MS) and as soon as it finds itself logged out — run login whenever the tools are idle; if Chrome reports the profile is in use, wait a couple of minutes or stop the server.
Security note. The profile holds a full Yandex session for that account (not a scoped token) and Chrome stores it with a basic keychain, so treat the profile directory like a credential: keep it on your own machine and prefer a dedicated Yandex account that only has access to the AppMetrica apps you need. web_session_status reports the account name (yandex_login); no other cookie or token value is ever returned.
Environment variables. APPMETRICA_BROWSER_PROFILE (profile directory, default ~/.config/appmetrica-mcp/chrome-profile), APPMETRICA_BROWSER_PATH (Chrome/Chromium executable) and APPMETRICA_BROWSER_CHANNEL (chrome by default; chromium, msedge, ...). Requirement: Google Chrome installed (or a browser given by APPMETRICA_BROWSER_PATH).
Widgets. Every tool that takes widgets accepts the same WidgetInput, exactly one of:
{ "preset": "AudienceMulti" } — a web preset widget (ids from web_list_widget_presets, e.g. Installs, Audience, Crashes, CrashFreeSessions, Revenue, AppVersion, PushSent); optional view_kind.{ "funnel_id": 267628 } — a saved funnel (list_funnels) as a Funnels widget (default view FunnelFirstStep).{ "name": "...", "metrics": ["ym:u:users"], "dimensions": ["ym:u:appVersion"], "segment_id": 5, "view_kind": "Table" } — a custom widget. The report namespace is derived from the first metric's prefix (ym:u: → Audience, ym:r2: → Revenue, ym:ce2: → Events, ...; for prefixes shared by several namespaces Cohort is used for ym:i: and UserAcquisition for ym:ts:) or given explicitly with namespace (web_list_report_namespaces). Metric and dimension ids are validated against the namespace; an unknown id fails with a list of similar ones.view_kind values: Timeline (default), TimeColumn, Table, Pie, MultiTimeColumn, FunnelFirstStep; other strings are passed through unchanged. A group is { "header": "text", "widgets": [...] }; a group with both becomes a header row followed by a widgets row. AppMetrica limits a workspace to 20 widgets and 40 groups, an app to 20 dashboards.
{
"app_id": 12345,
"name": "Product overview",
"groups": [
{ "header": "Audience" },
{ "widgets": [{ "preset": "AudienceMulti" }, { "preset": "NewUsers" }] },
{ "header": "Funnels" },
{ "widgets": [{ "funnel_id": 267628 }] },
{ "widgets": [{ "name": "Users by version", "metrics": ["ym:u:users"], "dimensions": ["ym:u:appVersion"], "view_kind": "Table" }] }
]
}
web_create_workspace creates the whole workspace with one request and returns {dashboard_id, name, url, groups}.
Local workspace → AppMetrica. web_push_workspace(app_id, workspace, name?) takes a workspace saved with save_workspace and creates it in AppMetrica: one header row (the widget name) plus a row of web widgets per local widget. Local presets map to web presets where there is a clear counterpart — audience → AudienceMulti, installs → Installs, engagement → UserTimeSpent + AvgSessionTime + UserSessionsCount, app_versions → AppVersion, crashes → CrashFreeSessions + Crashes, errors → ErrorLogsIos + ErrorLogsAndroid, revenue → RevenueTotal + RevenuePurchases, ad_revenue → AdRevenue + AdRevenueARPU + AdRevenueECPM, traffic → Clicks + Installs + InstallConversion, push → PushSent + PushReceived + PushOpened, retention → RetentionDynamics, funnels → one Funnels widget per saved funnel. installs_by_country, events, conversions, anr, ad_revenue_by_type and local custom metrics widgets become custom widgets; local funnel_id widgets become Funnels widgets. Widgets that cannot be created (unknown metric ids, no saved funnels) are skipped and listed in skipped; notes lists what could not be carried over (filters, segment_id on preset widgets).
Limitations.
src/web/operations.ts; to refresh them record real traffic with node scripts/record-graphql.mjs (after npm run build; it opens Chrome with the logged-in profile and records everything you do) and update the fragments/operations in src/web/operations.ts accordingly.APPMETRICA_ALLOW_WRITE=true. System dashboards (<appId>/General, ...) cannot be deleted by web_delete_workspace.data, data/bytime, data/drilldown; filters, sorting, segments (segment_id), currency and sampling parameters; funnel step metrics via funnel_pattern.events, crashes, errors, installations, sessions_starts, deeplinks, postbacks, clicks, push_tokens, profiles_v2, revenue_events, ecommerce_events, ad_revenue_events.src/catalog.generated.ts. Regenerate it with node scripts/update-catalog.mjs.Once connected, you can ask Claude things like:
APPMETRICA_ALLOW_WRITE=true)APPMETRICA_ALLOW_WRITE=true)AppMetrica enforces the following limits on all API requests:
The client retries automatically on 429 and 5xx responses with exponential backoff (1s → 2s → 4s, up to 3 attempts).
MIT