gogcli-mcp-gmail 2.7.1 → 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/dist/index.js +17 -10
- package/manifest.json +1 -1
- package/package.json +1 -1
- package/src/tools/gmail-extra.ts +19 -10
- package/tests/tools/gmail-extra.test.ts +17 -0
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.
|
|
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
|
-
|
|
31430
|
-
|
|
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.
|
|
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.
|
|
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>",
|
package/src/tools/gmail-extra.ts
CHANGED
|
@@ -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
|
-
|
|
154
|
-
|
|
155
|
-
max
|
|
156
|
-
|
|
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', () => {
|