mcp-search-console 0.3.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Amin Foroutan
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,613 @@
1
+ Metadata-Version: 2.4
2
+ Name: mcp-search-console
3
+ Version: 0.3.0
4
+ Summary: Google Search Console integration for Model Context Protocol (MCP)
5
+ Author-email: Amin Foroutan <aio@aminforoutan.com>
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/AminForou/mcp-gsc
8
+ Project-URL: Bug Tracker, https://github.com/AminForou/mcp-gsc/issues
9
+ Keywords: mcp,google search console,seo,claude,search analytics
10
+ Classifier: Development Status :: 4 - Beta
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Programming Language :: Python :: 3.11
14
+ Classifier: Topic :: Internet :: WWW/HTTP :: Indexing/Search
15
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
16
+ Requires-Python: >=3.11
17
+ Description-Content-Type: text/markdown
18
+ License-File: LICENSE
19
+ Requires-Dist: google-api-python-client>=2.163.0
20
+ Requires-Dist: google-auth-httplib2>=0.2.0
21
+ Requires-Dist: google-auth-oauthlib>=1.2.1
22
+ Requires-Dist: mcp[cli]>=1.3.0
23
+ Requires-Dist: platformdirs>=4.0.0
24
+ Dynamic: license-file
25
+
26
+ # Google Search Console MCP server for SEOs
27
+
28
+ > **April 2026 (v0.3.0):** Coming to the **Cursor Marketplace** — one-click install with bundled SEO skills. Also: token storage moved to user config dir (survives `uvx` upgrades), all data tools now return structured JSON, and 39 new unit tests. See the [Changelog](#changelog) for details.
29
+
30
+ A Model Context Protocol (MCP) server that connects [Google Search Console](https://search.google.com/search-console/about) (GSC) to AI assistants, allowing you to analyze your SEO data through natural language conversations. Works with **Claude**, **Cursor**, **Codex**, **Gemini CLI**, **Antigravity**, and any other MCP-compatible client. This integration gives you access to property information, search analytics, URL inspection, and sitemap management—all through simple chat.
31
+
32
+ ---
33
+
34
+ ## Cursor Marketplace
35
+
36
+ > **One-click install available** — search for `mcp-search-console` in the Cursor Marketplace.
37
+
38
+ After installing, configure your credentials (see [Getting Started](#getting-started-no-coding-experience-required) below) then use the bundled skills directly in Cursor Agent chat:
39
+
40
+ | Skill | How to invoke | What it does |
41
+ |---|---|---|
42
+ | `seo-weekly-report` | *"Run the SEO weekly report for example.com"* | Full 28-day performance summary with period-over-period comparison and top queries |
43
+ | `cannibalization-check` | *"Check for keyword cannibalization on example.com"* | Finds queries where multiple pages compete; recommends which to keep |
44
+ | `indexing-audit` | *"Audit indexing for my top pages"* | Batch-inspects top 20 pages and returns a prioritized fix list |
45
+ | `content-opportunities` | *"Find content opportunities for example.com"* | Surfaces position-11-20 queries with high impressions and low CTR |
46
+
47
+ ### Required environment variables (set in Cursor MCP settings after install)
48
+
49
+ | Variable | Required | Description |
50
+ |---|---|---|
51
+ | `GSC_OAUTH_CLIENT_SECRETS_FILE` | One of these two | Path to your OAuth `client_secrets.json` |
52
+ | `GSC_CREDENTIALS_PATH` | One of these two | Path to your service account credentials JSON |
53
+ | `GSC_DATA_STATE` | Optional | `all` (default, matches GSC dashboard) or `final` (2–3 day lag) |
54
+ | `GSC_ALLOW_DESTRUCTIVE` | Optional | Set to `true` to enable add/delete site and delete sitemap tools |
55
+
56
+ ### First-time authentication (OAuth users only)
57
+
58
+ After installing, ask your AI assistant: *"Authenticate my Google Search Console"* — it will run the `reauthenticate` tool which opens a browser window once to authorize access. Subsequent uses are token-based and require no interaction.
59
+
60
+ ---
61
+
62
+ ## What Can This Tool Do For SEO Professionals?
63
+
64
+ 1. **Property Management**
65
+ - See all your GSC properties in one place
66
+ - Get verification details and basic site information
67
+ - Add new properties to your account
68
+ - Remove properties from your account
69
+
70
+ 2. **Search Analytics & Reporting**
71
+ - Discover which search queries bring visitors to your site
72
+ - Track impressions, clicks, and click-through rates
73
+ - Analyze performance trends over time
74
+ - Compare different time periods to spot changes
75
+ - **Visualize your data** with charts and graphs created by Claude
76
+
77
+ 3. **URL Inspection & Indexing**
78
+ - Check if specific pages have indexing problems
79
+ - See when Google last crawled your pages
80
+ - Inspect multiple URLs at once to identify patterns
81
+ - Get actionable insights on how to improve indexing
82
+
83
+ 4. **Sitemap Management**
84
+ - View all your sitemaps and their status
85
+ - Submit new sitemaps directly through Claude
86
+ - Check for errors or warnings in your sitemaps
87
+ - Monitor sitemap processing status
88
+
89
+ ---
90
+
91
+ ## Available Tools
92
+
93
+ Here's what you can ask your AI assistant to do once you've set up this integration:
94
+
95
+ | **What You Can Ask For** | **What It Does** | **What You'll Need to Provide** |
96
+ |---------------------------------|-------------------------------------------------------------|----------------------------------------------------------------|
97
+ | `list_properties` | Shows all your GSC properties | Nothing - just ask! |
98
+ | `get_site_details` | Shows details about a specific site | Your website URL |
99
+ | `add_site` | Adds a new site to your GSC properties | Your website URL |
100
+ | `delete_site` | Removes a site from your GSC properties | Your website URL |
101
+ | `get_search_analytics` | Shows top queries and pages with metrics | Your website URL, time period, and optional `row_limit` (default 20, max 500) |
102
+ | `get_performance_overview` | Gives a summary of site performance | Your website URL and time period |
103
+ | `check_indexing_issues` | Checks if pages have indexing problems | Your website URL and list of pages to check |
104
+ | `inspect_url_enhanced` | Detailed inspection of a specific URL | Your website URL and the page to inspect |
105
+ | `get_sitemaps` | Lists all sitemaps for your site | Your website URL |
106
+ | `submit_sitemap` | Submits a new sitemap to Google | Your website URL and sitemap URL |
107
+
108
+ *For a complete list of all 20 available tools and their detailed descriptions, ask your AI assistant to "list tools" after setup.*
109
+
110
+ ---
111
+
112
+ ## Getting Started (No Coding Experience Required!)
113
+
114
+ ### 1. Set Up Google Search Console API Access
115
+
116
+ Before using this tool, you'll need to create API credentials that allow your AI assistant to access your GSC data:
117
+
118
+ #### Authentication Options
119
+
120
+ The tool supports two authentication methods:
121
+
122
+ ##### 1. OAuth Authentication (Recommended)
123
+
124
+ This method allows you to authenticate with your own Google account, which is often more convenient than using a service account. It will have access to the same resources you normally do.
125
+
126
+ Set `GSC_SKIP_OAUTH` to "true", "1", or "yes" to skip OAuth authentication and use only service account authentication
127
+
128
+ ###### Setup Instructions:
129
+
130
+ 1. Go to the [Google Cloud Console](https://console.cloud.google.com/) and create a Google Cloud account if you don't have one
131
+ 2. Create a new project or select an existing one
132
+ 3. [Enable the Search Console API](https://console.cloud.google.com/apis/library/searchconsole.googleapis.com) for your project
133
+ 4. [Add scope](https://console.cloud.google.com/auth/scopes) `https://www.googleapis.com/auth/webmasters` to your project
134
+ 5. Go to the ["Credentials" page](https://console.cloud.google.com/apis/credentials)
135
+ 6. Click "Create Credentials" and select "OAuth client ID"
136
+ 7. Configure the OAuth consent screen
137
+ 8. For application type, select "Desktop app"
138
+ 9. Give your OAuth client a name and click "Create"
139
+ 10. Download the client secrets JSON file (it will be named something like `client_secrets.json`)
140
+ 11. Place this file in the same directory as the script or set the `GSC_OAUTH_CLIENT_SECRETS_FILE` environment variable to point to its location
141
+
142
+ When you run the tool for the first time with OAuth authentication, it will open a browser window asking you to sign in to your Google account and authorize the application. After authorization, the tool will save the token for future use.
143
+
144
+ ##### 2. Service Account Authentication
145
+
146
+ This method uses a service account, which is useful for automated scripts or when you don't want to use your personal Google account. This requires adding the service account as a user in Google Search Console.
147
+
148
+ ###### Setup Instructions:
149
+
150
+ 1. Go to the [Google Cloud Console](https://console.cloud.google.com/) and create a Google Cloud account if you don't have one
151
+ 2. Create a new project or select an existing one
152
+ 3. [Enable the Search Console API](https://console.cloud.google.com/apis/library/searchconsole.googleapis.com) for your project
153
+ 4. Go to the ["Credentials" page](https://console.cloud.google.com/apis/credentials)
154
+ 5. Click "Create Credentials" and select "Service Account"
155
+ 6. Fill in the service account details and click "Create"
156
+ 7. Click on the newly created service account
157
+ 8. Go to the "Keys" tab and click "Add Key" > "Create new key"
158
+ 9. Select JSON format and click "Create"
159
+ 10. Download the key file and save it as `service_account_credentials.json` in the same directory as the script or set the `GSC_CREDENTIALS_PATH` environment variable to point to its location
160
+ 11. Add your service account email address to appropriate Search Console properties
161
+
162
+ **🎬 Watch this beginner-friendly tutorial on Youtube:**
163
+
164
+ <div align="center">
165
+ <a href="https://youtu.be/PCWsK5BgSd0">
166
+ <img src="https://i.ytimg.com/vi/PCWsK5BgSd0/maxresdefault.jpg" alt="Google Search Console API Setup Tutorial" width="600" style="margin: 20px 0; border-radius: 8px;">
167
+ </a>
168
+ </div>
169
+
170
+ *Click the image above to watch the step-by-step video tutorial*
171
+
172
+ ### 2. Install Required Software
173
+
174
+ You'll need to install these tools on your computer:
175
+
176
+ - [Python](https://www.python.org/downloads/) (version 3.11 or newer) - This runs the MCP server
177
+ - An MCP-compatible AI client — [Claude Desktop](https://claude.ai/download), [Cursor](https://www.cursor.com/), [Codex CLI](https://github.com/openai/codex), [Gemini CLI](https://github.com/google-gemini/gemini-cli), or [Antigravity](https://antigravity.ai/) are all supported
178
+
179
+ Make sure Python is properly installed and available in your system path before proceeding.
180
+
181
+ ### 3. Install the MCP Server
182
+
183
+ **Option A — `uvx` (simplest, no clone needed)**
184
+
185
+ If you have [uv](https://docs.astral.sh/uv/) installed, you can skip cloning entirely. Use this config directly in step 5:
186
+
187
+ ```json
188
+ {
189
+ "mcpServers": {
190
+ "gscServer": {
191
+ "command": "uvx",
192
+ "args": ["mcp-search-console"],
193
+ "env": {
194
+ "GSC_CREDENTIALS_PATH": "/FULL/PATH/TO/service_account_credentials.json",
195
+ "GSC_SKIP_OAUTH": "true"
196
+ }
197
+ }
198
+ }
199
+ }
200
+ ```
201
+
202
+ `uvx` installs the server in an isolated environment automatically and keeps it up to date. No virtual environment management needed. Skip to [Step 5](#5-connect-your-ai-client-to-google-search-console) if using this option.
203
+
204
+ **Option B — Clone manually (more control)**
205
+
206
+ Download this tool to your computer. The easiest way is:
207
+
208
+ 1. Click the green "Code" button at the top of this page
209
+ 2. Select "Download ZIP"
210
+ 3. Unzip the downloaded file to a location you can easily find (like your Documents folder)
211
+
212
+ Alternatively, if you're familiar with Git:
213
+
214
+ ```bash
215
+ git clone https://github.com/AminForou/mcp-gsc.git
216
+ ```
217
+
218
+ ### 4. Install Required Components (Option B only)
219
+
220
+ Open your computer's Terminal (Mac) or Command Prompt (Windows):
221
+
222
+ 1. Navigate to the folder where you unzipped the files:
223
+ ```bash
224
+ # Example (replace with your actual path):
225
+ cd ~/Documents/mcp-gsc-main
226
+ ```
227
+
228
+ 2. Create a virtual environment (this keeps the project dependencies isolated):
229
+ ```bash
230
+ # Using uv (recommended):
231
+ uv venv .venv
232
+
233
+ # If uv is not installed, install it first:
234
+ pip install uv
235
+ # Then create the virtual environment:
236
+ uv venv .venv
237
+
238
+ # OR using standard Python:
239
+ python -m venv .venv
240
+ ```
241
+
242
+ **Note:** If you get a "pip not found" error when trying to install uv, see the "If you get 'pip not found' error" section below.
243
+
244
+ 3. Activate the virtual environment:
245
+ ```bash
246
+ # On Mac/Linux:
247
+ source .venv/bin/activate
248
+
249
+ # On Windows:
250
+ .venv\Scripts\activate
251
+ ```
252
+
253
+ 4. Install the required dependencies:
254
+ ```bash
255
+ # Using uv:
256
+ uv pip install -r requirements.txt
257
+
258
+ # OR using standard pip:
259
+ pip install -r requirements.txt
260
+ ```
261
+
262
+ **If you get "pip not found" error:**
263
+ ```bash
264
+ # First ensure pip is installed and updated:
265
+ python3 -m ensurepip --upgrade
266
+ python3 -m pip install --upgrade pip
267
+
268
+ # Then try installing the requirements again:
269
+ python3 -m pip install -r requirements.txt
270
+
271
+ # Or to install uv:
272
+ python3 -m pip install uv
273
+ ```
274
+
275
+ When you see `(.venv)` at the beginning of your command prompt, it means the virtual environment is active and the dependencies will be installed there without affecting your system Python installation.
276
+
277
+ ### 5. Connect Your AI Client to Google Search Console
278
+
279
+ The configuration below uses Claude Desktop as an example. For other clients (Cursor, Codex, Gemini CLI, Antigravity), the JSON structure is the same — check your client's documentation for where the config file lives.
280
+
281
+ 1. Download and install [Claude Desktop](https://claude.ai/download) if you haven't already
282
+ 2. Make sure you have your Google credentials file saved somewhere on your computer
283
+ 3. Open your computer's Terminal (Mac) or Command Prompt (Windows) and type:
284
+
285
+ ```bash
286
+ # For Mac users:
287
+ nano ~/Library/Application\ Support/Claude/claude_desktop_config.json
288
+
289
+ # For Windows users:
290
+ notepad %APPDATA%\Claude\claude_desktop_config.json
291
+ ```
292
+
293
+ 4. Add the following configuration text (this tells your AI client how to connect to GSC):
294
+
295
+ #### OAuth authentication (using your own account)
296
+
297
+ ```json
298
+ {
299
+ "mcpServers": {
300
+ "gscServer": {
301
+ "command": "/FULL/PATH/TO/-main/.venv/bin/python",
302
+ "args": ["/FULL/PATH/TO/mcp-gsc-main/gsc_server.py"],
303
+ "env": {
304
+ "GSC_OAUTH_CLIENT_SECRETS_FILE": "/FULL/PATH/TO/client_secrets.json",
305
+ "GSC_DATA_STATE": "all"
306
+ }
307
+ }
308
+ }
309
+ }
310
+ ```
311
+
312
+ #### Service account authentication
313
+
314
+ ```json
315
+ {
316
+ "mcpServers": {
317
+ "gscServer": {
318
+ "command": "/FULL/PATH/TO/-main/.venv/bin/python",
319
+ "args": ["/FULL/PATH/TO/mcp-gsc-main/gsc_server.py"],
320
+ "env": {
321
+ "GSC_CREDENTIALS_PATH": "/FULL/PATH/TO/service_account_credentials.json",
322
+ "GSC_SKIP_OAUTH": "true",
323
+ "GSC_DATA_STATE": "all"
324
+ }
325
+ }
326
+ }
327
+ }
328
+ ```
329
+
330
+ #### Environment Variables Reference
331
+
332
+ | Variable | Required | Default | Description |
333
+ |---|---|---|---|
334
+ | `GSC_OAUTH_CLIENT_SECRETS_FILE` | OAuth only | `client_secrets.json` (same folder) | Path to your OAuth client secrets JSON file |
335
+ | `GSC_CREDENTIALS_PATH` | Service account only | `service_account_credentials.json` (same folder) | Path to your service account JSON key file |
336
+ | `GSC_SKIP_OAUTH` | No | `false` | Set to `"true"` to force service account auth and skip OAuth |
337
+ | `GSC_DATA_STATE` | No | `"all"` | `"all"` returns fresh data matching the GSC dashboard. `"final"` returns only confirmed data (2–3 day lag). |
338
+
339
+ **Important:** Replace all paths with the actual locations on your computer:
340
+
341
+ - The first path should point to the Python executable inside your virtual environment
342
+ - The second path should point to the `gsc_server.py` file inside the folder you unzipped
343
+ - The third path should point to your Google service account credentials JSON file
344
+
345
+ Examples:
346
+ - Mac:
347
+ - Python path: `/Users/yourname/Documents/mcp-gsc/.venv/bin/python`
348
+ - Script path: `/Users/yourname/Documents/mcp-gsc/gsc_server.py`
349
+ - Windows:
350
+ - Python path: `C:\\Users\\yourname\\Documents\\mcp-gsc\\.venv\\Scripts\\python.exe`
351
+ - Script path: `C:\\Users\\yourname\\Documents\\mcp-gsc\\gsc_server.py`
352
+
353
+ 5. Save the file:
354
+ - Mac: Press Ctrl+O, then Enter, then Ctrl+X to exit
355
+ - Windows: Click File > Save, then close Notepad
356
+
357
+ 6. Restart your AI client
358
+ 7. When it opens, you should now see GSC tools available in the tools section
359
+
360
+ ### 6. Start Analyzing Your SEO Data!
361
+
362
+ Now you can ask your AI assistant questions about your GSC data! It can not only retrieve the data but also analyze it, explain trends, and create visualizations to help you understand your SEO performance better.
363
+
364
+ Here are some powerful prompts you can use with each tool:
365
+
366
+ | **Tool Name** | **Sample Prompt** |
367
+ |---------------------------------|--------------------------------------------------------------------------------------------------|
368
+ | `list_properties` | "List all my GSC properties and tell me which ones have the most pages indexed." |
369
+ | `get_site_details` | "Analyze the verification status of mywebsite.com and explain what the ownership details mean." |
370
+ | `add_site` | "Add my new website https://mywebsite.com to Search Console and verify its status." |
371
+ | `delete_site` | "Remove the old test site https://test.mywebsite.com from Search Console." |
372
+ | `get_search_analytics` | "Show me the top 20 search queries for mywebsite.com in the last 30 days, highlight any with CTR below 2%, and suggest title improvements." |
373
+ | `get_performance_overview` | "Create a visual performance overview of mywebsite.com for the last 28 days, identify any unusual drops or spikes, and explain possible causes." |
374
+ | `check_indexing_issues` | "Check these important pages for indexing issues and prioritize which ones need immediate attention: mywebsite.com/product, mywebsite.com/services, mywebsite.com/about" |
375
+ | `inspect_url_enhanced` | "Do a comprehensive inspection of mywebsite.com/landing-page and give me actionable recommendations to improve its indexing status." |
376
+ | `batch_url_inspection` | "Inspect my top 5 product pages, identify common crawling or indexing patterns, and suggest technical SEO improvements." |
377
+ | `get_sitemaps` | "List all sitemaps for mywebsite.com, identify any with errors, and recommend next steps." |
378
+ | `list_sitemaps_enhanced` | "Analyze all my sitemaps for mywebsite.com, focusing on error patterns, and create a prioritized action plan." |
379
+ | `submit_sitemap` | "Submit my new product sitemap at https://mywebsite.com/product-sitemap.xml and explain how long it typically takes for Google to process it." |
380
+ | `get_sitemap_details` | "Check the status of my main sitemap at mywebsite.com/sitemap.xml and explain what the warnings mean for my SEO." |
381
+ | `get_search_by_page_query` | "What search terms are driving traffic to my blog post at mywebsite.com/blog/post-title? Identify opportunities to optimize for related keywords." |
382
+ | `compare_search_periods` | "Compare my site's performance between January and February. What queries improved the most, which declined, and what might explain these changes?" |
383
+ | `get_advanced_search_analytics` | "Analyze queries with high impressions but positions below 10, filtered to mobile traffic in the US only. Use `filters` with country=usa and device=MOBILE." |
384
+
385
+ You can also ask your AI assistant to combine multiple tools and analyze the results. For example:
386
+
387
+ - "Find my top 20 landing pages by traffic, check their indexing status, and create a report highlighting any pages with both high traffic and indexing issues."
388
+
389
+ - "Analyze my site's performance trend over the last 90 days, identify my fastest-growing queries, and check if the corresponding landing pages have any technical issues."
390
+
391
+ - "Compare my desktop vs. mobile search performance, visualize the differences with charts, and recommend specific pages that need mobile optimization based on performance gaps."
392
+
393
+ - "Identify queries where I'm ranking on page 2 (positions 11-20) that have high impressions but low CTR, then inspect the corresponding URLs and suggest title and meta description improvements."
394
+
395
+ Your AI assistant will use the GSC tools to fetch the data, present it in an easy-to-understand format, create visualizations when helpful, and provide actionable insights based on the results.
396
+
397
+ ---
398
+
399
+ ## Data Visualization Capabilities
400
+
401
+ Your AI assistant can help you visualize your GSC data in various ways:
402
+
403
+ - **Trend Charts**: See how metrics change over time
404
+ - **Comparison Graphs**: Compare different time periods or dimensions
405
+ - **Performance Distributions**: Understand how your content performs across positions
406
+ - **Correlation Analysis**: Identify relationships between different metrics
407
+ - **Heatmaps**: Visualize complex datasets with color-coded representations
408
+
409
+ Simply ask your AI assistant to "visualize" or "create a chart" when analyzing your data, and it will generate appropriate visualizations to help you understand the information better.
410
+
411
+ ---
412
+
413
+ ## Troubleshooting
414
+
415
+ ### Python Command Not Found
416
+
417
+ On macOS, the default Python command is often `python3` rather than `python`, which can cause issues with some applications including Node.js integrations.
418
+
419
+ If you encounter errors related to Python not being found, you can create an alias:
420
+
421
+ 1. Create a Python alias (one-time setup):
422
+ ```bash
423
+ # For macOS users:
424
+ sudo ln -s $(which python3) /usr/local/bin/python
425
+
426
+ # If that doesn't work, try finding your Python installation:
427
+ sudo ln -s /Library/Frameworks/Python.framework/Versions/3.11/bin/python3 /usr/local/bin/python
428
+ ```
429
+
430
+ 2. Verify the alias works:
431
+ ```bash
432
+ python --version
433
+ ```
434
+
435
+ This creates a symbolic link so that when applications call `python`, they'll actually use your `python3` installation.
436
+
437
+ ### AI Client Configuration Issues
438
+
439
+ If you're having trouble connecting:
440
+
441
+ 1. Make sure all file paths in your configuration are correct and use the full path
442
+ 2. Check that your service account has access to your GSC properties
443
+ 3. Restart your AI client after making any changes
444
+ 4. Look for error messages in the response when you try to use a tool
445
+ 5. Ensure your virtual environment is activated when running the server manually
446
+
447
+ ### Other Unexpected Issues
448
+
449
+ If you encounter any other unexpected issues during installation or usage:
450
+
451
+ 1. Copy the exact error message you're receiving
452
+ 2. Use ChatGPT or Claude and explain your problem in detail, including:
453
+ - What you were trying to do
454
+ - The exact error message
455
+ - Your operating system
456
+ - Any steps you've already tried
457
+ 3. AI assistants can often help diagnose and resolve technical issues by suggesting specific solutions for your situation
458
+
459
+ Remember that most issues have been encountered by others before, and there's usually a straightforward solution available.
460
+
461
+ ---
462
+
463
+ ## Safety: Destructive Operations
464
+
465
+ By default, the tools that can **permanently modify your GSC account** (`add_site`, `delete_site`, `delete_sitemap`) are disabled. If you ask the AI to "clean things up" or "remove old properties", it will explain the safety restriction instead of deleting data.
466
+
467
+ To enable these tools, set the `GSC_ALLOW_DESTRUCTIVE` environment variable:
468
+
469
+ ```bash
470
+ # In your MCP client config (Claude Desktop, Cursor, etc.)
471
+ GSC_ALLOW_DESTRUCTIVE=true
472
+ ```
473
+
474
+ If you never use add/delete operations, you don't need to do anything — your existing setup works exactly as before.
475
+
476
+ ---
477
+
478
+ ## Remote Deployment & Docker (Advanced)
479
+
480
+ The standard setup above runs the server locally on your machine. This section is **only for users who want to run it on a remote server, in a container, or share it with a team** — existing local users don't need any of this.
481
+
482
+ ### HTTP Transport
483
+
484
+ By default the server communicates over stdio (standard input/output), which only works locally. To run it as a network server, set the `MCP_TRANSPORT` environment variable:
485
+
486
+ ```bash
487
+ MCP_TRANSPORT=sse MCP_HOST=0.0.0.0 MCP_PORT=3001 python gsc_server.py
488
+ ```
489
+
490
+ Your MCP client then connects to `http://your-server:3001/sse` instead of launching the process locally.
491
+
492
+ | Variable | Default | Description |
493
+ |---|---|---|
494
+ | `MCP_TRANSPORT` | `stdio` | Set to `sse` for network/remote use |
495
+ | `MCP_HOST` | `127.0.0.1` | Host to bind (use `0.0.0.0` for all interfaces) |
496
+ | `MCP_PORT` | `3001` | Port to bind |
497
+
498
+ ### Docker
499
+
500
+ A `Dockerfile` is included in the repo. Build and run:
501
+
502
+ ```bash
503
+ # Build the image
504
+ docker build -t mcp-gsc .
505
+
506
+ # Run locally (stdio mode — for testing)
507
+ docker run -v /path/to/client_secrets.json:/app/client_secrets.json mcp-gsc
508
+
509
+ # Run as a network server (SSE mode — for remote use)
510
+ docker run \
511
+ -e MCP_TRANSPORT=sse \
512
+ -e MCP_HOST=0.0.0.0 \
513
+ -e MCP_PORT=3001 \
514
+ -e GSC_CREDENTIALS_PATH=/app/credentials.json \
515
+ -v /path/to/credentials.json:/app/credentials.json \
516
+ -p 3001:3001 \
517
+ mcp-gsc
518
+ ```
519
+
520
+ ### Cloud Platforms
521
+
522
+ The Docker image works on any container platform. Set `MCP_TRANSPORT=sse`, `MCP_HOST=0.0.0.0`, and inject credentials via environment variables or mounted secrets:
523
+
524
+ - **Railway** — connect your repo, set env vars in the dashboard
525
+ - **Render** — deploy as a Web Service, set env vars under Environment
526
+ - **Fly.io** — `fly deploy`, set secrets with `fly secrets set`
527
+
528
+ ---
529
+
530
+ ## Related Tools
531
+
532
+ If you work with Google Search Console regularly, you may also find these tools useful:
533
+
534
+ **[Advanced GSC Visualizer](https://www.advancedgsc.com/)** — A Chrome extension (14,000+ users) that brings powerful charts, annotations, and one-click API access directly inside Google Search Console. Features include:
535
+
536
+ - Interactive charts with trendlines, moving averages, and Google algorithm update overlays
537
+ - One-click export of up to 25,000 rows from the GSC API — no coding required
538
+ - Keyword cannibalization detection
539
+ - Crawl stats visualizations
540
+ - AI assistant for querying your GSC data directly in the browser
541
+
542
+ Built by the same author. [Install from the Chrome Web Store →](https://chromewebstore.google.com/detail/advanced-gsc-visualizer/cdiccpnglfpnclonhpchpaaoigfpieel)
543
+
544
+ ---
545
+
546
+ ## Contributing
547
+
548
+ Found a bug or have an idea for improvement? We welcome your input! Open an issue or submit a pull request on GitHub.
549
+
550
+ ---
551
+
552
+ ## License
553
+
554
+ This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
555
+
556
+ ---
557
+
558
+ ## Changelog
559
+
560
+ ### [0.3.0] — April 2026
561
+
562
+ - **Cursor Marketplace plugin** — added `.cursor-plugin/plugin.json`, `mcp.json`, and 4 bundled SEO skills (`seo-weekly-report`, `cannibalization-check`, `indexing-audit`, `content-opportunities`)
563
+ - **Stable token storage** — OAuth token now stored in the platform user config dir (`~/Library/Application Support/mcp-gsc/` on macOS, `~/.config/mcp-gsc/` on Linux) instead of the package directory; survives `uvx` upgrades. Existing tokens are silently migrated on first run.
564
+ - **Structured JSON output** — all 13 data-returning tools now return structured JSON (`json.dumps`) instead of pipe-separated text, improving AI reasoning accuracy
565
+ - **Dependency fix** — added `platformdirs>=4.0.0`; removed deprecated `oauth2client` from `requirements.txt`
566
+ - **MCP safety** — fixed stdout pollution (`print()` → `logging.warning()`) that could corrupt stdio MCP protocol; replaced silent browser-flow hang in MCP context with clear `RuntimeError` directing users to `reauthenticate`
567
+ - **Test suite** — 39 unit tests covering auth, all 13 data tools, safety guards, stdout cleanliness, and token migration (zero real credentials required)
568
+
569
+ ### [0.2.2] — April 2026
570
+
571
+ #### Added
572
+ - **Safety mode for destructive tools:** `add_site`, `delete_site`, and `delete_sitemap` are now disabled by default. Set `GSC_ALLOW_DESTRUCTIVE=true` to enable them. This prevents accidental deletion of GSC properties through vague AI instructions.
573
+ - **HTTP/SSE transport:** Set `MCP_TRANSPORT=sse` (plus `MCP_HOST` and `MCP_PORT`) to run the server as a network service instead of a local process. Enables Docker, cloud, and team deployments.
574
+ - **Dockerfile:** Official container image using the `uv` base image. Includes `.dockerignore` to prevent credential files from being baked into images.
575
+ - **CLAUDE.md:** Project context file for AI coding assistants — covers auth, env vars, and how to add new tools.
576
+
577
+ #### Fixed
578
+ - **Sitemap warning status:** `get_sitemaps` now correctly shows "Has warnings" when a sitemap has warnings but no errors. Previously, warnings were silently ignored in the status field. (Thanks [@nloadholtes](https://github.com/nloadholtes)!)
579
+
580
+ #### Improved
581
+ - **PyPI package:** `pyproject.toml` now correctly declares `gsc_server.py` as the installable module. `pip install mcp-gsc` and `uvx mcp-gsc` now produce a working installation. (Thanks [@jjeejj](https://github.com/jjeejj)!)
582
+
583
+ ---
584
+
585
+ ### [0.2.0] — March 2026
586
+
587
+ #### Added
588
+ - **Data freshness:** All search analytics queries now use `dataState: "all"` by default, returning data that matches the GSC dashboard instead of finalized-only data (which lags 2–3 days). Configurable via the `GSC_DATA_STATE` environment variable (`"all"` or `"final"`).
589
+ - **Flexible row limits:** `get_search_analytics` and `get_search_by_page_query` now accept an optional `row_limit` parameter (default 20, max 500). Claude will automatically choose an appropriate value based on your request — use higher values for comprehensive analysis, lower values for quick overviews.
590
+ - **Multi-dimension filtering:** `get_advanced_search_analytics` now accepts a `filters` parameter — a JSON array of filter objects for AND logic across multiple dimensions simultaneously (e.g., country = USA **and** device = mobile). The existing single-filter parameters (`filter_dimension`, `filter_operator`, `filter_expression`) remain fully supported.
591
+
592
+ ### [0.2.1] — March 2026
593
+
594
+ #### Added
595
+ - **Reauthenticate tool:** New `reauthenticate` tool lets you switch Google accounts by deleting the saved OAuth token and triggering a fresh browser login. Ask your AI assistant: *"switch to a different Google account"*. (Thanks [@fterenzani](https://github.com/fterenzani)!)
596
+
597
+ #### Fixed
598
+ - **Sitemap TypeError crash:** `get_sitemaps` and `list_sitemaps_enhanced` crashed with `TypeError` when a sitemap had errors or warnings, because the GSC API returns those counts as strings. Added `int()` casts before comparison. (Thanks [@mcprobert](https://github.com/mcprobert)!)
599
+ - **File cache warning:** Suppressed the `file_cache is only supported with oauth2client<4.0.0` warning that caused crashes on MCP hosts that treat any stderr output as fatal (e.g. GitHub Copilot CLI).
600
+ - **Domain property 404 errors:** All tools now return a clear, actionable message when a 404 occurs, explaining the exact format required and service account permission requirements for `sc-domain:` properties.
601
+
602
+ #### Improved
603
+ - **Multi-client support:** README now explicitly lists Claude, Cursor, Codex, Gemini CLI, and Antigravity as supported clients with setup guidance for each.
604
+ - **`site_url` guidance:** All 15 tool docstrings now explain how to get the exact property URL from `list_properties` and how domain properties relate to subdomain filtering.
605
+
606
+ ---
607
+
608
+ ### [0.1.0] — Initial release
609
+
610
+ - 19 tools covering property management, search analytics, URL inspection, and sitemap management
611
+ - OAuth and service account authentication
612
+ - Batch URL inspection (up to 10 URLs)
613
+ - Period comparison tool