Skip to content

feat: add 'login_customer_id' support to enable Manager Account access#10

Open
balikasg wants to merge 2 commits intogoogleads:mainfrom
balikasg:main
Open

feat: add 'login_customer_id' support to enable Manager Account access#10
balikasg wants to merge 2 commits intogoogleads:mainfrom
balikasg:main

Conversation

@balikasg
Copy link

@balikasg balikasg commented Dec 5, 2025

This PR adds support for the login_customer_id parameter in the search tool. This is critical for users accessing Client Accounts via a Manager Account, as the Google Ads API explicitly requires the login-customer-id header to be set for these requests.

Problem
Currently, attempting to query a client account (customer_id) while authenticated as a Manager Account results in a USER_PERMISSION_DENIED error with the message to pass a login_customer_id as part of the headers. This happens because the default client initialization uses the global configuration without the specific login-customer-id context required for hierarchy traversal. The MCPs do not currently support passing this information and this PR adds this functionality.

This commit enables the  tool to accept an optional  parameter. This is required when accessing client accounts via a Manager Account, as the Google Ads API demands the  header in such cases.

Changes:
- Updated  to dynamically create/retrieve a GoogleAdsClient with the specific  if provided.
- Updated  to accept the argument and pass it to the service factory.
- Added tool documentation hints.
conditions: List[str] = None,
orderings: List[str] = None,
limit: int | str = None,
login_customer_id: str = None,
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The core of this PR. Add support and propagate properly in the project for this parameter.

"""Tests that output values are formatted correctly."""

client = utils.get_googleads_client()
client = utils._get_googleads_client()
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a typo..

Once fixed the tests are green:

OK
nox > Session tests-3.13 was successful in 34 seconds.
nox > Ran 4 sessions in 2 minutes:
nox > * tests-3.10: success, took 35 seconds
nox > * tests-3.11: success, took 31 seconds
nox > * tests-3.12: success, took 34 seconds
nox > * tests-3.13: success, took 34 seconds

@balikasg
Copy link
Author

balikasg commented Dec 8, 2025

@DeanLukies any chance you could take a look at this?

@PhilipJohnBasile
Copy link

Does anyone check this?

@Raibaz
Copy link
Collaborator

Raibaz commented Feb 2, 2026

Hi, thanks for looking into this!

We are evaluating adding this feature in a future version of the MCP server, but we won't be doing so right now.

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants