mcp-google-multi 5.2.1-beta.1 → 5.2.2-alpha.1
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/executor.d.ts +1 -0
- package/dist/executor.js +12 -1
- package/package.json +1 -1
package/dist/executor.d.ts
CHANGED
|
@@ -31,6 +31,7 @@ export declare function jsonResult(payload: unknown, isError?: boolean): {
|
|
|
31
31
|
}[];
|
|
32
32
|
};
|
|
33
33
|
export declare function buildQueryString(queryParams: QueryParams | undefined): string;
|
|
34
|
+
export declare function resolveRequestBody(httpMethod: string, body: unknown): unknown;
|
|
34
35
|
export declare function executeApiMethod(method: ApiMethodRef, args: ExecuteArgs, deps?: ExecuteDeps): Promise<{
|
|
35
36
|
content: {
|
|
36
37
|
type: "text";
|
package/dist/executor.js
CHANGED
|
@@ -20,6 +20,17 @@ export function buildQueryString(queryParams) {
|
|
|
20
20
|
}
|
|
21
21
|
return usp.toString();
|
|
22
22
|
}
|
|
23
|
+
// GET/HEAD must never carry a request body: no Google Discovery GET/HEAD method
|
|
24
|
+
// declares a request schema, and undici/fetch throw ("Request with GET/HEAD method
|
|
25
|
+
// cannot have body") if one is attached. gaxios stringifies any object `data`
|
|
26
|
+
// without checking the verb, so a caller-supplied `{}` on a read would otherwise
|
|
27
|
+
// crash the request. Write verbs keep prior semantics: null/undefined -> no body.
|
|
28
|
+
export function resolveRequestBody(httpMethod, body) {
|
|
29
|
+
const verb = httpMethod.toUpperCase();
|
|
30
|
+
if (verb === 'GET' || verb === 'HEAD')
|
|
31
|
+
return undefined;
|
|
32
|
+
return body ?? undefined;
|
|
33
|
+
}
|
|
23
34
|
export async function executeApiMethod(method, args, deps = {}) {
|
|
24
35
|
if (args.queryParams?.alt === 'media') {
|
|
25
36
|
return jsonResult({
|
|
@@ -70,7 +81,7 @@ export async function executeApiMethod(method, args, deps = {}) {
|
|
|
70
81
|
// query string built by hand: gaxios comma-joins arrays, Google needs repeated keys
|
|
71
82
|
url: `${url}?${buildQueryString(args.queryParams)}`,
|
|
72
83
|
method: method.httpMethod,
|
|
73
|
-
data: args.body
|
|
84
|
+
data: resolveRequestBody(method.httpMethod, args.body),
|
|
74
85
|
});
|
|
75
86
|
const text = JSON.stringify(res.data ?? null);
|
|
76
87
|
if (text.length > MAX_RESPONSE_CHARS) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mcp-google-multi",
|
|
3
|
-
"version": "5.2.
|
|
3
|
+
"version": "5.2.2-alpha.1",
|
|
4
4
|
"description": "Local MCP server for Google Workspace (Gmail, Drive, Calendar, Sheets, Docs, Contacts, Tasks, Meet, Search Console, +Forms/Chat/Admin) across multiple accounts — OAuth-only, encrypted token storage, deny-by-default writes.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|