google-ecommerce-mcp
One read-only MCP server for the Google services an online shop lives on: GA4, Search Console, Merchant Center, Tag Manager, Indexing API and PageSpeed.
Ask your AI assistant "how much organic traffic did we get this month?", "which products are disapproved in Merchant Center?" or "is GA4 loaded twice on my site?" and it answers from your own Google accounts.
Built by MoonEyes, a small French shop selling 3D-printed tabletop terrain, because no existing MCP server covered GA4, Search Console and Merchant Center together.
Documentation
| Page | What is in it |
|---|---|
| Architecture | Components, a tool call step by step, design choices, sequence diagrams |
| Tool reference | Every tool: parameters, output, example questions |
| Google Cloud setup | OAuth client, APIs to enable, where to find each id |
| Security model | Scopes, token storage, threats, how to revoke |
| Troubleshooting | Every error we have met and its fix |
| Example prompts | Questions that work well, by use case |
| Client configs | Claude Desktop (one or two shops), Claude Code |
Why this one
- All-in-one for e-commerce. Other MCP servers cover one or two of these services. This one covers the six a shop owner checks every week.
- Read-only by design. No tool creates, updates, publishes or deletes anything. A test enforces it.
- Token in your OS keyring. The OAuth token goes to Windows Credential Manager, macOS Keychain or Secret Service, not to a plain file (a file is still possible if you prefer).
- No third party. Requests go straight from your machine to Google.
Tools
| Tool | Service | What it answers |
|---|---|---|
server_status |
All | Which services are configured, does the token work |
ga4_report |
GA4 | Any report: channels, landing pages, purchases, revenue, by period |
ga4_realtime |
GA4 | Last 30 minutes, e.g. to check a page view is counted once |
gsc_performance |
Search Console | Clicks, impressions, CTR, position by query, page, country, device, date |
gsc_inspect_url |
Search Console | Is this URL indexed, which canonical did Google pick, last crawl |
gsc_sitemaps |
Search Console | Declared sitemaps, last download, errors |
merchant_data_sources |
Merchant Center | Feeds, labels, countries, fetch URLs |
merchant_product_issues |
Merchant Center | Products with disapprovals or warnings, all pages |
merchant_report_query |
Merchant Center | Any Merchant Query Language report |
gtm_inventory |
Tag Manager | Tags, triggers, variables, live version |
indexing_status |
Indexing API | What Google knows about a submitted URL |
pagespeed |
PageSpeed Insights | Lighthouse performance and SEO scores, Core Web Vitals |
Quick install
Create your Google OAuth client first (step 1 below), then run one line. The installer installs uv if needed, asks your ids, opens the Google consent screen and adds the server to Claude Desktop (your previous config is backed up).
Windows (PowerShell):
irm https://raw.githubusercontent.com/MoonEyes/google-ecommerce-mcp/main/install.ps1 | iex
macOS / Linux:
curl -LsSf https://raw.githubusercontent.com/MoonEyes/google-ecommerce-mcp/main/install.sh | sh
Then quit Claude Desktop completely and reopen it. Prefer to read a script before running it? Download it, read it, then run it with options, for example .\install.ps1 --ga4 123456789 --gsc sc-domain:example.com --client-secret client_secret.json. Run google-ecommerce-mcp install --help for every option.
Setup, step by step
If you used the quick install, you only need step 1. The steps below are the manual path.
1. Google Cloud (once, about 10 minutes)
Full walkthrough with every click explained: docs/SETUP-GOOGLE-CLOUD.md. Short version:
- In Google Cloud Console, create or pick a project.
- Enable the APIs you need: Google Analytics Data API, Google Search Console API, Merchant API, Tag Manager API, Web Search Indexing API, PageSpeed Insights API.
- Configure the OAuth consent screen (External, add yourself as a test user).
- Create an OAuth client of type Desktop app and download its JSON file.
- Merchant API only: register your Cloud project with your Merchant Center account.
- Optional: create an API key restricted to PageSpeed Insights (the anonymous quota is shared and often exhausted).
2. Install and authorize
# with uv (recommended): nothing to install, uvx fetches the package from PyPI
uvx google-ecommerce-mcp setup --client-secret path/to/client_secret.json
# or with pip
pip install google-ecommerce-mcp
google-ecommerce-mcp setup --client-secret path/to/client_secret.json
Latest development version: uvx --from git+https://github.com/MoonEyes/google-ecommerce-mcp google-ecommerce-mcp.
Your browser opens the Google consent screen. The token is then stored in your OS keyring. Check everything with google-ecommerce-mcp check.
3. Add it to your MCP client
Claude Desktop (claude_desktop_config.json):
{
"mcpServers": {
"google-ecommerce": {
"command": "uvx",
"args": ["google-ecommerce-mcp"],
"env": {
"GA4_PROPERTY_ID": "123456789",
"GSC_SITE_URL": "sc-domain:example.com",
"MERCHANT_ACCOUNT_ID": "1234567890",
"GTM_CONTAINER_ID": "GTM-XXXXXXX",
"PAGESPEED_API_KEY": ""
}
}
}
}
Claude Code:
claude mcp add google-ecommerce -e GA4_PROPERTY_ID=123456789 -e GSC_SITE_URL=sc-domain:example.com \
-e MERCHANT_ACCOUNT_ID=1234567890 -e GTM_CONTAINER_ID=GTM-XXXXXXX \
-- uvx google-ecommerce-mcp
Every variable is optional: a tool for a service you did not configure simply answers not_configured.
| Variable | Example | Used by |
|---|---|---|
GA4_PROPERTY_ID |
123456789 (numeric property id) |
GA4 tools |
GSC_SITE_URL |
sc-domain:example.com or https://www.example.com/ |
Search Console tools |
MERCHANT_ACCOUNT_ID |
1234567890 |
Merchant tools |
GTM_CONTAINER_ID |
GTM-XXXXXXX |
gtm_inventory |
PAGESPEED_API_KEY |
API key | pagespeed |
GOOGLE_TOKEN_FILE |
~/.config/google-ecommerce-mcp/token.json |
store the token in a file instead of the keyring |
How a call works
Security notes
Details: docs/SECURITY.md.
- The server never calls a write endpoint (no Tag Manager publish, no feed upload, no sitemap submission).
tests/test_server.py::test_every_call_is_read_onlychecks every outgoing call. - Scopes are read-only except Merchant Center (
content) and Indexing API (indexing): Google has no read-only scope for these. The server does not use them to write, but treat the token as sensitive, or remove those scopes if you do not need the services. - Revoke access at any time from your Google account permissions.
Limitations
- The Merchant API is recent and Google keeps changing it; the older Content API for Shopping is being shut down. Open an issue if a call breaks.
- One property, site, Merchant account and container per server instance. Run several instances for several shops.
- GA4 Data API quotas apply to
ga4_report.
Contributing
See CONTRIBUTING.md. Security reports: SECURITY.md.
Development
pip install -e ".[dev]"
pytest
Tests run offline with a fake HTTP session; no Google account needed.
License
MIT, see LICENSE.
Metadata
Release files for google-ecommerce-mcp 0.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| google_ecommerce_mcp-0.1.4.tar.gz | 88.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| google_ecommerce_mcp-0.1.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 108.4 kB
Release files / google_ecommerce_mcp-0.1.4.tar.gz
| Download URL | google_ecommerce_mcp-0.1.4.tar.gz |
|---|---|
| Size | 88.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
84c9659906d5d8b08b593d9496dd2e64da5d6b5315613daf358710fd1d16ec3d
|
|
BLAKE2b-256 checksum How to use checksums |
daff92008eb1cd697a908337f600c288c548d06dd477372a5575b7b7faa1b932
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 4, 2026.
Transparency logRelease files / google_ecommerce_mcp-0.1.4-py3-none-any.whl
| Download URL | google_ecommerce_mcp-0.1.4-py3-none-any.whl |
|---|---|
| Size | 19.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
071865cb512b932593c9e0d3dab899092e504102ce9446accf6e447f7532946c
|
|
BLAKE2b-256 checksum How to use checksums |
1261b0ba03c11c86101525eb225c6ef92e4c73ed056ff2324760ffa2a9ba6741
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 4, 2026.
Transparency log