gogcli-mcp-gmail 2.0.3 → 2.0.6

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 CHANGED
@@ -9070,7 +9070,7 @@ var Doc = class {
9070
9070
  var version = {
9071
9071
  major: 4,
9072
9072
  minor: 4,
9073
- patch: 2
9073
+ patch: 3
9074
9074
  };
9075
9075
 
9076
9076
  // ../../node_modules/zod/v4/core/schemas.js
@@ -10669,6 +10669,7 @@ var $ZodFile = /* @__PURE__ */ $constructor("$ZodFile", (inst, def) => {
10669
10669
  });
10670
10670
  var $ZodTransform = /* @__PURE__ */ $constructor("$ZodTransform", (inst, def) => {
10671
10671
  $ZodType.init(inst, def);
10672
+ inst._zod.optin = "optional";
10672
10673
  inst._zod.parse = (payload, ctx) => {
10673
10674
  if (ctx.direction === "backward") {
10674
10675
  throw new $ZodEncodeError(inst.constructor.name);
@@ -10678,6 +10679,7 @@ var $ZodTransform = /* @__PURE__ */ $constructor("$ZodTransform", (inst, def) =>
10678
10679
  const output = _out instanceof Promise ? _out : Promise.resolve(_out);
10679
10680
  return output.then((output2) => {
10680
10681
  payload.value = output2;
10682
+ payload.fallback = true;
10681
10683
  return payload;
10682
10684
  });
10683
10685
  }
@@ -10685,11 +10687,12 @@ var $ZodTransform = /* @__PURE__ */ $constructor("$ZodTransform", (inst, def) =>
10685
10687
  throw new $ZodAsyncError();
10686
10688
  }
10687
10689
  payload.value = _out;
10690
+ payload.fallback = true;
10688
10691
  return payload;
10689
10692
  };
10690
10693
  });
10691
10694
  function handleOptionalResult(result, input) {
10692
- if (result.issues.length && input === void 0) {
10695
+ if (input === void 0 && (result.issues.length || result.fallback)) {
10693
10696
  return { issues: [], value: void 0 };
10694
10697
  }
10695
10698
  return result;
@@ -10707,10 +10710,11 @@ var $ZodOptional = /* @__PURE__ */ $constructor("$ZodOptional", (inst, def) => {
10707
10710
  });
10708
10711
  inst._zod.parse = (payload, ctx) => {
10709
10712
  if (def.innerType._zod.optin === "optional") {
10713
+ const input = payload.value;
10710
10714
  const result = def.innerType._zod.run(payload, ctx);
10711
10715
  if (result instanceof Promise)
10712
- return result.then((r) => handleOptionalResult(r, payload.value));
10713
- return handleOptionalResult(result, payload.value);
10716
+ return result.then((r) => handleOptionalResult(r, input));
10717
+ return handleOptionalResult(result, input);
10714
10718
  }
10715
10719
  if (payload.value === void 0) {
10716
10720
  return payload;
@@ -10826,7 +10830,7 @@ var $ZodSuccess = /* @__PURE__ */ $constructor("$ZodSuccess", (inst, def) => {
10826
10830
  });
10827
10831
  var $ZodCatch = /* @__PURE__ */ $constructor("$ZodCatch", (inst, def) => {
10828
10832
  $ZodType.init(inst, def);
10829
- defineLazy(inst._zod, "optin", () => def.innerType._zod.optin);
10833
+ inst._zod.optin = "optional";
10830
10834
  defineLazy(inst._zod, "optout", () => def.innerType._zod.optout);
10831
10835
  defineLazy(inst._zod, "values", () => def.innerType._zod.values);
10832
10836
  inst._zod.parse = (payload, ctx) => {
@@ -10846,6 +10850,7 @@ var $ZodCatch = /* @__PURE__ */ $constructor("$ZodCatch", (inst, def) => {
10846
10850
  input: payload.value
10847
10851
  });
10848
10852
  payload.issues = [];
10853
+ payload.fallback = true;
10849
10854
  }
10850
10855
  return payload;
10851
10856
  });
@@ -10860,6 +10865,7 @@ var $ZodCatch = /* @__PURE__ */ $constructor("$ZodCatch", (inst, def) => {
10860
10865
  input: payload.value
10861
10866
  });
10862
10867
  payload.issues = [];
10868
+ payload.fallback = true;
10863
10869
  }
10864
10870
  return payload;
10865
10871
  };
@@ -10905,7 +10911,7 @@ function handlePipeResult(left, next, ctx) {
10905
10911
  left.aborted = true;
10906
10912
  return left;
10907
10913
  }
10908
- return next._zod.run({ value: left.value, issues: left.issues }, ctx);
10914
+ return next._zod.run({ value: left.value, issues: left.issues, fallback: left.fallback }, ctx);
10909
10915
  }
10910
10916
  var $ZodCodec = /* @__PURE__ */ $constructor("$ZodCodec", (inst, def) => {
10911
10917
  $ZodType.init(inst, def);
@@ -10959,8 +10965,6 @@ function handleCodecTxResult(left, value, nextSchema, ctx) {
10959
10965
  }
10960
10966
  var $ZodPreprocess = /* @__PURE__ */ $constructor("$ZodPreprocess", (inst, def) => {
10961
10967
  $ZodPipe.init(inst, def);
10962
- defineLazy(inst._zod, "optin", () => def.out._zod.optin);
10963
- defineLazy(inst._zod, "optout", () => def.out._zod.optout);
10964
10968
  });
10965
10969
  var $ZodReadonly = /* @__PURE__ */ $constructor("$ZodReadonly", (inst, def) => {
10966
10970
  $ZodType.init(inst, def);
@@ -20478,10 +20482,12 @@ var ZodTransform = /* @__PURE__ */ $constructor("ZodTransform", (inst, def) => {
20478
20482
  if (output instanceof Promise) {
20479
20483
  return output.then((output2) => {
20480
20484
  payload.value = output2;
20485
+ payload.fallback = true;
20481
20486
  return payload;
20482
20487
  });
20483
20488
  }
20484
20489
  payload.value = output;
20490
+ payload.fallback = true;
20485
20491
  return payload;
20486
20492
  };
20487
20493
  });
@@ -31084,7 +31090,7 @@ function registerGmailTools(server2) {
31084
31090
  }
31085
31091
 
31086
31092
  // ../gogcli-mcp/src/server.ts
31087
- var VERSION = true ? "2.0.3" : "0.0.0";
31093
+ var VERSION = true ? "2.0.5" : "0.0.0";
31088
31094
  function createServer(options) {
31089
31095
  return new McpServer({
31090
31096
  name: options?.name ?? "gogcli",
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.0.3",
6
+ "version": "2.0.6",
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",
@@ -57,43 +57,154 @@
57
57
  }
58
58
  },
59
59
  "tools": [
60
- { "name": "gog_auth_add", "description": "Authorize a Google account via browser-based OAuth" },
61
- { "name": "gog_auth_list", "description": "List all Google accounts stored in gogcli" },
62
- { "name": "gog_auth_status", "description": "Show gogcli auth configuration" },
63
- { "name": "gog_auth_services", "description": "List Google services and OAuth scopes supported by gogcli" },
64
- { "name": "gog_auth_run", "description": "Run any gog auth subcommand (escape hatch)" },
65
- { "name": "gog_gmail_search", "description": "Search Gmail threads using Gmail query syntax" },
66
- { "name": "gog_gmail_get", "description": "Get a Gmail message by ID" },
67
- { "name": "gog_gmail_send", "description": "Send an email" },
68
- { "name": "gog_gmail_run", "description": "Run any gog gmail subcommand (escape hatch)" },
69
- { "name": "gog_gmail_raw", "description": "Dump raw Gmail API JSON for a message" },
70
- { "name": "gog_gmail_attachment", "description": "Download a single attachment from a message" },
71
- { "name": "gog_gmail_url", "description": "Print Gmail web URLs for one or more threads" },
72
- { "name": "gog_gmail_history", "description": "List Gmail history events since a historyId" },
73
- { "name": "gog_gmail_archive", "description": "Archive messages by IDs or by query" },
74
- { "name": "gog_gmail_mark_read", "description": "Mark messages as read by IDs or by query" },
75
- { "name": "gog_gmail_mark_unread", "description": "Mark messages as unread by IDs or by query" },
76
- { "name": "gog_gmail_trash", "description": "Move messages to trash by IDs or by query" },
77
- { "name": "gog_gmail_message_modify", "description": "Modify labels on a single message" },
78
- { "name": "gog_gmail_batch_delete", "description": "Permanently delete multiple messages (irreversible)" },
79
- { "name": "gog_gmail_batch_modify", "description": "Modify labels on multiple messages at once" },
80
- { "name": "gog_gmail_thread_get", "description": "Get a thread with all messages" },
81
- { "name": "gog_gmail_thread_modify", "description": "Modify labels on all messages in a thread" },
82
- { "name": "gog_gmail_thread_attachments", "description": "List or download all attachments in a thread" },
83
- { "name": "gog_gmail_labels_list", "description": "List all Gmail labels" },
84
- { "name": "gog_gmail_labels_get", "description": "Get label details and counts" },
85
- { "name": "gog_gmail_labels_create", "description": "Create a new Gmail label" },
86
- { "name": "gog_gmail_labels_rename", "description": "Rename a Gmail label" },
87
- { "name": "gog_gmail_labels_delete", "description": "Delete a Gmail label" },
88
- { "name": "gog_gmail_labels_modify", "description": "Modify labels on one or more threads" },
89
- { "name": "gog_gmail_drafts_list", "description": "List Gmail drafts" },
90
- { "name": "gog_gmail_drafts_get", "description": "Get a Gmail draft by ID" },
91
- { "name": "gog_gmail_drafts_create", "description": "Create a new Gmail draft" },
92
- { "name": "gog_gmail_drafts_update", "description": "Update an existing Gmail draft" },
93
- { "name": "gog_gmail_drafts_delete", "description": "Delete a Gmail draft" },
94
- { "name": "gog_gmail_drafts_send", "description": "Send an existing Gmail draft" },
95
- { "name": "gog_gmail_forward", "description": "Forward a Gmail message to new recipients" },
96
- { "name": "gog_gmail_autoreply", "description": "Reply once to all messages matching a Gmail search query" }
60
+ {
61
+ "name": "gog_auth_add",
62
+ "description": "Authorize a Google account via browser-based OAuth"
63
+ },
64
+ {
65
+ "name": "gog_auth_list",
66
+ "description": "List all Google accounts stored in gogcli"
67
+ },
68
+ {
69
+ "name": "gog_auth_status",
70
+ "description": "Show gogcli auth configuration"
71
+ },
72
+ {
73
+ "name": "gog_auth_services",
74
+ "description": "List Google services and OAuth scopes supported by gogcli"
75
+ },
76
+ {
77
+ "name": "gog_auth_run",
78
+ "description": "Run any gog auth subcommand (escape hatch)"
79
+ },
80
+ {
81
+ "name": "gog_gmail_search",
82
+ "description": "Search Gmail threads using Gmail query syntax"
83
+ },
84
+ {
85
+ "name": "gog_gmail_get",
86
+ "description": "Get a Gmail message by ID"
87
+ },
88
+ {
89
+ "name": "gog_gmail_send",
90
+ "description": "Send an email"
91
+ },
92
+ {
93
+ "name": "gog_gmail_run",
94
+ "description": "Run any gog gmail subcommand (escape hatch)"
95
+ },
96
+ {
97
+ "name": "gog_gmail_raw",
98
+ "description": "Dump raw Gmail API JSON for a message"
99
+ },
100
+ {
101
+ "name": "gog_gmail_attachment",
102
+ "description": "Download a single attachment from a message"
103
+ },
104
+ {
105
+ "name": "gog_gmail_url",
106
+ "description": "Print Gmail web URLs for one or more threads"
107
+ },
108
+ {
109
+ "name": "gog_gmail_history",
110
+ "description": "List Gmail history events since a historyId"
111
+ },
112
+ {
113
+ "name": "gog_gmail_archive",
114
+ "description": "Archive messages by IDs or by query"
115
+ },
116
+ {
117
+ "name": "gog_gmail_mark_read",
118
+ "description": "Mark messages as read by IDs or by query"
119
+ },
120
+ {
121
+ "name": "gog_gmail_mark_unread",
122
+ "description": "Mark messages as unread by IDs or by query"
123
+ },
124
+ {
125
+ "name": "gog_gmail_trash",
126
+ "description": "Move messages to trash by IDs or by query"
127
+ },
128
+ {
129
+ "name": "gog_gmail_message_modify",
130
+ "description": "Modify labels on a single message"
131
+ },
132
+ {
133
+ "name": "gog_gmail_batch_delete",
134
+ "description": "Permanently delete multiple messages (irreversible)"
135
+ },
136
+ {
137
+ "name": "gog_gmail_batch_modify",
138
+ "description": "Modify labels on multiple messages at once"
139
+ },
140
+ {
141
+ "name": "gog_gmail_thread_get",
142
+ "description": "Get a thread with all messages"
143
+ },
144
+ {
145
+ "name": "gog_gmail_thread_modify",
146
+ "description": "Modify labels on all messages in a thread"
147
+ },
148
+ {
149
+ "name": "gog_gmail_thread_attachments",
150
+ "description": "List or download all attachments in a thread"
151
+ },
152
+ {
153
+ "name": "gog_gmail_labels_list",
154
+ "description": "List all Gmail labels"
155
+ },
156
+ {
157
+ "name": "gog_gmail_labels_get",
158
+ "description": "Get label details and counts"
159
+ },
160
+ {
161
+ "name": "gog_gmail_labels_create",
162
+ "description": "Create a new Gmail label"
163
+ },
164
+ {
165
+ "name": "gog_gmail_labels_rename",
166
+ "description": "Rename a Gmail label"
167
+ },
168
+ {
169
+ "name": "gog_gmail_labels_delete",
170
+ "description": "Delete a Gmail label"
171
+ },
172
+ {
173
+ "name": "gog_gmail_labels_modify",
174
+ "description": "Modify labels on one or more threads"
175
+ },
176
+ {
177
+ "name": "gog_gmail_drafts_list",
178
+ "description": "List Gmail drafts"
179
+ },
180
+ {
181
+ "name": "gog_gmail_drafts_get",
182
+ "description": "Get a Gmail draft by ID"
183
+ },
184
+ {
185
+ "name": "gog_gmail_drafts_create",
186
+ "description": "Create a new Gmail draft"
187
+ },
188
+ {
189
+ "name": "gog_gmail_drafts_update",
190
+ "description": "Update an existing Gmail draft"
191
+ },
192
+ {
193
+ "name": "gog_gmail_drafts_delete",
194
+ "description": "Delete a Gmail draft"
195
+ },
196
+ {
197
+ "name": "gog_gmail_drafts_send",
198
+ "description": "Send an existing Gmail draft"
199
+ },
200
+ {
201
+ "name": "gog_gmail_forward",
202
+ "description": "Forward a Gmail message to new recipients"
203
+ },
204
+ {
205
+ "name": "gog_gmail_autoreply",
206
+ "description": "Reply once to all messages matching a Gmail search query"
207
+ }
97
208
  ],
98
209
  "compatibility": {
99
210
  "platforms": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gogcli-mcp-gmail",
3
- "version": "2.0.3",
3
+ "version": "2.0.6",
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>",
@@ -25,7 +25,7 @@
25
25
  },
26
26
  "dependencies": {
27
27
  "@modelcontextprotocol/sdk": "^1.29.0",
28
- "zod": "^4.4.2"
28
+ "zod": "^4.4.3"
29
29
  },
30
30
  "license": "MIT",
31
31
  "keywords": [
@@ -1,7 +1,7 @@
1
1
  import { describe, it, expect, vi, beforeEach } from 'vitest';
2
- import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
3
2
  import { registerExtraGmailTools } from '../../src/tools/gmail-extra.js';
4
3
  import * as lib from '../../../gogcli-mcp/src/lib.js';
4
+ import { setupExtrasHandlers, toText, type ToolHandler } from '../../../gogcli-mcp/tests/helpers/extras-harness.js';
5
5
 
6
6
  vi.mock('../../../gogcli-mcp/src/lib.js', async (importOriginal) => {
7
7
  const actual = await importOriginal<typeof lib>();
@@ -11,29 +11,12 @@ vi.mock('../../../gogcli-mcp/src/lib.js', async (importOriginal) => {
11
11
  };
12
12
  });
13
13
 
14
- type ToolHandler = (args: Record<string, unknown>) => Promise<{ content: Array<{ type: string; text: string }> }>;
15
-
16
- function toText(text: string) {
17
- return { content: [{ type: 'text', text }] };
18
- }
19
-
20
- function setupHandlers(): Map<string, ToolHandler> {
21
- const server = new McpServer({ name: 'test', version: '0.0.0' });
22
- const handlers = new Map<string, ToolHandler>();
23
- vi.spyOn(server, 'registerTool').mockImplementation((name, _config, cb) => {
24
- handlers.set(name, cb as ToolHandler);
25
- return undefined as never;
26
- });
27
- registerExtraGmailTools(server);
28
- return handlers;
29
- }
30
-
31
14
  let handlers: Map<string, ToolHandler>;
32
15
 
33
16
  beforeEach(() => {
34
17
  vi.clearAllMocks();
35
18
  vi.mocked(lib.runOrDiagnose).mockResolvedValue(toText('{}'));
36
- handlers = setupHandlers();
19
+ handlers = setupExtrasHandlers(registerExtraGmailTools);
37
20
  });
38
21
 
39
22
  describe('gog_gmail_raw', () => {