[BUG] google-ads-mcp: DEVELOPER_TOKEN_INVALID / missing credential error only when invoked via Claude Code, works fine standalone
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Summary
Calling any tool from the official google-ads-mcp server
(github.com/googleads/google-ads-mcp) via Claude Code's MCP tool-call
mechanism consistently fails with an authentication error, even though the
exact same credentials work perfectly when the server is invoked outside
Claude Code.
Environment
- Claude Code: VSCode native extension
- MCP server: google-ads-mcp (official, github.com/googleads/google-ads-mcp), v0.0.1
- Auth: Application Default Credentials (
gcloud auth application-default login
with a custom OAuth client + https://www.googleapis.com/auth/adwords scope)
- Developer token: Basic Access approved
Error (identical every time, regardless of what's changed below)
_InactiveRpcError: UNAUTHENTICATED - "Request is missing required
authentication credential..."
errors { error_code { authentication_error: DEVELOPER_TOKEN_INVALID } }
What I tried (all failed identically via Claude Code)
- Original
.mcp.jsonentry usinguvx --from git+https://github.com/googleads/google-ads-mcp.git google-ads-mcp - Explicitly setting
GOOGLE_APPLICATION_CREDENTIALSto the ADC file path - Patching the package locally to always use
google.auth.default()
(removing a code path that checks fastmcp.server.dependencies.get_access_token()
first and prefers it over ADC when truthy)
- Registering the server under a brand-new name (
google-ads-patched) to
rule out any server-identity caching
- Copying the ADC credentials file into the project directory instead of
~/.config/gcloud/..., in case of a subprocess sandbox file-access restriction
- Full app restart (Cmd+Q) after every change above
What DOES work (proving credentials/token/setup are correct)
- A direct
curlcall tohttps://googleads.googleapis.com/v24/customers:listAccessibleCustomers
using the ADC access token + developer token header → HTTP 200, correct customer IDs returned.
- Launching the exact same
google-ads-mcpserver as a subprocess manually
(same command/args/env as .mcp.json) and calling it via fastmcp.Client
StdioTransportfrom a plain Python script → succeeds, returns the
correct customer IDs.
- Only calls routed through Claude Code's own MCP tool-call path fail, with
byte-identical error text across every variant above.
Suspected cause
Something in how Claude Code spawns/sandboxes MCP server subprocesses
differs from a bare subprocess launch — possibly network egress restriction
to googleads.googleapis.com, or an env/credential-file access restriction
that isn't hit by other MCP servers (e.g. meta-ads, an HTTP-transport
server, works fine).
Request
Any guidance on how Claude Code sandboxes stdio MCP subprocess network/file
access, and whether that can be adjusted for a specific server, would help
narrow this down further.
What Should Happen?
Please refer to above
Error Messages/Logs
Please refer to above
Steps to Reproduce
Please refer to above
Claude Model
None
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.1.217
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Other
Additional Information
FYI, I'm using Antigravity IDE.