mcp-google-search-console 1.3.2 → 1.4.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/README.md +16 -8
- package/README.ru.md +17 -9
- package/dist/tools/auth.js +3 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -56,7 +56,7 @@ Start with a read-only question:
|
|
|
56
56
|
You need Node.js 20+ and a Google account. Credentials are not required at install time — the server connects from the conversation.
|
|
57
57
|
|
|
58
58
|
1. Add the server to your AI app.
|
|
59
|
-
2. Say "connect Google Search Console": the assistant
|
|
59
|
+
2. Say "connect Google Search Console": the assistant gives you a Google sign-in link — [no Google Cloud project or OAuth client to create](#getting-access).
|
|
60
60
|
3. Start with the read-only question above.
|
|
61
61
|
|
|
62
62
|
<details open><summary><strong>Codex</strong></summary>
|
|
@@ -64,9 +64,9 @@ You need Node.js 20+ and a Google account. Credentials are not required at insta
|
|
|
64
64
|
<br>
|
|
65
65
|
|
|
66
66
|
<<<<<<< Updated upstream
|
|
67
|
-
**In the app:** open **Settings → MCP servers**, select **Add server**, choose **STDIO**, enter the command `npx -y mcp-google-search-console@latest
|
|
67
|
+
**In the app:** open **Settings → MCP servers**, select **Add server**, choose **STDIO**, enter the command `npx -y mcp-google-search-console@latest`, then select **Save** and **Restart**.
|
|
68
68
|
||||||| Stash base
|
|
69
|
-
**In the app:** open **Settings → Plugins → MCP servers**, choose **Add server**, then add `npx -y mcp-google-search-console@latest
|
|
69
|
+
**In the app:** open **Settings → Plugins → MCP servers**, choose **Add server**, then add `npx -y mcp-google-search-console@latest`.
|
|
70
70
|
=======
|
|
71
71
|
**In the app:** open **Settings → Plugins → MCP servers**, choose **Add server**, then add `npx -y mcp-google-search-console@latest`.
|
|
72
72
|
>>>>>>> Stashed changes
|
|
@@ -187,12 +187,20 @@ Google Search Console requires OAuth 2.0; an API key is not enough. There are tw
|
|
|
187
187
|
|
|
188
188
|
### Connect from the chat (recommended)
|
|
189
189
|
|
|
190
|
-
Say "connect Google Search Console"
|
|
190
|
+
Say "connect Google Search Console". The server ships with a built-in OAuth client, so there is no Google Cloud project or OAuth client to create:
|
|
191
|
+
|
|
192
|
+
1. `start_login` returns a Google consent link. Open it **on this machine** and approve; the code comes back to a one-shot listener on `127.0.0.1` (PKCE), never through the chat.
|
|
193
|
+
2. `finish_login` exchanges the code, saves the tokens to `~/.config/mcp-google-search-console/credentials.json` (mode 0600) and verifies them with a real Google Search Console API call — so an API that is still switched off is caught right there.
|
|
194
|
+
|
|
195
|
+
Google may show a **"Google hasn't verified this app"** screen while the app's verification is in progress: choose **Advanced → Go to A1 MCP**. The built-in client only identifies the app to Google — the tokens are issued to and stored on your machine, and A1 never receives them.
|
|
196
|
+
|
|
197
|
+
#### Use your own OAuth client
|
|
198
|
+
|
|
199
|
+
The built-in client and its Google API quota are shared by everyone who uses it. Bring your own client to get a quota of your own, or when a Google Workspace admin blocks third-party apps:
|
|
191
200
|
|
|
192
201
|
1. `setup_instructions` prints the checklist: create or select a Google Cloud project, enable **Google Search Console API**, configure the consent screen and create a **Desktop app** OAuth client.
|
|
193
|
-
2. Download that client's JSON ("Download JSON") and give the assistant its **path** — `set_client` stores it owner-only. The secret never goes through the conversation.
|
|
194
|
-
3. `start_login`
|
|
195
|
-
4. `finish_login` exchanges the code and saves the tokens to `~/.config/mcp-google-search-console/credentials.json` (mode 0600) and verifies them with a real Google Search Console API call — so an API that is still switched off is caught right there.
|
|
202
|
+
2. Download that client's JSON ("Download JSON") and give the assistant its **path** — `set_client` stores it owner-only. The secret never goes through the conversation. From then on it takes priority over the built-in client.
|
|
203
|
+
3. Run `start_login` and `finish_login` again.
|
|
196
204
|
|
|
197
205
|
The tokens are re-read on every call, so the connection works immediately — no restart of the AI app. `auth_status` shows what is connected, `logout` revokes and deletes it.
|
|
198
206
|
|
|
@@ -220,7 +228,7 @@ Every variable is optional — with none of them the server connects [from the c
|
|
|
220
228
|
| `GOOGLE_SEARCH_CONSOLE_TIMEOUT_MS` | No | Per-request timeout; default `60000` ms. |
|
|
221
229
|
| `GOOGLE_SEARCH_CONSOLE_MAX_RETRIES` | No | Temporary-error retries; default `3`. |
|
|
222
230
|
|
|
223
|
-
\*
|
|
231
|
+
\* Only for a setup without the in-chat login: provide either the OAuth trio or an access token.
|
|
224
232
|
|
|
225
233
|
## Data, limits and background work
|
|
226
234
|
|
package/README.ru.md
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
Сервер работает со свойствами, к которым есть доступ у вашего Google-аккаунта. Важная особенность: он использует точное значение свойства Search Console — domain property и URL-prefix property являются разными объектами.
|
|
13
13
|
|
|
14
14
|
- **18 инструментов.** Семь инструментов читают свойства, поисковые данные, sitemap и статус индексации; два добавляют свойство или отправляют sitemap; три могут удалить данные или вызвать произвольный метод API.
|
|
15
|
-
- **Подключение из диалога.** Скажите «подключи Google Search Console»: сервер
|
|
15
|
+
- **Подключение из диалога.** Скажите «подключи Google Search Console»: встроенный OAuth-клиент уже есть — сервер даст ссылку на согласие Google, поймает редирект Google на `127.0.0.1` с PKCE и сам сохранит токены — без конфигов и перезапуска.
|
|
16
16
|
- **Точные ID свойств.** `https://example.com/`, `https://www.example.com/` и `sc-domain:example.com` различаются. `list_sites` показывает значение, которое нужно использовать.
|
|
17
17
|
- **Поисковые данные с контекстом.** Можно получить клики, показы, CTR и позицию по дате, странице, запросу, стране, устройству или search appearance.
|
|
18
18
|
- **Индексация, а не публикация.** Проверка URL показывает текущий статус Google, но не заставляет страницу попасть в индекс.
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
Нужны Node.js 20+ и Google-аккаунт. Учётные данные при установке не нужны: сервер подключается прямо в диалоге.
|
|
57
57
|
|
|
58
58
|
1. Добавьте сервер в AI-приложение.
|
|
59
|
-
2. Скажите «подключи Google Search Console» — ассистент
|
|
59
|
+
2. Скажите «подключи Google Search Console» — ассистент даст ссылку на согласие Google и [подключит аккаунт](#как-получить-доступ) — без проекта Google Cloud и без правки конфигов.
|
|
60
60
|
3. Начните с запроса, который только читает данные.
|
|
61
61
|
|
|
62
62
|
<details open><summary><strong>Codex</strong></summary>
|
|
@@ -64,9 +64,9 @@
|
|
|
64
64
|
<br>
|
|
65
65
|
|
|
66
66
|
<<<<<<< Updated upstream
|
|
67
|
-
**В приложении:** откройте **Settings → MCP servers**, нажмите **Add server**, выберите **STDIO**, укажите команду `npx -y mcp-google-search-console@latest
|
|
67
|
+
**В приложении:** откройте **Settings → MCP servers**, нажмите **Add server**, выберите **STDIO**, укажите команду `npx -y mcp-google-search-console@latest`, затем нажмите **Save**, потом **Restart**.
|
|
68
68
|
||||||| Stash base
|
|
69
|
-
**В приложении:** откройте **Settings → Plugins → MCP servers**, выберите **Add server**, затем добавьте `npx -y mcp-google-search-console@latest
|
|
69
|
+
**В приложении:** откройте **Settings → Plugins → MCP servers**, выберите **Add server**, затем добавьте `npx -y mcp-google-search-console@latest`.
|
|
70
70
|
=======
|
|
71
71
|
**В приложении:** откройте **Settings → Plugins → MCP servers**, выберите **Add server**, затем добавьте `npx -y mcp-google-search-console@latest`.
|
|
72
72
|
>>>>>>> Stashed changes
|
|
@@ -187,12 +187,20 @@ Google Search Console требует OAuth 2.0: одного API-ключа не
|
|
|
187
187
|
|
|
188
188
|
### Подключение из диалога (рекомендуемый путь)
|
|
189
189
|
|
|
190
|
-
Скажите «подключи Google Search Console
|
|
190
|
+
Скажите «подключи Google Search Console». У сервера есть встроенный OAuth-клиент, поэтому создавать проект Google Cloud и OAuth-клиент не нужно:
|
|
191
|
+
|
|
192
|
+
1. `start_login` возвращает ссылку на согласие Google. Откройте её **на этой же машине** и подтвердите доступ: код возвращается на одноразовый слушатель `127.0.0.1` (PKCE), а не в чат.
|
|
193
|
+
2. `finish_login` меняет код на токены и кладёт их в `~/.config/mcp-google-search-console/credentials.json` (права 0600) и проверяет их реальным вызовом Google Search Console API — так невключённый API ловится сразу.
|
|
194
|
+
|
|
195
|
+
Пока приложение проходит проверку Google, на шаге согласия может появиться экран **«Google hasn't verified this app»**: выберите **Advanced → Go to A1 MCP**. Встроенный клиент только называет приложение для Google — токены выдаются вашей машине и хранятся на ней, A1 их не получает.
|
|
196
|
+
|
|
197
|
+
#### Свой OAuth-клиент
|
|
198
|
+
|
|
199
|
+
Встроенный клиент и его квоту Google API делят все, кто им пользуется. Свой клиент даёт собственную квоту и нужен, если администратор Google Workspace блокирует сторонние приложения:
|
|
191
200
|
|
|
192
201
|
1. `setup_instructions` выдаёт чек-лист: создать или выбрать проект Google Cloud, включить **Google Search Console API**, настроить consent screen и создать OAuth-клиент типа **Desktop app**.
|
|
193
|
-
2. Скачайте JSON этого клиента («Download JSON») и передайте ассистенту **путь** к файлу — `set_client` сохранит его с правами только для владельца. Секрет через переписку не проходит.
|
|
194
|
-
3. `start_login`
|
|
195
|
-
4. `finish_login` меняет код на токены и кладёт их в `~/.config/mcp-google-search-console/credentials.json` (права 0600) и проверяет их реальным вызовом Google Search Console API — так невключённый API ловится сразу.
|
|
202
|
+
2. Скачайте JSON этого клиента («Download JSON») и передайте ассистенту **путь** к файлу — `set_client` сохранит его с правами только для владельца. Секрет через переписку не проходит. С этого момента он имеет приоритет над встроенным.
|
|
203
|
+
3. Снова выполните `start_login` и `finish_login`.
|
|
196
204
|
|
|
197
205
|
Токены перечитываются на каждый вызов, поэтому подключение действует немедленно — перезапускать AI-приложение не нужно. `auth_status` показывает состояние, `logout` отзывает токен и удаляет его.
|
|
198
206
|
|
|
@@ -220,7 +228,7 @@ Refresh token OAuth-приложения в режиме Testing может ис
|
|
|
220
228
|
| `GOOGLE_SEARCH_CONSOLE_TIMEOUT_MS` | Нет | Тайм-аут запроса; по умолчанию `60000` мс. |
|
|
221
229
|
| `GOOGLE_SEARCH_CONSOLE_MAX_RETRIES` | Нет | Повторы временных ошибок; по умолчанию `3`. |
|
|
222
230
|
|
|
223
|
-
\*
|
|
231
|
+
\* Нужны только для установки без входа из диалога: передайте OAuth-тройку или access token.
|
|
224
232
|
|
|
225
233
|
## Данные, лимиты и работа в фоне
|
|
226
234
|
|
package/dist/tools/auth.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OAuthError, registerGoogleAuth, TokenProvider, unconfiguredPrefix, USERINFO_URL, } from "@a1-x-tech/mcp-google-auth";
|
|
1
|
+
import { OAuthError, A1_DEFAULT_CLIENT, registerGoogleAuth, TokenProvider, unconfiguredPrefix, USERINFO_URL, } from "@a1-x-tech/mcp-google-auth";
|
|
2
2
|
import { probeApi } from "../client.js";
|
|
3
3
|
import { GoogleSearchConsoleError } from "../types.js";
|
|
4
4
|
import { fail } from "./util.js";
|
|
@@ -92,6 +92,8 @@ export const AUTH_OPTIONS = {
|
|
|
92
92
|
serverName: "search-console",
|
|
93
93
|
envPrefix: "GOOGLE_SEARCH_CONSOLE",
|
|
94
94
|
scopes: LOGIN_SCOPES,
|
|
95
|
+
// Built-in A1 OAuth client: login without a Google Cloud project. Env and set_client still win.
|
|
96
|
+
defaultClient: A1_DEFAULT_CLIENT,
|
|
95
97
|
verifyIdentity,
|
|
96
98
|
// Login-tool failures go through the server's own renderer, so telemetry gets their origin.
|
|
97
99
|
fail,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mcp-google-search-console",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"description": "MCP server for the Google Search Console API — search analytics, sitemaps, URL inspection and site management. For Claude, Cursor, Codex and other AI clients.",
|
|
5
5
|
"mcpName": "io.github.A1-x-Tech/mcp-google-search-console",
|
|
6
6
|
"type": "module",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"url": "https://github.com/A1-x-Tech/mcp-google-search-console/issues"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@a1-x-tech/mcp-google-auth": "^0.1.
|
|
54
|
+
"@a1-x-tech/mcp-google-auth": "^0.1.3",
|
|
55
55
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
56
56
|
"zod": "^3.25.0"
|
|
57
57
|
},
|