gogcli-mcp-gmail 2.7.0 → 2.8.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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Chris Hall
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.
package/dist/index.js CHANGED
@@ -31299,7 +31299,7 @@ var failIfNotEmptyParam = external_exports.boolean().optional().describe(
31299
31299
  );
31300
31300
 
31301
31301
  // ../gogcli-mcp/src/server.ts
31302
- var VERSION = true ? "2.7.0" : "0.0.0";
31302
+ var VERSION = true ? "2.8.0" : "0.0.0";
31303
31303
  function createServer(options) {
31304
31304
  return new McpServer({
31305
31305
  name: options?.name ?? "gogcli",
@@ -31403,7 +31403,8 @@ function registerExtraGmailTools(server2) {
31403
31403
  {
31404
31404
  tool: "gog_gmail_archive",
31405
31405
  cmd: "archive",
31406
- description: "Archive messages (remove from inbox). Pass either messageIds or a Gmail search query."
31406
+ description: "Archive messages (remove from inbox). Pass either messageIds or a Gmail search query. Set thread=true to treat the ids as THREAD ids and archive every message in each thread (the right mode for ids that came from thread search).",
31407
+ supportsThread: true
31407
31408
  },
31408
31409
  {
31409
31410
  tool: "gog_gmail_mark_read",
@@ -31421,21 +31422,27 @@ function registerExtraGmailTools(server2) {
31421
31422
  description: "Move messages to trash. Pass either messageIds or a Gmail search query."
31422
31423
  }
31423
31424
  ];
31424
- for (const { tool, cmd, description } of bulkActions) {
31425
+ for (const { tool, cmd, description, supportsThread } of bulkActions) {
31426
+ const inputSchema = {
31427
+ messageIds: external_exports.array(external_exports.string()).optional().describe("Specific message IDs to act on"),
31428
+ query: external_exports.string().optional().describe("Gmail search query (alternative to messageIds; acts on all matching)"),
31429
+ max: external_exports.number().optional().describe("Max messages when using --query (default: 100)"),
31430
+ account: accountParam
31431
+ };
31432
+ if (supportsThread) {
31433
+ inputSchema.thread = external_exports.boolean().optional().describe("Treat messageIds as THREAD ids and act on every message in each thread");
31434
+ }
31425
31435
  server2.registerTool(tool, {
31426
31436
  description,
31427
31437
  annotations: { destructiveHint: true },
31428
- inputSchema: {
31429
- messageIds: external_exports.array(external_exports.string()).optional().describe("Specific message IDs to act on"),
31430
- query: external_exports.string().optional().describe("Gmail search query (alternative to messageIds; acts on all matching)"),
31431
- max: external_exports.number().optional().describe("Max messages when using --query (default: 100)"),
31432
- account: accountParam
31433
- }
31434
- }, async ({ messageIds, query, max, account }) => {
31438
+ inputSchema
31439
+ }, async (rawArgs) => {
31440
+ const { messageIds, query, max, thread, account } = rawArgs;
31435
31441
  const args = ["gmail", cmd];
31436
31442
  if (messageIds) args.push(...messageIds);
31437
31443
  if (query) args.push(`--query=${query}`);
31438
31444
  if (max !== void 0) args.push(`--max=${max}`);
31445
+ if (supportsThread && thread) args.push("--thread");
31439
31446
  return runOrDiagnose(args, { account });
31440
31447
  });
31441
31448
  }
package/manifest.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "manifest_version": "0.3",
4
4
  "name": "gogcli-mcp-gmail",
5
5
  "display_name": "gogcli (Gmail)",
6
- "version": "2.7.0",
6
+ "version": "2.8.0",
7
7
  "description": "Extended Gmail for Claude via gogcli — auth + full Gmail support (threads, labels, drafts, attachments, forward, autoreply, bulk operations)",
8
8
  "author": {
9
9
  "name": "Chris Hall",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gogcli-mcp-gmail",
3
- "version": "2.7.0",
3
+ "version": "2.8.0",
4
4
  "mcpName": "io.github.chrischall/gogcli-mcp-gmail",
5
5
  "description": "Extended Gmail MCP server via gogcli — auth + full Gmail support (threads, labels, drafts, attachments, forward, autoreply, bulk operations)",
6
6
  "author": "Claude Code (AI) <https://www.anthropic.com/claude>",
@@ -122,11 +122,12 @@ export function registerExtraGmailTools(server: McpServer): void {
122
122
  return runOrDiagnose(args, { account });
123
123
  });
124
124
 
125
- const bulkActions: Array<{ tool: string; cmd: string; description: string }> = [
125
+ const bulkActions: Array<{ tool: string; cmd: string; description: string; supportsThread?: boolean }> = [
126
126
  {
127
127
  tool: 'gog_gmail_archive',
128
128
  cmd: 'archive',
129
- description: 'Archive messages (remove from inbox). Pass either messageIds or a Gmail search query.',
129
+ description: 'Archive messages (remove from inbox). Pass either messageIds or a Gmail search query. Set thread=true to treat the ids as THREAD ids and archive every message in each thread (the right mode for ids that came from thread search).',
130
+ supportsThread: true,
130
131
  },
131
132
  {
132
133
  tool: 'gog_gmail_mark_read',
@@ -145,21 +146,29 @@ export function registerExtraGmailTools(server: McpServer): void {
145
146
  },
146
147
  ];
147
148
 
148
- for (const { tool, cmd, description } of bulkActions) {
149
+ for (const { tool, cmd, description, supportsThread } of bulkActions) {
150
+ const inputSchema: Record<string, z.ZodTypeAny> = {
151
+ messageIds: z.array(z.string()).optional().describe('Specific message IDs to act on'),
152
+ query: z.string().optional().describe('Gmail search query (alternative to messageIds; acts on all matching)'),
153
+ max: z.number().optional().describe('Max messages when using --query (default: 100)'),
154
+ account: accountParam,
155
+ };
156
+ if (supportsThread) {
157
+ inputSchema.thread = z.boolean().optional().describe('Treat messageIds as THREAD ids and act on every message in each thread');
158
+ }
149
159
  server.registerTool(tool, {
150
160
  description,
151
161
  annotations: { destructiveHint: true },
152
- inputSchema: {
153
- messageIds: z.array(z.string()).optional().describe('Specific message IDs to act on'),
154
- query: z.string().optional().describe('Gmail search query (alternative to messageIds; acts on all matching)'),
155
- max: z.number().optional().describe('Max messages when using --query (default: 100)'),
156
- account: accountParam,
157
- },
158
- }, async ({ messageIds, query, max, account }) => {
162
+ inputSchema,
163
+ }, async (rawArgs) => {
164
+ const { messageIds, query, max, thread, account } = rawArgs as {
165
+ messageIds?: string[]; query?: string; max?: number; thread?: boolean; account?: string;
166
+ };
159
167
  const args = ['gmail', cmd];
160
168
  if (messageIds) args.push(...messageIds);
161
169
  if (query) args.push(`--query=${query}`);
162
170
  if (max !== undefined) args.push(`--max=${max}`);
171
+ if (supportsThread && thread) args.push('--thread');
163
172
  return runOrDiagnose(args, { account });
164
173
  });
165
174
  }
@@ -132,6 +132,23 @@ describe('bulk action tools (archive, mark_read, mark_unread, trash)', () => {
132
132
  });
133
133
  });
134
134
  }
135
+
136
+ // gog 0.25.0 — --thread is archive-only
137
+ it('gog_gmail_archive passes --thread to archive whole threads by id', async () => {
138
+ await handlers.get('gog_gmail_archive')!({ messageIds: ['t1', 't2'], thread: true });
139
+ expect(lib.runOrDiagnose).toHaveBeenCalledWith(
140
+ ['gmail', 'archive', 't1', 't2', '--thread'],
141
+ { account: undefined },
142
+ );
143
+ });
144
+
145
+ it('other bulk tools do not expose a thread param', async () => {
146
+ await handlers.get('gog_gmail_trash')!({ messageIds: ['m1'], thread: true });
147
+ expect(lib.runOrDiagnose).toHaveBeenCalledWith(
148
+ ['gmail', 'trash', 'm1'],
149
+ { account: undefined },
150
+ );
151
+ });
135
152
  });
136
153
 
137
154
  describe('gog_gmail_message_modify', () => {