Skip to content

get_account_summaries and other tools hang indefinitely when using user OAuth (ADC) credentials on Python 3.14 #134

@yoship90

Description

@yoship90

Environment:

  • analytics-mcp v0.2.0
  • Python 3.14.3
  • Claude Code (stdio MCP client)
  • Windows 11
  • Credentials: authorized_user type via gcloud auth application-default login --client-id-file

Describe the bug:
When using Application Default Credentials (user OAuth / authorized_user type), any tool call hangs indefinitely and never returns a response. The MCP server starts successfully and responds to initialize and tools/list, but tool calls like get_account_summaries produce no response.

Root cause (suspected):
utils.py calls google.auth.default(scopes=[...]) which returns synchronous google.oauth2.credentials.Credentials. These are passed to async gRPC clients (AnalyticsAdminServiceAsyncClient). When the client attempts to refresh the access token, the synchronous HTTP call blocks the asyncio event loop, causing the hang.

Workaround:
Using a service account JSON key (service_account type credentials) instead of user OAuth resolves the issue immediately.

Steps to reproduce:

  1. Run gcloud auth application-default login --client-id-file=<client.json> --scopes=https://www.googleapis.com/auth/analytics.readonly,https://www.googleapis.com/auth/cloud-platform
  2. Set GOOGLE_APPLICATION_CREDENTIALS to the resulting ADC file
  3. Call get_account_summaries via Claude Code or any MCP client
  4. Tool hangs indefinitely

Expected: Tool returns account summaries

Actual: No response, infinite hang

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions