Skip to content

MCP Server

gmc mcp starts a Model Context Protocol server over stdio, exposing GMC tools to AI assistants. Any MCP-compatible client (Claude Desktop, Cursor, VS Code Copilot, etc.) can call them.

Quick start

Add to your MCP client config (e.g. claude_desktop_config.json):

json
{
  "mcpServers": {
    "gmc": {
      "command": "gmc",
      "args": ["mcp"]
    }
  }
}

Or with an explicit account:

json
{
  "mcpServers": {
    "gmc": {
      "command": "gmc",
      "args": ["--account", "123456789", "mcp"]
    }
  }
}

The server uses your existing gmc auth configuration — the same credentials you use with the CLI.

Tools

The server exposes 12 tools:

Diagnostics

ToolDescription
doctorDiagnose auth, GCP registration, and Merchant API access
preflightValidate feed files offline — catches disapprovals before upload

Account & catalog

ToolDescription
accounts_listList accessible Merchant Center accounts
accounts_getGet account details
products_listList products with status and issues
products_getGet a single product by key
products_insertInsert or update a product
products_deleteDelete a product

Feeds & reporting

ToolDescription
datasources_listList data sources (feeds)
issues_accountGet account-level issues and disapprovals
quota_listCheck daily API quota and usage
reports_queryRun an MCQL query (clicks, impressions, etc.)

Authentication

The MCP server uses the same auth as the CLI. Set up credentials once:

bash
gmc auth login                    # interactive OAuth
# or
export GMC_SERVICE_ACCOUNT=key.json  # service account for headless use

Then gmc mcp picks up the credential automatically. Global options (--profile, --account) work too:

bash
gmc --profile production --account 123456789 mcp

Example conversations

With the MCP server running, an AI assistant can:

  • "Check if my Merchant Center setup is working" → calls doctor
  • "List my products and show any with issues" → calls products_list
  • "Validate the feeds directory for disapprovals" → calls preflight
  • "How many clicks did my products get last week?" → calls reports_query
  • "What account-level issues do I have?" → calls issues_account

Released under the MIT License.