Google Webmaster MCP

Google Webmaster MCP

Enables AI agents to manage Google Tag Manager, Google Search Console, and Google Analytics (GA4) through unified access to tags, search performance data, URL inspection, sitemaps, and analytics reporting.

Category
Visit Server

README

Google Webmaster MCP

A Unified Model Context Protocol (MCP) server for managing Google Tag Manager (GTM), Google Search Console (GSC), and Google Analytics (GA4).

This tool allows AI agents (like Claude, Cursor, etc.) to interact with your Google Webmaster tools directly, enabling automated auditing, tag management, and reporting.

Features

🏷️ Google Tag Manager (GTM)

  • List & Search: Find tags, triggers, and variables.
  • Manage Tags: Create, update, pause, and delete tags (HTML, GA4 Event, GA4 Config).
  • Manage Variables: Create and update Custom JavaScript and Data Layer variables.
  • Versioning: Create versions, submit workspaces, and publish containers.
  • Validation: Check for common issues (missing triggers, unknown variables) before publishing.

🔍 Google Search Console (GSC)

  • Site Management: List all accessible properties.
  • Performance Data: Query search analytics (clicks, impressions, CTR, position).
  • URL Inspection: Inspect URLs for indexing status and mobile usability.
  • Sitemaps: List, submit, and extract URLs from sitemaps.

📊 Google Analytics (GA4)

  • Reporting: Run reports with custom dimensions and metrics.
  • Account Summary: List accessible accounts and properties.

Prerequisites

  • Node.js (v18 or higher)
  • A Google Cloud Project with the following APIs enabled:
    • Google Tag Manager API
    • Google Search Console API
    • Google Analytics Data API
    • Google Analytics Admin API

Installation

  1. Clone the repository (or download the source):

    git clone <repository-url>
    cd google-webmaster-mcp
    
  2. Install dependencies:

    npm install
    
  3. Build the project:

    npm run build
    

Configuration

  1. Create a .env file: Copy .env.example to .env:

    cp .env.example .env
    
  2. Set up Google OAuth:

    • Go to your Google Cloud Console.
    • Create OAuth 2.0 credentials (Desktop App).
    • Download the client secret JSON or copy the Client ID and Secret.
    • Update .env with your credentials:
      GOOGLE_CLIENT_ID=your_client_id
      GOOGLE_CLIENT_SECRET=your_client_secret
      
  3. Authenticate: Run the authentication script to generate your token.json:

    npm run auth
    
    • Click the link to authorize the app.
    • Grant all requested permissions (GTM, GSC, Analytics).
    • The script will save token.json in the root directory.

Usage

Running the Server

To use this with an MCP client, configure it to run the built Node.js script:

{
  "mcpServers": {
    "google-webmaster": {
      "command": "node",
      "args": ["/path/to/google-webmaster-mcp/dist/index.js"],
      "env": {
        "GOOGLE_CLIENT_ID": "...",
        "GOOGLE_CLIENT_SECRET": "..."
      }
    }
  }
}

Global Installation (CLI)

You can install this tool globally to use it as a command-line utility or to simplify the MCP configuration path.

  1. Install Globally:

    npm install -g .
    # Or from git:
    npm install -g git+https://github.com/ehukaimedia/google-webmasters-mcp.git
    
  2. Configuration: The tool stores its configuration (tokens) in ~/.config/google-webmaster-mcp/. You can also place a .env file in that directory with your GOOGLE_CLIENT_ID and GOOGLE_CLIENT_SECRET.

  3. Authenticate: Run the auth command from anywhere:

    google-webmaster-mcp-auth
    

    (This command is available globally if you installed via npm install -g)

Using in Other Projects (Global Usage)

Since this is an MCP server, you don't install it into other repositories. Instead, you configure your AI client (Cursor, Claude Desktop, etc.) to connect to this server. Once connected, the tools are available globally, regardless of which project you have open.

Cursor Configuration

  1. Open Cursor Settings.
  2. Go to Features > MCP.
  3. Click + Add New MCP Server.
  4. Enter the following:
    • Name: google-webmaster
    • Type: command
    • Command: node /absolute/path/to/google-webmaster-mcp/dist/index.js (Replace with your actual path)
    • Environment Variables: (Optional, if not set in .env or if you prefer explicit config)
      • GOOGLE_CLIENT_ID: ...
      • GOOGLE_CLIENT_SECRET: ...

Claude Desktop Configuration

Edit your claude_desktop_config.json:

{
  "mcpServers": {
    "google-webmaster": {
      "command": "node",
      "args": ["/absolute/path/to/google-webmaster-mcp/dist/index.js"],
      "env": {
        "GOOGLE_CLIENT_ID": "...",
        "GOOGLE_CLIENT_SECRET": "..."
      }
    }
  }
}

Multi-Repository Workflow

This tool is designed to work seamlessly across multiple projects without reconfiguration.

  1. Global Auth: You authenticate once (globally).
  2. Local Context: In each of your project repositories, create a .env file (or just have the info in your README) with the specific IDs for that project.

Example Project .env:

GTM_ID=GTM-ABC1234
GSC_SITE=https://my-project.com
GA4_PROPERTY_ID=987654321

How it works: When you ask your AI agent (Cursor/Claude) to "list tags" or "check indexing", the AI will:

  1. Read the GTM_ID or GSC_SITE from your current project's files.
  2. Pass that ID as an argument to the global MCP tool.
  3. The MCP tool uses your global authentication to perform the action on that specific container/site.

Migrating from Legacy Tools

If you were previously using gtm-manager-mcp or gsc-manager-mcp, you should:

  1. Update your MCP Configuration: Replace the separate configurations for GTM and GSC with the single google-webmaster configuration shown above.

    • Old tools: gtm_list_tags, gsc_list_sites, etc. are all now available under this one server.
  2. Uninstall Legacy Packages: If you installed the old tools globally, you can remove them to avoid confusion:

    npm uninstall -g gtm-manager-mcp gsc-manager-mcp
    

Available Tools

GTM Tools

  • Discovery: gtm_list_accounts, gtm_list_containers, gtm_list_workspaces
  • Tags: gtm_list_tags, gtm_create_tag (supports Smart Trigger Resolution), gtm_update_tag, gtm_delete_tag
  • GA4 Helpers: gtm_create_ga4_event_tag, gtm_create_ga4_configuration_tag
  • Variables: gtm_list_variables, gtm_create_variable, gtm_delete_variable
  • Triggers: gtm_list_triggers, gtm_create_trigger
  • Versions: gtm_list_versions, gtm_create_version, gtm_publish_version
  • Validation: gtm_validate_workspace

GSC Tools

  • gsc_list_sites
  • gsc_get_performance_overview (Quick Look)
  • gsc_analytics_query
  • gsc_inspect_url
  • gsc_sitemaps_submit, gsc_list_sitemaps

Analytics Tools

  • analytics_list_account_summaries
  • analytics_get_metadata (List Dimensions/Metrics)
  • analytics_run_report

Development

  • Build: npm run build
  • Dev (Watch): npm run dev
  • Auth: npm run auth

License

ISC

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured