Skip to main content

Google Play Vitals MCP Server

PyPI version Python Version License: MIT MCP Protocol CI

English | 简体中文

Google Play Vitals MCP is a high-performance, token-efficient Model Context Protocol (MCP) server for the Google Play Developer Reporting API (Android Vitals).

Designed specifically for AI coding assistants and autonomous agents (Cursor, Claude Desktop, Claude Code, Codex, Windsurf, and Cline), it empowers AI to analyze Android production stability, diagnose ANRs (Application Not Responding), track crash trends, and verify startup optimizations (such as AndroidX Baseline Profiles) with minimal context token consumption.


🌟 Key Highlights

  • Token Economy by Design (Token Saver): Upstream Google Developer Reporting APIs return deeply nested, verbose Protobuf responses. Our built-in compression engine strips 80%+ redundant metadata and automatically reassembles raw frame data into clean, single-line standard Java stack traces (at com.example.Foo.bar(Foo.java:42)).
  • One-Shot Comprehensive Diagnosis (play_get_top_anr_summary): Eliminates the frustration of multi-turn tool roundtrips. A single tool call aggregates Top ANR clusters, affected user counts, occurrence numbers, and their representative de-obfuscated main thread stack traces.
  • Version Comparative Analysis (play_compare_versions): Specifically designed for quantifying release optimizations. Compare before-and-after versions (e.g., verifying ANR governance or Baseline Profile cold-start acceleration) with automated delta calculation and percentage improvement reporting.
  • Universal & Production Decoupled: Zero proprietary hardcoding. Supports any Android package, dynamic runtime parameters, environment variables, Service Account JSON files, JSON strings, or Google Application Default Credentials (ADC).
  • Zero-Latency In-Memory Hot Cache: Built-in 5-minute LRU cache prevents accidental quota exhaustion during multi-step AI reasoning.
  • Broad Agent Compatibility: Works out of the box with Cursor, Claude Desktop, Claude Code, Windsurf, Codex, and standard MCP JSON-RPC 2.0 stdio clients.

🛠️ MCP Tools Overview

Tool Name Type Description
play_check_status Diagnostics Self-tests Python dependencies, GCP Service Account key presence, and environment readiness.
play_get_top_anr_summary Core Diagnosis Aggregates Top ANR clusters, user volume, impact count, and representative main-thread call stacks in a single invocation.
play_get_metric_trends Metrics Queries historical daily trends and overall averages for ANR, STARTUP (slow cold starts), or CRASH with optional version code filters.
play_compare_versions Analytics Compares metrics between two app versions (e.g. baseline 100 vs target 101) and computes net percentage improvement.
play_get_raw_error_reports Deep Drilldown Retrieves detailed device environment metadata (OS version, device model, timestamp) and long stack traces for an issue.

📝 MCP Prompts & Resources

Capability Name / URI Purpose
Prompt analyze-anr-incident Interactive prompt guiding AI to perform root-cause triage and generate architectural fixes.
Prompt verify-baseline-profile Automated audit prompt comparing release versions to quantify cold-start acceleration and ANR reductions.
Prompt vitals-weekly-report Executive prompt generating a weekly Android stability markdown dashboard.
Resource vitals://status Read-only JSON resource reporting connection health, credentials presence, and active configuration.

🚀 Quick Start

1. Installation

Option A: Install via pip or uv

pip install google-play-vitals-mcp
# or
uv pip install google-play-vitals-mcp

Option B: One-click Install via Smithery (Cursor / Windsurf / Claude)

npx -y @smithery/cli install google-play-vitals-mcp --client cursor

Option C: Docker Container

docker run -i --rm -v ~/.config/gcp:/gcp -e GOOGLE_APPLICATION_CREDENTIALS=/gcp/key.json google-play-vitals-mcp

2. Google Cloud & Play Console Setup

To connect to your Android app's Play Vitals data:

  1. Go to the Google Play Console -> Setup -> API access.
  2. Link an existing Google Cloud Project or create a new one.
  3. In the Service Accounts section, click Create new service account (or select an existing one).
  4. Grant the Service Account the "View app quality data (read-only)" permission.
  5. In the Google Cloud Console, navigate to IAM & Admin -> Service Accounts, select the account, go to the Keys tab, and generate a new JSON key.
  6. Save the downloaded JSON key file securely (e.g., ~/.config/gcp/play_service_account.json).

🤖 AI Client Integration Guides

1. Cursor

Add to your project's .cursor/mcp.json or global Cursor settings:

{
  "mcpServers": {
    "google-play-vitals": {
      "command": "google-play-vitals-mcp",
      "args": [],
      "env": {
        "GOOGLE_APPLICATION_CREDENTIALS": "/path/to/play_service_account.json",
        "GOOGLE_PLAY_PACKAGE_NAME": "com.yourcompany.app"
      }
    }
  }
}

Note: You can also run with python -m google_play_vitals_mcp if installed in a specific virtual environment.

2. Claude Desktop

Add to your claude_desktop_config.json:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "google-play-vitals": {
      "command": "google-play-vitals-mcp",
      "env": {
        "GOOGLE_APPLICATION_CREDENTIALS": "/path/to/play_service_account.json",
        "GOOGLE_PLAY_PACKAGE_NAME": "com.yourcompany.app"
      }
    }
  }
}

3. Claude Code CLI

Add the MCP server directly via CLI:

claude mcp add google-play-vitals -- \
  google-play-vitals-mcp \
  --package-name com.yourcompany.app \
  --credentials /path/to/play_service_account.json

4. Windsurf

Add to ~/.codeium/windsurf/mcp_config.json:

{
  "mcpServers": {
    "google-play-vitals": {
      "command": "google-play-vitals-mcp",
      "env": {
        "GOOGLE_APPLICATION_CREDENTIALS": "/path/to/play_service_account.json",
        "GOOGLE_PLAY_PACKAGE_NAME": "com.yourcompany.app"
      }
    }
  }
}

💡 Prompt Examples

Once configured, simply talk to your AI assistant:

  • "Check Google Play Vitals connection status."
  • "Analyze the top ANR clusters in production right now and show me the problematic stack traces."
  • "Show me the daily ANR rate and slow startup rate for the last 14 days."
  • "Compare version 204000 against version 203000 to verify if our Baseline Profile and ANR fixes improved cold startup and reduced ANRs."
  • "Inspect issue apps/com.example/errorIssues/123456 and retrieve the raw device reports."

💻 CLI Commands

The package includes a built-in CLI:

# Check configuration and credentials readiness
google-play-vitals-mcp check -p com.example.app -c /path/to/key.json

# Launch MCP stdio server manually
google-play-vitals-mcp run -p com.example.app

# Check version
google-play-vitals-mcp --version

🔧 Environment Variables

Variable Description
GOOGLE_APPLICATION_CREDENTIALS Path to Google Cloud Service Account JSON key file.
GOOGLE_PLAY_CREDENTIALS_JSON Raw JSON string of Service Account credentials (useful for CI/CD or Cloud runtimes).
GOOGLE_PLAY_PACKAGE_NAME Default Android application package name (e.g. com.example.app).
GOOGLE_PLAY_CACHE_TTL Cache duration in seconds (default: 300).

🧪 Development & Testing

# Clone repository
git clone https://github.com/OldJii/google-play-vitals-mcp.git
cd google-play-vitals-mcp

# Install in editable mode with dev dependencies
pip install -e ".[dev]"

# Run unit tests
pytest -v

# Run linting
ruff check .
ruff format --check .

📄 License

This project is licensed under the MIT License.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

google_play_vitals_mcp-1.0.0.tar.gz (21.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

google_play_vitals_mcp-1.0.0-py3-none-any.whl (19.1 kB view details)

Uploaded Python 3

File details

Details for the file google_play_vitals_mcp-1.0.0.tar.gz.

File metadata

  • Download URL: google_play_vitals_mcp-1.0.0.tar.gz
  • Upload date:
  • Size: 21.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for google_play_vitals_mcp-1.0.0.tar.gz
Algorithm Hash digest
SHA256 f71b2119eb605ab55f0617852b64e53487d5290292e307f0fafb83a94c69fac4
MD5 db8847bbc282e26f5f9a1473a7a38605
BLAKE2b-256 b06a8e8bea06944104f98ba91e6aa2dc505b7d6f18ab9b876439848fe27bd340

See more details on using hashes here.

Provenance

The following attestation bundles were made for google_play_vitals_mcp-1.0.0.tar.gz:

Publisher: publish.yml on OldJii/google-play-vitals-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file google_play_vitals_mcp-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for google_play_vitals_mcp-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7e7ca4d3a2824a05414befb45fee6f12cb781c7cacb535ad1aa8615e9bcf4bc2
MD5 01ad5d259aa62e7f96b41def09f87f93
BLAKE2b-256 7bdbf030e12913f4c12611a7bb1dbea30226294b496b8132e424559de8972592

See more details on using hashes here.

Provenance

The following attestation bundles were made for google_play_vitals_mcp-1.0.0-py3-none-any.whl:

Publisher: publish.yml on OldJii/google-play-vitals-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

1.3.1

2 files

1.3.0

2 files

1.2.2

2 files

1.2.1

2 files

1.2.0

2 files

1.1.2

2 files

1.1.1

2 files

1.1.0

2 files

This release

1.0.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page