Google E-commerce (GA4, Search Console, Merchant Center)

io.github.MoonEyesv0.1.4更新於 Oct 4, 2026

Read-only GA4, Search Console, Merchant Center, Tag Manager, Indexing and PageSpeed for shops.

概覽

AI 產生的概覽

以唯讀方式存取網路商店的 Google Analytics 4、Search Console、Merchant Center、Tag Manager、Indexing 與 PageSpeed 資料。

功能
提供涵蓋電商常用六項 Google 服務的唯讀工具。工具包括用於流量、營收與即時活動的 ga4_report 與 ga4_realtime;用於搜尋點擊、索引狀態與網站地圖的 gsc_performance、gsc_inspect_url 與 gsc_sitemaps;用於商品 Feed 與遭拒商品的 merchant_data_sources、merchant_product_issues 與 merchant_report_query;以及 gtm_inventory、indexing_status 與 pagespeed。server_status 工具可顯示哪些服務已設定、權杖是否可用。
適用情境
適合讓助理回答關於自家商店 Google 資料的問題,例如自然流量、Merchant Center 中被拒的商品,或頁面是否重複載入 GA4。適合需要定期查看這些服務、希望用一個伺服器取代多個伺服器的店主。
執行需求
透過 stdio 在本機執行,可用 uvx 或 pip 從 PyPI 安裝。需要一個已啟用相關 API 的 Google Cloud 專案以及 OAuth 桌面用戶端 JSON;瀏覽器授權流程會把權杖存入作業系統鑰匙圈。選用環境變數用於指定資源、網站、帳戶與容器:GA4_PROPERTY_ID、GSC_SITE_URL、MERCHANT_ACCOUNT_ID、GTM_CONTAINER_ID,另有 PAGESPEED_API_KEY 與 GOOGLE_TOKEN_FILE。每個執行個體對應一個資源、網站、帳戶與容器。
安裝前請注意
OAuth 權杖屬於敏感資訊:除 Merchant Center(content)與 Indexing API(indexing)外,權限範圍皆為唯讀,而這兩項沒有唯讀範圍,如不需要可移除。PAGESPEED_API_KEY 是選用金鑰。文件稱此伺服器從不呼叫寫入端點,但它會讀取你的 Google 帳戶資料並直接向 Google 送出請求。可隨時在 Google 帳戶中撤銷授權。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Google E-commerce (GA4, Search Console, Merchant Center),將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

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.

[tests] [license] [python] [PyPI] [MCP Registry]

[Architecture overview]

Documentation

PageWhat is in it
ArchitectureComponents, a tool call step by step, design choices, sequence diagrams
Tool referenceEvery tool: parameters, output, example questions
Google Cloud setupOAuth client, APIs to enable, where to find each id
Security modelScopes, token storage, threats, how to revoke
TroubleshootingEvery error we have met and its fix
Example promptsQuestions that work well, by use case
Client configsClaude 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

ToolServiceWhat it answers
server_statusAllWhich services are configured, does the token work
ga4_reportGA4Any report: channels, landing pages, purchases, revenue, by period
ga4_realtimeGA4Last 30 minutes, e.g. to check a page view is counted once
gsc_performanceSearch ConsoleClicks, impressions, CTR, position by query, page, country, device, date
gsc_inspect_urlSearch ConsoleIs this URL indexed, which canonical did Google pick, last crawl
gsc_sitemapsSearch ConsoleDeclared sitemaps, last download, errors
merchant_data_sourcesMerchant CenterFeeds, labels, countries, fetch URLs
merchant_product_issuesMerchant CenterProducts with disapprovals or warnings, all pages
merchant_report_queryMerchant CenterAny Merchant Query Language report
gtm_inventoryTag ManagerTags, triggers, variables, live version
indexing_statusIndexing APIWhat Google knows about a submitted URL
pagespeedPageSpeed InsightsLighthouse 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):

powershell
irm https://raw.githubusercontent.com/MoonEyes/google-ecommerce-mcp/main/install.ps1 | iex

macOS / Linux:

bash
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:

  1. In Google Cloud Console, create or pick a project.
  2. 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.
  3. Configure the OAuth consent screen (External, add yourself as a test user).
  4. Create an OAuth client of type Desktop app and download its JSON file.
  5. Merchant API only: register your Cloud project with your Merchant Center account.
  6. Optional: create an API key restricted to PageSpeed Insights (the anonymous quota is shared and often exhausted).

2. Install and authorize

bash
# with uv (recommended): nothing to install, uvx fetches the package from PyPIuvx google-ecommerce-mcp setup --client-secret path/to/client_secret.json
# or with pippip install google-ecommerce-mcpgoogle-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):

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:

bash
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.

VariableExampleUsed by
GA4_PROPERTY_ID123456789 (numeric property id)GA4 tools
GSC_SITE_URLsc-domain:example.com or https://www.example.com/Search Console tools
MERCHANT_ACCOUNT_ID1234567890Merchant tools
GTM_CONTAINER_IDGTM-XXXXXXXgtm_inventory
PAGESPEED_API_KEYAPI keypagespeed
GOOGLE_TOKEN_FILE~/.config/google-ecommerce-mcp/token.jsonstore the token in a file instead of the keyring

How a call works

[Sequence of one tool call]

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_only checks 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

bash
pip install -e ".[dev]"pytest

Tests run offline with a fake HTTP session; no Google account needed.

License

MIT, see LICENSE.

來源:README.md,提交 28afc2d

工具

0
工具後設資料尚未被收錄。

版本歷史

1
  1. v0.1.4最新Oct 4, 2026