mcp-google-tasks 1.1.1 → 1.2.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 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 Tasks": the assistant walks you through [creating the OAuth client and approving access](#getting-access) without editing config files.
59
+ 2. Say "connect Google Tasks": the assistant gives you a Google sign-in link — [no Google Cloud project or OAuth client to create](#getting-access).
60
60
  3. Ask the read-only question above.
61
61
 
62
62
  <details open>
@@ -64,7 +64,7 @@ You need Node.js 20+ and a Google account. Credentials are not required at insta
64
64
 
65
65
  <br>
66
66
 
67
- **In the app:** open **Settings → MCP servers**, select **Add server**, choose **STDIO**, enter the command `npx -y mcp-google-tasks@latest` and environment variables `GOOGLE_TASKS_CLIENT_ID`, `GOOGLE_TASKS_CLIENT_SECRET`, `GOOGLE_TASKS_REFRESH_TOKEN`, then select **Save** and **Restart**.
67
+ **In the app:** open **Settings → MCP servers**, select **Add server**, choose **STDIO**, enter the command `npx -y mcp-google-tasks@latest`, then select **Save** and **Restart**.
68
68
 
69
69
  **From the command line:**
70
70
 
@@ -224,12 +224,20 @@ Google Tasks requires OAuth 2.0; an API key is not enough. There are two ways in
224
224
 
225
225
  ### Connect from the chat (recommended)
226
226
 
227
- Say "connect Google Tasks" and the assistant runs the flow with you:
227
+ Say "connect Google Tasks". The server ships with a built-in OAuth client, so there is no Google Cloud project or OAuth client to create:
228
+
229
+ 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.
230
+ 2. `finish_login` exchanges the code, saves the tokens to `~/.config/mcp-google-tasks/credentials.json` (mode 0600) and verifies them with a real Google Tasks API call — so an API that is still switched off is caught right there.
231
+
232
+ 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.
233
+
234
+ #### Use your own OAuth client
235
+
236
+ 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:
228
237
 
229
238
  1. `setup_instructions` prints the checklist: create or select a Google Cloud project, enable **Google Tasks API**, configure the consent screen and create a **Desktop app** OAuth client.
230
- 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.
231
- 3. `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.
232
- 4. `finish_login` exchanges the code and saves the tokens to `~/.config/mcp-google-tasks/credentials.json` (mode 0600) and verifies them with a real Google Tasks API call — so an API that is still switched off is caught right there.
239
+ 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.
240
+ 3. Run `start_login` and `finish_login` again.
233
241
 
234
242
  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.
235
243
 
@@ -261,9 +269,9 @@ Every variable is optional — with none of them the server connects [from the c
261
269
  | `GOOGLE_TASKS_TIMEOUT_MS` | No | Per-request timeout; default `60000` ms. |
262
270
  | `GOOGLE_TASKS_MAX_RETRIES` | No | Temporary-error retries; default `3`. |
263
271
 
264
- \* Provide either the OAuth trio or an access token.
272
+ \* Only for a setup without the in-chat login: provide either the OAuth trio or an access token.
265
273
 
266
- Without credentials the server still starts and completes the MCP handshake; the first tool call then fails with a message naming the variables to set and asking for a restart.
274
+ Without credentials the server still starts and completes the MCP handshake; the first tool call then explains how to connect from the chat (`start_login` and `finish_login`) and names the variables for a setup without it.
267
275
 
268
276
  ## Data, limits and background work
269
277
 
package/README.ru.md CHANGED
@@ -12,7 +12,7 @@
12
12
  Сервер работает с Google Tasks API через ваш Google-аккаунт. Он отделяет обратимое завершение от безвозвратного удаления и явно показывает ограничения Tasks API, а не создаёт впечатление, что планировщику доступно всё.
13
13
 
14
14
  - **21 инструментов.** Просмотр, создание и изменение списков и задач, перемещение задач, управление завершением, массовая очистка сделанного и прямой вызов API, когда отдельного инструмента нет.
15
- - **Подключение из диалога.** Скажите «подключи Google Задачи»: сервер проведёт через создание OAuth-клиента, поймает редирект Google на `127.0.0.1` с PKCE и сам сохранит токены — без конфигов и перезапуска.
15
+ - **Подключение из диалога.** Скажите «подключи Google Задачи»: встроенный OAuth-клиент уже есть — сервер даст ссылку на согласие Google, поймает редирект Google на `127.0.0.1` с PKCE и сам сохранит токены — без конфигов и перезапуска.
16
16
  - **Завершение обратимо, удаление — нет.** У `complete_task` есть отмена (`reopen_task`); инструменты удаления отделены и помечены как разрушительные.
17
17
  - **Честные сроки.** API хранит только календарную дату — сервер не изображает планирование по часам; время дня записывается в заметки.
18
18
  - **Минимальный scope Google.** Единственный scope `tasks` — без доступа к Drive, Calendar и Gmail.
@@ -56,7 +56,7 @@
56
56
  Нужны Node.js 20+ и Google-аккаунт. Учётные данные при установке не нужны: сервер подключается прямо в диалоге.
57
57
 
58
58
  1. Добавьте сервер в AI-приложение.
59
- 2. Скажите «подключи Google Задачи» — ассистент проведёт [создание OAuth-клиента и выдачу доступа](#как-получить-доступ), не трогая конфиги.
59
+ 2. Скажите «подключи Google Задачи» — ассистент даст ссылку на согласие Google и [подключит аккаунт](#как-получить-доступ) — без проекта Google Cloud и без правки конфигов.
60
60
  3. Отправьте запрос, который только читает данные.
61
61
 
62
62
  <details open>
@@ -64,7 +64,7 @@
64
64
 
65
65
  <br>
66
66
 
67
- **В приложении:** откройте **Settings → MCP servers**, нажмите **Add server**, выберите **STDIO**, укажите команду `npx -y mcp-google-tasks@latest` и переменные окружения `GOOGLE_TASKS_CLIENT_ID`, `GOOGLE_TASKS_CLIENT_SECRET`, `GOOGLE_TASKS_REFRESH_TOKEN`, затем нажмите **Save**, потом **Restart**.
67
+ **В приложении:** откройте **Settings → MCP servers**, нажмите **Add server**, выберите **STDIO**, укажите команду `npx -y mcp-google-tasks@latest`, затем нажмите **Save**, потом **Restart**.
68
68
 
69
69
  **В командной строке:**
70
70
 
@@ -224,12 +224,20 @@ Google Tasks требует OAuth 2.0: одного API-ключа недост
224
224
 
225
225
  ### Подключение из диалога (рекомендуемый путь)
226
226
 
227
- Скажите «подключи Google Задачи», и ассистент пройдёт флоу вместе с вами:
227
+ Скажите «подключи Google Задачи». У сервера есть встроенный OAuth-клиент, поэтому создавать проект Google Cloud и OAuth-клиент не нужно:
228
+
229
+ 1. `start_login` возвращает ссылку на согласие Google. Откройте её **на этой же машине** и подтвердите доступ: код возвращается на одноразовый слушатель `127.0.0.1` (PKCE), а не в чат.
230
+ 2. `finish_login` меняет код на токены и кладёт их в `~/.config/mcp-google-tasks/credentials.json` (права 0600) и проверяет их реальным вызовом Google Tasks API — так невключённый API ловится сразу.
231
+
232
+ Пока приложение проходит проверку Google, на шаге согласия может появиться экран **«Google hasn't verified this app»**: выберите **Advanced → Go to A1 MCP**. Встроенный клиент только называет приложение для Google — токены выдаются вашей машине и хранятся на ней, A1 их не получает.
233
+
234
+ #### Свой OAuth-клиент
235
+
236
+ Встроенный клиент и его квоту Google API делят все, кто им пользуется. Свой клиент даёт собственную квоту и нужен, если администратор Google Workspace блокирует сторонние приложения:
228
237
 
229
238
  1. `setup_instructions` выдаёт чек-лист: создать или выбрать проект Google Cloud, включить **Google Tasks API**, настроить consent screen и создать OAuth-клиент типа **Desktop app**.
230
- 2. Скачайте JSON этого клиента («Download JSON») и передайте ассистенту **путь** к файлу — `set_client` сохранит его с правами только для владельца. Секрет через переписку не проходит.
231
- 3. `start_login` возвращает ссылку на согласие Google. Откройте её **на этой же машине** и подтвердите доступ: код возвращается на одноразовый слушатель `127.0.0.1` (PKCE), а не в чат.
232
- 4. `finish_login` меняет код на токены и кладёт их в `~/.config/mcp-google-tasks/credentials.json` (права 0600) и проверяет их реальным вызовом Google Tasks API — так невключённый API ловится сразу.
239
+ 2. Скачайте JSON этого клиента («Download JSON») и передайте ассистенту **путь** к файлу — `set_client` сохранит его с правами только для владельца. Секрет через переписку не проходит. С этого момента он имеет приоритет над встроенным.
240
+ 3. Снова выполните `start_login` и `finish_login`.
233
241
 
234
242
  Токены перечитываются на каждый вызов, поэтому подключение действует немедленно — перезапускать AI-приложение не нужно. `auth_status` показывает состояние, `logout` отзывает токен и удаляет его.
235
243
 
@@ -261,9 +269,9 @@ Refresh token OAuth-приложения в режиме Testing может ис
261
269
  | `GOOGLE_TASKS_TIMEOUT_MS` | Нет | Тайм-аут одного запроса; по умолчанию `60000` мс. |
262
270
  | `GOOGLE_TASKS_MAX_RETRIES` | Нет | Повторы временных ошибок; по умолчанию `3`. |
263
271
 
264
- \* Передайте OAuth-тройку или access token.
272
+ \* Нужны только для установки без входа из диалога: передайте OAuth-тройку или access token.
265
273
 
266
- Без учётных данных сервер всё равно запускается и завершает MCP-рукопожатие; первый вызов инструмента вернёт ошибку, которая назовёт нужные переменные и попросит перезапуск.
274
+ Без учётных данных сервер всё равно запускается и завершает MCP-рукопожатие; первый вызов инструмента объяснит, как подключиться из диалога (`start_login` и `finish_login`), и назовёт переменные для установки без него.
267
275
 
268
276
  ## Данные, лимиты и работа в фоне
269
277
 
package/dist/telemetry.js CHANGED
@@ -135,10 +135,10 @@ const OUTCOME_PATTERNS = [
135
135
  ["error_timeout", /timed?[ _-]?out|таймаут|ETIMEDOUT|AbortError|не был готов|not ready/i],
136
136
  ["error_network", /ECONNRESET|ECONNREFUSED|ENOTFOUND|EAI_AGAIN|EPIPE|fetch failed|socket hang up/i],
137
137
  ["error_rate_limit", /\b429\b|rate[ _-]?limit|too many requests|quota|квот|лимит|\[(?:56|152|506|9000)\]/i],
138
- ["error_permission", /нет доступа к кабинету|не подключ[её]н к аккаунту/i],
138
+ ["error_permission", /нет доступа к кабинету|не подключ[её]н к аккаунту|accessNotConfigured|SERVICE_DISABLED/i],
139
139
  [
140
140
  "error_auth",
141
- /\b401\b|unauthori[sz]ed|unauthenticated|invalid[ _-]?(?:token|grant|credentials)|token (?:expired|revoked)|login required|AuthRequired|авториз|не подключ|\[53\]/i,
141
+ /\b401\b|unauthori[sz]ed|unauthenticated|invalid[ _-]?(?:token|grant|credentials)|token (?:expired|revoked)|login required|AuthRequired|OAuthError|авториз|не подключ|\[53\]/i,
142
142
  ],
143
143
  ["error_permission", /\b403\b|forbidden|access[ _-]?denied|permission|insufficient[ _-]?scope|нет доступа|\[(?:54|3228)\]/i],
144
144
  ["error_not_found", /\b404\b|not[ _-]?found|не найден|не существует|\[8800\]/i],
@@ -248,6 +248,10 @@ function jsBug(err) {
248
248
  function errorText(err) {
249
249
  if (!(err instanceof Error) || "errno" in err || "syscall" in err)
250
250
  return undefined;
251
+ // OAuthError's code is a fixed OAuth/Google vocabulary (invalid_grant, accessNotConfigured), not user data.
252
+ const code = err.code;
253
+ if (err.name === "OAuthError" && typeof code === "string" && /^[A-Za-z_]{2,40}$/.test(code))
254
+ return `OAuthError ${code}`;
251
255
  return /^[A-Z][A-Za-z0-9]*(?:Error|Exception)$/.test(err.name) && err.name !== "Error" ? err.name : undefined;
252
256
  }
253
257
  /**
@@ -1,6 +1,7 @@
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 { GoogleTasksError } from "../types.js";
4
+ import { fail } from "./util.js";
4
5
  /**
5
6
  * The scopes an in-chat login requests (the per-task table lives in
6
7
  * docs/TOOLS.md). The component always adds the identity scopes on top.
@@ -91,7 +92,11 @@ export const AUTH_OPTIONS = {
91
92
  serverName: "tasks",
92
93
  envPrefix: "GOOGLE_TASKS",
93
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,
94
97
  verifyIdentity,
98
+ // Login-tool failures go through the server's own renderer, so telemetry gets their origin.
99
+ fail,
95
100
  };
96
101
  /**
97
102
  * Registers the six onboarding tools (auth_status, setup_instructions,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mcp-google-tasks",
3
- "version": "1.1.1",
3
+ "version": "1.2.0",
4
4
  "description": "MCP server for the Google Tasks API — manage task lists, create and organize tasks with due dates, notes and subtasks, track completion and sync changes. For Claude, Cursor, Codex and other AI clients.",
5
5
  "mcpName": "io.github.A1-x-Tech/mcp-google-tasks",
6
6
  "type": "module",
@@ -49,7 +49,7 @@
49
49
  "url": "https://github.com/A1-x-Tech/mcp-google-tasks/issues"
50
50
  },
51
51
  "dependencies": {
52
- "@a1-x-tech/mcp-google-auth": "^0.1.0",
52
+ "@a1-x-tech/mcp-google-auth": "^0.1.3",
53
53
  "@modelcontextprotocol/sdk": "^1.29.0",
54
54
  "zod": "^3.25.0"
55
55
  },