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:
- 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
- Set
GOOGLE_APPLICATION_CREDENTIALS to the resulting ADC file
- Call
get_account_summaries via Claude Code or any MCP client
- Tool hangs indefinitely
Expected: Tool returns account summaries
Actual: No response, infinite hang
Environment:
analytics-mcpv0.2.0authorized_usertype viagcloud auth application-default login --client-id-fileDescribe the bug:
When using Application Default Credentials (user OAuth /
authorized_usertype), any tool call hangs indefinitely and never returns a response. The MCP server starts successfully and responds toinitializeandtools/list, but tool calls likeget_account_summariesproduce no response.Root cause (suspected):
utils.pycallsgoogle.auth.default(scopes=[...])which returns synchronousgoogle.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_accounttype credentials) instead of user OAuth resolves the issue immediately.Steps to reproduce:
gcloud auth application-default login --client-id-file=<client.json> --scopes=https://www.googleapis.com/auth/analytics.readonly,https://www.googleapis.com/auth/cloud-platformGOOGLE_APPLICATION_CREDENTIALSto the resulting ADC fileget_account_summariesvia Claude Code or any MCP clientExpected: Tool returns account summaries
Actual: No response, infinite hang