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.
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
-
Clone the repository (or download the source):
git clone <repository-url> cd google-webmaster-mcp -
Install dependencies:
npm install -
Build the project:
npm run build
Configuration
-
Create a
.envfile: Copy.env.exampleto.env:cp .env.example .env -
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
.envwith your credentials:GOOGLE_CLIENT_ID=your_client_id GOOGLE_CLIENT_SECRET=your_client_secret
-
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.jsonin 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.
-
Install Globally:
npm install -g . # Or from git: npm install -g git+https://github.com/ehukaimedia/google-webmasters-mcp.git -
Configuration: The tool stores its configuration (tokens) in
~/.config/google-webmaster-mcp/. You can also place a.envfile in that directory with yourGOOGLE_CLIENT_IDandGOOGLE_CLIENT_SECRET. -
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
- Open Cursor Settings.
- Go to Features > MCP.
- Click + Add New MCP Server.
- 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
.envor if you prefer explicit config)GOOGLE_CLIENT_ID:...GOOGLE_CLIENT_SECRET:...
- Name:
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.
- Global Auth: You authenticate once (globally).
- Local Context: In each of your project repositories, create a
.envfile (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:
- Read the
GTM_IDorGSC_SITEfrom your current project's files. - Pass that ID as an argument to the global MCP tool.
- 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:
-
Update your MCP Configuration: Replace the separate configurations for GTM and GSC with the single
google-webmasterconfiguration shown above.- Old tools:
gtm_list_tags,gsc_list_sites, etc. are all now available under this one server.
- Old tools:
-
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_sitesgsc_get_performance_overview(Quick Look)gsc_analytics_querygsc_inspect_urlgsc_sitemaps_submit,gsc_list_sitemaps
Analytics Tools
analytics_list_account_summariesanalytics_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
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
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.
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.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
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.
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.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
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.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.