google-mcp-suite 1.4.0 → 1.5.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 +14 -9
- package/dist/docs/capabilities.d.ts +3 -0
- package/dist/docs/capabilities.d.ts.map +1 -0
- package/dist/docs/capabilities.js +15 -0
- package/dist/docs/capabilities.js.map +1 -0
- package/dist/docs/entities/BatchUpdateReceipt.d.ts +14 -0
- package/dist/docs/entities/BatchUpdateReceipt.d.ts.map +1 -0
- package/dist/docs/entities/BatchUpdateReceipt.js +16 -0
- package/dist/docs/entities/BatchUpdateReceipt.js.map +1 -0
- package/dist/docs/entities/Document.d.ts +31 -0
- package/dist/docs/entities/Document.d.ts.map +1 -0
- package/dist/docs/entities/Document.js +25 -0
- package/dist/docs/entities/Document.js.map +1 -0
- package/dist/docs/entities/Range.d.ts +14 -0
- package/dist/docs/entities/Range.d.ts.map +1 -0
- package/dist/docs/entities/Range.js +21 -0
- package/dist/docs/entities/Range.js.map +1 -0
- package/dist/docs/entities/StructuralElement.d.ts +25 -0
- package/dist/docs/entities/StructuralElement.d.ts.map +1 -0
- package/dist/docs/entities/StructuralElement.js +37 -0
- package/dist/docs/entities/StructuralElement.js.map +1 -0
- package/dist/docs/entities/SubstringMatchCriteria.d.ts +13 -0
- package/dist/docs/entities/SubstringMatchCriteria.d.ts.map +1 -0
- package/dist/docs/entities/SubstringMatchCriteria.js +15 -0
- package/dist/docs/entities/SubstringMatchCriteria.js.map +1 -0
- package/dist/docs/index.d.ts +3 -0
- package/dist/docs/index.d.ts.map +1 -0
- package/dist/docs/index.js +26 -0
- package/dist/docs/index.js.map +1 -0
- package/dist/docs/instructions.d.ts +2 -0
- package/dist/docs/instructions.d.ts.map +1 -0
- package/dist/docs/instructions.js +23 -0
- package/dist/docs/instructions.js.map +1 -0
- package/dist/docs/lib/batch.d.ts +16 -0
- package/dist/docs/lib/batch.d.ts.map +1 -0
- package/dist/docs/lib/batch.js +21 -0
- package/dist/docs/lib/batch.js.map +1 -0
- package/dist/docs/lib/document.d.ts +13 -0
- package/dist/docs/lib/document.d.ts.map +1 -0
- package/dist/docs/lib/document.js +58 -0
- package/dist/docs/lib/document.js.map +1 -0
- package/dist/docs/methods/create_document/handler.d.ts +5 -0
- package/dist/docs/methods/create_document/handler.d.ts.map +1 -0
- package/dist/docs/methods/create_document/handler.js +6 -0
- package/dist/docs/methods/create_document/handler.js.map +1 -0
- package/dist/docs/methods/create_document/index.d.ts +26 -0
- package/dist/docs/methods/create_document/index.d.ts.map +1 -0
- package/dist/docs/methods/create_document/index.js +21 -0
- package/dist/docs/methods/create_document/index.js.map +1 -0
- package/dist/docs/methods/create_document/schema.d.ts +30 -0
- package/dist/docs/methods/create_document/schema.d.ts.map +1 -0
- package/dist/docs/methods/create_document/schema.js +16 -0
- package/dist/docs/methods/create_document/schema.js.map +1 -0
- package/dist/docs/methods/delete_content_range/handler.d.ts +5 -0
- package/dist/docs/methods/delete_content_range/handler.d.ts.map +1 -0
- package/dist/docs/methods/delete_content_range/handler.js +8 -0
- package/dist/docs/methods/delete_content_range/handler.js.map +1 -0
- package/dist/docs/methods/delete_content_range/index.d.ts +17 -0
- package/dist/docs/methods/delete_content_range/index.d.ts.map +1 -0
- package/dist/docs/methods/delete_content_range/index.js +22 -0
- package/dist/docs/methods/delete_content_range/index.js.map +1 -0
- package/dist/docs/methods/delete_content_range/schema.d.ts +15 -0
- package/dist/docs/methods/delete_content_range/schema.d.ts.map +1 -0
- package/dist/docs/methods/delete_content_range/schema.js +11 -0
- package/dist/docs/methods/delete_content_range/schema.js.map +1 -0
- package/dist/docs/methods/get_document/handler.d.ts +5 -0
- package/dist/docs/methods/get_document/handler.d.ts.map +1 -0
- package/dist/docs/methods/get_document/handler.js +6 -0
- package/dist/docs/methods/get_document/handler.js.map +1 -0
- package/dist/docs/methods/get_document/index.d.ts +27 -0
- package/dist/docs/methods/get_document/index.d.ts.map +1 -0
- package/dist/docs/methods/get_document/index.js +22 -0
- package/dist/docs/methods/get_document/index.js.map +1 -0
- package/dist/docs/methods/get_document/schema.d.ts +25 -0
- package/dist/docs/methods/get_document/schema.d.ts.map +1 -0
- package/dist/docs/methods/get_document/schema.js +9 -0
- package/dist/docs/methods/get_document/schema.js.map +1 -0
- package/dist/docs/methods/insert_text/handler.d.ts +5 -0
- package/dist/docs/methods/insert_text/handler.d.ts.map +1 -0
- package/dist/docs/methods/insert_text/handler.js +8 -0
- package/dist/docs/methods/insert_text/handler.js.map +1 -0
- package/dist/docs/methods/insert_text/index.d.ts +10 -0
- package/dist/docs/methods/insert_text/index.d.ts.map +1 -0
- package/dist/docs/methods/insert_text/index.js +17 -0
- package/dist/docs/methods/insert_text/index.js.map +1 -0
- package/dist/docs/methods/insert_text/schema.d.ts +13 -0
- package/dist/docs/methods/insert_text/schema.d.ts.map +1 -0
- package/dist/docs/methods/insert_text/schema.js +19 -0
- package/dist/docs/methods/insert_text/schema.js.map +1 -0
- package/dist/docs/methods/registry.d.ts +82 -0
- package/dist/docs/methods/registry.d.ts.map +1 -0
- package/dist/docs/methods/registry.js +23 -0
- package/dist/docs/methods/registry.js.map +1 -0
- package/dist/docs/methods/replace_all_text/handler.d.ts +5 -0
- package/dist/docs/methods/replace_all_text/handler.d.ts.map +1 -0
- package/dist/docs/methods/replace_all_text/handler.js +16 -0
- package/dist/docs/methods/replace_all_text/handler.js.map +1 -0
- package/dist/docs/methods/replace_all_text/index.d.ts +20 -0
- package/dist/docs/methods/replace_all_text/index.d.ts.map +1 -0
- package/dist/docs/methods/replace_all_text/index.js +23 -0
- package/dist/docs/methods/replace_all_text/index.js.map +1 -0
- package/dist/docs/methods/replace_all_text/schema.d.ts +17 -0
- package/dist/docs/methods/replace_all_text/schema.d.ts.map +1 -0
- package/dist/docs/methods/replace_all_text/schema.js +19 -0
- package/dist/docs/methods/replace_all_text/schema.js.map +1 -0
- package/dist/docs/operation.d.ts +12 -0
- package/dist/docs/operation.d.ts.map +1 -0
- package/dist/docs/operation.js +10 -0
- package/dist/docs/operation.js.map +1 -0
- package/dist/doctor/services.d.ts.map +1 -1
- package/dist/doctor/services.js +32 -1
- package/dist/doctor/services.js.map +1 -1
- package/package.json +8 -3
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { create_document } from './create_document/index.js';
|
|
2
|
+
import { delete_content_range } from './delete_content_range/index.js';
|
|
3
|
+
import { get_document } from './get_document/index.js';
|
|
4
|
+
import { insert_text } from './insert_text/index.js';
|
|
5
|
+
import { replace_all_text } from './replace_all_text/index.js';
|
|
6
|
+
/**
|
|
7
|
+
* REST-sourced operations, from
|
|
8
|
+
* `developers.google.com/workspace/docs/api/reference/rest`. Google publishes
|
|
9
|
+
* no MCP toolset for Docs, so there is no `tools/` folder and this registry is
|
|
10
|
+
* the service's whole wire surface. The three text-editing operations each
|
|
11
|
+
* wrap `documents.batchUpdate` with exactly one request type; the rest of the
|
|
12
|
+
* 40-variant union is issue #35.
|
|
13
|
+
*/
|
|
14
|
+
export const methods = {
|
|
15
|
+
// documents
|
|
16
|
+
get_document,
|
|
17
|
+
create_document,
|
|
18
|
+
// text editing (curated batchUpdate requests)
|
|
19
|
+
insert_text,
|
|
20
|
+
replace_all_text,
|
|
21
|
+
delete_content_range,
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../../src/docs/methods/registry.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAE/D;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG;IACrB,YAAY;IACZ,YAAY;IACZ,eAAe;IACf,8CAA8C;IAC9C,WAAW;IACX,gBAAgB;IAChB,oBAAoB;CACgC,CAAC","sourcesContent":["import type { docs_v1 } from '@googleapis/docs';\nimport type { AnyOperation } from '../../lib/operation.js';\nimport { create_document } from './create_document/index.js';\nimport { delete_content_range } from './delete_content_range/index.js';\nimport { get_document } from './get_document/index.js';\nimport { insert_text } from './insert_text/index.js';\nimport { replace_all_text } from './replace_all_text/index.js';\n\n/**\n * REST-sourced operations, from\n * `developers.google.com/workspace/docs/api/reference/rest`. Google publishes\n * no MCP toolset for Docs, so there is no `tools/` folder and this registry is\n * the service's whole wire surface. The three text-editing operations each\n * wrap `documents.batchUpdate` with exactly one request type; the rest of the\n * 40-variant union is issue #35.\n */\nexport const methods = {\n // documents\n get_document,\n create_document,\n // text editing (curated batchUpdate requests)\n insert_text,\n replace_all_text,\n delete_content_range,\n} satisfies Record<string, AnyOperation<docs_v1.Docs>>;\n"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { docs_v1 } from '@googleapis/docs';
|
|
2
|
+
import type { z } from 'zod';
|
|
3
|
+
import type { schema } from './schema.js';
|
|
4
|
+
export declare function handler(docs: docs_v1.Docs, args: z.infer<typeof schema.input>): Promise<z.infer<typeof schema.output>>;
|
|
5
|
+
//# sourceMappingURL=handler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../../../src/docs/methods/replace_all_text/handler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAG7B,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C,wBAAsB,OAAO,CAC3B,IAAI,EAAE,OAAO,CAAC,IAAI,EAClB,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,MAAM,CAAC,KAAK,CAAC,GACjC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,CAYxC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { forGoogle } from '../../../lib/google.js';
|
|
2
|
+
import { applyUpdate } from '../../lib/batch.js';
|
|
3
|
+
export async function handler(docs, args) {
|
|
4
|
+
const { reply, documentId, revisionId } = await applyUpdate(docs, args.documentId, {
|
|
5
|
+
replaceAllText: {
|
|
6
|
+
containsText: forGoogle(args.containsText),
|
|
7
|
+
replaceText: args.replaceText,
|
|
8
|
+
},
|
|
9
|
+
});
|
|
10
|
+
return {
|
|
11
|
+
documentId,
|
|
12
|
+
occurrencesChanged: reply?.replaceAllText?.occurrencesChanged ?? 0,
|
|
13
|
+
revisionId,
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=handler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handler.js","sourceRoot":"","sources":["../../../../src/docs/methods/replace_all_text/handler.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAGjD,MAAM,CAAC,KAAK,UAAU,OAAO,CAC3B,IAAkB,EAClB,IAAkC;IAElC,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,GAAG,MAAM,WAAW,CAAC,IAAI,EAAE,IAAI,CAAC,UAAU,EAAE;QACjF,cAAc,EAAE;YACd,YAAY,EAAE,SAAS,CAAC,IAAI,CAAC,YAAY,CAAC;YAC1C,WAAW,EAAE,IAAI,CAAC,WAAW;SAC9B;KACF,CAAC,CAAC;IACH,OAAO;QACL,UAAU;QACV,kBAAkB,EAAE,KAAK,EAAE,cAAc,EAAE,kBAAkB,IAAI,CAAC;QAClE,UAAU;KACX,CAAC;AACJ,CAAC","sourcesContent":["import type { docs_v1 } from '@googleapis/docs';\nimport type { z } from 'zod';\nimport { forGoogle } from '../../../lib/google.js';\nimport { applyUpdate } from '../../lib/batch.js';\nimport type { schema } from './schema.js';\n\nexport async function handler(\n docs: docs_v1.Docs,\n args: z.infer<typeof schema.input>,\n): Promise<z.infer<typeof schema.output>> {\n const { reply, documentId, revisionId } = await applyUpdate(docs, args.documentId, {\n replaceAllText: {\n containsText: forGoogle(args.containsText),\n replaceText: args.replaceText,\n },\n });\n return {\n documentId,\n occurrencesChanged: reply?.replaceAllText?.occurrencesChanged ?? 0,\n revisionId,\n };\n}\n"]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One ReplaceAllTextRequest applied via `documents.batchUpdate` (the curated
|
|
3
|
+
* subset; issue #35). Destructive: the matched text is gone and the API has
|
|
4
|
+
* no undo. Not idempotent: when the replacement reintroduces the match
|
|
5
|
+
* (replace `a` with `aa`), every repeat grows the document, so the hint
|
|
6
|
+
* cannot promise repeat-safety for all arguments.
|
|
7
|
+
*/
|
|
8
|
+
export declare const replace_all_text: import("../../../lib/operation.js").Operation<import("@googleapis/docs").docs_v1.Docs, import("zod").ZodObject<{
|
|
9
|
+
documentId: import("zod").ZodString;
|
|
10
|
+
containsText: import("zod").ZodObject<{
|
|
11
|
+
text: import("zod").ZodString;
|
|
12
|
+
matchCase: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
13
|
+
}, import("zod/v4/core").$strip>;
|
|
14
|
+
replaceText: import("zod").ZodString;
|
|
15
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
16
|
+
documentId: import("zod").ZodString;
|
|
17
|
+
revisionId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
18
|
+
occurrencesChanged: import("zod").ZodNumber;
|
|
19
|
+
}, import("zod/v4/core").$strip>>;
|
|
20
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/docs/methods/replace_all_text/index.ts"],"names":[],"mappings":"AAIA;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;iCAa3B,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { docsOperation } from '../../operation.js';
|
|
2
|
+
import { handler } from './handler.js';
|
|
3
|
+
import { schema } from './schema.js';
|
|
4
|
+
/**
|
|
5
|
+
* One ReplaceAllTextRequest applied via `documents.batchUpdate` (the curated
|
|
6
|
+
* subset; issue #35). Destructive: the matched text is gone and the API has
|
|
7
|
+
* no undo. Not idempotent: when the replacement reintroduces the match
|
|
8
|
+
* (replace `a` with `aa`), every repeat grows the document, so the hint
|
|
9
|
+
* cannot promise repeat-safety for all arguments.
|
|
10
|
+
*/
|
|
11
|
+
export const replace_all_text = docsOperation({
|
|
12
|
+
description: 'Replace every occurrence of a substring in the document, irreversibly; returns how many occurrences changed.',
|
|
13
|
+
annotations: {
|
|
14
|
+
readOnlyHint: false,
|
|
15
|
+
destructiveHint: true,
|
|
16
|
+
idempotentHint: false,
|
|
17
|
+
openWorldHint: false,
|
|
18
|
+
},
|
|
19
|
+
source: 'https://developers.google.com/workspace/docs/api/reference/rest/v1/documents/request#ReplaceAllTextRequest',
|
|
20
|
+
schema,
|
|
21
|
+
handler,
|
|
22
|
+
});
|
|
23
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/docs/methods/replace_all_text/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,aAAa,CAAC;IAC5C,WAAW,EACT,8GAA8G;IAChH,WAAW,EAAE;QACX,YAAY,EAAE,KAAK;QACnB,eAAe,EAAE,IAAI;QACrB,cAAc,EAAE,KAAK;QACrB,aAAa,EAAE,KAAK;KACrB;IACD,MAAM,EACJ,4GAA4G;IAC9G,MAAM;IACN,OAAO;CACR,CAAC,CAAC","sourcesContent":["import { docsOperation } from '../../operation.js';\nimport { handler } from './handler.js';\nimport { schema } from './schema.js';\n\n/**\n * One ReplaceAllTextRequest applied via `documents.batchUpdate` (the curated\n * subset; issue #35). Destructive: the matched text is gone and the API has\n * no undo. Not idempotent: when the replacement reintroduces the match\n * (replace `a` with `aa`), every repeat grows the document, so the hint\n * cannot promise repeat-safety for all arguments.\n */\nexport const replace_all_text = docsOperation({\n description:\n 'Replace every occurrence of a substring in the document, irreversibly; returns how many occurrences changed.',\n annotations: {\n readOnlyHint: false,\n destructiveHint: true,\n idempotentHint: false,\n openWorldHint: false,\n },\n source:\n 'https://developers.google.com/workspace/docs/api/reference/rest/v1/documents/request#ReplaceAllTextRequest',\n schema,\n handler,\n});\n"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const schema: {
|
|
3
|
+
input: z.ZodObject<{
|
|
4
|
+
documentId: z.ZodString;
|
|
5
|
+
containsText: z.ZodObject<{
|
|
6
|
+
text: z.ZodString;
|
|
7
|
+
matchCase: z.ZodOptional<z.ZodBoolean>;
|
|
8
|
+
}, z.core.$strip>;
|
|
9
|
+
replaceText: z.ZodString;
|
|
10
|
+
}, z.core.$strip>;
|
|
11
|
+
output: z.ZodObject<{
|
|
12
|
+
documentId: z.ZodString;
|
|
13
|
+
revisionId: z.ZodOptional<z.ZodString>;
|
|
14
|
+
occurrencesChanged: z.ZodNumber;
|
|
15
|
+
}, z.core.$strip>;
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/docs/methods/replace_all_text/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,MAAM;;;;;;;;;;;;;;CAgBlB,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { BatchUpdateReceipt } from '../../entities/BatchUpdateReceipt.js';
|
|
3
|
+
import { SubstringMatchCriteria } from '../../entities/SubstringMatchCriteria.js';
|
|
4
|
+
export const schema = {
|
|
5
|
+
input: z.object({
|
|
6
|
+
documentId: z.string().describe('The ID of the document to update.'),
|
|
7
|
+
containsText: SubstringMatchCriteria.describe('Finds text in the document matching this substring.'),
|
|
8
|
+
replaceText: z
|
|
9
|
+
.string()
|
|
10
|
+
.describe('The text that will replace the matched text; empty deletes the matches.'),
|
|
11
|
+
}),
|
|
12
|
+
output: BatchUpdateReceipt.extend({
|
|
13
|
+
occurrencesChanged: z
|
|
14
|
+
.number()
|
|
15
|
+
.int()
|
|
16
|
+
.describe('The number of occurrences changed by replacing all text.'),
|
|
17
|
+
}),
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../src/docs/methods/replace_all_text/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAC1E,OAAO,EAAE,sBAAsB,EAAE,MAAM,0CAA0C,CAAC;AAElF,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,mCAAmC,CAAC;QACpE,YAAY,EAAE,sBAAsB,CAAC,QAAQ,CAC3C,qDAAqD,CACtD;QACD,WAAW,EAAE,CAAC;aACX,MAAM,EAAE;aACR,QAAQ,CAAC,yEAAyE,CAAC;KACvF,CAAC;IACF,MAAM,EAAE,kBAAkB,CAAC,MAAM,CAAC;QAChC,kBAAkB,EAAE,CAAC;aAClB,MAAM,EAAE;aACR,GAAG,EAAE;aACL,QAAQ,CAAC,0DAA0D,CAAC;KACxE,CAAC;CACH,CAAC","sourcesContent":["import { z } from 'zod';\nimport { BatchUpdateReceipt } from '../../entities/BatchUpdateReceipt.js';\nimport { SubstringMatchCriteria } from '../../entities/SubstringMatchCriteria.js';\n\nexport const schema = {\n input: z.object({\n documentId: z.string().describe('The ID of the document to update.'),\n containsText: SubstringMatchCriteria.describe(\n 'Finds text in the document matching this substring.',\n ),\n replaceText: z\n .string()\n .describe('The text that will replace the matched text; empty deletes the matches.'),\n }),\n output: BatchUpdateReceipt.extend({\n occurrencesChanged: z\n .number()\n .int()\n .describe('The number of occurrences changed by replacing all text.'),\n }),\n};\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { docs_v1 } from '@googleapis/docs';
|
|
2
|
+
import type { z } from 'zod';
|
|
3
|
+
import { type Operation } from '../lib/operation.js';
|
|
4
|
+
/**
|
|
5
|
+
* `operation()` bound to the Docs client. Every docs op's `index.ts` uses
|
|
6
|
+
* this instead of the raw `operation()` so the handler's client is always
|
|
7
|
+
* `docs_v1.Docs`: a handler that drops or mistypes its client annotation
|
|
8
|
+
* fails here (the client can no longer silently infer `unknown` and slip into
|
|
9
|
+
* the registry) rather than surfacing as a confusing `unknown` deep in the body.
|
|
10
|
+
*/
|
|
11
|
+
export declare const docsOperation: <In extends z.ZodObject, Out extends z.ZodObject>(def: Operation<docs_v1.Docs, In, Out>) => Operation<docs_v1.Docs, In, Out>;
|
|
12
|
+
//# sourceMappingURL=operation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operation.d.ts","sourceRoot":"","sources":["../../src/docs/operation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,EAAE,KAAK,SAAS,EAAa,MAAM,qBAAqB,CAAC;AAEhE;;;;;;GAMG;AACH,eAAO,MAAM,aAAa,GAAI,EAAE,SAAS,CAAC,CAAC,SAAS,EAAE,GAAG,SAAS,CAAC,CAAC,SAAS,EAC3E,KAAK,SAAS,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,EAAE,GAAG,CAAC,KACpC,SAAS,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,EAAE,GAAG,CAAmB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { operation } from '../lib/operation.js';
|
|
2
|
+
/**
|
|
3
|
+
* `operation()` bound to the Docs client. Every docs op's `index.ts` uses
|
|
4
|
+
* this instead of the raw `operation()` so the handler's client is always
|
|
5
|
+
* `docs_v1.Docs`: a handler that drops or mistypes its client annotation
|
|
6
|
+
* fails here (the client can no longer silently infer `unknown` and slip into
|
|
7
|
+
* the registry) rather than surfacing as a confusing `unknown` deep in the body.
|
|
8
|
+
*/
|
|
9
|
+
export const docsOperation = (def) => operation(def);
|
|
10
|
+
//# sourceMappingURL=operation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operation.js","sourceRoot":"","sources":["../../src/docs/operation.ts"],"names":[],"mappings":"AAEA,OAAO,EAAkB,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEhE;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAC3B,GAAqC,EACH,EAAE,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC","sourcesContent":["import type { docs_v1 } from '@googleapis/docs';\nimport type { z } from 'zod';\nimport { type Operation, operation } from '../lib/operation.js';\n\n/**\n * `operation()` bound to the Docs client. Every docs op's `index.ts` uses\n * this instead of the raw `operation()` so the handler's client is always\n * `docs_v1.Docs`: a handler that drops or mistypes its client annotation\n * fails here (the client can no longer silently infer `unknown` and slip into\n * the registry) rather than surfacing as a confusing `unknown` deep in the body.\n */\nexport const docsOperation = <In extends z.ZodObject, Out extends z.ZodObject>(\n def: Operation<docs_v1.Docs, In, Out>,\n): Operation<docs_v1.Docs, In, Out> => operation(def);\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"services.d.ts","sourceRoot":"","sources":["../../src/doctor/services.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"services.d.ts","sourceRoot":"","sources":["../../src/doctor/services.ts"],"names":[],"mappings":"AAmBA,iFAAiF;AACjF,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;AAEhE,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,gFAAgF;IAChF,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,WAAW,EAAE,OAAO,CAAC;IACrB,KAAK,CAAC,EAAE,YAAY,CAAC;CACtB,CAAC;AAwDF,eAAO,MAAM,QAAQ,EAAE,WAAW,EAwCjC,CAAC;AAEF,iEAAiE;AACjE,wBAAgB,cAAc,IAAI,MAAM,EAAE,CAEzC;AAED,wEAAwE;AACxE,wBAAgB,YAAY,IAAI,MAAM,EAAE,CAEvC;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,SAAS,EAAE,MAAM,EAAE,EACnB,QAAQ,GAAE,MAAM,EAAqB,GACpC;IAAE,OAAO,EAAE,MAAM,EAAE,CAAC;IAAC,KAAK,EAAE,MAAM,EAAE,CAAA;CAAE,CAOxC"}
|
package/dist/doctor/services.js
CHANGED
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
* `assertScopeRegistryMatches` guards the two against silent drift.
|
|
13
13
|
*/
|
|
14
14
|
import { calendar } from '@googleapis/calendar';
|
|
15
|
+
import { docs } from '@googleapis/docs';
|
|
15
16
|
import { gmail } from '@googleapis/gmail';
|
|
16
17
|
import { sheets } from '@googleapis/sheets';
|
|
17
18
|
import { authorizedClient } from '../auth/oauth.js';
|
|
@@ -27,6 +28,30 @@ async function calendarProbe(account) {
|
|
|
27
28
|
const res = await client.calendars.get({ calendarId: 'primary' });
|
|
28
29
|
return res.data.summary ?? res.data.timeZone ?? '(reachable)';
|
|
29
30
|
}
|
|
31
|
+
// Docs has neither an id-free read (listing is Drive's) nor a stable public
|
|
32
|
+
// sample document (Sheets' probe trick below does not transfer), so the probe
|
|
33
|
+
// reads a sentinel id: a clean 404 proves the token authenticated and the API
|
|
34
|
+
// is enabled (an auth failure is 401, a disabled API 403); anything else throws.
|
|
35
|
+
const DOCS_PROBE_SENTINEL = 'google-mcp-doctor-probe-sentinel';
|
|
36
|
+
function isNotFound(error) {
|
|
37
|
+
if (typeof error !== 'object' || error === null)
|
|
38
|
+
return false;
|
|
39
|
+
const status = error.status ??
|
|
40
|
+
error.response?.status;
|
|
41
|
+
return status === 404;
|
|
42
|
+
}
|
|
43
|
+
async function docsProbe(account) {
|
|
44
|
+
const client = docs({ version: 'v1', auth: await authorizedClient(account) });
|
|
45
|
+
try {
|
|
46
|
+
await client.documents.get({ documentId: DOCS_PROBE_SENTINEL });
|
|
47
|
+
return '(reachable)';
|
|
48
|
+
}
|
|
49
|
+
catch (error) {
|
|
50
|
+
if (isNotFound(error))
|
|
51
|
+
return '(reachable)';
|
|
52
|
+
throw error;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
30
55
|
// The Sheets API has no id-free read (listing spreadsheets is Drive's job), so
|
|
31
56
|
// the probe reads Google's long-stable public sample spreadsheet (titled
|
|
32
57
|
// "Example Spreadsheet", used throughout the Sheets API docs). If Google ever
|
|
@@ -54,7 +79,13 @@ export const SERVICES = [
|
|
|
54
79
|
implemented: true,
|
|
55
80
|
probe: sheetsProbe,
|
|
56
81
|
},
|
|
57
|
-
{
|
|
82
|
+
{
|
|
83
|
+
name: 'docs',
|
|
84
|
+
api: 'docs.googleapis.com',
|
|
85
|
+
scopes: [`${S}documents`],
|
|
86
|
+
implemented: true,
|
|
87
|
+
probe: docsProbe,
|
|
88
|
+
},
|
|
58
89
|
{
|
|
59
90
|
name: 'calendar',
|
|
60
91
|
api: 'calendar-json.googleapis.com',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"services.js","sourceRoot":"","sources":["../../src/doctor/services.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAcpD,gFAAgF;AAChF,iFAAiF;AAEjF,KAAK,UAAU,UAAU,CAAC,OAAe;IACvC,MAAM,MAAM,GAAG,KAAK,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IAC/E,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;IAC5D,OAAO,GAAG,CAAC,IAAI,CAAC,YAAY,IAAI,aAAa,CAAC;AAChD,CAAC;AAED,KAAK,UAAU,aAAa,CAAC,OAAe;IAC1C,MAAM,MAAM,GAAG,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IAClF,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,UAAU,EAAE,SAAS,EAAE,CAAC,CAAC;IAClE,OAAO,GAAG,CAAC,IAAI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AAG,IAAI,GAAG,CAAC,QAAQ,CAAC,CAAC;IAC/B,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,SAAS,CAAC,CAAC;IACjC,OAAO;QACL,OAAO,EAAE,CAAC,GAAG,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QAC/C,KAAK,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;KAC9C,CAAC;AACJ,CAAC","sourcesContent":["/**\n * The doctor's knowledge of the Google services this suite targets.\n *\n * Dependency direction is one-way: doctor knows services; services never import\n * doctor. To stay decoupled from each service's churning internals, a probe is\n * expressed against stable public surfaces only (`@googleapis/*` plus the shared\n * `authorizedClient`), not `src/<service>` code. Adding a service here is how the\n * doctor learns to check it.\n *\n * Scopes are attributed per service for reporting, but the canonical scope list\n * is `SCOPES` in `src/auth/config.ts` (services do not declare scopes locally).\n * `assertScopeRegistryMatches` guards the two against silent drift.\n */\nimport { calendar } from '@googleapis/calendar';\nimport { docs } from '@googleapis/docs';\nimport { gmail } from '@googleapis/gmail';\nimport { sheets } from '@googleapis/sheets';\nimport { authorizedClient } from '../auth/oauth.js';\n\n/** A cheap, read-only call that proves a service's token + API actually work. */\nexport type ServiceProbe = (account: string) => Promise<string>;\n\nexport type ServiceInfo = {\n name: string;\n /** Google Cloud API identifier to enable (as `gcloud services enable` uses). */\n api: string;\n scopes: string[];\n implemented: boolean;\n probe?: ServiceProbe;\n};\n\n// Probe API versions duplicate each service's index.ts on purpose (doctor never\n// imports service internals); when a service moves versions, move its probe too.\n\nasync function gmailProbe(account: string): Promise<string> {\n const client = gmail({ version: 'v1', auth: await authorizedClient(account) });\n const res = await client.users.getProfile({ userId: 'me' });\n return res.data.emailAddress ?? '(reachable)';\n}\n\nasync function calendarProbe(account: string): Promise<string> {\n const client = calendar({ version: 'v3', auth: await authorizedClient(account) });\n const res = await client.calendars.get({ calendarId: 'primary' });\n return res.data.summary ?? res.data.timeZone ?? '(reachable)';\n}\n\n// Docs has neither an id-free read (listing is Drive's) nor a stable public\n// sample document (Sheets' probe trick below does not transfer), so the probe\n// reads a sentinel id: a clean 404 proves the token authenticated and the API\n// is enabled (an auth failure is 401, a disabled API 403); anything else throws.\nconst DOCS_PROBE_SENTINEL = 'google-mcp-doctor-probe-sentinel';\n\nfunction isNotFound(error: unknown): boolean {\n if (typeof error !== 'object' || error === null) return false;\n const status =\n (error as { status?: unknown }).status ??\n (error as { response?: { status?: unknown } }).response?.status;\n return status === 404;\n}\n\nasync function docsProbe(account: string): Promise<string> {\n const client = docs({ version: 'v1', auth: await authorizedClient(account) });\n try {\n await client.documents.get({ documentId: DOCS_PROBE_SENTINEL });\n return '(reachable)';\n } catch (error) {\n if (isNotFound(error)) return '(reachable)';\n throw error;\n }\n}\n\n// The Sheets API has no id-free read (listing spreadsheets is Drive's job), so\n// the probe reads Google's long-stable public sample spreadsheet (titled\n// \"Example Spreadsheet\", used throughout the Sheets API docs). If Google ever\n// unpublishes it, the probe fails loudly and this id gets replaced.\nconst SAMPLE_SPREADSHEET_ID = '1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms';\n\nasync function sheetsProbe(account: string): Promise<string> {\n const client = sheets({ version: 'v4', auth: await authorizedClient(account) });\n const res = await client.spreadsheets.get({ spreadsheetId: SAMPLE_SPREADSHEET_ID });\n return res.data.properties?.title ?? '(reachable)';\n}\n\nconst S = 'https://www.googleapis.com/auth/';\n\nexport const SERVICES: ServiceInfo[] = [\n {\n name: 'gmail',\n api: 'gmail.googleapis.com',\n scopes: ['https://mail.google.com/', `${S}gmail.settings.basic`],\n implemented: true,\n probe: gmailProbe,\n },\n { name: 'drive', api: 'drive.googleapis.com', scopes: [`${S}drive`], implemented: false },\n {\n name: 'sheets',\n api: 'sheets.googleapis.com',\n scopes: [`${S}spreadsheets`],\n implemented: true,\n probe: sheetsProbe,\n },\n {\n name: 'docs',\n api: 'docs.googleapis.com',\n scopes: [`${S}documents`],\n implemented: true,\n probe: docsProbe,\n },\n {\n name: 'calendar',\n api: 'calendar-json.googleapis.com',\n scopes: [`${S}calendar`],\n implemented: true,\n probe: calendarProbe,\n },\n {\n name: 'meet',\n api: 'meet.googleapis.com',\n scopes: [\n `${S}meetings.space.created`,\n `${S}meetings.space.readonly`,\n `${S}meetings.space.settings`,\n ],\n implemented: false,\n },\n];\n\n/** Every scope the suite expects, attributed across services. */\nexport function requiredScopes(): string[] {\n return SERVICES.flatMap((s) => s.scopes);\n}\n\n/** APIs to enable in Google Cloud, in `gcloud services enable` form. */\nexport function requiredApis(): string[] {\n return SERVICES.map((s) => s.api);\n}\n\n/**\n * Guard the per-service scope attribution against the canonical `SCOPES` union.\n * Returns the symmetric difference; empty means the two agree.\n */\nexport function scopeRegistryDrift(\n canonical: string[],\n declared: string[] = requiredScopes(),\n): { missing: string[]; extra: string[] } {\n const have = new Set(declared);\n const truth = new Set(canonical);\n return {\n missing: [...truth].filter((s) => !have.has(s)),\n extra: [...have].filter((s) => !truth.has(s)),\n };\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "google-mcp-suite",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"description": "Per-account MCP servers for Gmail, Google Calendar, and Google
|
|
5
|
+
"description": "Per-account MCP servers for Gmail, Google Calendar, Google Sheets, and Google Docs: identity is bound to the running instance, so an agent can never act on the wrong account; each server exposes Google's curated MCP toolset (where one exists) plus the broader REST surface.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"mcp",
|
|
8
8
|
"mcp-server",
|
|
@@ -18,7 +18,10 @@
|
|
|
18
18
|
"scheduling",
|
|
19
19
|
"sheets",
|
|
20
20
|
"google-sheets",
|
|
21
|
-
"spreadsheet"
|
|
21
|
+
"spreadsheet",
|
|
22
|
+
"docs",
|
|
23
|
+
"google-docs",
|
|
24
|
+
"document"
|
|
22
25
|
],
|
|
23
26
|
"author": "the-simian <info@simiancraft.com>",
|
|
24
27
|
"license": "MIT",
|
|
@@ -34,6 +37,7 @@
|
|
|
34
37
|
"google-mcp-gmail": "./dist/gmail/index.js",
|
|
35
38
|
"google-mcp-calendar": "./dist/calendar/index.js",
|
|
36
39
|
"google-mcp-sheets": "./dist/sheets/index.js",
|
|
40
|
+
"google-mcp-docs": "./dist/docs/index.js",
|
|
37
41
|
"google-mcp-doctor": "./dist/doctor/index.js"
|
|
38
42
|
},
|
|
39
43
|
"files": [
|
|
@@ -65,6 +69,7 @@
|
|
|
65
69
|
},
|
|
66
70
|
"dependencies": {
|
|
67
71
|
"@googleapis/calendar": "^15.0.0",
|
|
72
|
+
"@googleapis/docs": "^9.3.0",
|
|
68
73
|
"@googleapis/gmail": "^17.0.0",
|
|
69
74
|
"@googleapis/sheets": "^13.0.2",
|
|
70
75
|
"@modelcontextprotocol/sdk": "^1.29.0",
|