@getmcpads/google-search-console-mcp-server 1.0.0
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.
- package/LICENSE +201 -0
- package/NOTICE +16 -0
- package/README.md +304 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +3073 -0
- package/dist/cli.js.map +1 -0
- package/dist/index.d.ts +44 -0
- package/dist/index.js +3055 -0
- package/dist/index.js.map +1 -0
- package/package.json +39 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/NOTICE
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
google-search-console-mcp-server
|
|
2
|
+
Copyright 2026 GetMCPAds
|
|
3
|
+
|
|
4
|
+
This product includes software developed at GetMCPAds (https://www.getmcpads.com).
|
|
5
|
+
|
|
6
|
+
An open-source Model Context Protocol server for Google Search Console.
|
|
7
|
+
It is self-hosted, read-only, and unaffiliated with Google.
|
|
8
|
+
|
|
9
|
+
GetMCPAds also runs a managed gateway that covers Search Console alongside
|
|
10
|
+
Meta Ads, Google Ads, TikTok Ads, Pinterest Ads and Google Analytics, with
|
|
11
|
+
hosted OAuth and cross-platform reporting: https://www.getmcpads.com
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
Google and Google Search Console are trademarks of Google LLC. This project
|
|
16
|
+
is not affiliated with, endorsed by, or sponsored by Google LLC.
|
package/README.md
ADDED
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
# google-search-console-mcp-server
|
|
2
|
+
|
|
3
|
+
[](https://github.com/getmcpads-com/google-search-console-mcp-server/actions/workflows/ci.yml)
|
|
4
|
+
[](LICENSE)
|
|
5
|
+
[](package.json)
|
|
6
|
+
|
|
7
|
+
An open-source [Model Context Protocol](https://modelcontextprotocol.io) server for
|
|
8
|
+
**Google Search Console**. It lets Claude, ChatGPT, Cursor or any MCP client query your
|
|
9
|
+
search performance, inspect indexing, and analyse sitemaps.
|
|
10
|
+
|
|
11
|
+
**Read-only, with no way to turn that off.** You run it, and your credentials stay on your
|
|
12
|
+
machine.
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
npx -y @getmcpads/google-search-console-mcp-server
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
> **Prefer not to run it yourself?** [getmcpads.com](https://www.getmcpads.com) is the hosted
|
|
19
|
+
> version of this server, with Search Console alongside Meta Ads, Google Ads, TikTok Ads,
|
|
20
|
+
> Pinterest Ads and Google Analytics behind a single endpoint, hosted OAuth, and
|
|
21
|
+
> cross-platform reporting. Same tools, same safety model, no setup.
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## What you get
|
|
26
|
+
|
|
27
|
+
| | |
|
|
28
|
+
|---|---|
|
|
29
|
+
| **20 read tools** | Search Analytics, sites, sitemaps, URL Inspection, and analyses built on top of them |
|
|
30
|
+
| **SEO analyses, not just an API wrapper** | Cannibalisation detection, query clustering, wins and losses between periods, indexation watchlists, large-site sampling plans |
|
|
31
|
+
| **7 resources** | Live catalogues the model can read: metrics, dimensions, filters, compatibility rules, 8 workflow recipes, read-only playbooks |
|
|
32
|
+
| **Quota guardrails** | Every URL Inspection call is capped at 10 URLs, so one exploratory question cannot burn a day of quota |
|
|
33
|
+
| **No writes at all** | Not a flag, a property of the code. See below |
|
|
34
|
+
|
|
35
|
+
### What it does beyond fetching rows
|
|
36
|
+
|
|
37
|
+
Search Console answers questions about rows. Most real questions are about **change**: which
|
|
38
|
+
queries did we lose, which pages compete for the same term, is indexing drifting.
|
|
39
|
+
|
|
40
|
+
These tools do that work rather than leaving it to the model:
|
|
41
|
+
|
|
42
|
+
| Tool | Question it answers |
|
|
43
|
+
|---|---|
|
|
44
|
+
| `gsc_detect_cannibalization` | Which pages compete for the same query |
|
|
45
|
+
| `gsc_find_losses_gains` | What we won and lost between two periods |
|
|
46
|
+
| `gsc_cluster_queries` | Which queries belong to the same intent |
|
|
47
|
+
| `gsc_compare_search_types` | How web, image, video and news differ |
|
|
48
|
+
| `gsc_analyze_search_appearance_trends` | How rich results evolve |
|
|
49
|
+
| `gsc_indexation_watchlist` | Which URLs changed indexing verdict |
|
|
50
|
+
| `gsc_plan_large_site_sampling` | Which URLs to inspect, when you cannot inspect them all |
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## One thing to know before you trust a number
|
|
55
|
+
|
|
56
|
+
**Search Console returns a top N, not a site total.**
|
|
57
|
+
|
|
58
|
+
When you query with a dimension such as `query` or `page`, the API returns the highest
|
|
59
|
+
ranked rows up to your row limit, ordered by clicks. Summing the clicks of those rows does
|
|
60
|
+
**not** give you the site total: the long tail is missing, and on a large site it can be most
|
|
61
|
+
of the traffic.
|
|
62
|
+
|
|
63
|
+
To get a real total, query **without dimensions**. To compare periods, compare like with
|
|
64
|
+
like: same dimensions, same row limit, same search type.
|
|
65
|
+
|
|
66
|
+
`gsc_query_search_analytics` reports what it actually returned, and `gsc_validate_query`
|
|
67
|
+
checks a combination before it runs. But the arithmetic mistake is yours to avoid, and it is
|
|
68
|
+
the most common one in Search Console analysis.
|
|
69
|
+
|
|
70
|
+
Two other limits worth carrying in your head:
|
|
71
|
+
|
|
72
|
+
- **Roughly 16 months of history.** Anything older is gone, not slow.
|
|
73
|
+
- **Data settles over about three days.** `gsc_get_data_freshness` tells you what is final.
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
## Read-only, and why it stays that way
|
|
78
|
+
|
|
79
|
+
There are no write tools, and no environment variable that adds any. The Search Console API
|
|
80
|
+
can submit and delete sitemaps, add and remove properties, and request indexing. **This
|
|
81
|
+
server exposes none of that.**
|
|
82
|
+
|
|
83
|
+
The scope it asks for reflects that: `webmasters.readonly`, not `webmasters`. Even if the
|
|
84
|
+
model tried, the token cannot write.
|
|
85
|
+
|
|
86
|
+
Our ad platform servers, where writes make sense, do have them, guarded by a mandatory
|
|
87
|
+
preview:
|
|
88
|
+
[Meta Ads](https://github.com/getmcpads-com/meta-ads-mcp-server) ·
|
|
89
|
+
[Google Ads](https://github.com/getmcpads-com/google-ads-mcp-server) ·
|
|
90
|
+
[TikTok Ads](https://github.com/getmcpads-com/tiktok-ads-mcp-server)
|
|
91
|
+
|
|
92
|
+
The hosted version at [getmcpads.com](https://www.getmcpads.com) keeps the same rule: Search
|
|
93
|
+
Console stays read-only there too.
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
## Getting credentials
|
|
98
|
+
|
|
99
|
+
Three values, obtained once.
|
|
100
|
+
|
|
101
|
+
### 1. OAuth client
|
|
102
|
+
|
|
103
|
+
In a [Google Cloud project](https://console.cloud.google.com/), enable the **Google Search
|
|
104
|
+
Console API**, then create an OAuth client under **APIs & Services → Credentials**. Choose
|
|
105
|
+
**Desktop app** for local use. Note the **client ID** and **client secret**.
|
|
106
|
+
|
|
107
|
+
### 2. Refresh token
|
|
108
|
+
|
|
109
|
+
Run the OAuth consent flow once, signed in as a Google account that owns or can read your
|
|
110
|
+
properties, and keep the **refresh token**. Request `webmasters.readonly` and nothing more.
|
|
111
|
+
|
|
112
|
+
📖 [Google OAuth for installed apps](https://developers.google.com/identity/protocols/oauth2/native-app)
|
|
113
|
+
|
|
114
|
+
**The refresh token does not expire.** Use an OAuth client dedicated to this server so you
|
|
115
|
+
can revoke it on its own.
|
|
116
|
+
|
|
117
|
+
For a quick trial you can set `GSC_ACCESS_TOKEN` to a short-lived token instead, but it
|
|
118
|
+
expires within the hour and is useless for daily work.
|
|
119
|
+
|
|
120
|
+
If setting up an OAuth client is more than you want to do for one property,
|
|
121
|
+
[getmcpads.com](https://www.getmcpads.com) handles the consent flow for you and gives you the
|
|
122
|
+
same tools behind a hosted endpoint.
|
|
123
|
+
|
|
124
|
+
### 3. Site URL, optional
|
|
125
|
+
|
|
126
|
+
Set `GSC_SITE_URL` to avoid passing it on every call. Both property forms work:
|
|
127
|
+
|
|
128
|
+
| Property type | Value |
|
|
129
|
+
|---|---|
|
|
130
|
+
| URL-prefix | `https://example.com/` (the trailing slash matters) |
|
|
131
|
+
| Domain | `sc-domain:example.com` |
|
|
132
|
+
|
|
133
|
+
List what you can reach with `gsc_list_sites`, and run **`gsc_health_check`** as your first
|
|
134
|
+
call. It verifies the credentials without printing any secret.
|
|
135
|
+
|
|
136
|
+
---
|
|
137
|
+
|
|
138
|
+
## Setup
|
|
139
|
+
|
|
140
|
+
### Claude Desktop
|
|
141
|
+
|
|
142
|
+
`~/Library/Application Support/Claude/claude_desktop_config.json` (macOS)
|
|
143
|
+
or `%APPDATA%\Claude\claude_desktop_config.json` (Windows):
|
|
144
|
+
|
|
145
|
+
```json
|
|
146
|
+
{
|
|
147
|
+
"mcpServers": {
|
|
148
|
+
"search-console": {
|
|
149
|
+
"command": "npx",
|
|
150
|
+
"args": ["-y", "@getmcpads/google-search-console-mcp-server"],
|
|
151
|
+
"env": {
|
|
152
|
+
"GSC_CLIENT_ID": "your-client-id",
|
|
153
|
+
"GSC_CLIENT_SECRET": "your-client-secret",
|
|
154
|
+
"GSC_REFRESH_TOKEN": "your-refresh-token"
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
Restart Claude Desktop. Ask it: *"which queries did we lose last month?"*.
|
|
162
|
+
|
|
163
|
+
### Claude Code
|
|
164
|
+
|
|
165
|
+
```bash
|
|
166
|
+
claude mcp add search-console --env GSC_CLIENT_ID=... --env GSC_CLIENT_SECRET=... --env GSC_REFRESH_TOKEN=... -- npx -y @getmcpads/google-search-console-mcp-server
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
### Cursor
|
|
170
|
+
|
|
171
|
+
`.cursor/mcp.json` in your project, same shape as the Claude Desktop config above.
|
|
172
|
+
|
|
173
|
+
### From source
|
|
174
|
+
|
|
175
|
+
```bash
|
|
176
|
+
git clone https://github.com/getmcpads-com/google-search-console-mcp-server.git
|
|
177
|
+
cd google-search-console-mcp-server
|
|
178
|
+
npm install && npm run build
|
|
179
|
+
cp .env.example .env # then fill in your credentials
|
|
180
|
+
npm start
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
### Configuration
|
|
184
|
+
|
|
185
|
+
| Variable | Default | Meaning |
|
|
186
|
+
|---|---|---|
|
|
187
|
+
| `GSC_CLIENT_ID` | none | OAuth client ID |
|
|
188
|
+
| `GSC_CLIENT_SECRET` | none | OAuth client secret |
|
|
189
|
+
| `GSC_REFRESH_TOKEN` | none | From the consent flow |
|
|
190
|
+
| `GSC_ACCESS_TOKEN` | none | Alternative to the three above, expires within the hour |
|
|
191
|
+
| `GSC_SITE_URL` | none | Optional default property |
|
|
192
|
+
| `LOG_LEVEL` | `info` | `debug`, `info`, `warn`, `error` |
|
|
193
|
+
|
|
194
|
+
Either the three OAuth values, or `GSC_ACCESS_TOKEN`. The server refuses to start with neither.
|
|
195
|
+
|
|
196
|
+
```bash
|
|
197
|
+
npm run doctor
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
---
|
|
201
|
+
|
|
202
|
+
## Tools
|
|
203
|
+
|
|
204
|
+
<details>
|
|
205
|
+
<summary><b>20 read tools</b></summary>
|
|
206
|
+
|
|
207
|
+
### Discovery and health
|
|
208
|
+
| Tool | Purpose |
|
|
209
|
+
|---|---|
|
|
210
|
+
| `gsc_health_check` | Validates credentials and reachable properties |
|
|
211
|
+
| `gsc_list_sites` / `gsc_get_site` | Properties you can reach, and their permission level |
|
|
212
|
+
| `gsc_get_data_freshness` | How settled the most recent data is |
|
|
213
|
+
|
|
214
|
+
### Search Analytics
|
|
215
|
+
| Tool | Purpose |
|
|
216
|
+
|---|---|
|
|
217
|
+
| `gsc_query_search_analytics` | The main reporting tool. Dimensions, filters, date ranges |
|
|
218
|
+
| `gsc_validate_query` | Check a combination *before* running it |
|
|
219
|
+
| `gsc_compare_search_types` | Web, image, video, news and discover side by side |
|
|
220
|
+
| `gsc_analyze_search_appearance_trends` | How rich results evolve over time |
|
|
221
|
+
|
|
222
|
+
### SEO analysis
|
|
223
|
+
| Tool | Purpose |
|
|
224
|
+
|---|---|
|
|
225
|
+
| `gsc_detect_cannibalization` | Pages competing for the same query |
|
|
226
|
+
| `gsc_find_losses_gains` | Queries and pages won or lost between two periods |
|
|
227
|
+
| `gsc_cluster_queries` | Group queries by shared intent |
|
|
228
|
+
|
|
229
|
+
### Indexing
|
|
230
|
+
| Tool | Purpose |
|
|
231
|
+
|---|---|
|
|
232
|
+
| `gsc_inspect_url` | Crawl and index status for one URL |
|
|
233
|
+
| `gsc_bulk_inspect_urls` | Up to 10 URLs per call, to protect your quota |
|
|
234
|
+
| `gsc_indexation_watchlist` | Track URLs whose verdict changed |
|
|
235
|
+
| `gsc_monitor_indexation_freshness` | Freshness and indexation drift together |
|
|
236
|
+
| `gsc_plan_large_site_sampling` | Build an inspection sample when you cannot inspect everything |
|
|
237
|
+
|
|
238
|
+
### Sitemaps
|
|
239
|
+
| Tool | Purpose |
|
|
240
|
+
|---|---|
|
|
241
|
+
| `gsc_list_sitemaps` / `gsc_get_sitemap` | Submitted sitemaps and their status |
|
|
242
|
+
| `gsc_get_sitemap_health` | Errors, warnings and pending states |
|
|
243
|
+
| `gsc_track_sitemap_deltas` | What changed against a baseline you supply |
|
|
244
|
+
|
|
245
|
+
</details>
|
|
246
|
+
|
|
247
|
+
<details>
|
|
248
|
+
<summary><b>7 resources</b></summary>
|
|
249
|
+
|
|
250
|
+
| URI | Contents |
|
|
251
|
+
|---|---|
|
|
252
|
+
| `gsc://manifest` | What this server exposes, and which tool to run first |
|
|
253
|
+
| `gsc://metrics` | The 8 Search Analytics metrics, raw and derived |
|
|
254
|
+
| `gsc://dimensions` | The 7 dimensions and where they are valid |
|
|
255
|
+
| `gsc://filters` | The 5 filter operators and their accepted values |
|
|
256
|
+
| `gsc://compatibility` | Which dimensions work with which search types and data states |
|
|
257
|
+
| `gsc://recipes` | 8 step-by-step workflows |
|
|
258
|
+
| `gsc://p2-readonly-playbooks` | Monitoring playbooks and their invariants |
|
|
259
|
+
|
|
260
|
+
</details>
|
|
261
|
+
|
|
262
|
+
---
|
|
263
|
+
|
|
264
|
+
## Security
|
|
265
|
+
|
|
266
|
+
- **The client secret and refresh token are never logged**, at any log level, or written to disk.
|
|
267
|
+
- **Four hosts are contacted, and only four**: `searchconsole.googleapis.com` and
|
|
268
|
+
`www.googleapis.com` for the API, `oauth2.googleapis.com` and `accounts.google.com` for
|
|
269
|
+
OAuth. *A test fails the build if a fifth host appears in the source.*
|
|
270
|
+
- **No fetch follows a redirect.** Every outbound call sets `redirect: "error"`, so a redirect
|
|
271
|
+
cannot forward a bearer token or client secret to another host. *A test fails the build if
|
|
272
|
+
any fetch omits this.*
|
|
273
|
+
- **The scope is `webmasters.readonly`.** The token itself cannot write.
|
|
274
|
+
- **No telemetry.** The server makes no network call other than to Google.
|
|
275
|
+
|
|
276
|
+
Full policy: [SECURITY.md](SECURITY.md).
|
|
277
|
+
|
|
278
|
+
---
|
|
279
|
+
|
|
280
|
+
## Looking for a managed, multi-platform version?
|
|
281
|
+
|
|
282
|
+
This server does one platform, on your machine, with your credentials. That is on purpose.
|
|
283
|
+
|
|
284
|
+
If you'd rather not run it yourself, or you need Search Console **alongside Meta Ads, Google
|
|
285
|
+
Ads, TikTok Ads, Pinterest Ads and Google Analytics** behind one endpoint, with hosted OAuth
|
|
286
|
+
and cross-platform reporting, that's what we build at **[getmcpads.com](https://www.getmcpads.com)**.
|
|
287
|
+
|
|
288
|
+
Same philosophy, less plumbing. This project stays open source and independently useful
|
|
289
|
+
either way.
|
|
290
|
+
|
|
291
|
+
---
|
|
292
|
+
|
|
293
|
+
## Contributing
|
|
294
|
+
|
|
295
|
+
Issues and pull requests are welcome. See [CONTRIBUTING.md](CONTRIBUTING.md).
|
|
296
|
+
Please read [SECURITY.md](SECURITY.md) before reporting anything security-related.
|
|
297
|
+
|
|
298
|
+
## Licence
|
|
299
|
+
|
|
300
|
+
[Apache License 2.0](LICENSE). See also [NOTICE](NOTICE).
|
|
301
|
+
|
|
302
|
+
Google and Google Search Console are trademarks of Google LLC.
|
|
303
|
+
**This project is not affiliated with, endorsed by, or sponsored by Google LLC.**
|
|
304
|
+
It is an independent client of a public API.
|
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
#!/usr/bin/env node
|